/* FluentSTEM
   Navy #0F172A · Emerald #10B981 · Amber #F59E0B · Paper #F8FAFC
   Broken step #DC2626
   Type: Plus Jakarta Sans, STIX Two Text
*/

:root {
  --navy: #0f172a;
  --emerald: #10b981;
  --emerald-ink: #065f46;
  --amber: #f59e0b;
  --amber-ink: #92400e;
  --paper: #f8fafc;
  --white: #ffffff;
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --error: #dc2626;
  --error-ink: #991b1b;
  --cream: #fffef8;
  --shadow: 0 22px 50px rgba(15, 23, 42, 0.16);
  --header: 72px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  color-scheme: light;
}

img, svg { max-width: 100%; }

[id] { scroll-margin-top: calc(var(--header) + 12px); }

::selection { background: #a7f3d0; color: var(--navy); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 50;
  background: var(--amber);
  color: var(--navy);
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
}
h2 { font-size: clamp(1.8rem, 3vw, 2.55rem); margin-bottom: 12px; }
h3 { font-size: 1.25rem; margin-bottom: 8px; }

a { color: var(--emerald-ink); }
.lede {
  font-size: 1.125rem;
  color: var(--body);
  max-width: 64ch;
}
.fine { color: var(--muted); font-size: 0.92rem; }

.kicker {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--emerald-ink);
}

.math {
  font-family: "STIX Two Text", Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 500;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header);
  background: rgba(15, 23, 42, 0.94);
  color: white;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(248, 250, 252, 0.08);
}
.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header);
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
}
.mark { width: 32px; height: 32px; flex: none; }
.brand-name span,
.footer-brand span { color: #34d399; }

.nav-toggle {
  display: none;
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
}
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a[aria-current="page"] { color: white; box-shadow: inset 0 -2px 0 var(--emerald); }
.site-nav a.nav-cta {
  color: var(--navy);
  background: var(--emerald);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: none;
}
.site-nav a.nav-cta[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--amber); }

.hero, .page-hero {
  background-color: var(--navy);
  background-image:
    linear-gradient(rgba(248, 250, 252, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(248, 250, 252, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  color: white;
}
.hero { padding: 28px 0 76px; }
.page-hero { padding: 36px 0 52px; }
.hero h1, .page-hero h1 { margin: 0 0 16px; }
.hero h1 { font-size: clamp(2.3rem, 4.2vw, 3.55rem); max-width: 16ch; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3.15rem); max-width: 18ch; }
.hero .kicker, .page-hero .kicker, .band-navy .kicker { color: #6ee7b7; }
.hero .lede, .page-hero .lede, .band-navy .lede { color: #e2e8f0; }
.hero-grid, .split, .demo-layout, .form-layout, .brand-grid, .pillar-grid {
  display: grid;
  gap: 32px;
}
.hero-actions, .cluster { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-actions { margin-top: 22px; }
.hero .fine { color: #94a3b8; margin-top: 16px; max-width: 52ch; }
.hero .fine a, .band-navy a { color: #6ee7b7; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  color: var(--navy);
  background: var(--emerald);
}
.btn:hover { background: #34d399; }
.btn-ghost {
  background: transparent;
  color: white;
  border-color: rgba(248, 250, 252, 0.4);
}
.btn-ghost:hover { background: rgba(248, 250, 252, 0.08); }
.btn-line {
  background: white;
  color: var(--navy);
  border-color: var(--line);
}
.btn-line:hover { background: #f1f5f9; }
.btn-navy { background: var(--navy); color: white; }
.btn-navy:hover { background: #1e293b; }

.section { padding: 80px 0; }
.band-white { background: white; }
.band-navy { background: var(--navy); color: white; }

.section-head { max-width: 68ch; margin-bottom: 28px; }

.subject-grid, .exam-grid, .card-grid, .swatch-grid {
  display: grid;
  gap: 14px;
}
.subject, .card, .exam, .swatch, .panel, .readout, .done {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.subject, .card, .exam, .panel { padding: 18px; }
.subject {
  min-height: 148px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subject.is-open { border-color: var(--emerald); box-shadow: inset 0 0 0 1px var(--emerald); }
.subject.is-soon { color: var(--muted); background: #f8fafc; }
.subject strong, .card strong { color: var(--ink); letter-spacing: -0.02em; }
.subject p, .card p, .exam p { margin: 0; color: var(--body); }
.subject.is-soon p { color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill-open { background: #d1fae5; color: var(--emerald-ink); }
.pill-soon { background: #e2e8f0; color: #475569; }
.pill-human { background: #fef3c7; color: var(--amber-ink); text-transform: none; letter-spacing: 0; font-size: 0.75rem; }
.pill-bad { background: #fee2e2; color: var(--error-ink); }
.pill-ok { background: #d1fae5; color: var(--emerald-ink); }

.promise-list { border-bottom: 1px solid var(--line); }
.promise {
  display: grid;
  gap: 10px 28px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.promise-index {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0;
}
.promise-index span {
  color: var(--emerald-ink);
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}
.promise p { margin: 0 0 8px; color: var(--body); }
.promise a { font-weight: 700; }

.notebook {
  display: flex;
  background: var(--cream);
  color: var(--ink);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero .notebook { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); }
.notebook-spine {
  width: 22px;
  flex: none;
  background-color: var(--navy);
  background-image: radial-gradient(circle, #f8fafc 3px, transparent 3.6px);
  background-size: 22px 36px;
  background-position: center 14px;
  background-repeat: repeat-y;
}
.notebook-sheet { flex: 1; min-width: 0; border-left: 2px solid #fecaca; }
.notebook-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid #e7e5e4;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.prompt { margin: 0; padding: 16px 16px 4px; font-size: 1.05rem; }
.steps { list-style: none; margin: 0; padding: 8px 12px 16px; }
.step { margin: 8px 0; border-radius: 12px; padding: 8px 10px; }
.step-hit {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}
.step-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-index {
  width: 1.6rem;
  flex: none;
  font-weight: 700;
  color: var(--muted);
  font-style: normal;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.85rem;
}
.step .math { font-size: clamp(1.05rem, 2.4vw, 1.28rem); }
.step-badge { margin-left: auto; display: none; }
.step-note, .step-hint, .step-human { display: none; margin: 8px 0 0 2.2rem; color: var(--body); font-size: 0.92rem; }
.notebook.is-marked .step[data-state="ok"] {
  background: rgba(16, 185, 129, 0.14);
  box-shadow: inset 3px 0 var(--emerald);
}
.notebook.is-marked .step[data-state="bad"] {
  background: rgba(220, 38, 38, 0.09);
  box-shadow: inset 3px 0 var(--error);
}
.notebook.is-marked .step-badge,
.notebook.is-marked .step-note,
.notebook.is-marked .step-hint,
.notebook.is-marked .step-human { display: block; }
.notebook.is-marked .step-human {
  padding: 8px 10px;
  background: #fef3c7;
  color: var(--amber-ink);
  border-radius: 10px;
  font-weight: 600;
}
.step-human .pill {
  display: inline;
  padding: 0;
  background: transparent;
  color: inherit;
  letter-spacing: 0;
  text-transform: none;
  font-size: inherit;
}
.notebook.is-marked .step-badge { display: inline-flex; }
.caption { margin: 12px 2px 0; color: #cbd5e1; font-size: 0.95rem; }

.switch {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: #e2e8f0;
  border-radius: 999px;
  margin-bottom: 14px;
}
.switch button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  color: var(--body);
}
.switch button[aria-pressed="true"] { background: white; color: var(--navy); }

.demo-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.readout { padding: 18px 18px 8px; }
.readout p:last-child { margin-bottom: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.timeline p { margin: 0; }
.time { font-weight: 700; color: var(--emerald-ink); font-variant-numeric: tabular-nums; }

.mastery { display: grid; gap: 14px; }
.mastery-row { display: grid; gap: 6px; }
.mastery-top { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.track { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.fill { display: block; height: 100%; border-radius: inherit; }
.fill-ok { background: var(--emerald); }
.fill-practice { background: var(--amber); }
.fill-soon { background: #94a3b8; }
.sample-note { margin: 14px 0 0; }

.flow, .anima { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.flow li, .anima li {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.anima { counter-reset: anima; }
.anima li { display: grid; gap: 4px; }
.anima li::before {
  counter-increment: anima;
  content: counter(anima, decimal-leading-zero);
  font-weight: 700;
  color: var(--emerald-ink);
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}
.band-navy .flow li { background: #111c33; border-color: rgba(248, 250, 252, 0.12); color: #e2e8f0; }

.pillar { padding-top: 8px; }
.pillar + .pillar { margin-top: 48px; padding-top: 48px; border-top: 1px solid var(--line); }
.plain { padding-left: 18px; }
.plain li { margin: 6px 0; }

.form-card, .panel { background: white; }
.form-card { border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.form-grid { display: grid; gap: 14px; }
label, .choice { font-weight: 600; font-size: 0.95rem; }
label span, .choice small { font-weight: 500; color: var(--body); display: block; }
input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: white;
  color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
fieldset.choices { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.choice input { width: auto; margin-top: 4px; }
.choice:has(input:checked) { border-color: var(--emerald); background: #f0fdf4; }
.done { padding: 22px; border-color: #a7f3d0; background: #f0fdf4; }
.done h2 { font-size: 1.6rem; }

.swatch { padding: 16px; min-height: 148px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.swatch-chip { height: 64px; border-radius: 12px; }
.swatch button {
  justify-self: start;
  width: fit-content;
  background: transparent;
  border: 0;
  padding: 0;
  font-weight: 700;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px;
  border-radius: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.4rem;
}
.lockup.on-navy { background: var(--navy); color: white; }
.lockup.on-paper { background: white; border: 1px solid var(--line); }
.specimen { font-size: clamp(1.8rem, 3vw, 2.6rem); margin: 0 0 8px; }
.formula { font-size: 1.8rem; margin: 8px 0 0; }

.site-footer {
  background: var(--navy);
  color: #cbd5e1;
  padding: 48px 0 24px;
}
.footer-grid { display: grid; gap: 28px; }
.footer-brand { color: white; font-weight: 700; letter-spacing: -0.03em; font-size: 1.25rem; margin: 0 0 8px; }
.footer-label {
  margin: 0 0 8px;
  color: #6ee7b7;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-footer a { color: white; text-decoration: none; display: block; padding: 4px 0; }
.site-footer a:hover { color: #6ee7b7; }
.footer-base {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(248, 250, 252, 0.12);
  margin-top: 28px;
  padding-top: 16px;
  font-size: 0.92rem;
}
.footer-base p { margin: 0; }

@media (min-width: 800px) {
  .promise { grid-template-columns: 140px 1fr 1fr; align-items: start; }
  .subject-grid, .exam-grid, .swatch-grid { grid-template-columns: repeat(4, 1fr); }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 0.8fr 0.8fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: span 2; }
  fieldset.choices { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: repeat(3, 1fr); }
  .anima { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr); align-items: center; }
  .split, .demo-layout, .form-layout, .pillar-grid { grid-template-columns: 1.05fr 0.95fr; align-items: start; }
  .readout { position: sticky; top: calc(var(--header) + 16px); }
}
@media (max-width: 799px) {
  .subject-grid, .exam-grid, .swatch-grid, .card-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(280px, 80vw);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    background: var(--navy);
    border: 1px solid rgba(248, 250, 252, 0.12);
    border-radius: 16px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 10px 8px; }
  .site-nav a.nav-cta { text-align: center; }
}
@media (max-width: 520px) {
  .subject-grid { grid-template-columns: 1fr; }
  .hero h1, .page-hero h1 { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
