/* Layout concept: an academy seal on a ruled exam-paper ground — navy bands,
   gold rules, generous editorial headings, cards only where content is a "thing". */
:root {
  --navy: #002c69;
  --navy-deep: #001a40;
  --gold: #c9a443;
  --gold-ink: #8a681e;
  --gold-soft: #f4ead0;
  --bg: #f6f7fa;
  --surface: #ffffff;
  --ink: #0e1a33;
  --muted: #56627a;
  --line: #dbe1ec;
  --rule: rgba(0, 44, 105, 0.06);
  --link: #002c69;
  --on-navy: #f2f5fb;
  --on-navy-muted: #b9c6dc;

  --f-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r: 14px;
  --wrap: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1326; --surface: #101d38; --ink: #edf1f8; --muted: #a2afc6;
    --line: #22335a; --rule: rgba(201, 164, 67, 0.06); --link: #e2c46f;
    --gold-soft: #2a2414; --gold-ink: #e2c46f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1326; --surface: #101d38; --ink: #edf1f8; --muted: #a2afc6;
  --line: #22335a; --rule: rgba(201, 164, 67, 0.06); --link: #e2c46f;
  --gold-soft: #2a2414; --gold-ink: #e2c46f; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--link); }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.12; margin: 0; text-wrap: balance; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.3rem; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wrap {
  max-width: var(--wrap); margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.section { padding-block: clamp(64px, 9vw, 112px); }
.eyebrow {
  font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-ink); display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--gold); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 58ch; }
.section-head { display: grid; gap: 14px; margin-bottom: 44px; max-width: 760px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  font: 600 1rem/1 var(--f-body); padding: 16px 26px; border-radius: 999px;
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: var(--gold); color: #1d1503; }
.btn-gold:hover { background: #d8b452; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-outline { border-color: currentColor; color: var(--ink); background: transparent; }
.btn-light { border-color: var(--on-navy); color: var(--on-navy); background: transparent; }
.btn-disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn-disabled:hover { transform: none; }

/* Header */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--navy-deep); }
.topbar { background: var(--navy-deep); color: var(--on-navy-muted); font-size: .85rem; }
.topbar .wrap { display: flex; gap: 20px; justify-content: space-between; align-items: center; padding-block: 8px; flex-wrap: wrap; }
.topbar a { color: var(--on-navy); text-decoration: none; }
.topbar .tb-links { display: flex; gap: 18px; flex-wrap: wrap; }
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 48px; height: 48px; }
.brand strong { font-family: var(--f-display); font-size: 1.2rem; display: block; line-height: 1.1; }
.brand small { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a { text-decoration: none; color: var(--ink); font-weight: 500; padding: 10px 14px; border-radius: 999px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--gold-soft); }
.site-nav .btn { padding: 12px 20px; margin-left: 8px; }
.site-nav .btn:hover { background: #d8b452; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink); font: 600 .9rem var(--f-body); }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px max(20px, env(safe-area-inset-left, 0px)) 20px; }
  .site-nav.open { display: flex; }
  .site-nav .btn { margin: 8px 0 0; }
  .topbar .tb-tag { display: none; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background-image: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 9px);
}
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; padding-block: clamp(48px, 7vw, 96px); }
.hero-copy { display: grid; gap: 24px; min-width: 0; }
.hero h1 em { font-style: italic; color: var(--gold-ink); }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 28px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.hero-meta div { display: grid; }
.hero-meta b { font-family: var(--f-display); font-size: 1.9rem; color: var(--ink); }
.hero-meta span { font-size: .85rem; color: var(--muted); }
.coin-stage { position: relative; display: grid; place-items: center; min-width: 0; }
#coin { width: min(100%, 520px); aspect-ratio: 1; image-rendering: pixelated; cursor: grab; }
.coin-caption { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .coin-stage { order: -1; }
  #coin { width: min(78vw, 360px); }
}

/* Exam marquee */
.marquee { background: var(--navy); color: var(--on-navy); overflow: hidden; border-block: 3px solid var(--gold); }
.marquee-track { display: flex; gap: 40px; width: max-content; padding-block: 16px; animation: slide 48s linear infinite; font-family: var(--f-mono); font-size: .88rem; letter-spacing: .06em; }
.marquee-track span::after { content: "◆"; color: var(--gold); margin-left: 40px; }
@keyframes slide { to { transform: translateX(-50%); } }

/* Exam grid */
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.exam-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; display: grid; gap: 8px; align-content: start; transition: border-color .2s, transform .2s;
}
.exam-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.exam-group { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }
.exam-card h3 { font-size: 1.2rem; }
.exam-tag { color: var(--muted); font-size: .93rem; }
.exam-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { font-size: .78rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); text-decoration: none; }
.chip-live { background: var(--gold); color: #1d1503; }
.chip-muted { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* Split feature (NTC style alternating) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split > * { min-width: 0; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Teacher */
.teacher { background: var(--surface); border-block: 1px solid var(--line); }
.teacher-photo { position: relative; max-width: 440px; justify-self: center; }
.teacher-photo img { border-radius: 220px 220px var(--r) var(--r); background: #000; aspect-ratio: 600/1021; object-fit: cover; object-position: top; max-height: 620px; width: 100%; }
.teacher-photo::after { content: ""; position: absolute; inset: 18px -18px -18px 18px; border: 2px solid var(--gold); border-radius: 220px 220px var(--r) var(--r); z-index: -1; }
.teacher-photo { isolation: isolate; }
.teacher-copy { display: grid; gap: 22px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.facts div { padding: 18px; display: grid; gap: 2px; }
.facts div + div { border-left: 1px solid var(--line); }
.facts b { font-family: var(--f-display); font-size: 1.9rem; color: var(--gold-ink); }
.facts span { font-size: .85rem; color: var(--muted); }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; } .facts div + div { border-left: 0; border-top: 1px solid var(--line); } }
.signature { font-family: var(--f-display); font-style: italic; font-size: 1.5rem; }

/* Navy band */
.band { background: var(--navy); color: var(--on-navy); position: relative; overflow: hidden; }
.band h2 { color: #fff; }
.band .lede { color: var(--on-navy-muted); }
.band .eyebrow { color: var(--gold); }
.yt-card { background: var(--navy-deep); border: 1px solid rgba(201,164,67,.35); border-radius: var(--r); padding: 28px; display: grid; gap: 16px; }
.yt-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--on-navy-muted); }
.yt-card li { display: flex; gap: 12px; }
.yt-card li::before { content: "▸"; color: var(--gold); }
.yt-play { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #e62117; color: #fff; font-size: 1.4rem; }

/* Two feature cards */
.feature-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 760px) { .feature-pair { grid-template-columns: 1fr; } }
.feature { border-radius: var(--r); padding: clamp(26px, 4vw, 40px); display: grid; gap: 16px; align-content: start; border: 1px solid var(--line); background: var(--surface); }
.feature.gold { background: var(--gold-soft); border-color: transparent; }
.feature .btn { justify-self: start; }
.formula { font-family: var(--f-mono); font-size: .92rem; background: var(--bg); border: 1px dashed var(--line); padding: 12px 14px; border-radius: 10px; color: var(--ink); overflow-x: auto; }
.feature.gold .formula { background: var(--surface); }

/* Contact & footer */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.contact-item { border-top: 2px solid var(--gold); padding-top: 16px; display: grid; gap: 6px; }
.contact-item span { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact-item a, .contact-item b { font-size: 1.1rem; font-weight: 600; color: var(--ink); text-decoration: none; word-break: break-word; }
.contact-item a:hover { color: var(--gold-ink); }
.site-footer { background: var(--navy-deep); color: var(--on-navy-muted); font-size: .92rem; }
.site-footer .wrap { padding-block: 48px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 12px; }
.site-footer a { color: var(--on-navy); text-decoration: none; display: block; padding: 3px 0; }
.site-footer a:hover { color: var(--gold); }
.site-footer .brand { color: #fff; }
.site-footer .brand small { color: var(--on-navy-muted); }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.1); }
.foot-bottom .wrap { padding-block: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; grid-template-columns: none; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* Page header (inner pages) */
.page-head { background: var(--navy); color: var(--on-navy); background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 9px); }
.page-head .wrap { padding-block: clamp(48px, 7vw, 88px); display: grid; gap: 16px; }
.page-head h1 { color: #fff; font-size: clamp(2.2rem, 4.6vw, 3.6rem); }
.page-head .lede { color: var(--on-navy-muted); }
.page-head .eyebrow { color: var(--gold); }

/* Quiz page */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filter { font: 600 .9rem var(--f-body); padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.filter.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.quiz-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.quiz-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.quiz-info { min-width: 0; }
.quiz-info p { color: var(--muted); font-size: .93rem; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 56px; }
.how div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: grid; gap: 8px; }
.how b { font-family: var(--f-mono); color: var(--gold-ink); font-size: .8rem; letter-spacing: .1em; }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; } }

/* Resources */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.res-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.res-thumb { aspect-ratio: 16/10; background: var(--gold-soft); display: grid; place-items: center; overflow: hidden; }
.res-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.res-thumb.empty { font-family: var(--f-mono); color: var(--gold-ink); font-size: 2rem; }
.res-body { padding: 22px; display: grid; gap: 10px; align-content: start; }
.res-body .btn { justify-self: start; margin-top: 6px; padding: 12px 20px; }
.badge { justify-self: start; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; background: var(--gold-soft); color: var(--gold-ink); }
.badge.free { background: #1f7a4c; color: #fff; }

/* Landing page */
.landing-hero .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; padding-block: clamp(40px, 6vw, 80px); }
.landing-hero .wrap > * { min-width: 0; }
@media (max-width: 900px) { .landing-hero .wrap { grid-template-columns: 1fr; } }
.stack { position: relative; height: clamp(320px, 42vw, 480px); }
.stack img { position: absolute; width: 58%; border-radius: 8px; box-shadow: 0 18px 40px rgba(0,26,64,.25); border: 1px solid var(--line); }
.stack img:nth-child(1) { left: 0; top: 8%; transform: rotate(-6deg); }
.stack img:nth-child(2) { left: 21%; top: 2%; transform: rotate(1deg); z-index: 2; }
.stack img:nth-child(3) { right: 0; top: 10%; transform: rotate(7deg); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 12px; align-items: baseline; }
.checklist li::before { content: "✓"; color: var(--gold-ink); font-weight: 700; }
.topics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.topics div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: grid; gap: 10px; align-content: start; }
.topics b { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }
.topics p { color: var(--muted); font-size: .93rem; }
@media (max-width: 960px) { .topics { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .topics { grid-template-columns: 1fr; } }

.gate-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: var(--r); padding: clamp(24px, 4vw, 40px); display: grid; gap: 18px; box-shadow: 0 24px 60px rgba(0,26,64,.08); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; }
.field input, .field select {
  font: 400 1rem var(--f-body); padding: 13px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--muted); }
.consent input { margin-top: 4px; accent-color: var(--navy); }
.form-error { color: #c0392b; font-weight: 600; min-height: 1.4em; font-size: .92rem; }
.fine { font-size: .82rem; color: var(--muted); }

.preview-pages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.preview-pages img { border-radius: 8px; border: 1px solid var(--line); background: #fff; }
@media (max-width: 760px) { .preview-pages { grid-template-columns: 1fr 1fr; } }
.locked .preview-pages img { filter: blur(5px) saturate(.6); }
.lock-wrap { position: relative; }
.lock-note { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.lock-note span { background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.ready-card { background: var(--gold-soft); border-radius: var(--r); padding: clamp(24px, 4vw, 44px); display: grid; gap: 18px; }
.ready-actions { display: flex; gap: 12px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
