/* ==========================================================================
   LearnToTrade — Forex education site
   Design tokens, light/dark theming, layout and components.
   ========================================================================== */

:root {
  color-scheme: light dark;
  --bg: oklch(98.4% 0.006 258);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(96.4% 0.009 258);
  --surface-3: oklch(92.8% 0.013 258);
  --ink: oklch(23% 0.032 262);
  --ink-2: oklch(36% 0.026 262);
  --muted: oklch(51% 0.021 262);
  --line: oklch(90.5% 0.011 262);
  --line-strong: oklch(84% 0.015 262);
  --brand: oklch(52% 0.17 270);
  --brand-hover: oklch(46% 0.17 270);
  --brand-soft: oklch(95.5% 0.028 270);
  --on-brand: oklch(100% 0 0);
  --accent: oklch(68% 0.15 162);
  --accent-strong: oklch(52% 0.13 162);
  --accent-soft: oklch(95% 0.045 162);
  --warn: oklch(72% 0.14 78);
  --warn-soft: oklch(96% 0.05 85);
  --danger: oklch(56% 0.19 25);
  --danger-soft: oklch(96% 0.03 25);
  --gold: oklch(78% 0.13 85);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px oklch(20% 0.03 262 / 0.06);
  --shadow: 0 1px 2px oklch(20% 0.03 262 / 0.05), 0 14px 34px -18px oklch(25% 0.05 262 / 0.35);
  --shadow-lg: 0 2px 4px oklch(20% 0.03 262 / 0.05), 0 30px 60px -30px oklch(25% 0.05 262 / 0.45);

  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;

  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0: clamp(0.98rem, 0.94rem + 0.2vw, 1.08rem);
  --step-1: clamp(1.15rem, 1.06rem + 0.45vw, 1.4rem);
  --step-2: clamp(1.4rem, 1.22rem + 0.9vw, 1.9rem);
  --step-3: clamp(1.75rem, 1.4rem + 1.75vw, 2.6rem);
  --step-4: clamp(2.2rem, 1.6rem + 3vw, 3.9rem);
  --step-5: clamp(2.6rem, 1.6rem + 4.4vw, 4.8rem);

  --container: 1140px;
  --gutter: 1.35rem;
  --header-h: 72px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: oklch(18.5% 0.022 265);
    --surface: oklch(22.5% 0.024 265);
    --surface-2: oklch(26.5% 0.026 265);
    --surface-3: oklch(31% 0.028 265);
    --ink: oklch(96.5% 0.006 265);
    --ink-2: oklch(86% 0.012 265);
    --muted: oklch(72% 0.018 265);
    --line: oklch(32.5% 0.022 265);
    --line-strong: oklch(40% 0.026 265);
    --brand: oklch(72% 0.14 272);
    --brand-hover: oklch(78% 0.13 272);
    --brand-soft: oklch(29% 0.055 272);
    --on-brand: oklch(19% 0.03 272);
    --accent: oklch(78% 0.14 162);
    --accent-strong: oklch(84% 0.12 162);
    --accent-soft: oklch(29% 0.05 162);
    --warn: oklch(80% 0.13 80);
    --warn-soft: oklch(30% 0.05 80);
    --danger: oklch(70% 0.17 25);
    --danger-soft: oklch(29% 0.06 25);
    --gold: oklch(82% 0.12 85);
    --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.3);
    --shadow: 0 1px 2px oklch(0% 0 0 / 0.25), 0 16px 40px -20px oklch(0% 0 0 / 0.6);
    --shadow-lg: 0 2px 6px oklch(0% 0 0 / 0.3), 0 34px 70px -32px oklch(0% 0 0 / 0.7);
  }
}
/* Explicit theme choice (set by the theme toggle) overrides the OS setting. */
html[data-theme="light"] { color-scheme: light; }

html[data-theme="dark"] {
  color-scheme: dark;
    color-scheme: dark;
  --bg: oklch(18.5% 0.022 265);
  --surface: oklch(22.5% 0.024 265);
  --surface-2: oklch(26.5% 0.026 265);
  --surface-3: oklch(31% 0.028 265);
  --ink: oklch(96.5% 0.006 265);
  --ink-2: oklch(86% 0.012 265);
  --muted: oklch(72% 0.018 265);
  --line: oklch(32.5% 0.022 265);
  --line-strong: oklch(40% 0.026 265);
  --brand: oklch(72% 0.14 272);
  --brand-hover: oklch(78% 0.13 272);
  --brand-soft: oklch(29% 0.055 272);
  --on-brand: oklch(19% 0.03 272);
  --accent: oklch(78% 0.14 162);
  --accent-strong: oklch(84% 0.12 162);
  --accent-soft: oklch(29% 0.05 162);
  --warn: oklch(80% 0.13 80);
  --warn-soft: oklch(30% 0.05 80);
  --danger: oklch(70% 0.17 25);
  --danger-soft: oklch(29% 0.06 25);
  --gold: oklch(82% 0.12 85);
  --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.3);
  --shadow: 0 1px 2px oklch(0% 0 0 / 0.25), 0 16px 40px -20px oklch(0% 0 0 / 0.6);
  --shadow-lg: 0 2px 6px oklch(0% 0 0 / 0.3), 0 34px 70px -32px oklch(0% 0 0 / 0.7);
}


/* --------------------------------------------------------------- Reset -- */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
}

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 750;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--brand); color: var(--on-brand); }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

:target { scroll-margin-top: calc(var(--header-h) + 1.5rem); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* -------------------------------------------------------------- Layout -- */

.container {
  width: min(var(--container), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--surface { background: var(--surface); border-block: 1px solid var(--line); }

.stack { display: grid; gap: 1rem; }
.stack-lg { display: grid; gap: 1.75rem; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* -------------------------------------------------------------- Header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px -20px oklch(0% 0 0 / 0.5);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  margin-right: auto;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, oklch(58% 0.17 275), oklch(58% 0.14 175));
  color: #fff;
  box-shadow: 0 6px 14px -8px oklch(45% 0.15 270 / 0.8);
  flex: none;
}
.brand-mark svg { width: 20px; height: 20px; }

.nav { display: flex; align-items: center; gap: 0.15rem; }

.nav a {
  display: inline-block;
  padding: 0.55rem 0.78rem;
  border-radius: 999px;
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"],
.nav a[aria-current="true"] { color: var(--brand); background: var(--brand-soft); }
.nav .nav-cta { display: none; }

.header-actions { display: flex; align-items: center; gap: 0.6rem; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  place-items: center;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@supports not (color: light-dark(#000, #fff)) {
  /* Keeps the toggle usable on very old browsers: no change is required. */
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  html:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* --------------------------------------------------------------- Hero --- */

.hero {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 6vw, 5.5rem);
  overflow: clip;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -20% auto -20%;
  height: 720px;
  background:
    radial-gradient(38% 55% at 22% 32%, oklch(70% 0.14 275 / 0.28), transparent 70%),
    radial-gradient(34% 48% at 76% 18%, oklch(74% 0.13 168 / 0.26), transparent 70%),
    radial-gradient(30% 40% at 60% 70%, oklch(80% 0.1 90 / 0.14), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
  z-index: -1;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero h1 {
  font-size: var(--step-5);
  letter-spacing: -0.035em;
  margin-top: 1.15rem;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--brand), oklch(58% 0.15 190));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead {
  margin-top: 1.15rem;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 34ch;
  font-weight: 450;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.8rem;
}
.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.35rem;
  margin-top: 1.6rem;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--muted);
}
.hero-notes li { display: inline-flex; align-items: center; gap: 0.42rem; }
.hero-notes svg { width: 15px; height: 15px; color: var(--accent-strong); flex: none; }

/* Hero visual ---------------------------------------------------------- */

.hero-visual { position: relative; }

.chart-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.15rem 0.9rem;
  box-shadow: var(--shadow-lg);
  transform: rotate(-1.2deg);
}
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.chart-pair { display: flex; align-items: center; gap: 0.55rem; }
.chart-pair .flag {
  width: 26px; height: 26px; border-radius: 50%;
  background: conic-gradient(from 210deg, oklch(62% 0.19 25) 0 50%, oklch(94% 0.01 250) 0);
  border: 1px solid var(--line);
}
.chart-pair strong { font-size: 0.95rem; letter-spacing: -0.01em; }
.chart-pair span { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 500; }
.chart-price { text-align: right; }
.chart-price strong { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.chart-price span {
  font-size: 0.75rem; font-weight: 650; color: var(--accent-strong);
  background: var(--accent-soft); padding: 0.1rem 0.4rem; border-radius: 6px;
}
.chart-card svg.chart { width: 100%; height: auto; }

.chart-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 0.7rem;
  margin-top: 0.35rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}
.chart-legend .tp { color: var(--accent-strong); font-weight: 650; }
.chart-legend .sl { color: var(--danger); font-weight: 650; }

.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  line-height: 1.3;
}
.float-card strong { display: block; font-size: 0.86rem; }
.float-card span { color: var(--muted); font-size: 0.74rem; }
.float-card--risk { left: -1.4rem; bottom: 1.4rem; }
.float-card--rr { right: 0.4rem; top: -2.9rem; }
.float-icon {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent-strong);
  flex: none;
}
.float-icon svg { width: 17px; height: 17px; }

/* --------------------------------------------------------------- Cards -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.82rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 12px 24px -16px oklch(48% 0.17 270 / 0.9);
}
.btn-primary:hover { background: var(--brand-hover); }

.btn-accent {
  background: var(--accent);
  color: oklch(22% 0.05 165);
}
.btn-accent:hover { background: oklch(74% 0.15 162); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--muted); }

.btn-link {
  padding: 0;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--brand);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.btn-link:hover { text-decoration: underline; }

.btn-sm { padding: 0.58rem 1rem; font-size: 0.86rem; }
.btn-block { width: 100%; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2.4vw, 1.75rem);
  box-shadow: var(--shadow-sm);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

/* Section heading ------------------------------------------------------ */

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.2rem;
}
.section-head > div { max-width: 58ch; }
.section-head h2 {
  font-size: var(--step-3);
  letter-spacing: -0.03em;
  margin-top: 0.65rem;
}
.section-head p {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: var(--step-0);
  max-width: 52ch;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}
.kicker::before {
  content: "";
  width: 18px; height: 2px; border-radius: 2px;
  background: currentColor;
}

/* Feature cards -------------------------------------------------------- */

.feature { display: flex; flex-direction: column; gap: 0.55rem; }
.feature-icon {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  margin-bottom: 0.3rem;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid color-mix(in oklab, var(--brand) 14%, transparent);
}
.feature-icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.06rem; letter-spacing: -0.015em; }
.feature p { color: var(--muted); font-size: 0.94rem; line-height: 1.6; }

/* Stats ---------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  background: var(--surface);
  padding: 1.25rem 1.15rem;
}
.stat strong {
  display: block;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat span { font-size: 0.82rem; color: var(--muted); font-weight: 500; }

/* Roadmap / levels ----------------------------------------------------- */

.level-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  counter-reset: level;
  list-style: none;
  padding: 0;
}
.level {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  padding: 1.2rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.level:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.level-num {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  font-size: 0.88rem;
  font-weight: 800;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.level[data-stage="beginner"] .level-num,
.level-num[data-stage="beginner"] { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }
.level[data-stage="intermediate"] .level-num,
.level-num[data-stage="intermediate"] { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.level[data-stage="advanced"] .level-num,
.level-num[data-stage="advanced"] { background: var(--warn-soft); color: oklch(45% 0.1 70); border-color: transparent; }
.level h3 { font-size: 0.99rem; letter-spacing: -0.01em; }
.level p { font-size: 0.84rem; color: var(--muted); margin-top: 0.18rem; line-height: 1.45; }
.level-meta { font-size: 0.75rem; color: var(--muted); white-space: nowrap; text-align: right; }
.level-meta b { display: block; color: var(--ink); font-weight: 700; }
.level-arrow { color: var(--muted); justify-self: end; }
.level:hover .level-arrow { color: var(--brand); }

/* Lesson cards --------------------------------------------------------- */

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}
.lesson-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.lesson-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.lesson-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.chip--beginner { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }
.chip--intermediate { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.chip--advanced { background: var(--warn-soft); color: oklch(45% 0.1 70); border-color: transparent; }
.chip--new { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.lesson-time { font-size: 0.76rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.3rem; }
.lesson-time svg { width: 13px; height: 13px; }
.lesson-card h3 { font-size: 1.02rem; line-height: 1.35; letter-spacing: -0.015em; }
.lesson-card p { font-size: 0.88rem; color: var(--muted); line-height: 1.55; }
.lesson-more {
  margin-top: auto;
  padding-top: 0.4rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Brokers table -------------------------------------------------------- */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow-sm);
}
table.compare {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 0.9rem;
}
table.compare caption {
  caption-side: top;
  text-align: left;
  padding: 1rem 1.15rem 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}
table.compare thead th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 0.85rem 1.1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.compare tbody td {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.compare tbody tr:last-child td { border-bottom: none; }
table.compare tbody tr { transition: background-color 0.15s ease; }
table.compare tbody tr:hover { background: color-mix(in oklab, var(--surface-2) 60%, transparent); }

.broker-name { display: flex; align-items: center; gap: 0.65rem; min-width: 165px; }
.broker-logo {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.9rem;
  background: var(--brand-soft);
  color: var(--brand);
  flex: none;
}
.broker-name strong { display: block; font-size: 0.92rem; line-height: 1.25; }
.broker-name div > span { display: block; font-size: 0.74rem; color: var(--muted); }
table.compare .val { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.compare .muted { color: var(--muted); font-size: 0.82rem; }
.rating {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 750;
  font-size: 0.85rem;
}
.rating svg { width: 14px; height: 14px; color: var(--gold); }
.rating .count { font-weight: 500; color: var(--muted); font-size: 0.76rem; }

.disclosure {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 0.79rem;
  color: var(--muted);
  background: var(--surface-2);
}
.disclosure a { color: var(--ink-2); }

/* Calculator ----------------------------------------------------------- */

.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.calc-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 1.9rem);
  box-shadow: var(--shadow);
}
.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-size: 0.79rem; font-weight: 650; color: var(--ink-2); }
.field .hint { font-size: 0.72rem; color: var(--muted); font-weight: 500; }
.field input, .field select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}
.field input:user-invalid { border-color: var(--danger); }

.calc-out {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}
.calc-out div {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}
.calc-out span { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.calc-out strong {
  display: block;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.calc-out small { font-size: 0.7rem; color: var(--muted); }

/* Callouts ------------------------------------------------------------- */

.callout {
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.15rem;
  font-size: 0.94rem;
  line-height: 1.6;
}
.callout strong { color: inherit; }
.callout--warn { border-color: var(--warn); background: var(--warn-soft); }
.callout--danger { border-color: var(--danger); background: var(--danger-soft); }
.callout--tip { border-color: var(--accent-strong); background: var(--accent-soft); }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

/* FAQ ------------------------------------------------------------------ */

.faq-list { display: grid; gap: 0.7rem; max-width: 820px; }
details.faq {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.2rem 1.1rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
details.faq[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
details.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  font-weight: 650;
  font-size: 0.97rem;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1;
  transition: transform 0.2s ease;
  flex: none;
}
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq .faq-body {
  padding-bottom: 1rem;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.65;
  max-width: 68ch;
}
details.faq .faq-body p + p { margin-top: 0.6rem; }

/* CTA band ------------------------------------------------------------- */

.cta-band {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.6rem);
  background:
    radial-gradient(120% 160% at 12% 10%, oklch(46% 0.16 275), transparent 60%),
    linear-gradient(135deg, oklch(38% 0.12 268), oklch(30% 0.08 235));
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.cta-band::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, oklch(74% 0.14 170 / 0.55), transparent 68%);
}
.cta-band h2 {
  font-size: var(--step-3);
  letter-spacing: -0.03em;
  max-width: 22ch;
}
.cta-band p {
  margin-top: 0.8rem;
  color: oklch(92% 0.02 265);
  max-width: 48ch;
  font-size: 1rem;
}
.cta-band .btn { margin-top: 1.6rem; }
.cta-band .btn-accent { background: oklch(96% 0.02 160); color: oklch(28% 0.06 200); }
.cta-band .btn-accent:hover { background: #fff; }
.cta-band .fine {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: oklch(84% 0.02 265);
}

/* ----------------------------------------------------------- Article --- */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  padding-top: 1.5rem;
}
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); text-decoration: underline; }
.breadcrumbs .sep { opacity: 0.55; }

.article-hero { padding-block: 1.5rem 2rem; border-bottom: 1px solid var(--line); }
.article-hero h1 {
  font-size: var(--step-4);
  letter-spacing: -0.035em;
  margin-top: 1rem;
  max-width: 22ch;
}
.article-hero .dek {
  margin-top: 1rem;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 62ch;
  font-weight: 450;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.article-meta .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(2rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem);
  align-items: start;
}
.toc {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  font-size: 0.86rem;
  border-left: 2px solid var(--line);
  padding-left: 1.1rem;
}
.toc h2 {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.7rem;
}
.toc ol { list-style: none; padding: 0; display: grid; gap: 0.45rem; counter-reset: toc; }
.toc a { color: var(--muted); text-decoration: none; line-height: 1.4; display: block; }
.toc a:hover { color: var(--brand); }
.toc .toc-cta {
  margin-top: 1.4rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.8rem;
  color: var(--ink-2);
  line-height: 1.5;
}
.toc .toc-cta .btn { display: inline-flex; text-decoration: none; margin-top: 0.65rem; width: 100%; }
.toc .toc-cta .btn-primary { color: var(--on-brand); }
.toc .toc-cta .btn-ghost { color: var(--ink); }
.toc .toc-cta .btn:hover { text-decoration: none; }

.prose {
  max-width: 70ch;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--ink-2);
}
.prose > * + * { margin-top: 1.15rem; }
.prose h2 {
  font-size: var(--step-2);
  color: var(--ink);
  margin-top: 2.6rem;
  letter-spacing: -0.025em;
  scroll-margin-top: calc(var(--header-h) + 1.2rem);
}
.prose h2 + * { margin-top: 0.85rem; }
.prose h3 {
  font-size: 1.16rem;
  color: var(--ink);
  margin-top: 1.9rem;
  letter-spacing: -0.015em;
}
.prose h3 + * { margin-top: 0.6rem; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { color: var(--brand); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3rem; display: grid; gap: 0.5rem; }
.prose li::marker { color: var(--brand); }
.prose ul li::marker { color: var(--brand); }
.prose blockquote {
  border-left: 3px solid var(--brand);
  padding: 0.2rem 0 0.2rem 1.15rem;
  font-size: 1.1rem;
  color: var(--ink);
  font-style: italic;
}
.prose figure { margin-top: 1.6rem; }
.prose figure img, .prose figure svg { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.prose figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.prose th, .prose td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { background: var(--surface-2); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.prose tbody tr:last-child td { border-bottom: none; }
.prose .num { font-variant-numeric: tabular-nums; }

.key-takeaways {
  margin-top: 2.2rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.key-takeaways h2 { margin: 0 0 0.6rem; font-size: 1rem; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.key-takeaways ul { margin: 0; padding-left: 1.15rem; display: grid; gap: 0.45rem; font-size: 0.93rem; }

.article-foot {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.2rem;
}
.pager a {
  display: block;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  background: var(--surface);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.pager a:hover { border-color: var(--brand); transform: translateY(-1px); }
.pager span { display: block; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; }
.pager strong { display: block; font-size: 0.9rem; margin-top: 0.2rem; line-height: 1.35; }

/* Curriculum page ------------------------------------------------------ */

.page-head {
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: var(--step-4); letter-spacing: -0.035em; max-width: 20ch; }
.page-head p { margin-top: 1rem; font-size: var(--step-1); color: var(--ink-2); max-width: 60ch; line-height: 1.55; }

.curriculum { display: grid; gap: 1.6rem; }
.module {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.module-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1.1rem 1.3rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.module-head .level-num { width: 34px; height: 34px; border-radius: 9px; font-size: 0.8rem; }
.module-title { margin-right: auto; }
.module-title h2 { font-size: 1.08rem; letter-spacing: -0.015em; }
.module-title p { font-size: 0.82rem; color: var(--muted); margin-top: 0.1rem; }
.lesson-rows { list-style: none; padding: 0; margin: 0; }
.lesson-rows li { border-bottom: 1px solid var(--line); }
.lesson-rows li:last-child { border-bottom: none; }
.lesson-rows a, .lesson-rows .row-static {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1.3rem;
  text-decoration: none;
  font-size: 0.92rem;
  transition: background-color 0.15s ease;
}
.lesson-rows a:hover { background: var(--surface-2); }
.lesson-rows .idx {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 2.2ch;
}
.lesson-rows .name { flex: 1; color: var(--ink); }
.lesson-rows .row-static .name { color: var(--muted); }
.lesson-rows .status {
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 750;
  padding: 0.16rem 0.45rem;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.lesson-rows .status--live { background: var(--accent-soft); color: var(--accent-strong); }
.lesson-rows .go { color: var(--muted); }
.lesson-rows a:hover .go { color: var(--brand); }

/* Legal / prose pages -------------------------------------------------- */

.legal-container { max-width: 760px; }
.legal-wrap { max-width: 760px; padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3rem, 6vw, 5rem); }
.legal-wrap h1 { font-size: var(--step-3); letter-spacing: -0.03em; }
.legal-wrap .updated { margin-top: 0.6rem; font-size: 0.84rem; color: var(--muted); }
.legal-wrap h2 { font-size: 1.18rem; margin-top: 2.2rem; }
.legal-wrap h3 { font-size: 1rem; margin-top: 1.5rem; }
.legal-wrap p, .legal-wrap li { color: var(--ink-2); font-size: 1rem; line-height: 1.7; }
.legal-wrap ul { padding-left: 1.25rem; display: grid; gap: 0.4rem; }
.legal-wrap > * + * { margin-top: 0.9rem; }

/* Footer --------------------------------------------------------------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  margin-top: clamp(3rem, 6vw, 5rem);
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: clamp(1.8rem, 4vw, 3rem);
  padding-block: clamp(2.5rem, 5vw, 4rem);
}
.footer-brand p {
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 34ch;
  margin-top: 0.9rem;
  line-height: 1.6;
}
.footer-col h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.9rem;
}
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 0.55rem; }
.footer-col a { color: var(--ink-2); text-decoration: none; font-size: 0.87rem; }
.footer-col a:hover { color: var(--brand); text-decoration: underline; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.footer-bottom a { text-decoration: none; }
.footer-bottom a:hover { color: var(--ink); text-decoration: underline; }

.risk-note {
  padding: 1rem 0 1.6rem;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 100ch;
}
.risk-note strong { color: var(--ink-2); }

/* Utilities ------------------------------------------------------------ */

.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-3 { margin-bottom: 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.divider { height: 1px; background: var(--line); border: 0; margin-block: 2rem; }

/* Responsive ----------------------------------------------------------- */

@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero .lead { max-width: 46ch; }
  .hero-visual { max-width: 560px; margin-top: 0.5rem; }
  .float-card--risk { left: -0.5rem; }
  .float-card--rr { right: -0.5rem; }
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  :root { --header-h: 64px; }
  .nav-toggle { display: grid; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.7rem var(--gutter) 1rem;
    margin-inline: calc(var(--gutter) * -1);
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.75rem 0.9rem; font-size: 1rem; border-radius: 10px; }
  .nav .nav-cta { display: inline-flex; justify-content: center; margin-top: 0.45rem; padding: 0.8rem 1rem; color: var(--on-brand); }
  .nav .nav-cta:hover { background: var(--brand-hover); color: var(--on-brand); }
  .header-inner { position: relative; }
  .header-actions .btn { display: none; }
  .header-actions { margin-left: auto; }
  .level-list { grid-template-columns: minmax(0, 1fr); }
  .calc { grid-template-columns: minmax(0, 1fr); }
  .section-head { flex-direction: column; align-items: start; gap: 1rem; }
}

@media (max-width: 620px) {
  .grid-3, .grid-2, .lesson-grid { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: clamp(2.2rem, 10vw, 3rem); }
  .hero-actions .btn { width: 100%; }
  .float-card--risk { left: 0.4rem; bottom: -1rem; }
  .float-card--rr { right: 0.4rem; top: -2.6rem; }
  .chart-card { transform: none; }
  .hero-visual { margin-top: 1.2rem; margin-bottom: 1rem; }
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat { padding: 1rem 0.9rem; }
  .calc-grid { grid-template-columns: minmax(0, 1fr); }
  .calc-out { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .article-hero h1 { font-size: clamp(1.9rem, 8vw, 2.5rem); }
  table.compare { min-width: 680px; }
  .cta-band { padding: 1.6rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: 0.06s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.12s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.18s; }
  .hero-copy > :nth-child(5) { animation-delay: 0.24s; }
  .hero-visual { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
