/* =================================================================
   RetardHub v2 — Design System
   ================================================================= */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #000; }

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --brand:        #FE9803;
  --brand-glow:   #FFB544;
  --brand-deep:   #B86E00;
  --accent:       #FF2E63;
  --accent-glow:  #FF5C8A;
  --cyan:         #00F5FF;
  --lime:         #B6FF3C;

  /* Surface */
  --bg:           #07070c;
  --bg-2:         #0d0d15;
  --surface:      rgba(20, 20, 32, 0.55);
  --surface-2:    rgba(28, 28, 42, 0.75);
  --border:       rgba(254, 152, 3, 0.18);
  --border-soft:  rgba(255, 255, 255, 0.06);

  /* Text */
  --fg:           #F5F5F7;
  --fg-muted:     #9B9BA8;
  --fg-dim:       #5C5C68;

  /* Effects */
  --shadow-glow:  0 0 32px rgba(254, 152, 3, 0.35);
  --shadow-card:  0 8px 32px rgba(0, 0, 0, 0.4);
  --radius:       14px;
  --radius-lg:    22px;
  --radius-pill:  999px;

  /* Type */
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --font-pixel:   "Press Start 2P", monospace;

  /* Layout */
  --container:    1240px;
  --nav-h:        72px;

  /* Easing */
  --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Base ---------- */
html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(254, 152, 3, 0.12), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(255, 46, 99, 0.08), transparent 60%),
    radial-gradient(700px 400px at 50% 110%, rgba(0, 245, 255, 0.06), transparent 60%),
    var(--bg);
  /* background-attachment:fixed is GPU-expensive on mobile — desktop only */
}
@media (hover: hover) and (min-width: 880px) {
  body { background-attachment: fixed; }
}

/* Static grid layer — no longer animated (was causing scroll jank) */
.bg-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(254, 152, 3, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(254, 152, 3, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 100%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Cursor glow */
.cursor-glow {
  position: fixed;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 152, 3, 0.18), transparent 65%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  mix-blend-mode: screen;
  will-change: transform;
  contain: layout style paint;
}
@media (hover: none), (max-width: 880px) { .cursor-glow { display: none !important; } }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); }

.gradient-text {
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-glow) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mono { font-family: var(--font-mono); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(7, 7, 12, 0.65);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.nav-brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 0 24px rgba(254, 152, 3, 0.4);
  object-fit: contain;
  background: linear-gradient(135deg, #1a0d00, #2a1a05);
  padding: 4px;
}

/* CSS-only brand mark — replaces banner logo at small sizes */
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-glow) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  color: #1a0d00;
  letter-spacing: -0.02em;
  box-shadow: 0 0 20px rgba(254, 152, 3, 0.4), inset 0 1px 0 rgba(255,255,255,0.25);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.brand-mark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.35), transparent 60%);
  pointer-events: none;
}
.footer .brand-mark { width: 32px; height: 32px; font-size: 0.72rem; }
.nav-brand .tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--brand);
  background: rgba(254, 152, 3, 0.12);
  border: 1px solid rgba(254, 152, 3, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-left: 6px;
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}
.nav-link {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: all 0.2s var(--ease-out);
  position: relative;
}
.nav-link:hover { color: var(--fg); background: rgba(255, 255, 255, 0.05); }
.nav-link.active { color: var(--brand); }
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--brand);
}
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  align-items: center;
  justify-content: center;
  margin-left: auto;
}
.nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--fg);
  position: relative;
}
.nav-burger span::before,
.nav-burger span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--fg);
}
.nav-burger span::before { top: -6px; }
.nav-burger span::after  { top:  6px; }

@media (max-width: 880px) {
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    background: rgba(7, 7, 12, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 16px;
    gap: 4px;
    align-items: stretch;
    /* Robust hide: visibility + opacity, transform only for slide-in */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out), visibility 0s linear 0.25s;
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 24px 48px rgba(0,0,0,0.4);
  }
  .nav-links.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out), visibility 0s linear 0s;
  }
  .nav-link { padding: 14px 16px; font-size: 1rem; }
  .nav-burger { display: flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-glow) 100%);
  color: #1a0d00;
  box-shadow: 0 8px 24px rgba(254, 152, 3, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(254, 152, 3, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border-soft);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  border-color: var(--brand);
  background: rgba(254, 152, 3, 0.08);
  color: var(--brand-glow);
}
.btn-discord {
  background: linear-gradient(135deg, #5865F2 0%, #7983F5 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.4);
}
.btn-discord:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(88, 101, 242, 0.55); }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-icon { padding: 12px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
  contain: layout style;
}
/* Spotlight effect only on hover-capable devices (saves mobile perf) */
@media (hover: hover) {
  .card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%),
                rgba(254, 152, 3, 0.08), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
  }
  .card:hover::before { opacity: 1; }
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(254, 152, 3, 0.4);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(254, 152, 3, 0.2);
}
.card-link { display: block; color: inherit; }
.card-link:hover { color: inherit; }

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(254, 152, 3, 0.2), rgba(255, 46, 99, 0.15));
  border: 1px solid rgba(254, 152, 3, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 1.6rem;
}
.card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}
.card p {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}
.card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.9rem;
  transition: gap 0.2s;
}
.card:hover .card-arrow { gap: 10px; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 880px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (min-width: 600px) and (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  background: rgba(254, 152, 3, 0.12);
  color: var(--brand);
  border: 1px solid rgba(254, 152, 3, 0.25);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-live {
  background: rgba(182, 255, 60, 0.12);
  color: var(--lime);
  border-color: rgba(182, 255, 60, 0.3);
}
.badge-live::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  animation: pulse 1.6s ease-in-out infinite;
}
.badge-soon {
  background: rgba(155, 155, 168, 0.1);
  color: var(--fg-muted);
  border-color: rgba(155, 155, 168, 0.2);
}
.badge-accent {
  background: rgba(255, 46, 99, 0.12);
  color: var(--accent-glow);
  border-color: rgba(255, 46, 99, 0.3);
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 80px;
  text-align: center;
  position: relative;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  background: rgba(254, 152, 3, 0.08);
  border: 1px solid rgba(254, 152, 3, 0.25);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
}
.hero h1 {
  margin-bottom: 20px;
}
.hero .lead {
  max-width: 620px;
  margin: 0 auto 36px;
  color: var(--fg-muted);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
/* Hero banner logo — natural aspect ratio (~3:1) */
.hero-logo {
  display: block;
  width: auto;
  max-width: min(420px, 80vw);
  height: auto;
  margin: 0 auto 36px;
  border-radius: 18px;
  box-shadow: 0 0 80px rgba(254, 152, 3, 0.35), 0 0 180px rgba(254, 152, 3, 0.12);
  animation: float 4s ease-in-out infinite;
  background: linear-gradient(135deg, #0a0a0f, #1a0d00);
  padding: 6px;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ---------- Section header ---------- */
.section-head {
  text-align: center;
  margin-bottom: 48px;
}
.section-head .eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}
.section-head h2 { margin-bottom: 12px; }
.section-head p {
  color: var(--fg-muted);
  max-width: 580px;
  margin: 0 auto;
}

/* ---------- Stat strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-soft);
}
.stat {
  background: var(--bg-2);
  padding: 28px 20px;
  text-align: center;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
}
.stat-label {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 80px;
  padding: 48px 0 32px;
  border-top: 1px solid var(--border-soft);
  background: rgba(7, 7, 12, 0.6);
  position: relative;
  z-index: 2;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
}
.footer-brand img { width: 32px; height: 32px; border-radius: 8px; }
.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  color: var(--fg-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--brand); }
.footer-copy {
  color: var(--fg-dim);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

/* ---------- Toast ---------- */
.toast-host {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 14px 20px;
  background: rgba(20, 20, 32, 0.92);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 360px;
  animation: toastIn 0.35s var(--ease-bounce);
}
.toast.out { animation: toastOut 0.25s var(--ease-out) forwards; }
.toast .toast-icon { color: var(--brand); font-size: 1.1rem; }
.toast-success .toast-icon { color: var(--lime); }
.toast-error   .toast-icon { color: var(--accent); }
@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  to { transform: translateX(120%); opacity: 0; }
}

/* ---------- Form controls ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-weight: 500;
}
.input, .select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--fg);
  font-size: 0.95rem;
  transition: border 0.2s, box-shadow 0.2s;
  width: 100%;
}
.input:focus, .select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(254, 152, 3, 0.15);
}

/* Custom checkbox */
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-soft);
  transition: all 0.2s;
  user-select: none;
}
.check:hover { border-color: rgba(254, 152, 3, 0.3); }
.check input { display: none; }
.check .box {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid var(--fg-dim);
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
}
.check input:checked + .box {
  background: linear-gradient(135deg, var(--brand), var(--brand-glow));
  border-color: var(--brand);
  box-shadow: 0 0 16px rgba(254, 152, 3, 0.5);
}
.check input:checked + .box::after {
  content: '';
  position: absolute;
  left: 6px; top: 2px;
  width: 6px; height: 11px;
  border: solid #1a0d00;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* Range slider */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  outline: none;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-glow));
  cursor: pointer;
  box-shadow: 0 0 16px rgba(254, 152, 3, 0.6);
  transition: transform 0.15s;
}
.range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.range::-moz-range-thumb {
  width: 20px; height: 20px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-glow));
  cursor: pointer;
  box-shadow: 0 0 16px rgba(254, 152, 3, 0.6);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .bg-grid { animation: none; }
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-muted  { color: var(--fg-muted); }
.text-brand  { color: var(--brand); }
.mt-2 { margin-top: 16px; } .mt-4 { margin-top: 32px; } .mt-6 { margin-top: 48px; }
.mb-2 { margin-bottom: 16px; } .mb-4 { margin-bottom: 32px; } .mb-6 { margin-bottom: 48px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.hidden { display: none !important; }
