/* ── FONT IMPORTS ── Inter as the single typographic voice.
   Variable font, preconnect handled by Google Fonts CSS. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── RESET ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── DESIGN TOKENS ── */
:root {
  /* Colors — softer deep-indigo base, warmer text for comfort.
     --bg dropped from #0f0c1f (HSL 251°, 44%, 8%) to #15131c (HSL 252°,
     14%, 9%) on 2026-05-04. The previous bg was almost double the
     saturation of premium dark UIs (Apple ~5%, Linear ~9%, GitHub ~27%)
     and that hue saturation on the surface itself created fatigue —
     purple cast on the bg, again on accents, again on buttons. Same
     darkness preserved so atmospheric layers (orb halo, hero nebula)
     still read correctly. */
  --bg: #15131c;
  --text: #ededf2;
  --muted: rgba(255, 255, 255, 0.58);
  --border: rgba(255, 255, 255, 0.05);
  --accent: #7c5cfc;
  --accent2: #a78bfa;
  --card-bg: rgba(255, 255, 255, 0.03);
  --radius: 14px;

  /* ── TYPE SYSTEM ─────────────────────────────────────────────────────
     Every role is a TRIPLET: size / weight / tracking / leading.
     Tight tracking on display, looser tracking on small text — Apple/Stripe
     pairing. Use the .t-* utility classes below instead of ad-hoc font-size. */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;

  /* Display — hero, big campaign moments */
  --t-display-size: 56px;
  --t-display-weight: 700;
  --t-display-track: -0.028em;
  --t-display-lead: 1.04;

  /* Title — page hero, primary section hero */
  --t-title-size: 40px;
  --t-title-weight: 600;
  --t-title-track: -0.022em;
  --t-title-lead: 1.1;

  /* Heading — section title, card hero */
  --t-heading-size: 24px;
  --t-heading-weight: 600;
  --t-heading-track: -0.014em;
  --t-heading-lead: 1.25;

  /* Subtitle — card title, form label hero */
  --t-subtitle-size: 18px;
  --t-subtitle-weight: 500;
  --t-subtitle-track: -0.008em;
  --t-subtitle-lead: 1.45;

  /* Body — default reading text */
  --t-body-size: 15px;
  --t-body-weight: 400;
  --t-body-track: -0.003em;
  --t-body-lead: 1.6;

  /* Meta — secondary info, timestamps, helper text */
  --t-meta-size: 13px;
  --t-meta-weight: 400;
  --t-meta-track: 0;
  --t-meta-lead: 1.5;

  /* Micro — uppercase eyebrow, stat label */
  --t-micro-size: 11px;
  --t-micro-weight: 600;
  --t-micro-track: 0.1em;
  --t-micro-lead: 1;

  /* Back-compat: legacy --fs-* tokens still resolve, now aligned to the new scale */
  --fs-xs: var(--t-micro-size);
  --fs-sm: var(--t-meta-size);
  --fs-base: var(--t-body-size);
  --fs-lg: var(--t-subtitle-size);
  --fs-xl: var(--t-heading-size);
  --fs-display: var(--t-title-size);

  /* Spacing rhythm — 4/8/12/16/24/32/48/64 */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  /* ── NEUTRAL RAMP ─────────────────────────────────────────────────────
     Alpha-based white scale on dark bg. 8 stops. Use these for text,
     borders, surfaces — not the hex neutrals. Each stop owns one role. */
  --neutral-50:  rgba(255, 255, 255, 0.98);  /* primary text on dark */
  --neutral-100: rgba(255, 255, 255, 0.85);  /* strong text */
  --neutral-200: rgba(255, 255, 255, 0.70);  /* secondary text */
  --neutral-300: rgba(255, 255, 255, 0.55);  /* muted / meta */
  --neutral-400: rgba(255, 255, 255, 0.30);  /* disabled, hint */
  --neutral-500: rgba(255, 255, 255, 0.14);  /* strong border */
  --neutral-600: rgba(255, 255, 255, 0.08);  /* default border */
  --neutral-700: rgba(255, 255, 255, 0.04);  /* surface (card-bg) */
  --neutral-800: rgba(255, 255, 255, 0.02);  /* subtle fill */

  /* Semantic aliases — back-compat with existing vars.
     --muted bumped from --neutral-300 (0.55) to --neutral-200 (0.70) on
     2026-05-04 — body copy / descriptions / meta were bordering on
     unreadable on the dark page bg. 0.55 is fine for "hint"-level text;
     anything the learner has to read deserves more contrast.
     --card-bg bumped from --neutral-700 (0.04) to a custom 0.06 same day —
     cards were losing their edges against the page bg. The neutral ramp
     stays untouched so other surfaces using --neutral-700 are unaffected.
     --text dropped from --neutral-50 (0.98) to a custom 0.92 same day —
     pure-white text at heavy weight on a near-black bg produces halation
     (the white characters bloom outward and the eye cannot focus a sharp
     edge). 0.92 is still well above accessibility contrast minimums and
     dramatically reduces eye fatigue during long reading. */
  --text: rgba(255, 255, 255, 0.92);
  --muted: var(--neutral-200);
  --border: var(--neutral-600);
  --card-bg: rgba(255, 255, 255, 0.06);

  /* ── ACCENT RAMP ──────────────────────────────────────────────────────
     Kept as brand primary. The 500 is the existing --accent, others built
     around it for hover / tint / outline states. */
  --accent-50:  rgba(124, 92, 252, 0.08);   /* barely-there tint */
  --accent-100: rgba(124, 92, 252, 0.14);   /* hover surface */
  --accent-300: rgba(167, 139, 250, 0.40);  /* strong outline */
  --accent-500: #7c5cfc;                    /* primary brand */
  --accent-600: #6b4ae8;                    /* hover */
  --accent-700: #5a3dd0;                    /* pressed */
  /* --accent / --accent2 retained for back-compat below */

  /* ── SEMANTIC COLORS ──────────────────────────────────────────────────
     Each role: solid (icons, indicators), fg (text on tint), bg (subtle tint),
     border (thin rule). Hue chosen for adequate contrast on dark bg. */
  --success:        #34d399;                 /* emerald-400 */
  --success-fg:     #6ee7b7;                 /* text on tinted bg */
  --success-bg:     rgba(52, 211, 153, 0.10);
  --success-border: rgba(52, 211, 153, 0.28);

  --warn:           #f59e0b;                 /* amber-500 */
  --warn-fg:        #fbbf24;
  --warn-bg:        rgba(245, 158, 11, 0.10);
  --warn-border:    rgba(245, 158, 11, 0.28);

  --danger:         #f87171;                 /* red-400 */
  --danger-fg:      #fca5a5;
  --danger-bg:      rgba(248, 113, 113, 0.10);
  --danger-border:  rgba(248, 113, 113, 0.28);

  --info:           #60a5fa;                 /* blue-400 */
  --info-fg:        #93c5fd;
  --info-bg:        rgba(96, 165, 250, 0.10);
  --info-border:    rgba(96, 165, 250, 0.28);

  /* ── ELEVATION ────────────────────────────────────────────────────────
     Layered 2-4 shadow stacks: tight near shadow + mid ambient + wide
     diffusion. Gives real depth vs a single flat 0 4px 12px. */
  --elev-0: none;
  --elev-1:
    0 1px 2px rgba(0, 0, 0, 0.20),
    0 2px 6px rgba(0, 0, 0, 0.18);
  --elev-2:
    0 1px 2px rgba(0, 0, 0, 0.22),
    0 4px 10px rgba(0, 0, 0, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.18);
  --elev-3:
    0 1px 3px rgba(0, 0, 0, 0.28),
    0 6px 16px rgba(0, 0, 0, 0.30),
    0 18px 42px rgba(0, 0, 0, 0.28),
    0 40px 80px rgba(0, 0, 0, 0.22);

  /* ── MOTION ───────────────────────────────────────────────────────────
     Durations: short for micro-feedback, base for most UI, slow for large
     surface shifts (drawers, modals). Never use >500ms for routine UI.
     Easings: standard = workhorse, decelerate = entrances, accelerate =
     exits, emphasized = "important" movements, spring = playful overshoot
     (use sparingly — reward moments only). */
  --dur-instant: 60ms;
  --dur-fast:    140ms;
  --dur-base:    220ms;
  --dur-slow:    360ms;
  --dur-slower:  520ms;

  --ease-standard:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-decelerate:  cubic-bezier(0, 0, 0.2, 1);
  --ease-accelerate:  cubic-bezier(0.4, 0, 1, 1);
  --ease-emphasized:  cubic-bezier(0.2, 0, 0, 1);
  --ease-spring:      cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Paired presets — most common combos, use these before inventing new. */
  --motion-hover: var(--dur-fast) var(--ease-standard);
  --motion-press: var(--dur-instant) var(--ease-accelerate);
  --motion-enter: var(--dur-base) var(--ease-decelerate);
  --motion-exit:  var(--dur-fast) var(--ease-accelerate);
  --motion-morph: var(--dur-base) var(--ease-emphasized);
}

/* ── REDUCED MOTION ── Respect user OS setting; collapse everything to
   near-instant. Avoid removing transitions entirely (causes jarring snaps). */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-instant: 0.01ms;
    --dur-fast:    0.01ms;
    --dur-base:    0.01ms;
    --dur-slow:    0.01ms;
    --dur-slower:  0.01ms;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

html { scroll-behavior: smooth; background-color: #0f0c1f; }
html.light { background-color: #f5f5f7; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  /* Inter OpenType features: contextual alternates + tabular figures off by default
     (turn on .tabular for numeric columns); 'cv11' = single-storey 'a' for softer feel. */
  font-feature-settings: 'cv11' 1, 'ss01' 1, 'ss03' 1, 'calt' 1;
  font-variant-ligatures: common-ligatures contextual;
  font-size: var(--t-body-size);
  font-weight: var(--t-body-weight);
  line-height: var(--t-body-lead);
  letter-spacing: var(--t-body-track);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ── TYPE UTILITIES ── Prefer these over inline font-size.
   Compose: <h1 class="t-title">…</h1> */
.t-display  { font-size: var(--t-display-size);  font-weight: var(--t-display-weight);  letter-spacing: var(--t-display-track);  line-height: var(--t-display-lead); }
.t-title    { font-size: var(--t-title-size);    font-weight: var(--t-title-weight);    letter-spacing: var(--t-title-track);    line-height: var(--t-title-lead); }
.t-heading  { font-size: var(--t-heading-size);  font-weight: var(--t-heading-weight);  letter-spacing: var(--t-heading-track);  line-height: var(--t-heading-lead); }
.t-subtitle { font-size: var(--t-subtitle-size); font-weight: var(--t-subtitle-weight); letter-spacing: var(--t-subtitle-track); line-height: var(--t-subtitle-lead); }
.t-body     { font-size: var(--t-body-size);     font-weight: var(--t-body-weight);     letter-spacing: var(--t-body-track);     line-height: var(--t-body-lead); }
.t-meta     { font-size: var(--t-meta-size);     font-weight: var(--t-meta-weight);     letter-spacing: var(--t-meta-track);     line-height: var(--t-meta-lead); color: var(--muted); }
.t-micro    { font-size: var(--t-micro-size);    font-weight: var(--t-micro-weight);    letter-spacing: var(--t-micro-track);    line-height: var(--t-micro-lead); text-transform: uppercase; color: var(--accent2); }

/* Numeric columns (stats, scores, prices) — tabular figures so digits align. */
.tabular { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1, 'cv11' 1; }

/* ── ELEVATION UTILITIES ── Stack these on any element. Prefer over ad-hoc box-shadow. */
.elev-0 { box-shadow: var(--elev-0); }
.elev-1 { box-shadow: var(--elev-1); }
.elev-2 { box-shadow: var(--elev-2); }
.elev-3 { box-shadow: var(--elev-3); }

/* ── SURFACE UTILITIES ── Unified card treatment: neutral surface + thin border + soft lift. */
.surface {
  background: var(--neutral-700);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.card-elev {
  background: var(--neutral-700);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--elev-1);
  transition:
    box-shadow var(--motion-hover),
    border-color var(--motion-hover),
    transform var(--motion-hover);
}
.card-elev:hover {
  box-shadow: var(--elev-2);
  border-color: var(--neutral-500);
  transform: translateY(-1px);
}
.card-elev:active {
  transition: var(--motion-press);
  transform: translateY(0);
  box-shadow: var(--elev-1);
}

/* ── MOTION UTILITIES ── Compose onto interactive elements. */
.lift-on-hover {
  transition: transform var(--motion-hover), box-shadow var(--motion-hover);
}
.lift-on-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--elev-2);
}
.press-feedback {
  transition: transform var(--motion-press);
}
.press-feedback:active { transform: scale(0.97); }

/* Entrance — fade + tiny rise. Use on initial render, not on hover. */
@keyframes enterRise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-enter { animation: enterRise var(--dur-base) var(--ease-decelerate) both; }

/* Staggered enter — children inherit with offset via custom property --i */
.anim-stagger > * { animation: enterRise var(--dur-base) var(--ease-decelerate) both; animation-delay: calc(var(--i, 0) * 40ms); }

/* ──────────────────────────────────────────────────────────────────────
   PRIMITIVE COMPONENTS — the 6 shapes every page uses. Prefer these
   over ad-hoc inline styles. Each is composable (stack on .surface, add
   .elev-1, etc.)
   ────────────────────────────────────────────────────────────────────── */

/* ── CARD ── padded neutral surface. Replaces 10+ ad-hoc "section-card"
   patterns. Base gives a flat card; add .card.elev-1 for lift on hover. */
.card {
  background: var(--neutral-700);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.card--tight   { padding: 14px 16px; }
.card--roomy   { padding: 28px; }
.card--flush   { padding: 0; }
.card--accent  { border-color: var(--accent-300); background: var(--accent-50); }
.card--header  { padding: 16px 20px; border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; }

/* ── STAT ── big number + small label. Replaces inline font-size:32/36
   stacks with grey label underneath. */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__value {
  font-size: var(--t-title-size);
  font-weight: var(--t-title-weight);
  letter-spacing: var(--t-title-track);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'cv11' 1;
}
.stat__value--sm { font-size: var(--t-heading-size); }
.stat__value--lg { font-size: var(--t-display-size); }
.stat__label {
  font-size: var(--t-micro-size);
  font-weight: var(--t-micro-weight);
  letter-spacing: var(--t-micro-track);
  text-transform: uppercase;
  color: var(--muted);
}

/* ── PILL ── small inline chip for counts, labels, metadata.
   (Distinct from .status-pill which is semantic/coloured.) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--neutral-700);
  border: 1px solid var(--border);
  font-size: var(--t-micro-size);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  line-height: 1.4;
}
.pill--accent { background: var(--accent-100); border-color: var(--accent-300); color: var(--accent2); }
.pill--solid  { background: var(--neutral-100); border-color: transparent; color: var(--bg); }

/* ── EYEBROW ── the repeated 10px-uppercase-accent kicker label.
   Semantic alias of .t-micro — use this name for section eyebrows. */
.eyebrow {
  font-size: var(--t-micro-size);
  font-weight: var(--t-micro-weight);
  letter-spacing: var(--t-micro-track);
  text-transform: uppercase;
  color: var(--accent2);
  display: block;
  margin-bottom: 6px;
}

/* ── SECTION HEADER ── the row of: eyebrow + title on the left,
   link/action on the right. Replaces 10+ flex:space-between patterns. */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.section-head__title {
  font-size: var(--t-heading-size);
  font-weight: var(--t-heading-weight);
  letter-spacing: var(--t-heading-track);
  line-height: var(--t-heading-lead);
}

/* ── BUTTON VARIANTS ── .btn-ghost / .btn-primary already exist.
   Add outline + link variants. */
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: var(--t-meta-size);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition:
    border-color var(--motion-hover),
    background var(--motion-hover),
    transform var(--motion-press);
}
.btn-outline:hover { border-color: var(--accent-300); background: var(--accent-50); }
.btn-outline:active { transform: scale(0.98); transition: var(--motion-press); }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--accent2);
  font-size: var(--t-meta-size);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity var(--motion-hover);
}
.btn-link:hover { opacity: 1; }

/* ── DIVIDER ── Hairline rule. Use instead of ad-hoc 1px background strips. */
.hr { height: 1px; background: var(--border); border: 0; margin: 16px 0; }
.hr--soft { background: var(--neutral-800); }

/* ── META ROW ── The small "Course · Module 3 · 2d ago" dot-separated row. */
.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--t-meta-size);
  color: var(--muted);
}
.meta-row > * + *::before {
  content: '·';
  margin-right: 8px;
  opacity: 0.5;
}

/* ── STATUS PILLS ── Tinted chips using semantic palette. */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--t-meta-size);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  border: 1px solid transparent;
}
.status-success { background: var(--success-bg); color: var(--success-fg); border-color: var(--success-border); }
.status-warn    { background: var(--warn-bg);    color: var(--warn-fg);    border-color: var(--warn-border); }
.status-danger  { background: var(--danger-bg);  color: var(--danger-fg);  border-color: var(--danger-border); }
.status-info    { background: var(--info-bg);    color: var(--info-fg);    border-color: var(--info-border); }

/* ── BASELINE ELEMENT STYLING ── Hn tags pick up the scale automatically so pages
   that use raw <h1>..<h4> look right without adding classes. */
h1 { font-size: var(--t-title-size);    font-weight: var(--t-title-weight);    letter-spacing: var(--t-title-track);    line-height: var(--t-title-lead); }
h2 { font-size: var(--t-heading-size);  font-weight: var(--t-heading-weight);  letter-spacing: var(--t-heading-track);  line-height: var(--t-heading-lead); }
h3 { font-size: var(--t-subtitle-size); font-weight: var(--t-subtitle-weight); letter-spacing: var(--t-subtitle-track); line-height: var(--t-subtitle-lead); }
h4 { font-size: var(--t-body-size);     font-weight: 600;                      letter-spacing: var(--t-body-track);     line-height: 1.4; }
h5, h6 { font-size: var(--t-meta-size); font-weight: 600;                      letter-spacing: 0.02em;                  line-height: 1.3; text-transform: uppercase; color: var(--muted); }

p { font-size: var(--t-body-size); line-height: var(--t-body-lead); letter-spacing: var(--t-body-track); }

button, input, select, textarea { font-family: inherit; }
input, select, textarea { font-size: var(--t-body-size); letter-spacing: var(--t-body-track); }

/* ── LUCIDE ICONS ── */
[data-lucide] {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  vertical-align: middle;
  flex-shrink: 0;
  display: inline-block;
}
.icon-sm [data-lucide], [data-lucide].icon-sm { width: 14px; height: 14px; }
.icon-lg [data-lucide], [data-lucide].icon-lg { width: 20px; height: 20px; }
.icon-xl [data-lucide], [data-lucide].icon-xl { width: 28px; height: 28px; }

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  background: rgba(15, 12, 31, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition:
    background var(--dur-slow) var(--ease-standard),
    border-color var(--dur-slow) var(--ease-standard),
    height var(--dur-base) var(--ease-emphasized);
}

nav.nav-authenticated {
  height: 68px;
}

.nav-logo {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: #fff;
  display: flex;
  align-items: center;
  line-height: 1;
  gap: 8px;
  text-decoration: none;
  transition: color var(--dur-slow) var(--ease-standard);
}

.nav-logo-img {
  height: 18px;
  width: auto;
  flex-shrink: 0;
  display: block;
  /* Source PNG cropped to glyph bbox (440×466). 1px upward nudge
     to align with the wordmark's optical centre — equivalent to
     moving the text down 1px without needing to wrap the text
     node in a span on every page. */
  transform: translateY(-1px);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--motion-hover);
}

.nav-links a:hover,
.nav-links a.nav-active {
  color: #fff;
}

/* Hide nav actions + links until auth resolves — prevents sign-in/sign-out flash */
.nav-actions,
.nav-links { visibility: hidden; }
nav.nav-ready .nav-actions,
nav.nav-ready .nav-links { visibility: visible; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color var(--motion-hover), background var(--motion-hover);
  font-family: inherit;
}

.btn-ghost:hover { color: #fff; background: var(--neutral-700); }
.btn-ghost:active { transition: var(--motion-press); transform: scale(0.97); }

.btn-primary {
  background: #fff;
  color: #030014;
  border: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition:
    opacity var(--motion-hover),
    background var(--dur-slow) var(--ease-standard),
    color var(--dur-slow) var(--ease-standard),
    transform var(--motion-press),
    box-shadow var(--motion-hover);
  font-family: inherit;
}

.btn-primary:hover { opacity: 0.92; box-shadow: var(--elev-1); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.98); transition: var(--motion-press); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  font-size: var(--t-meta-size);
  font-weight: 400;
  letter-spacing: var(--t-meta-track);
  line-height: var(--t-meta-lead);
  color: var(--muted);
  transition: color 0.35s, border-color 0.35s;
}

/* ── DIVIDER ── */
.full-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 30%, var(--border) 70%, transparent);
}

/* ── BG GLOW ── */
.bg-glow {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-glow::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse, rgba(124, 92, 252, 0.08) 0%, transparent 70%);
}

.bg-glow::after {
  content: '';
  position: absolute;
  bottom: 0; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(ellipse, rgba(79, 70, 229, 0.06) 0%, transparent 70%);
}

/* ── STACKING ── */
body > *:not(.bg-glow):not(.theme-switch):not(.modal-overlay):not(nav) {
  position: relative;
  z-index: 1;
}

/* ── PAGE TRANSITION ── */
/* Apple-elegant cross-fade. Opacity-only — applying a transform to body
   makes it the containing block for position:fixed descendants, which
   breaks auth modals (modal-overlay covers body's full height, not the
   viewport, so the centered modal lands off-screen on long pages).
   The translate experiment was reverted because of that. iOS UIView
   curves drive the fade — long-tail decelerate on entrance reads as
   "settling in" rather than "appearing", so even opacity-only retains
   the elegant rhythm. */
body { opacity: 0; }

body.page-ready {
  opacity: 1;
  transition: opacity 480ms cubic-bezier(0.32, 0.72, 0, 1);
}

body.page-leaving {
  opacity: 0;
  transition: opacity 220ms cubic-bezier(0.55, 0.085, 0.68, 0.53);
}

@media (prefers-reduced-motion: reduce) {
  body,
  body.page-ready,
  body.page-leaving {
    opacity: 1 !important;
    transition: none !important;
  }
}

/* ── THEME SWITCH ── */
.theme-switch {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.switch-track {
  position: relative;
  width: 84px; height: 42px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
}

.switch-thumb {
  position: absolute;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c6cf0 0%, #5e4cd4 100%);
  top: 3px; left: 4px;
  transform: translateX(42px);
  transition: transform 0.4s cubic-bezier(0.34, 1.5, 0.64, 1), background 0.3s;
  box-shadow: 0 2px 12px rgba(94, 76, 212, 0.55);
  z-index: 1;
}

.switch-icon {
  position: absolute;
  font-size: 15px;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  transition: opacity 0.3s;
  line-height: 1;
}

.switch-sun { left: 10px; }
.switch-moon { right: 10px; }

html:not(.light) .switch-sun { opacity: 0.38; }
html:not(.light) .switch-moon { opacity: 1; }
html.light .switch-sun { opacity: 1; }
html.light .switch-moon { opacity: 0.38; }

html.light .switch-track {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,1);
}

html.light .switch-thumb {
  transform: translateX(0);
}

/* ── THEME TRANSITION ── */
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition:
    background-color 240ms var(--ease-standard),
    background 240ms var(--ease-standard),
    border-color 240ms var(--ease-standard),
    color 240ms var(--ease-standard),
    box-shadow 240ms var(--ease-standard),
    opacity 240ms var(--ease-standard) !important;
}

/* ── LIGHT MODE — shared tokens & components ── */
html.light {
  --bg: #f5f5f7;
  --text: #1d1d1f;
  --muted: rgba(0, 0, 0, 0.75);
  --border: rgba(0, 0, 0, 0.08);
  --accent: #5e4cd4;
  --accent2: #7c6cf0;
  --card-bg: rgba(255, 255, 255, 0.9);

  /* Invert neutral ramp to black-alpha on light bg */
  --neutral-50:  rgba(0, 0, 0, 0.92);
  --neutral-100: rgba(0, 0, 0, 0.80);
  --neutral-200: rgba(0, 0, 0, 0.62);
  --neutral-300: rgba(0, 0, 0, 0.48);
  --neutral-400: rgba(0, 0, 0, 0.28);
  --neutral-500: rgba(0, 0, 0, 0.14);
  --neutral-600: rgba(0, 0, 0, 0.08);
  --neutral-700: rgba(255, 255, 255, 0.9);
  --neutral-800: rgba(0, 0, 0, 0.03);

  /* Accent ramp — darker hues for contrast on white */
  --accent-50:  rgba(94, 76, 212, 0.06);
  --accent-100: rgba(94, 76, 212, 0.12);
  --accent-300: rgba(94, 76, 212, 0.35);
  --accent-500: #5e4cd4;
  --accent-600: #4d3cbe;
  --accent-700: #3d2ea8;

  /* Semantic — slightly deeper, higher-contrast for white bg */
  --success:        #059669;
  --success-fg:     #047857;
  --success-bg:     rgba(5, 150, 105, 0.08);
  --success-border: rgba(5, 150, 105, 0.24);

  --warn:           #d97706;
  --warn-fg:        #b45309;
  --warn-bg:        rgba(217, 119, 6, 0.08);
  --warn-border:    rgba(217, 119, 6, 0.24);

  --danger:         #dc2626;
  --danger-fg:      #b91c1c;
  --danger-bg:      rgba(220, 38, 38, 0.08);
  --danger-border:  rgba(220, 38, 38, 0.24);

  --info:           #2563eb;
  --info-fg:        #1d4ed8;
  --info-bg:        rgba(37, 99, 235, 0.08);
  --info-border:    rgba(37, 99, 235, 0.24);

  /* Softer shadows on light bg */
  --elev-1:
    0 1px 2px rgba(17, 12, 46, 0.06),
    0 2px 6px rgba(17, 12, 46, 0.05);
  --elev-2:
    0 1px 2px rgba(17, 12, 46, 0.08),
    0 4px 10px rgba(17, 12, 46, 0.06),
    0 10px 24px rgba(17, 12, 46, 0.05);
  --elev-3:
    0 1px 3px rgba(17, 12, 46, 0.10),
    0 6px 16px rgba(17, 12, 46, 0.08),
    0 18px 42px rgba(17, 12, 46, 0.08),
    0 40px 80px rgba(17, 12, 46, 0.06);
}

html.light body { background-color: #f5f5f7; }

html.light nav {
  background: rgba(245, 245, 247, 0.82);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

html.light .nav-logo { color: #1A1A1A; }
html.light .nav-links a { color: rgba(0,0,0,0.5); }
html.light .nav-links a:hover,
html.light .nav-links a.nav-active { color: #1d1d1f; }

html.light .nav-dropdown {
  background: rgba(255,255,255,0.97);
  border-color: rgba(0,0,0,0.1);
}

html.light .nav-dropdown-item { color: #1d1d1f; }
html.light .nav-dropdown-item:hover { background: rgba(0,0,0,0.05); color: #1d1d1f; }

html.light .btn-ghost { color: rgba(0, 0, 0, 0.5); }
html.light .btn-ghost:hover { color: #1d1d1f; }

html.light .btn-primary {
  background: #1d1d1f;
  color: #fff;
}

html.light footer { color: rgba(0, 0, 0, 0.38); }

/* ── AUTH MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: #0e0a1f;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 380px;
  position: relative;
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--text); }

.modal-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 24px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.modal-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.modal-field input {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.modal-field input:focus { border-color: rgba(124,92,252,0.45); }
.modal-field input::placeholder { color: var(--muted); opacity: 0.35; }

.modal-forgot {
  text-align: right;
  margin-top: -6px;
  margin-bottom: 12px;
}

.modal-forgot button {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.modal-forgot button:hover { color: var(--text); }

.modal-btn {
  width: 100%;
  margin-top: 6px;
  padding: 11px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal-btn:hover { opacity: 0.88; }

.modal-btn-google {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 140ms cubic-bezier(0.4,0,0.2,1), border-color 140ms cubic-bezier(0.4,0,0.2,1);
  margin-bottom: 14px;
}
.modal-btn-google:hover { background: #f8f8f8; border-color: rgba(0,0,0,0.22); }
.modal-btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

.modal-divider {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--muted);
  opacity: 0.65;
  margin: 0 0 16px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.modal-divider::before, .modal-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.modal-switch {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.modal-switch button {
  background: none;
  border: none;
  color: var(--accent2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-switch button:hover { opacity: 0.8; }

html.light .modal { background: #fff; border-color: rgba(0,0,0,0.09); }
html.light .modal-field input { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); color: #1d1d1f; }
html.light .modal-field input:focus { border-color: rgba(94,76,212,0.4); }

/* ── NAV USER STATE ── */
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-username {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.nav-user-menu {
  position: relative;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}

.nav-avatar:hover { opacity: 0.85; }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(15, 10, 40, 0.97);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  min-width: 148px;
  z-index: 9999;
  backdrop-filter: blur(16px);
}

.nav-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  border-radius: 5px;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.12s;
}

.nav-dropdown-item:hover {
  background: rgba(255,255,255,0.09);
  color: #fff;
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 3px 4px;
}

.nav-dropdown-signout { color: rgba(239,68,68,0.8); }
.nav-dropdown-signout:hover { background: rgba(239,68,68,0.06); }

/* ── SETTINGS MODAL ── */
.settings-modal {
  background: #0a0620;
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: modalIn 0.2s ease;
}

.sett-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #0a0620;
  z-index: 1;
  border-radius: 14px 14px 0 0;
}

.sett-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sett-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
  opacity: 0.55;
  line-height: 1;
  padding: 2px;
  transition: opacity 0.15s;
}
.sett-close:hover { opacity: 1; }

.sett-section {
  border-bottom: 1px solid var(--border);
}
.sett-section:last-child { border-bottom: none; }

.sett-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.45;
  padding: 16px 28px 10px;
}

.sett-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  min-height: 58px;
}
.sett-row:last-child { border-bottom: none; }

.sett-row-info { flex: 1; min-width: 0; }

.sett-row-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.sett-row-sub {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.55;
  line-height: 1.4;
}

.sett-row-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sett-input {
  width: 190px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.sett-input:focus { border-color: rgba(124,92,252,0.45); }
.sett-input::placeholder { color: var(--muted); opacity: 0.35; }

.sett-btn-save {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.sett-btn-save:hover { opacity: 0.85; }
.sett-btn-save:disabled { opacity: 0.45; cursor: default; }

.sett-btn-ghost {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 500;
  background: none;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.sett-btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.22); }
.sett-btn-ghost:disabled { opacity: 0.38; cursor: default; }
.sett-btn-ghost.sett-btn-small { padding: 5px 10px; font-size: 11.5px; }

/* Proof-share toggle + link row */
.sett-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}
.sett-toggle input { opacity: 0; width: 0; height: 0; }
.sett-toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
  transition: background 140ms ease;
}
.sett-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1);
}
.sett-toggle input:checked + .sett-toggle-track { background: var(--accent); }
.sett-toggle input:checked + .sett-toggle-track .sett-toggle-thumb { transform: translateX(18px); }

.sett-proof-link-wrap {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.sett-proof-link {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  min-width: 0;
}

html.light .sett-toggle-track { background: rgba(0,0,0,0.18); }
html.light .sett-proof-link { background: rgba(0,0,0,0.03); color: #1d1d1f; border-color: rgba(0,0,0,0.1); }

.sett-plan-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}

.sett-invoice-area {
  padding: 12px 28px 16px;
}
.sett-invoice-empty {
  font-size: 12.5px;
  color: var(--muted);
  opacity: 0.45;
  text-align: center;
  padding: 10px 0;
}
.sett-invoice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.sett-invoice-row:last-child { border-bottom: none; }
.sett-invoice-date { color: var(--muted); opacity: 0.6; }
.sett-invoice-amount { font-weight: 600; }
.sett-invoice-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(52,211,153,0.12);
  color: #34d399;
}

.sett-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--text);
  color: var(--bg);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  white-space: nowrap;
}
.sett-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Settings light mode */
html.light .settings-modal { background: #fff; border-color: rgba(0,0,0,0.09); }
html.light .sett-header { background: #fff; }
html.light .sett-input { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); color: #1d1d1f; }
html.light .sett-input::placeholder { color: rgba(0,0,0,0.3); }
html.light .sett-plan-badge { background: rgba(0,0,0,0.06); color: rgba(0,0,0,0.5); }
html.light .nav-dropdown { background: rgba(255,255,255,0.98); }

/* ── SKELETON LOADING STATES ── */
/* Use while async data is fetching so sections don't flash blank → fill.
   Pattern:
     <div id="foo" class="skeleton-wrap"> … real content here, or initial skeleton markup … </div>
   JS replaces innerHTML once data arrives.
   Variants:
     .skeleton          base pulse (apply to any block to make it a placeholder)
     .skeleton-line     single-line text placeholder (height 12px)
     .skeleton-line.lg  heading-sized (height 20px)
     .skeleton-line.sm  meta-sized (height 10px)
     .skeleton-circle   round avatar/icon placeholder
     .skeleton-card     card-height (height 120px)
     .skeleton-pill     small tag/pill
*/
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.035) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.035) 100%
  );
  background-size: 200% 100%;
  animation: skeletonPulse 1.4s ease-in-out infinite;
  border-radius: 6px;
  pointer-events: none;
  user-select: none;
  color: transparent !important;
  border-color: transparent !important;
}

.skeleton-line       { display: block; height: 12px; width: 100%; border-radius: 4px; margin: 6px 0; }
.skeleton-line.lg    { height: 20px; }
.skeleton-line.sm    { height: 10px; }
.skeleton-line.w30   { width: 30%; }
.skeleton-line.w50   { width: 50%; }
.skeleton-line.w70   { width: 70%; }
.skeleton-line.w85   { width: 85%; }

.skeleton-circle     { border-radius: 50%; }
.skeleton-card       { height: 120px; border-radius: 10px; }
.skeleton-pill       { display: inline-block; height: 22px; width: 72px; border-radius: 999px; margin-right: 6px; vertical-align: middle; }

/* Compose these on top of .skeleton, e.g. <div class="skeleton skeleton-line lg w50"></div> */

@keyframes skeletonPulse {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

html.light .skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04) 0%,
    rgba(0, 0, 0, 0.09) 50%,
    rgba(0, 0, 0, 0.04) 100%
  );
  background-size: 200% 100%;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; opacity: 0.7; }
}

/* ──────────────────────────────────────────────────────────────
   RESPONSIVE BASELINE — Option A
   Target: 768px – 1920px (laptops, windowed desktops, iPad landscape).
   Mobile (<768px) is a separate pass handled later.
   ────────────────────────────────────────────────────────────── */

/* ~1200px — tighten nav padding and link spacing for 13"–14" laptops */
@media (max-width: 1200px) {
  nav { padding: 0 20px; }
  .nav-links { gap: 20px; }
  footer { padding-left: 20px; padding-right: 20px; }
}

/* ~960px — compress nav further; hide the secondary links (placeholder items) */
@media (max-width: 960px) {
  nav { padding: 0 16px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 12px; }
  /* Hide 'Career Boots' and 'Success stories' — they're placeholder hrefs */
  .nav-links li:nth-last-child(-n+2) { display: none; }
}

/* ── MOBILE NAV (hamburger) ─────────────────────────────────────────────── */
/* The hamburger button is injected by shared.js into every <nav>. It's
   hidden on desktop via this default; the @media (max-width: 768px) block
   below shows it and converts the nav into a stacked drawer. */
.nav-hamburger {
  display: none;
  width: 44px; height: 44px;
  background: none; border: none; padding: 0;
  cursor: pointer; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
}
.nav-hamburger span {
  display: block; width: 20px; height: 2px;
  background: #fff; border-radius: 1px;
  transition: transform var(--motion-hover), opacity var(--motion-hover);
}
html.light .nav-hamburger span { background: #1d1d1f; }

/* ── MOBILE DESKTOP-ONLY GATE ───────────────────────────────────────────── */
/* Pages call window.enforceDesktopOnly() to mount this gate on mobile.
   Full-screen overlay with a friendly "use desktop" message. */
.mobile-gate {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* dynamic viewport — survives iOS Safari address-bar collapse */
  background: var(--bg);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  overflow-y: auto;
}
.mobile-gate.is-open { display: flex; }
.mobile-gate .mg-card {
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}
.mobile-gate .mg-icon {
  width: 64px; height: 64px;
  margin: 0 auto 24px;
  background: rgba(124, 92, 252, 0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.mobile-gate .mg-icon svg {
  width: 32px; height: 32px;
}
.mobile-gate .mg-title {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
  color: var(--text);
}
.mobile-gate .mg-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 20px;
}
.mobile-gate .mg-aside {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 28px;
  padding: 14px 16px;
  background: rgba(124, 92, 252, 0.05);
  border: 1px solid rgba(124, 92, 252, 0.18);
  border-radius: 10px;
  text-align: left;
}
.mobile-gate .mg-aside a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.mobile-gate .mg-aside a:hover { text-decoration: underline; }
.mobile-gate .mg-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--motion-hover);
}
.mobile-gate .mg-cta:hover { opacity: 0.88; }

/* ────────────────────────────────────────────────────────────────────────
   MOBILE BREAKPOINT — < 768px
   Hamburger nav + base touch sizing.
   ──────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Hard guard: never let the page scroll horizontally on mobile, even if
     a descendant container (e.g. learn.html's wide grid) extends past the
     viewport. Without this, position:fixed elements inside a horizontally-
     scrollable body can appear to scroll with the page. */
  html, body { overflow-x: hidden; max-width: 100vw; }

  nav {
    padding: 0 14px;
    height: 56px;
    flex-wrap: wrap;
  }
  nav.nav-authenticated { height: 56px; }

  .nav-logo-img { height: 18px; }

  .nav-hamburger { display: flex; }

  /* Collapse the link list and actions into a stacked drawer. By default
     hidden; .nav-mobile-open on the parent <nav> reveals them. */
  .nav-links,
  .nav-actions {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
  }

  nav.nav-mobile-open {
    height: auto;
    padding-top: 6px;
    padding-bottom: 16px;
    align-items: flex-start;
  }
  nav.nav-mobile-open .nav-hamburger {
    align-self: flex-start;
    margin-top: 6px;
  }
  nav.nav-mobile-open .nav-logo {
    align-self: flex-start;
    margin-top: 18px;
  }
  nav.nav-mobile-open .nav-links,
  nav.nav-mobile-open .nav-actions {
    display: flex;
    order: 99;
  }
  nav.nav-mobile-open .nav-links {
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 4px;
  }
  nav.nav-mobile-open .nav-links li {
    width: 100%;
    /* Override the 960px breakpoint rule that hides the last 2 nav links —
       in the mobile drawer we want every link to show, including the
       'Career' / 'Success stories' placeholder items. */
    display: list-item !important;
  }
  nav.nav-mobile-open .nav-links a {
    display: block;
    width: 100%;
    padding: 12px 4px;
    font-size: 15px;
    box-sizing: border-box;
  }
  nav.nav-mobile-open .nav-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    gap: 8px;
  }
  nav.nav-mobile-open .nav-actions .btn-ghost,
  nav.nav-mobile-open .nav-actions .btn-primary {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
    padding: 10px 16px;
  }

  /* Hamburger → X transform when open */
  nav.nav-mobile-open .nav-hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  nav.nav-mobile-open .nav-hamburger span:nth-child(2) {
    opacity: 0;
  }
  nav.nav-mobile-open .nav-hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Some pages (e.g. how-it-works.html) wrap a language toggle next to
     nav-actions inside an unclassed <div style="display:flex">. Flatten
     that wrapper on mobile so its children participate in the nav's own
     flex layout — otherwise the lang-switch sits beside the hamburger
     and collides with it. */
  nav > div[style] {
    display: contents;
  }
  /* Hide lang-switch in the collapsed bar; show it as the last item of
     the drawer when open, divider above. */
  nav .lang-switch {
    display: none;
  }
  nav.nav-mobile-open .lang-switch {
    display: flex;
    order: 100;
    width: 100%;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  /* The user dropdown panel becomes inline content on mobile (don't float
     it as a positioned popover — too cramped on a phone). */
  nav.nav-mobile-open .nav-dropdown {
    position: static;
    width: 100%;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
  }
  nav.nav-mobile-open .nav-dropdown-item {
    width: 100%;
    text-align: left;
    padding: 12px 4px;
    font-size: 14px;
    background: none;
  }
  nav.nav-mobile-open .nav-user .nav-avatar { display: none; }

  footer { padding-left: 14px; padding-right: 14px; }

  /* Touch-friendly default sizing for inputs + buttons inside marketing/
     settings forms. Per-page styles can override. */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px; /* prevents iOS Safari from zooming on focus */
  }

  /* Auth + settings modals — give breathing room from screen edges,
     compress padding, and ensure tap targets stay 44px+. */
  .modal-overlay { padding: 16px; }
  .modal {
    padding: 28px 22px 24px;
    max-width: 100%;
    border-radius: 12px;
  }
  .modal-title { font-size: 18px; margin-bottom: 18px; }
  .modal-field { margin-bottom: 12px; }
  .modal-field input { padding: 12px 14px; font-size: 16px; }
  .modal-btn { min-height: 44px; }
  .modal-close {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    top: 8px; right: 8px;
  }
}

