/* Neil Robot: site styles.

   Look: a robot-kit product page. A navy hero and footer, white and light-grey sections between,
   and colors taken from Neil's own bricks: brick yellow for actions, azure for the LLM agent (MCP),
   magenta for the VLA. Headings in Barlow Condensed, text in Barlow. Left-aligned text on a
   12-column grid (max 1200px), and the parts lists use a building booklet's 1x / 2x quantities. */

/* ------------------------------------------------------------------- fonts */

@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url("../fonts/atkinson-mono-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

/* ------------------------------------------------------------------ tokens */

:root {
  --paper: #ffffff;          /* page */
  --sheet: #f0f3f7;          /* alternate sections */
  --card: #ffffff;           /* panels: parts lists, the form, link cards */
  --ink: #0f1d2e;            /* text: navy */
  --ink-2: #4a5869;          /* secondary text */
  --rule: #d4dce5;           /* lines and borders */
  --tint: #e5ebf1;           /* placeholders, code */
  --stud: #c7d1dc;           /* the stud grid behind missing media */
  --yellow: #ffc61a;         /* brick yellow: primary actions, the logo */
  --yellow-edge: #c99500;    /* the yellow button's lower edge */
  --on-yellow: #0f1d2e;
  --azure: #0095d6;          /* MCP, links on hover, focus */
  --azure-text: #00699a;
  --magenta: #c4217a;        /* VLA, the TBC marker */
  --magenta-text: #a3185f;
  --on-accent: #ffffff;
  --error: #b42318;
  --night: #0f1d2e;          /* the hero and the footer, in both themes */
  --night-2: #1b2c42;
  --on-night: #ffffff;
  --on-night-2: #b6c3d3;
  --night-rule: #2b3e57;
  --scrim: rgb(10 19 31 / 0.66);  /* controls over video, the same in both themes */
  --on-scrim: #ffffff;

  --font-display: "Barlow Condensed", "Arial Narrow", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --step--1: 0.9375rem;
  --step-0: 1.0625rem;
  --step-1: 1.1875rem;
  --step-2: clamp(1.5rem, 1.3rem + 0.7vw, 1.875rem);
  --step-3: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  --step-4: clamp(3rem, 1.8rem + 5vw, 5.75rem);

  --radius: 6px;
  --radius-media: 8px;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1a27;
    --sheet: #132131;
    --card: #182739;
    --ink: #e8eef5;
    --ink-2: #a3b1c2;
    --rule: #2a3b50;
    --tint: #1b2b3e;
    --stud: #2d4058;
    --yellow: #ffc933;
    --yellow-edge: #b38600;
    --azure: #3db7ee;
    --azure-text: #6ccbf4;
    --magenta: #e04a98;
    --magenta-text: #f38cc3;
    --on-accent: #0f1a27;
    --error: #ff8a80;
    --night: #09121c;
    --night-2: #142234;
    --night-rule: #24364c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1a27;
  --sheet: #132131;
  --card: #182739;
  --ink: #e8eef5;
  --ink-2: #a3b1c2;
  --rule: #2a3b50;
  --tint: #1b2b3e;
  --stud: #2d4058;
  --yellow: #ffc933;
  --yellow-edge: #b38600;
  --azure: #3db7ee;
  --azure-text: #6ccbf4;
  --magenta: #e04a98;
  --magenta-text: #f38cc3;
  --on-accent: #0f1a27;
  --error: #ff8a80;
  --night: #09121c;
  --night-2: #142234;
  --night-rule: #24364c;
  color-scheme: dark;
}

/* -------------------------------------------------------------------- base */

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0) / 1.6 var(--font-body);
  overflow-wrap: break-word;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--azure-text); }

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

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1;
  text-wrap: balance;
}

p, ul, ol, dl, figure { margin: 0; }

code { font-family: var(--font-mono); font-size: 0.9em; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: max(var(--gutter), env(safe-area-inset-left, 0px));
  top: -100px;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--yellow);
  color: var(--on-yellow);
  font-weight: 700;
  border-radius: var(--radius);
}
.skip:focus { top: 0.75rem; color: var(--on-yellow); }

.small { font-size: var(--step--1); color: var(--ink-2); }

/* A fact that is still to be confirmed. scripts/check_site.py --strict refuses to deploy
   while any is left. */
.tbc {
  text-decoration: underline dotted var(--magenta-text);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
}
.tbc::after {
  content: "TBC";
  display: inline-block;
  margin-left: 0.35em;
  padding: 0.12em 0.3em;
  border: 1px solid var(--magenta-text);
  border-radius: 3px;
  color: var(--magenta-text);
  font: 700 0.62rem / 1 var(--font-body);
  letter-spacing: 0.04em;
  vertical-align: 0.25em;
  width: max-content;
  justify-self: start;
}

/* ----------------------------------------------------------------- buttons */

/* Chunky, with a lower edge like a brick's, that the button sinks into when pressed. */
.btn {
  --edge: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.7rem 1.5rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 700 1.2rem / 1.1 var(--font-display);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--primary {
  --edge: var(--yellow-edge);
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--on-yellow);
  box-shadow: 0 4px 0 var(--edge);
}
.btn--primary:hover { background: var(--yellow); color: var(--on-yellow); filter: brightness(1.06); }
.btn--primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.btn:disabled { opacity: 0.6; cursor: progress; }

.textlink { font-weight: 700; color: var(--azure-text); }

/* ------------------------------------------------------------------ header */

.site-header {
  background: var(--night);
  color: var(--on-night);
  border-bottom: 1px solid var(--night-rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: 800 1.75rem / 1 var(--font-display);
  letter-spacing: 0.01em;
  text-decoration: none;
}
.brand svg { width: 32px; height: 32px; flex: none; }
.brand:hover { color: inherit; }
.logo-bg { fill: var(--yellow); }
.logo-eye { fill: #0f1d2e; }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2vw, 2rem);
  padding: 0;
  list-style: none;
  font: 700 1.125rem / 1 var(--font-display);
  letter-spacing: 0.02em;
}
.nav a { color: var(--on-night-2); text-decoration: none; }
.nav a:hover { color: var(--on-night); }
.nav__gh a {
  display: inline-block;
  padding: 0.55rem 0.95rem;
  border: 2px solid var(--yellow);
  border-radius: var(--radius);
  color: var(--yellow);
}
.nav__gh a:hover { background: var(--yellow); color: #0f1d2e; }

@media (max-width: 680px) {
  .nav li:not(.nav__keep) { display: none; }
}

/* -------------------------------------------------------------------- hero */

.hero {
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem) clamp(3rem, 2rem + 4vw, 5.5rem);
  background: var(--night);
  color: var(--on-night);
}

.hero__grid {
  display: grid;
  gap: clamp(2.25rem, 1rem + 3vw, 4rem);
  align-items: center;
}
@media (min-width: 980px) {
  .hero__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

.hero h1 {
  font-size: var(--step-4);
  font-weight: 800;
  line-height: 0.92;
  text-transform: uppercase;
}

.lede {
  margin-top: 1.5rem;
  max-width: 34em;
  color: var(--ink-2);
  font-size: var(--step-1);
  line-height: 1.55;
}
.hero .lede { color: var(--on-night-2); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}
.hero .btn:not(.btn--primary) { border-color: var(--on-night); color: var(--on-night); }
.hero .btn:not(.btn--primary):hover { background: var(--on-night); color: #0f1d2e; }

.hero__aside { margin-top: 1.5rem; }
.hero .small { color: var(--on-night-2); }
.hero a:not(.btn):hover { color: var(--yellow); }

.hero__media { display: grid; gap: 0.85rem; min-width: 0; }

/* The parts callout: what the robot in the video is made of. */
.parts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  list-style: none;
  overflow: hidden;
  background: var(--night-rule);
  border: 1px solid var(--night-rule);
  border-radius: var(--radius);
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1.25;
}
.parts li {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  background: var(--night-2);
  color: var(--on-night-2);
}
.parts .qty { color: var(--yellow); font-size: 1.6rem; }
@media (max-width: 520px) {
  .parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.qty {
  color: var(--magenta-text);
  font: 800 1.25rem / 1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------- media */

.media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: var(--ratio, 16 / 9);
  max-width: 100%;
  border-radius: var(--radius-media);
  background-color: var(--tint);
  background-image: radial-gradient(circle, var(--stud) 0 3.4px, transparent 4px);
  background-size: 22px 22px;
  background-position: 11px 11px;
}

.media > video,
.media > img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--contain { background-image: none; background-color: transparent; }
.media--contain > img { object-fit: contain; }

/* Shown once site.js finds a media file missing: what goes here, and the file it should be.
   Until then the slot shows its stud grid, so that a file still on its way never looks missing. */
.ph {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.media:not(.is-missing) .ph { visibility: hidden; }
.ph__card {
  display: grid;
  gap: 0.2rem;
  max-width: 26rem;
  padding: 0.85rem 1.05rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink);
}
.ph__title { font: 700 1.15rem / 1.2 var(--font-display); }
.ph__file { font: 500 0.8rem / 1.4 var(--font-mono); color: var(--ink-2); overflow-wrap: anywhere; }
.ph__spec { font-size: 0.85rem; line-height: 1.4; color: var(--ink-2); }
/* A contained image has no stud grid behind it, so its placeholder brings its own. */
.media--contain .ph { background-color: var(--tint); background-image: radial-gradient(circle, var(--stud) 0 3.4px, transparent 4px); background-size: 22px 22px; border-radius: var(--radius-media); }

.media__toggle,
.media__sound {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 999px;
  background: var(--scrim);
  color: var(--on-scrim);
  font: 700 0.9rem / 1 var(--font-body);
  cursor: pointer;
}
.media__sound { right: auto; left: 0.75rem; }
.media__toggle svg { width: 16px; height: 16px; fill: currentColor; }
.media__toggle .i-pause,
.media.is-playing .media__toggle .i-play { display: none; }
.media.is-playing .media__toggle .i-pause { display: block; }
.media.is-missing .media__toggle,
.media.is-missing .media__sound { display: none; }

/* While a slot waits for its picture, or for the data to play its video on (site.js), a spinner
   turns in the middle. It fades in only after a moment, so that a quick load never flashes it. */
.media.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 3px solid rgb(255 255 255 / 0.3);
  border-top-color: var(--on-scrim);
  border-radius: 50%;
  background: var(--scrim);
  box-shadow: 0 0 0 11px var(--scrim);
  pointer-events: none;
  animation: media-wait 0.3s ease 0.4s both, media-spin 0.9s linear infinite;
}
@keyframes media-wait { from { opacity: 0; } }
@keyframes media-spin { to { transform: rotate(1turn); } }

.clip { display: grid; gap: 0.75rem; min-width: 0; }
.clip figcaption { color: var(--ink-2); font-size: var(--step--1); line-height: 1.5; }
.clip figcaption strong { color: var(--ink); }

/* ---------------------------------------------------------------- sections */

.section { padding-block: clamp(4rem, 2.5rem + 5vw, 7rem); }
.section--sheet { background: var(--sheet); }

.section__head {
  display: grid;
  gap: 1rem;
  max-width: 48rem;
  margin-bottom: clamp(2.25rem, 1.5rem + 2vw, 3.5rem);
}
.section h2 {
  font-size: var(--step-3);
  font-weight: 800;
  line-height: 0.95;
  text-transform: uppercase;
}
/* A short brick-yellow bar under each section title. */
.section h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 6px;
  margin-top: 0.9rem;
  border-radius: 2px;
  background: var(--yellow);
}
.section__head p { max-width: 40em; color: var(--ink-2); font-size: var(--step-1); line-height: 1.55; }

/* --------------------------------------------------------------- meet Neil */

.meet {
  display: grid;
  gap: clamp(2rem, 1rem + 3vw, 4rem);
  align-items: center;
}
@media (min-width: 900px) {
  .meet { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.meet__text { display: grid; gap: 1.25rem; min-width: 0; }
.meet__text > p { max-width: 38em; color: var(--ink-2); font-size: var(--step-1); line-height: 1.55; }

.specs {
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.specs > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.8rem 1.1rem;
  border-top: 1px solid var(--rule);
}
.specs > div:first-child { border-top: 0; }
.specs > div:nth-child(even) { background: var(--sheet); }
.specs dt { font: 700 1.15rem / 1.4 var(--font-display); }
.specs dd { margin: 0; color: var(--ink-2); }
@media (max-width: 520px) {
  .specs > div { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ------------------------------------------------------- tell it / show it */

.ways { display: grid; gap: 4rem; }
@media (min-width: 920px) {
  .ways {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(2rem, 0.5rem + 3vw, 3.75rem);
    row-gap: 2rem;
  }
  .way { grid-row: span 3; grid-template-rows: subgrid; }  /* head, clip, extras */
}

.way--mcp { --way: var(--azure); --way-text: var(--azure-text); }
.way--vla { --way: var(--magenta); --way-text: var(--magenta-text); }

.way { display: grid; gap: 1.75rem; align-content: start; min-width: 0; }
.way__head { display: grid; gap: 0.75rem; align-content: start; }
/* The path's tag, in its color: azure for "Tell it", magenta for "Show it". */
.way__head .way__label {
  justify-self: start;
  padding: 0.35rem 0.75rem 0.3rem;
  border-radius: var(--radius);
  background: var(--way);
  color: var(--on-accent);
  font: 800 1.15rem / 1 var(--font-display);
  letter-spacing: 0.02em;
}
.way h3 { font-size: var(--step-2); font-weight: 800; line-height: 1.05; }
.way__head p { color: var(--ink-2); }
.way__extra { display: grid; gap: 1.25rem; align-content: start; }
.way__extra .textlink { color: var(--way-text); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding: 0;
  list-style: none;
}
.chips code {
  display: inline-block;
  padding: 0.3rem 0.55rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--way);
  border-radius: 4px;
  font-size: 0.82rem;
}

.steps {
  display: grid;
  gap: 1rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  column-gap: 0.9rem;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--radius);
  background: var(--way);
  color: var(--on-accent);
  font: 800 1.45rem / 1 var(--font-display);
}
.steps b { font: 700 1.2rem / 1.3 var(--font-display); }
.steps span { color: var(--ink-2); }

/* ------------------------------------------------------------------- build */

.build { display: grid; gap: clamp(2rem, 1.5rem + 2vw, 3rem); }
@media (min-width: 920px) {
  .build {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-areas: "video render" "parts wiring";
    align-items: start;
  }
  .build__video { grid-area: video; }
  .build__parts { grid-area: parts; }
  .build__wiring { grid-area: wiring; }
  .build__render { grid-area: render; }
}

.callout {
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 6px solid var(--yellow);
  border-radius: var(--radius);
}
.callout h3,
.build__wiring h3,
.research h3 {
  margin-bottom: 0.9rem;
  font-size: var(--step-2);
  font-weight: 800;
}

.bom { display: grid; padding: 0; list-style: none; }
.bom li {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0.75rem;
  padding-block: 0.6rem;
  border-top: 1px dashed var(--rule);
}
.bom li:first-child { border-top: 0; padding-top: 0; }
.bom + .bom__cost {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
}
.bom__cost + .small { margin-top: 0.5rem; }

.build__wiring { display: grid; align-content: start; gap: 1rem; }
.ports {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}
.port {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding: 0.9rem 0.35rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: var(--step--1);
  font-weight: 600;
  text-align: center;
}
.port__id {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--night);
  color: var(--yellow);
  font: 800 1.5rem / 1 var(--font-display);
}
.build__diagram { display: grid; gap: 0.5rem; }
.build__diagram img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
@media (max-width: 380px) {
  .ports { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The 3D model (assets/js/model.js): a canvas over the still render. The render shows until the
   model is ready, and stays for visitors without WebGL or who save data. */
.model > canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: grab;
  touch-action: pan-y pinch-zoom;  /* a sideways drag turns the model; an upward one scrolls the page */
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.6s ease;
}
.model > img { transition: opacity 0.6s ease; }
.model.is-3d > canvas { opacity: 1; }
.model.is-3d > img { opacity: 0; }
.model.is-3d .ph,
.model.is-3d::after { visibility: hidden; }
.model.is-3d .media__toggle { display: grid; }
.model.is-dragging > canvas { cursor: grabbing; }
.model > canvas:focus-visible { outline-offset: -3px; border-radius: var(--radius-media); }

.model__hint {
  position: absolute;
  left: 0.75rem;
  bottom: calc(0.75rem + 3px);  /* level with the middle of the round button */
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.85rem 0 0.7rem;
  border-radius: 999px;
  background: var(--scrim);
  color: var(--on-scrim);
  font: 700 0.9rem / 1 var(--font-body);
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.model__hint svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.model.has-turned .model__hint { opacity: 0; }

/* ---------------------------------------------------------------- research */

.research { display: grid; gap: clamp(2rem, 1rem + 2vw, 3rem); }
@media (min-width: 960px) {
  .research { grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr); }
}
.research > div { min-width: 0; }
.research ul { display: grid; gap: 0.6rem; padding-left: 1.1rem; }
.research p + p { margin-top: 0.75rem; }

.code {
  overflow: hidden;
  background: var(--night);
  color: #dbe5f0;
  border-radius: var(--radius);
}
.code pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font: 400 0.84rem / 1.55 var(--font-mono);
}
.code__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.6rem 0.5rem 1.1rem;
  background: var(--night-2);
  font-size: var(--step--1);
  color: var(--on-night-2);
}
.code__bar .tbc { text-decoration-color: #f38cc3; }
.code__bar .tbc::after { border-color: #f38cc3; color: #f38cc3; }
.copy {
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border: 0;
  border-radius: 4px;
  background: var(--yellow);
  color: #0f1d2e;
  font: 700 1rem / 1 var(--font-display);
  cursor: pointer;
}
.copy:hover { filter: brightness(1.06); }

/* --------------------------------------------------------------- educators */

.edu {
  display: grid;
  gap: clamp(2.5rem, 1.5rem + 3vw, 4rem);
}
@media (min-width: 980px) {
  .edu { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
}
.edu__pitch { display: grid; gap: 1.25rem; min-width: 0; }
.edu__pitch > p { color: var(--ink-2); }
.edu__pitch > p:first-of-type { font-size: var(--step-1); line-height: 1.55; }
.edu__list { display: grid; gap: 0.6rem; padding: 0; list-style: none; }
.edu__list li { position: relative; padding-left: 1.6rem; }
.edu__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 2px;
  background: var(--yellow);
}

/* The pilot invitation, under the form; navy on top so it doesn't read as a second form. */
.edu__talk { margin-top: clamp(1.5rem, 1rem + 1.5vw, 2rem); border-top-color: var(--ink); }
.edu__talk p { color: var(--ink-2); }
.edu__talk p + p { margin-top: 0.75rem; }

/* Instructors' questions, closed until opened, under both columns. */
.edu__faq { max-width: 48rem; }
@media (min-width: 980px) {
  .edu__faq { grid-column: 1 / -1; }
}
.edu__faq h3 { margin-bottom: 0.6rem; font-size: var(--step-2); font-weight: 800; }
.edu__faq details { border-top: 1px solid var(--rule); }
.edu__faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.edu__faq summary {
  position: relative;
  padding: 0.9rem 2.25rem 0.9rem 0;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.edu__faq summary::-webkit-details-marker { display: none; }
.edu__faq summary::after {
  content: "+";
  position: absolute;
  top: 0.95rem;
  right: 0.35rem;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-2);
}
.edu__faq details[open] > summary::after { content: "\2212"; }
.edu__faq summary:hover { color: var(--azure-text); }
.edu__answer { display: grid; gap: 0.75rem; max-width: 42em; padding-bottom: 1.1rem; color: var(--ink-2); }

.form,
.form-done {
  display: grid;
  gap: 1.15rem;
  min-width: 0;
  padding: clamp(1.25rem, 0.9rem + 1.5vw, 2.1rem);
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 6px solid var(--yellow);
  border-radius: var(--radius-media);
}
.form h3,
.form-done h3 { font-size: var(--step-2); font-weight: 800; }
.form__head { display: grid; gap: 0.35rem; }
.form__head p,
.form-done p { color: var(--ink-2); }

.field { display: grid; gap: 0.4rem; align-content: start; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-row { display: grid; gap: 1.15rem; }
@media (min-width: 560px) {
  .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.field > label,
.field > legend { padding: 0; font-weight: 700; font-size: 1rem; }
.opt { margin-left: 0.3rem; color: var(--ink-2); font-weight: 400; font-size: 0.9rem; }

.form input[type="text"],
.form input[type="email"],
.form select,
.form textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.8rem;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.form textarea { min-height: 6rem; resize: vertical; }
.form input:hover,
.form select:hover,
.form textarea:hover { border-color: var(--ink-2); }

.checks { display: grid; gap: 0.5rem; margin-top: 0.2rem; }
.check { display: flex; align-items: flex-start; gap: 0.65rem; font-weight: 400; }
.check input {
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.2rem 0 0;
  accent-color: var(--azure);
}

/* Bots fill in every field; people never see this one. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form__preview {
  padding: 0.7rem 0.9rem;
  border: 1.5px dashed var(--magenta-text);
  border-radius: var(--radius);
  color: var(--ink-2);
  font-size: var(--step--1);
}
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.form__status { min-height: 1.5em; font-size: 0.95rem; }
.form__status[data-state="error"] { color: var(--error); font-weight: 700; }
/* The script moves focus to each step as it appears, so screen readers announce it. */
.form:focus,
.form-done:focus { outline: none; }

/* --------------------------------------------------------------- community */

.links {
  display: grid;
  gap: 1rem;
  padding: 0;
  list-style: none;
}
@media (min-width: 680px) { .links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .links { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.links a {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  height: 100%;
  padding: 1.1rem 1.2rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
}
.links a:hover { border-color: var(--ink); color: inherit; box-shadow: 0 4px 0 var(--yellow); }
.links strong { font: 800 1.4rem / 1.1 var(--font-display); }
.links span { color: var(--ink-2); font-size: var(--step--1); }

/* ------------------------------------------------------------------ footer */

.site-footer {
  padding-block: 3.5rem 2.5rem;
  background: var(--night);
  color: var(--on-night-2);
  font-size: var(--step--1);
}
.site-footer a:hover { color: var(--yellow); }
.footer__grid { display: grid; gap: 1.5rem 3rem; }
@media (min-width: 860px) {
  .footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); }
}
.footer__grid > div { display: grid; gap: 0.6rem; align-content: start; }
.footer__grid .brand { color: var(--on-night); font-size: 1.6rem; }
.footer__grid .brand svg { width: 28px; height: 28px; }
.legal { margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid var(--night-rule); font-size: 0.85rem; }
.site-footer .tbc { text-decoration-color: #f38cc3; }
.site-footer .tbc::after { border-color: #f38cc3; color: #f38cc3; }

/* --------------------------------------------------------- text pages (privacy, 404) */

.doc { padding-block: clamp(3rem, 2rem + 4vw, 5rem); }
.doc .wrap > * { max-width: 42rem; }
.doc h1 { font-size: var(--step-3); font-weight: 800; line-height: 0.95; text-transform: uppercase; }
.doc h2 { margin-top: 2.25rem; font-size: var(--step-2); font-weight: 800; }
.doc p, .doc ul { margin-top: 0.9rem; }
.doc ul { padding-left: 1.2rem; display: grid; gap: 0.4rem; }
.doc .small { margin-top: 0.75rem; }

/* ------------------------------------------------------------------ motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .media.is-loading::after { animation-duration: 0.3s, 2.4s; }  /* still a sign of loading, but slow */
}
