/* ==========================================================================
   ScrollSci — marketing site
   Single stylesheet, no framework, no external requests (fonts included).
   Dark-only by design: the product itself is a full-bleed dark feed, and a
   committed single look beats a half-maintained second theme.
   ========================================================================== */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  /* Surfaces — carried over from the app's own style.css so the landing page
     and the feed read as one product. */
  --bg:            #0a0b0f;
  --bg-raised:     #0f1116;
  --surface:       #14161d;
  --surface-hi:    #191c24;

  --line:          rgba(255, 255, 255, 0.075);
  --line-hi:       rgba(255, 255, 255, 0.14);

  /* Text — all four pass WCAG AA on --bg (17:1 / 9.9:1 / 6:1 / 10.9:1) */
  --text:          #f0f0f5;
  --text-2:        #b6bac7;
  --text-3:        #8b90a0;
  --accent:        #6ccff6;
  --accent-dim:    #3ba9d6;
  --accent-ink:    #06131a;
  /* Deeper sibling of --accent (same hue, dropped lightness) for the compact
     header CTA. 6.07:1 against white. */
  --accent-deep:   #196a8f;
  --accent-deep-hi:#1f82ae;

  /* Per-field colour, taken from the category-cube art direction. One hue per
     field, reused everywhere that field appears — badge, icon tile, demo card
     art — so colour becomes a way to recognise a field rather than decoration.
     Each is a light tint used on dark, so all twelve clear AA as text on --bg.
     Hues are spread deliberately around the wheel — with twelve fields,
     picking colours ad hoc stops being tellable apart. */
  --f-art:        #fb923c;   /*  27deg  orange   */
  --f-cs:         #fbbf24;   /*  43deg  amber    */
  --f-biology:    #a3e635;   /*  82deg  lime     */
  --f-environment:#22c55e;   /* 142deg  green    */
  --f-biotech:    #2dd4bf;   /* 172deg  teal     */
  --f-physics:    #22d3ee;   /* 190deg  cyan     */
  --f-math:       #60a5fa;   /* 215deg  blue     */
  --f-aerospace:  #a78bfa;   /* 258deg  violet   */
  --f-philosophy: #e879f9;   /* 292deg  fuchsia  */
  --f-music:      #f472b6;   /* 330deg  pink     */
  --f-literature: #fb7185;   /* 350deg  rose     */
  --f-history:    #cbd5e1;   /*  neutral silver  */

  /* Atmosphere. Deliberately gradients rather than blurred layers: a
     filter: blur() on a full-viewport element costs a repaint on every scroll
     frame, while a wide radial gradient is soft for free. */
  --orb-cyan:   rgba(34, 211, 238, 0.10);
  --orb-indigo: rgba(79, 70, 229, 0.11);
  --dot:        rgba(255, 255, 255, 0.038);
  --dot-gap:    34px;

  /* Reusable glass recipe for raised surfaces. */
  --glass:      rgba(255, 255, 255, 0.032);
  --glass-line: rgba(255, 255, 255, 0.085);
  --glass-hi:   rgba(255, 255, 255, 0.055);

  /* Type */
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --step--1: 0.8125rem;
  --step-0:  1.0625rem;
  --step-1:  clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --step-2:  clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem);
  --step-3:  clamp(1.75rem, 1.4rem + 1.5vw, 2.6rem);
  --step-4:  clamp(2.4rem, 1.5rem + 4vw, 4.6rem);

  /* Space — 4px rhythm */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;   --sp-6: 2rem;     --sp-7: 3rem;     --sp-8: 4rem;
  --sp-9: 6rem;     --sp-10: 8rem;

  --radius:    14px;
  --radius-lg: 22px;
  --radius-sm: 9px;

  --wrap: 1120px;
  --measure: 68ch;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 220ms;

  --z-header: 100;
}

/* ── Reset & base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchored sections clear the sticky header instead of hiding under it. */
  scroll-padding-top: 5.5rem;
  /* The page ground lives here, not on body, so body::before (z-index:-1) can
     paint the atmosphere above it without being buried by body's own fill. */
  background-color: var(--bg);
}

body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.7;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Atmosphere: one fixed, non-interactive layer carrying a technical dot matrix
   and two soft colour fields. Fixed rather than scrolling, so the page appears
   to move through the light instead of dragging it along — which is what stops
   a long dark scroll reading as one flat sheet. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Deliberately unmasked and uniform.
     A mask here looks like the obvious way to keep the texture subtle, but it
     is what produced a visible horizontal seam: a wide, shallow radial has
     nearly flat iso-alpha contours through the middle of the viewport, and the
     height at which the dots drop below the eye's threshold reads as a drawn
     line. Because the layer is fixed, that line then sits at the same screen
     position on every page and never scrolls away.
     A uniform grid has no threshold contour anywhere, so there is no edge to
     see. Subtlety comes from --dot being low, not from fading it out.
     The two colour fields are centred well outside the viewport so only their
     long, flat tails fall across the page — a smooth tonal drift with no ring
     edge, rather than two visible blobs. */
  background-image:
    radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0),
    radial-gradient(130ch 100ch at 108% -22%, var(--orb-indigo), transparent 72%),
    radial-gradient(120ch 95ch at -12% 88%, var(--orb-cyan), transparent 72%);
  background-size: var(--dot-gap) var(--dot-gap), cover, cover;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.022em;
  font-weight: 600;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); letter-spacing: -0.035em; font-weight: 620; }
h2 { font-size: var(--step-3); letter-spacing: -0.03em; }
h3 { font-size: var(--step-1); letter-spacing: -0.015em; }

p { margin: 0 0 var(--sp-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-color: rgba(108, 207, 246, 0.35); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

strong { font-weight: 600; color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: rgba(108, 207, 246, 0.28); color: #fff; }

/* ── Layout primitives ──────────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.section { position: relative; padding-block: var(--sp-9); }
.section + .section { padding-top: 0; }
.section--tight { padding-block: var(--sp-8); }

.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

.prose { max-width: var(--measure); }
.prose p { color: var(--text-2); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
  flex: none;
}

.lede { font-size: var(--step-1); color: var(--text-2); line-height: 1.6; }

.section-head { margin-bottom: var(--sp-6); max-width: var(--measure); }
.section-head h2 { margin-bottom: var(--sp-4); }
.section-head p { color: var(--text-2); margin-bottom: 0; }

/* ── Skip link ──────────────────────────────────────────────────────────── */
.skip {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 999;
  background: var(--accent);
  color: var(--accent-ink);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip:focus { top: var(--sp-4); }

/* ── Header ─────────────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(10, 11, 15, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.header[data-stuck="true"] {
  border-bottom-color: var(--line);
  background: rgba(10, 11, 15, 0.9);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 620;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  flex: none;
}
.brand svg { width: 26px; height: 26px; flex: none; }
.brand:hover { color: var(--text); }

.nav { display: flex; align-items: center; gap: var(--sp-2); }
/* :not(.btn) matters — a bare `.nav a` outranks `.btn--primary` on specificity
   and would repaint the CTA in muted link colour on its own accent background. */
.nav a:not(.btn) {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav a:not(.btn):hover { color: var(--text); background: var(--line); }
.nav a:not(.btn)[aria-current="page"] { color: var(--text); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  /* min-height keeps every CTA above the 44px touch-target floor */
  min-height: 2.875rem;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 560;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn svg { width: 17px; height: 17px; flex: none; }

.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #8bdcff; color: var(--accent-ink); }
.btn--primary:active { transform: translateY(1px); }

/* The header CTA is the one button set at 14px. At that size a bright cyan
   fill glares around the small glyphs — technically 11:1, but it reads sloppy.
   A deeper blue with white text carries better small, and leaves the bright
   accent to the hero so there is one loud CTA per screen instead of two. */
.header .btn--primary { background: var(--accent-deep); color: #fff; }
.header .btn--primary:hover { background: var(--accent-deep-hi); color: #fff; }

.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-hi); }
.btn--ghost:hover { background: var(--surface); border-color: rgba(255, 255, 255, 0.22); color: var(--text); }
.btn--ghost:active { transform: translateY(1px); }

/* 2.75rem = 44px, the touch-target floor. The header CTA is the smallest
   button on the site and still has to clear it. */
.btn--sm { min-height: 2.75rem; padding: 0.45rem 1.1rem; font-size: 0.875rem; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

.btn-note {
  font-size: var(--step--1);
  color: var(--text-3);
  margin: var(--sp-4) 0 0;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
/* overflow-x: clip, not hidden. The ambient glow behind the phone is 128% of
   its box and is meant to bleed past the device — but below ~1200px that
   reaches past the viewport edge and grows the document's scroll
   width. `hidden` would fix the width but makes this a scroll container, which
   breaks position:sticky for anything inside; `clip` trims the paint without
   that side effect, and still allows the glow to bleed vertically. */
.hero { padding-block: var(--sp-8) var(--sp-9); overflow-x: clip; }

.hero__grid {
  display: grid;
  gap: var(--sp-8);
  align-items: center;
}

.hero h1 { margin-bottom: var(--sp-5); }
.hero .lede { margin-bottom: var(--sp-6); max-width: 46ch; }

.hero__marks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}
.hero__marks li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--step--1);
  color: var(--text-3);
}
.hero__marks svg { width: 15px; height: 15px; color: var(--accent); flex: none; }

@media (min-width: 62rem) {
  .hero__grid { grid-template-columns: 1fr auto; gap: var(--sp-9); }
}

/* ── Demo phone ─────────────────────────────────────────────────────────── */
.demo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  /* Perspective on the container, not the phone, so the tilt reads as the
     object sitting in space rather than the face being skewed. */
  perspective: 1600px;
}

/* Ambient backlight. Sits behind the device and bleeds past its edges, which
   is what separates it from the page instead of letting it sit flat on black. */
.demo::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 46%;
  left: 50%;
  width: 128%;
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(34, 211, 238, 0.20), transparent 72%),
    radial-gradient(closest-side at 62% 38%, rgba(139, 92, 246, 0.20), transparent 70%);
}

.demo__phone {
  position: relative;
  width: min(320px, 100%);
  height: clamp(440px, 58vh, 600px);
  background: linear-gradient(160deg, #23262f 0%, #101219 38%, #0b0d12 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 34px;
  padding: 8px;
  box-shadow:
    /* contact shadow */
    0 48px 90px -32px rgba(0, 0, 0, 0.95),
    /* coloured bounce, so the device sits in the same light as the glow */
    0 24px 70px -40px rgba(34, 211, 238, 0.55),
    /* bezel highlight, top-left key */
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.045);
  transform: rotateY(-11deg) rotateX(4deg) rotateZ(-1.2deg);
  transition: transform 700ms var(--ease), box-shadow 700ms var(--ease);
}

/* Straighten when the reader actually engages with it — the tilt is for the
   first impression, not for fighting you while you read or scroll the cards. */
.demo:hover .demo__phone,
.demo:focus-within .demo__phone {
  transform: rotateY(0deg) rotateX(0deg) rotateZ(0deg);
}

/* Glass sheen across the screen face. */
.demo__phone::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 26px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(148deg,
              rgba(255, 255, 255, 0.10) 0%,
              rgba(255, 255, 255, 0.03) 18%,
              transparent 42%);
}

@media (prefers-reduced-motion: reduce) {
  .demo__phone { transform: none; }
}

.demo__feed {
  height: 100%;
  width: 100%;
  overflow-y: scroll;
  border-radius: 23px;
  /* Native CSS snap — the demo scrolls correctly with JS disabled. */
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: contain;
  background: var(--bg);
}
.demo__feed::-webkit-scrollbar { display: none; }

.demo__card {
  position: relative;
  height: 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
  overflow: hidden;
  isolation: isolate;
}

/* Field art: pure CSS, zero network cost. The real app renders a generated
   illustration here. */
.demo__card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--art);
}
/* Scrim guarantees text contrast over any art, exactly like the app's
   .card-image-fade. */
.demo__card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom,
              rgba(10, 11, 15, 0.25) 0%,
              rgba(10, 11, 15, 0.62) 42%,
              rgba(10, 11, 15, 0.94) 74%,
              var(--bg) 100%);
}

.demo__card[data-field="physics"] {
  --art: radial-gradient(80% 55% at 22% 18%, #4c3f9e 0%, transparent 62%),
         radial-gradient(70% 50% at 82% 30%, #7b4bc4 0%, transparent 60%),
         linear-gradient(165deg, #1a1740 0%, #0a0b0f 72%);
}
.demo__card[data-field="aerospace"] {
  --art: radial-gradient(75% 50% at 78% 16%, #f0a94a 0%, transparent 58%),
         radial-gradient(85% 60% at 18% 34%, #1f5f96 0%, transparent 62%),
         linear-gradient(170deg, #10233d 0%, #0a0b0f 74%);
}
.demo__card[data-field="biotech"] {
  --art: radial-gradient(72% 50% at 26% 20%, #1f8f7a 0%, transparent 60%),
         radial-gradient(76% 54% at 84% 36%, #2f7fb8 0%, transparent 58%),
         linear-gradient(168deg, #0d2b2c 0%, #0a0b0f 74%);
}
.demo__card[data-field="mathematics"] {
  --art: radial-gradient(70% 48% at 24% 18%, #b06a2a 0%, transparent 58%),
         radial-gradient(78% 55% at 80% 34%, #8c4a6b 0%, transparent 60%),
         linear-gradient(168deg, #2c1d20 0%, #0a0b0f 74%);
}

.demo__tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  margin-bottom: var(--sp-3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.demo__card h3 {
  font-size: 1.2rem;
  line-height: 1.24;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-3);
  color: #fff;
}

.demo__body {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: rgba(240, 240, 245, 0.86);
  margin-bottom: var(--sp-3);
}

.demo__why {
  font-size: 0.75rem;
  line-height: 1.5;
  color: rgba(240, 240, 245, 0.92);
  background: rgba(108, 207, 246, 0.09);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.5rem 0.7rem;
  margin-bottom: var(--sp-3);
}
.demo__why b {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.15rem;
  font-weight: 500;
}

.demo__src {
  font-size: 0.6875rem;
  color: rgba(240, 240, 245, 0.58);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.demo__src svg { width: 12px; height: 12px; flex: none; }

.demo__dots { display: flex; gap: 0.4rem; }
.demo__dots span {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--line-hi);
  transition: background var(--dur) var(--ease), width var(--dur) var(--ease);
}
.demo__dots span[data-on="true"] { background: var(--accent); width: 18px; }

.demo__caption {
  font-size: var(--step--1);
  color: var(--text-3);
  text-align: center;
  margin: 0;
  max-width: 30ch;
}

/* ── Cards / grids ──────────────────────────────────────────────────────── */
.grid { display: grid; gap: var(--sp-4); }
@media (min-width: 45rem)   { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 45rem)   { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 45rem)   { .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 68rem)   { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  position: relative;
  isolation: isolate;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  padding: var(--sp-5);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  /* Top-edge highlight: the single cheapest cue that a surface is glass lit
     from above rather than a flat grey box. */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
              transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

/* Hover glow. Painted on a pseudo-element rather than the border so the colour
   can bleed outward as light instead of drawing a hard ring. */
.card::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(60% 60% at 50% 0%,
              color-mix(in srgb, var(--tint, var(--accent)) 22%, transparent), transparent 72%);
  transition: opacity var(--dur) var(--ease);
}

.card:hover {
  background: var(--glass-hi);
  border-color: color-mix(in srgb, var(--tint, var(--accent)) 34%, transparent);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09),
              0 18px 40px -26px rgba(0, 0, 0, 0.9);
}
.card:hover::after { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
}
.card h3 { margin-bottom: var(--sp-3); }
.card p { color: var(--text-2); font-size: 0.9375rem; margin-bottom: 0; }

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: rgba(108, 207, 246, 0.1);
  border: 1px solid rgba(108, 207, 246, 0.18);
  color: var(--accent);
  margin-bottom: var(--sp-4);
}
.card__icon svg { width: 18px; height: 18px; }

.card__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: block;
  margin-bottom: var(--sp-3);
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  min-width: 34rem;
}
caption {
  caption-side: bottom;
  text-align: left;
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--step--1);
  color: var(--text-3);
  border-top: 1px solid var(--line);
}
th, td {
  text-align: left;
  padding: 0.85rem var(--sp-5);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
thead th {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}
tbody th { font-weight: 560; color: var(--text); white-space: nowrap; }
td { color: var(--text-2); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td, tbody tr:hover th { background: rgba(255, 255, 255, 0.018); }

/* ── Steps ──────────────────────────────────────────────────────────────── */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-5); }
.steps > li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: var(--sp-4);
  align-items: start;
}
.steps__n {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid rgba(108, 207, 246, 0.28);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.steps h3 { margin-bottom: var(--sp-2); }
.steps p { color: var(--text-2); font-size: 0.9375rem; margin-bottom: 0; }

/* ── Q&A ────────────────────────────────────────────────────────────────── */
.qa { display: grid; gap: 0; border-top: 1px solid var(--line); }
.qa > div { border-bottom: 1px solid var(--line); padding: var(--sp-5) 0; }
.qa h3 { margin-bottom: var(--sp-3); }
.qa p { color: var(--text-2); margin-bottom: var(--sp-3); }
.qa p:last-child { margin-bottom: 0; }

/* ── Callout ────────────────────────────────────────────────────────────── */
.callout {
  border: 1px solid var(--line-hi);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  padding: var(--sp-5);
}
.callout p { color: var(--text-2); margin-bottom: var(--sp-3); font-size: 0.9375rem; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--text); }

/* ── Final CTA ──────────────────────────────────────────────────────────── */
.cta {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(70ch 30ch at 50% 0%, rgba(108, 207, 246, 0.09), transparent 70%),
    var(--surface);
  padding: var(--sp-8) var(--sp-5);
  text-align: center;
}
.cta h2 { margin-bottom: var(--sp-4); }
.cta p { color: var(--text-2); max-width: 46ch; margin-inline: auto; margin-bottom: var(--sp-6); }
.cta .btn-row { justify-content: center; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  margin-top: var(--sp-9);
  padding-block: var(--sp-7) var(--sp-6);
  font-size: 0.9375rem;
}
.footer__grid {
  display: grid;
  gap: var(--sp-6);
  margin-bottom: var(--sp-7);
}
@media (min-width: 45rem) {
  .footer__grid { grid-template-columns: 1.6fr repeat(2, 1fr); gap: var(--sp-7); }
}
.footer h2 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: var(--sp-4);
}
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-3); }
.footer a { color: var(--text-2); text-decoration: none; }
.footer a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.footer__blurb { color: var(--text-3); max-width: 44ch; font-size: 0.9375rem; }
.footer__brand { margin-bottom: var(--sp-4); }

.footer__base {
  border-top: 1px solid var(--line);
  padding-top: var(--sp-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  justify-content: space-between;
  align-items: center;
  color: var(--text-3);
  font-size: var(--step--1);
}
.footer__base p { margin: 0; }

/* ── Reveal-on-scroll ───────────────────────────────────────────────────── */
/* The hidden start state is gated behind .js, which a one-line inline script
   in <head> sets before first paint. With JS blocked or broken the class is
   never added, so every section renders plainly visible — nothing this page
   says is ever hidden from a reader or a crawler by a failed animation. */
.js .js-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
  will-change: opacity, transform;
}
.js .js-reveal[data-shown="true"] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-reveal { opacity: 1 !important; transform: none !important; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Bento ──────────────────────────────────────────────────────────────── */
/* A 6-column bed on wide screens so tiles can be 1/3, 1/2 or 2/3 without
   inventing a new grid per section. Collapses to a single column early —
   asymmetric bento at phone width is just a stack with extra rules. */
.bento { display: grid; gap: var(--sp-4); }
@media (min-width: 48rem) {
  .bento { grid-template-columns: repeat(6, 1fr); }
  .bento > *          { grid-column: span 3; }
  .bento .span-2      { grid-column: span 2; }
  .bento .span-3      { grid-column: span 3; }
  .bento .span-4      { grid-column: span 4; }
  .bento .span-6      { grid-column: span 6; }
}

/* Cards that carry a heading + body and want the body pinned to the bottom. */
.card--tall { display: flex; flex-direction: column; }
.card--tall > :last-child { margin-top: auto; }

/* ── Field colour ───────────────────────────────────────────────────────── */
/* Set --tint once on an element and every tinted component inside it follows:
   badge fill, icon colour, card hover glow, tile luminance. */
[data-field="biology"]     { --tint: var(--f-biology); }
[data-field="environment"] { --tint: var(--f-environment); }
[data-field="music"]       { --tint: var(--f-music); }
[data-field="art"]         { --tint: var(--f-art); }
[data-field="philosophy"]  { --tint: var(--f-philosophy); }
[data-field="biotech"]     { --tint: var(--f-biotech); }
[data-field="aerospace"]   { --tint: var(--f-aerospace); }
[data-field="cs"]          { --tint: var(--f-cs); }
[data-field="mathematics"] { --tint: var(--f-math); }
[data-field="physics"]     { --tint: var(--f-physics); }
[data-field="history"]     { --tint: var(--f-history); }
[data-field="literature"]  { --tint: var(--f-literature); }

.f-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.26rem 0.62rem;
  border-radius: 999px;
  color: var(--tint, var(--accent));
  background: color-mix(in srgb, var(--tint, var(--accent)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint, var(--accent)) 30%, transparent);
}
/* The dot restates the field in colour alone — harmless for anyone who cannot
   distinguish it, since the label is right there. */
.f-badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 999px;
  background: currentColor;
  flex: none;
  box-shadow: 0 0 6px currentColor;
}

/* ── Category tiles ─────────────────────────────────────────────────────── */
.tiles {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(2, 1fr);
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (min-width: 40rem) { .tiles { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 56rem) { .tiles { grid-template-columns: repeat(6, 1fr); } }

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  text-align: center;
}

/* The glass block itself. Four stacked cues make it read as a lit solid rather
   than a coloured square: a raking surface gradient, a luminous core behind
   the icon, a bright top edge, and colour spilling onto the ground beneath. */
.tile__glass {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  display: grid;
  place-items: center;
  isolation: isolate;
  background: linear-gradient(158deg,
              color-mix(in srgb, var(--tint) 17%, transparent) 0%,
              color-mix(in srgb, var(--tint) 5%, transparent) 44%,
              rgba(255, 255, 255, 0.022) 100%);
  border: 1px solid color-mix(in srgb, var(--tint) 22%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -20px 34px -24px color-mix(in srgb, var(--tint) 55%, transparent),
    0 14px 30px -22px color-mix(in srgb, var(--tint) 28%, transparent);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* Luminous core */
.tile__glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(58% 52% at 50% 60%,
              color-mix(in srgb, var(--tint) 17%, transparent), transparent 72%);
}
/* Specular sheen */
.tile__glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(152deg, rgba(255, 255, 255, 0.15) 0%, transparent 38%);
}
/* Never a percentage height here: the tile's own height comes from
   aspect-ratio, so a % height makes the two resolve against each other and the
   "square" tile lands at 139x152. And the sprite's outer <svg> carries no
   viewBox (the <symbol> does), so it has no intrinsic ratio for height:auto to
   work from — aspect-ratio supplies the one it is missing. */
.tile__glass svg {
  width: 44%;
  height: auto;
  aspect-ratio: 1 / 1;
  color: var(--tint);
  filter: drop-shadow(0 0 9px color-mix(in srgb, var(--tint) 45%, transparent));
}

.tile:hover .tile__glass {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -20px 34px -24px color-mix(in srgb, var(--tint) 70%, transparent),
    0 20px 38px -22px color-mix(in srgb, var(--tint) 42%, transparent);
}

.tile__label { font-size: 0.875rem; font-weight: 560; color: var(--text); }
.tile__meta  { font-size: var(--step--1); color: var(--text-3); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .tile:hover .tile__glass { transform: none; }
}

/* ── Source chips (provenance table) ────────────────────────────────────── */
.src {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  color: var(--text);
  white-space: nowrap;
}
.src svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--text-3);
}

/* ── FAQ accordion ──────────────────────────────────────────────────────── */
/* <details> rather than JS: the answers stay in the raw HTML, which is what
   every AI crawler except Googlebot reads, and it still works with JS off. */
.qa {
  display: grid;
  gap: var(--sp-3);
  border-top: 0;
}
@media (min-width: 56rem) {
  .qa { grid-template-columns: repeat(2, 1fr); align-items: start; }
}

.qa__item {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  padding: 0 var(--sp-5);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.qa__item:hover { border-color: var(--line-hi); }
.qa__item[open] {
  background: var(--glass-hi);
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
}

.qa__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) 0;
  cursor: pointer;
  /* Both are needed — Safari uses the pseudo-element, everyone else list-style */
  list-style: none;
}
.qa__item summary::-webkit-details-marker { display: none; }
.qa__item summary:focus-visible { outline-offset: -2px; }

/* The question stays a real <h3> inside <summary>, which keeps the document
   outline intact for crawlers. <summary> accepts a single heading element, so
   the chevron has to be drawn rather than added as a sibling <svg>. */
.qa__item summary h3 {
  font-size: var(--step-1);
  font-weight: 560;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 0;
}

.qa__item summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 1px;
  color: var(--text-3);
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}
.qa__item[open] summary::after {
  transform: translateY(2px) rotate(225deg);
  color: var(--accent);
}

.qa__body { padding-bottom: var(--sp-5); }
.qa__body p { color: var(--text-2); font-size: 0.9375rem; margin-bottom: var(--sp-3); }
.qa__body p:last-child { margin-bottom: 0; }

/* ── Utilities ──────────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-3); }
.center { text-align: center; }

/* ── Small screens ──────────────────────────────────────────────────────── */
@media (max-width: 30rem) {
  .wrap { padding-inline: var(--sp-4); }
  .section { padding-block: var(--sp-8); }
  .nav a:not(.btn) { display: none; }
  th, td { padding: 0.75rem var(--sp-4); }
}
