/* SkeletonKey v4 — cinematic hero on cream paper, editorial plates below.
   See DESIGN.md: §1–§7 hold the palette, radius and motion curve; the v3 and
   v4 addenda hold the full-bleed hero, the 12 column grid and the type scale. */

/* ---------- faces, self hosted: no CDN, no third party request ----------
   Every URL carries ?v=4 so a stale cached stylesheet can never pair with a
   fresh font file, or the other way round. */
@font-face {
  font-family: Fraunces;
  src: url("/fonts/fraunces.woff2?v=4") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Fraunces;
  font-style: italic;
  src: url("/fonts/fraunces-italic.woff2?v=4") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url("/fonts/manrope.woff2?v=4") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrainsmono.woff2?v=4") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

/* A local Georgia, re-cut to Fraunces' metrics, so the swap moves the headline
   as little as possible. Measured: the same string set in Fraunces at
   'opsz' 144, 'wght' 300 is 0.88x the width of Georgia, and Fraunces carries a
   1956/-510 ascent and descent on a 2000 upm. */
@font-face {
  font-family: "Fraunces Fallback";
  src: local("Georgia"), local("Times New Roman"), local("Times");
  size-adjust: 88%;
  ascent-override: 111%;
  descent-override: 29%;
  line-gap-override: 0%;
}

:root {
  /* ---------- modular type scale ----------
     One ratio, two ends: 1.2 at a 375px viewport, 1.25 at 1440px. Every size on
     the page is a step on this table; nothing is typed in by hand. */
  --f--2: 0.6875rem;                                            /* 11  micro label */
  --f--1: 0.875rem;                                             /* 14  body S */
  --f-0:  1rem;                                                 /* 16  body */
  --f-1:  clamp(1.1875rem, 1.1435rem + 0.188vw, 1.3125rem);     /* 19 → 21  lede */
  --f-2:  clamp(1.4375rem, 1.394rem + 0.188vw, 1.5625rem);      /* 23 → 25  heading */
  --f-3:  clamp(1.75rem,   1.684rem + 0.282vw, 1.9375rem);      /* 28 → 31 */
  --f-4:  clamp(2.125rem,  1.861rem + 1.127vw, 2.875rem);       /* 34 → 46  statement */
  --f-5:  clamp(2.5rem,    2.302rem + 0.845vw, 3.0625rem);      /* 40 → 49 */
  --f-6:  clamp(2.625rem,  1.855rem + 3.286vw, 4.8125rem);      /* 42 → 77  pull quote */
  /* the one dominant idea: the hero headline, and nothing else on this step */
  /* width drives it, but a short window caps it: the headline, its lede and the
     foot line all have to live inside one screen */
  --f-hero: clamp(2.75rem, min(1.43rem + 5.63vw, 10.4svh), 6.5rem);  /* 44 → 104 */

  --lh-hero: 0.99;
  --lh-quote: 1.06;
  --lh-display: 1.14;
  --lh-head: 1.22;
  --lh-lede: 1.55;
  --lh-body: 1.65;
  --lh-micro: 1.45;

  /* spacing scale, 4px based */
  --s-25: 2px;  --s-50: 4px;  --s-75: 8px;  --s-100: 12px; --s-200: 16px;
  --s-300: 24px; --s-400: 32px; --s-500: 40px; --s-600: 48px; --s-700: 64px;
  --s-800: 80px; --s-900: 96px; --s-1000: 112px; --s-1100: 128px;
  --s-1200: 160px; --s-1400: 200px;

  --r-sm: 2px; --r-base: 4px; --r-lg: 8px; --r-xl: 12px; --r-2xl: 16px;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-fast: 160ms;
  --dur-ui: 200ms;
  --dur-reveal: 800ms;

  /* Headings never fall back to a sans: ui-serif and Georgia only. */
  --font-display: "Fraunces", "Fraunces Fallback", ui-serif, Georgia,
                  "Times New Roman", serif;
  --font-sans: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
               Consolas, "Liberation Mono", monospace;

  --measure: 34rem;
  --page: 1200px;
  --gutter: var(--s-300);
  --col-gap: var(--s-400);
  --head-h: 68px;

  /* light is the default theme */
  --bg: #F1ECE2;
  --surface: #F7F4EC;
  --border: #D5CBB6;
  --border-strong: #C4B79C;
  --text: #16130E;
  --muted: #554E43;
  --meta: #6E6557;
  --accent: #8A5A0F;
  --accent-deep: #63400A;
  --accent-hi: #E8B04B;
  --accent-ink: #F1ECE2;
  --accent-wash: rgba(138, 90, 15, 0.07);
  --select: rgba(138, 90, 15, 0.18);

  --shadow-card: 0 1px 1px rgba(44, 33, 14, 0.04), 0 16px 34px -20px rgba(44, 33, 14, 0.30);
  --shadow-lift: 0 2px 3px rgba(44, 33, 14, 0.05), 0 26px 50px -24px rgba(44, 33, 14, 0.38);

  /* the ink plates: the hero, the pull quote, the command blocks, the footer */
  --panel: #14110C;
  --panel-rule: rgba(246, 241, 230, 0.13);
  --code-bg: #15120D;
  --code-edge: rgba(246, 241, 230, 0.13);
  --code-ink: #EDE6D7;
  --code-hint: #9A907C;
  --code-btn: #C0B7A4;

  /* cream type for every ink plate, hero included */
  --ink: #F6F1E6;
  --ink-soft: #D8D1C2;
  --ink-meta: #C7BEAC;
  --ink-rule: rgba(246, 241, 230, 0.22);
  --veil: 20, 17, 12;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110C;
    --surface: #1E1A12;
    --border: #322C22;
    --border-strong: #473F31;
    --text: #F2F0ED;
    --muted: #A8A49D;
    --meta: #948F88;
    --accent: #E8B04B;
    --accent-deep: #F0C676;
    --accent-ink: #14110C;
    --accent-wash: rgba(232, 176, 75, 0.10);
    --select: rgba(232, 176, 75, 0.22);
    --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.34), 0 16px 34px -20px rgba(0, 0, 0, 0.70);
    --shadow-lift: 0 2px 3px rgba(0, 0, 0, 0.40), 0 26px 50px -24px rgba(0, 0, 0, 0.80);
    /* the plates sink below the page rather than rising above it */
    --panel: #0E0C08;
    --code-bg: #0E0C08;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--border-strong) transparent;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--bg);
  /* paper grain, tiled so it also covers a full page capture */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.11'/%3E%3C/svg%3E");
  background-repeat: repeat;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--f-0);
  line-height: var(--lh-body);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul, dl { margin: 0; }
h1, h2, h3 { font-weight: 400; text-wrap: balance; }
ol, ul { padding: 0; list-style: none; }

a {
  color: var(--text);
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}

::selection { background: var(--select); }
input { caret-color: var(--accent); }

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

/* display type: Fraunces, optical size wide open */
.display, .statement, .tagline p, .card h3, .point h3, .qa summary, .point .num {
  font-family: var(--font-display);
  font-optical-sizing: auto;
}

/* the tiny uppercase wide tracked label, used for every eyebrow and micro label */
.eyebrow, .snippet-label, .tag, .ver, .coord, .hero-cue {
  font-family: var(--font-mono);
  font-size: var(--f--2);
  line-height: var(--lh-micro);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.skip {
  position: absolute;
  left: var(--s-200);
  top: calc(-1 * var(--s-600));
  z-index: 5;
  padding: var(--s-75) var(--s-100);
  border-radius: var(--r-lg);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--f--1);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur-ui) var(--ease);
}
.skip:focus { top: var(--s-200); }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  /* padding-inline, not the shorthand: .hero-inner is a .wrap and sets its own
     block padding, which `padding: 0 x` would silently reset */
  padding-inline: var(--gutter);
}

/* ---------- header: it floats on the hero photograph ---------- */

.site-head {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  color: var(--ink);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-200);
  min-height: var(--head-h);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}
.wordmark svg { display: block; height: 22px; width: auto; }
.wordmark .glyph { stroke: var(--accent-hi); }

.head-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-75);
  margin-right: calc(-1 * var(--s-100));
  padding: var(--s-75) var(--s-100);
  border-radius: var(--r-lg);
  color: var(--ink);
  font-size: var(--f--1);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.head-link:hover { color: var(--ink); background: rgba(246, 241, 230, 0.10); }
.head-link:active { transform: translateY(1px); }

/* The wrap is space-between with the wordmark first, so the first of the trailing
   links claims the slack and the rest follow it to the right edge. */
.head-directory { margin-left: auto; }

/* ---------- section rhythm ----------
   Wide bands of nothing between the plates: the page is paced by air, and a
   hairline is the only thing that ever separates two cream sections. */

main { display: block; }

section { padding: var(--s-800) 0; }
section + section { border-top: 1px solid var(--border); }

/* a section opens on a hairline: a numbered mono label on the left, a short
   datum on the right. The label is the heading; nothing larger follows it. */
.sec-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-300);
  margin-bottom: var(--s-700);
  padding-bottom: var(--s-100);
  border-bottom: 1px solid var(--border);
}
/* the hairline is paper grey, except for the first 32px, which is brass */
.sec-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 32px;
  height: 1px;
  background: var(--accent);
}
.eyebrow { color: var(--text); font-weight: 500; }
.sec-head .sec-n { color: var(--accent); }
.sec-head .coord { color: var(--meta); font-weight: 400; }

/* ---------- hero: one photograph, full screen ---------- */

.hero {
  position: relative;
  isolation: isolate;
  /* if the photograph never arrives, the hero is still dark and the cream
     text is still legible */
  background-color: #14110C;
  padding: 0;
  border: 0;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  overflow: clip;
  color: var(--ink);
}
/* 5% of slack above and below, so the scroll parallax can translate the
   photograph down without ever exposing an edge */
.hero-media {
  position: absolute;
  left: 0;
  right: 0;
  top: -5%;
  height: 110%;
  z-index: -3;
  will-change: transform;
}
.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* the key sits to the right of frame; hold it in view at every aspect */
  object-position: 72% 52%;
  transform-origin: 72% 52%;
}

/* The light spilling past the door, breathing. A warm radial over the lit
   side of the frame; the scrim above it keeps the copy side untouched. */
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.6;
  background: radial-gradient(42% 52% at 86% 30%,
    rgba(255, 199, 112, 0.26) 0%,
    rgba(252, 186, 92, 0.12) 40%,
    rgba(246, 176, 84, 0) 74%);
}

/* The golden dust, drawn into a transparent 2D canvas by the script and
   cleared every frame. It is never filled, and it is never created at all
   without a 2D context or under reduced motion. */
.hero-dust {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: transparent;
}

/* The warm scrim. Left to right on desktop, top to bottom on the portrait
   crop, with a touch of extra shade under the header and the foot line. */
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom,
      rgba(var(--veil), 0.72) 0,
      rgba(var(--veil), 0.58) 7%,
      rgba(var(--veil), 0.20) 20%,
      rgba(var(--veil), 0) 36%),
    linear-gradient(to bottom,
      rgba(var(--veil), 0) 70%,
      rgba(var(--veil), 0.45) 100%),
    linear-gradient(92deg,
      rgba(var(--veil), 0.93) 0,
      rgba(var(--veil), 0.88) 34%,
      rgba(var(--veil), 0.66) 50%,
      rgba(var(--veil), 0.26) 72%,
      rgba(var(--veil), 0.08) 100%);
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: calc(var(--head-h) + var(--s-400));
  padding-bottom: var(--s-500);
}
.hero-copy { max-width: 36rem; will-change: transform, opacity; }

.hero h1 {
  font-size: var(--f-hero);
  font-variation-settings: 'opsz' 144, 'wght' 300;
  line-height: var(--lh-hero);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent-hi);
  font-variation-settings: 'opsz' 144, 'wght' 300;
}
.hero .sub {
  max-width: 38ch;
  margin-top: var(--s-300);
  color: var(--ink-soft);
  font-size: var(--f-1);
  line-height: var(--lh-lede);
  letter-spacing: -0.005em;
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-200) var(--s-300);
  margin-top: var(--s-500);
  padding-top: var(--s-200);
  border-top: 1px solid var(--ink-rule);
  will-change: transform, opacity;
}
.hero-meta {
  max-width: 60ch;
  color: var(--ink-meta);
  font-size: var(--f--1);
  line-height: 1.5;
}
/* the only navigation out of the first screen: a label over a hairline that
   drops towards the section it points at */
.hero-cue {
  position: relative;
  flex: none;
  padding-bottom: var(--s-300);
  color: var(--ink-soft);
  letter-spacing: 0.18em;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.hero-cue::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: var(--s-200);
  background: var(--accent-hi);
}
.hero-cue:hover { color: var(--ink); }

/* The dissolve out of the hero: the photograph's own black warming up into
   paper. In the dark theme the page is already that black, so it is flat. */
.hem {
  height: clamp(88px, 12vh, 160px);
  background-image: linear-gradient(to bottom,
    #14110C 0%, #231D14 22%, #5B4E3A 52%, #AFA28A 78%, var(--bg) 100%);
}
.hem + section { border-top: 0; }

@media (prefers-color-scheme: dark) {
  .hem { background-image: none; background-color: #14110C; }
}

/* ---------- the problem: a display statement beside its prose ---------- */

.split { display: grid; gap: var(--s-400); }
.statement {
  font-variation-settings: 'opsz' 144, 'wght' 300;
  font-size: var(--f-4);
  line-height: var(--lh-display);
  letter-spacing: -0.02em;
  max-width: 20ch;
  text-wrap: balance;
}
.prose { max-width: 46ch; color: var(--muted); }
.prose + .prose { margin-top: var(--s-300); }

/* ---------- benefits: four plates, cut to two widths ---------- */

.points { display: grid; gap: var(--s-300); }
.point {
  position: relative;
  overflow: hidden;
  padding: var(--s-400) var(--s-400) var(--s-400);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color var(--dur-ui) var(--ease), box-shadow var(--dur-ui) var(--ease),
              transform var(--dur-ui) var(--ease);
}
.point:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}
/* the numeral is the card's weight, not a badge: an outline cut from the
   paper, large enough to read as a figure and quiet enough to stay behind */
.point .num {
  position: absolute;
  top: var(--s-200);
  right: var(--s-300);
  color: var(--border);
  font-size: clamp(3.5rem, 7vw, 5.25rem);
  font-variation-settings: 'opsz' 144, 'wght' 300;
  line-height: 1;
  letter-spacing: -0.02em;
  pointer-events: none;
}
@supports (-webkit-text-stroke: 1px currentColor) {
  .point .num { color: transparent; -webkit-text-stroke: 1px var(--border-strong); }
}
.point-body { position: relative; }
.point h3 {
  padding-right: clamp(68px, 8vw, 116px);
  font-variation-settings: 'opsz' 72, 'wght' 400;
  font-size: var(--f-2);
  line-height: var(--lh-head);
  letter-spacing: -0.01em;
}
.point p {
  margin-top: var(--s-200);
  max-width: 46ch;
  color: var(--muted);
  font-size: var(--f--1);
  line-height: var(--lh-body);
}

/* ---------- the pull quote: one ink plate across the page ---------- */

.tagline {
  padding: var(--s-900) 0;
  border-top: 0;
  background: var(--panel);
  color: var(--ink);
}
.tagline + section { border-top: 0; }
.tagline-rule {
  display: block;
  width: 56px;
  height: 1px;
  margin-bottom: var(--s-500);
  background: var(--accent-hi);
}
.tagline p {
  max-width: 17ch;
  font-variation-settings: 'opsz' 144, 'wght' 300;
  font-size: var(--f-6);
  line-height: var(--lh-quote);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* ---------- command block: ink, wherever it sits ---------- */

.code {
  position: relative;
  max-width: var(--measure);
  border: 1px solid var(--code-edge);
  border-radius: var(--r-xl);
  background: var(--code-bg);
  padding: var(--s-300);
}
.code pre {
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--f--1);
  line-height: 1.7;
  color: var(--code-ink);
  scrollbar-width: thin;
  scrollbar-color: var(--code-hint) transparent;
}
.code pre .prompt { color: var(--accent-hi); user-select: none; }
.code pre .hint { color: var(--code-hint); }

/* Below the code, not over it: the clone URL is longer than the block is wide. */
.copy {
  display: block;
  margin: var(--s-200) 0 0 auto;
  padding: var(--s-50) var(--s-75);
  border: 1px solid var(--code-edge);
  border-radius: var(--r-base);
  background: transparent;
  color: var(--code-btn);
  font-family: var(--font-mono);
  font-size: var(--f--2);
  line-height: var(--lh-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.copy:hover { color: var(--accent-hi); border-color: rgba(232, 176, 75, 0.5); }
.copy:active { transform: scale(0.98); }
.copy[data-state="done"] { color: var(--accent-hi); border-color: var(--accent-hi); }
.code :focus-visible { outline-color: var(--accent-hi); }

/* ---------- the two doors ---------- */

.doors { display: grid; gap: var(--s-400); }
/* minmax(0, ...) plus min-width: 0 on the items and their children: the one
   line install command scrolls inside its own block instead of setting the
   track's automatic minimum and pushing a phone page wider than the screen */
.doors > *, .door > * { min-width: 0; }
.door .code { max-width: 100%; }
.door .note { margin-top: var(--s-50); }
/* an action sits to its own width, not stretched across the card */
.door > .btn { align-self: flex-start; }
.door .note a { color: var(--accent-deep); text-decoration-color: var(--border-strong); }
.door .note a:hover { text-decoration-color: var(--accent); }
.door-head {
  padding-bottom: var(--s-300);
  margin-bottom: var(--s-50);
  border-bottom: 1px solid var(--border);
}
.door .snippet-label {
  display: block;
  margin: 0 0 var(--s-75);
  color: var(--meta);
  font-weight: 400;
}
/* These commands are the page's main action, so they wrap rather than scroll
   out of sight. The copy button still copies the whole line. */
.door .code pre { white-space: pre-wrap; overflow-wrap: break-word; }
/* UAX #14 allows a line break after a hyphen, which would split the `--`
   separator across two lines. This keeps that token whole. */
.nb { white-space: nowrap; }

/* the open source door is the page's action and carries the paper; the hosted
   door is an outline on the page itself, so the hierarchy is visible before a
   word is read */
.door-primary { background: var(--surface); box-shadow: var(--shadow-card); }
.door-soft { background: transparent; box-shadow: none; }

/* ---------- tabs ---------- */

/* With scripting off the tablist is hidden and every panel stays visible under
   its own label, so no command is ever unreachable. */
html:not(.js) .tablist { display: none; }

.tablist {
  display: flex;
  gap: var(--s-300);
  margin-bottom: var(--s-200);
  border-bottom: 1px solid var(--border);
}
.tab {
  appearance: none;
  margin: 0 0 -1px;
  padding: var(--s-75) 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--meta);
  font-family: var(--font-mono);
  font-size: var(--f--2);
  line-height: var(--lh-micro);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent-deep); border-bottom-color: var(--accent); }
.panel + .panel { margin-top: var(--s-300); }
.panel:focus-visible { outline-offset: 6px; }

/* ---------- faq: every technical answer, folded away ---------- */

.faq { max-width: 72ch; border-bottom: 1px solid var(--border); }
.qa { border-top: 1px solid var(--border); }
.qa summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-300);
  padding: var(--s-300) 0;
  list-style: none;
  cursor: pointer;
  font-variation-settings: 'opsz' 72, 'wght' 400;
  font-size: var(--f-2);
  line-height: var(--lh-head);
  letter-spacing: -0.01em;
  text-wrap: balance;
  transition: color var(--dur-fast) var(--ease);
}
/* Safari still draws the triangle from the shadow marker. */
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { color: var(--accent-deep); }
/* a brass plus and minus, not a chevron: it matches the section furniture */
.qa summary::after {
  content: "+";
  flex: none;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--f-0);
  font-variation-settings: normal;
  line-height: 1.3;
}
.qa[open] summary { color: var(--accent-deep); }
.qa[open] summary::after { content: "\2212"; }
.qa .answer {
  padding-bottom: var(--s-400);
  max-width: 60ch;
  color: var(--muted);
  font-size: var(--f--1);
  line-height: 1.7;
}
.qa .answer p + p { margin-top: var(--s-200); }
.qa .answer p code { font-family: var(--font-mono); font-size: 0.92em; color: var(--text); }
/* a <code> inside an ink command block keeps the block's cream, not the page's ink */
.code code { color: inherit; font: inherit; }
.qa .answer .snippet-label {
  display: block;
  margin: var(--s-400) 0 var(--s-75);
  color: var(--meta);
  font-weight: 400;
}
.qa .answer .code { max-width: 100%; }

/* ---------- card: the two doors ---------- */

.card {
  display: flex;
  flex-direction: column;
  gap: var(--s-200);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: var(--s-400);
}
.card h3 {
  font-variation-settings: 'opsz' 72, 'wght' 400;
  font-size: var(--f-2);
  line-height: var(--lh-head);
  letter-spacing: -0.01em;
}
.card .tag {
  display: block;
  margin-bottom: var(--s-100);
  color: var(--accent);
  font-weight: 500;
}
.card p {
  color: var(--muted);
  font-size: var(--f--1);
  line-height: var(--lh-body);
}
.card .spacer { flex: 1 1 auto; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-75);
  padding: var(--s-100) var(--s-300);
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  font-family: var(--font-sans);
  font-size: var(--f-0);
  line-height: 1.5;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent); background: var(--accent-wash); }
.btn-secondary:active { transform: scale(0.98); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---------- form ---------- */

.form { display: flex; flex-direction: column; gap: var(--s-75); }
.form label {
  color: var(--text);
  font-size: var(--f--1);
  line-height: 1.4;
  font-weight: 600;
}
.row { display: flex; flex-wrap: wrap; gap: var(--s-75); margin-top: var(--s-50); }
.row .btn, .row input[type="email"] { min-height: 50px; }
/* the field always takes the whole line inside a 5 column card, so the button
   lands on its own line below it and takes the whole line too */
.row .btn { flex: 1 1 auto; }
.row input[type="email"] { flex: 1 1 200px; }
input[type="email"] {
  flex: 1 1 180px;
  min-width: 0;
  padding: var(--s-100) var(--s-200);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--f--1);
  line-height: 1.5;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
input[type="email"]::placeholder { color: var(--meta); }
input[type="email"]:hover { border-color: var(--accent); }
input[type="email"]:focus { background: var(--surface); }
input[type="email"][aria-invalid="true"] { border-color: var(--accent); }
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.note { color: var(--meta); font-size: var(--f--2); line-height: 1.6; letter-spacing: 0; }
.msg {
  min-height: 1.4em;
  font-size: var(--f--1);
  line-height: 1.4;
  color: var(--muted);
}
.msg[data-state="ok"] { color: var(--accent-deep); }
.msg[data-state="error"] { color: var(--text); }

/* ---------- footer: the wordmark at full size, on ink ---------- */

.site-foot {
  border-top: 1px solid var(--border);
  padding: var(--s-800) 0 var(--s-500);
  background: var(--panel);
  color: var(--ink-meta);
}
.foot-mark {
  display: block;
  color: var(--ink);
  text-decoration: none;
}
.foot-mark svg {
  display: block;
  width: auto;
  height: clamp(32px, 8.4vw, 76px);
  /* the lockup is a drawing: let it run to the measure, not past it */
  max-width: 100%;
}
.foot-mark .glyph { stroke: var(--accent-hi); }
.foot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-200) var(--s-400);
  margin-top: var(--s-700);
  padding-top: var(--s-300);
  border-top: 1px solid var(--panel-rule);
  font-size: var(--f--1);
  line-height: 1.5;
}
.foot-meta { display: flex; flex-wrap: wrap; gap: var(--s-100) var(--s-300); }
.site-foot .ver { color: var(--ink-meta); font-weight: 400; }
.foot-nav { display: flex; flex-wrap: wrap; gap: var(--s-200) var(--s-400); }
.site-foot a { color: var(--ink-soft); text-decoration-color: rgba(246, 241, 230, 0.28); }
.site-foot a:hover { color: var(--ink); text-decoration-color: var(--accent-hi); }
.site-foot :focus-visible { outline-color: var(--accent-hi); }

/* ---------- motion ----------
   One authored moment, and it is the hero: the photograph settles and breathes
   while dust drifts in the light and the headline rises out of it. Everything
   else is a quiet entrance. All of it is skipped under reduced motion, and
   none of it hides anything before scripting runs. */

@media (prefers-reduced-motion: no-preference) {
  .hero-media img {
    animation: ken-burns 32s cubic-bezier(0.2, 0.6, 0.2, 1) both;
  }
  .hero-glow { animation: seam 11s ease-in-out infinite; }
  .hero h1     { animation: rise 1200ms var(--ease) 60ms both; }
  .hero .sub   { animation: rise 1200ms var(--ease) 220ms both; }
  /* the entrance sits on the two children, so the scroll parallax owns the
     transform on .hero-foot itself */
  .hero-meta   { animation: rise 1200ms var(--ease) 360ms both; }
  .hero-cue    { animation: rise 1200ms var(--ease) 420ms both; }
  .hero-cue::after { animation: drop 2600ms var(--ease) 1400ms infinite; }

  .js .reveal {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(3px);
    transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease),
                filter var(--dur-reveal) var(--ease);
  }
  .js .reveal.in { opacity: 1; transform: none; filter: none; }

  /* the tagline is scrubbed by scroll position, word by word, in the script */
  .js .tagline .w { opacity: 0.22; transition: opacity 90ms linear; }
}

@keyframes ken-burns {
  from { transform: scale(1.085); }
  to   { transform: scale(1); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes drop {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(5px); opacity: 0.45; }
}
@keyframes seam {
  0%, 100% { opacity: 0.40; }
  50%      { opacity: 0.95; }
}

/* With scripting off, or with reduced motion asked for, everything is at rest. */
@media (prefers-reduced-motion: reduce) {
  .js .tagline .w { opacity: 1; }
}

/* ---------- breakpoints ---------- */

@media (min-width: 701px) and (max-width: 959px) {
  .hero-veil {
    background:
      linear-gradient(to bottom,
        rgba(var(--veil), 0.72) 0,
        rgba(var(--veil), 0.58) 7%,
        rgba(var(--veil), 0.20) 20%,
        rgba(var(--veil), 0) 36%),
      linear-gradient(to bottom,
        rgba(var(--veil), 0) 70%,
        rgba(var(--veil), 0.45) 100%),
      linear-gradient(92deg,
        rgba(var(--veil), 0.94) 0,
        rgba(var(--veil), 0.91) 44%,
        rgba(var(--veil), 0.82) 62%,
        rgba(var(--veil), 0.38) 80%,
        rgba(var(--veil), 0.12) 100%);
  }
}

@media (min-width: 701px) {
  .hero-media img { object-position: 72% 52%; }
  .hero-inner { padding-bottom: var(--s-600); }
  /* the copy sits low in frame, with open sky above it and the foot line below */
  .hero-copy { margin-top: auto; margin-bottom: var(--s-600); max-width: min(100%, 38rem); }
  .hero-foot { margin-top: 0; }

  section { padding: var(--s-1000) 0; }
  .tagline { padding: var(--s-1100) 0; }
  .site-foot { padding: var(--s-900) 0 var(--s-600); }
  .point { padding: var(--s-500); }
  .card { padding: var(--s-500); }
}

@media (max-width: 700px) {
  /* The portrait crop puts the key in the lower half, so the copy takes the
     dark top, the key keeps the middle, and the foot line sits on the shaded
     floor at the bottom. */
  .hero-media img { object-position: 55% 50%; }
  .hero-glow {
    background: radial-gradient(46% 30% at 84% 27%,
      rgba(255, 199, 112, 0.24) 0%,
      rgba(252, 186, 92, 0.11) 42%,
      rgba(246, 176, 84, 0) 76%);
  }
  .hero-veil {
    background:
      linear-gradient(to bottom,
        rgba(var(--veil), 0.94) 0,
        rgba(var(--veil), 0.88) 44%,
        rgba(var(--veil), 0.82) 64%,
        rgba(var(--veil), 0.26) 76%,
        rgba(var(--veil), 0.72) 86%,
        rgba(var(--veil), 0.92) 100%);
  }
  .hero-inner { padding-top: calc(var(--head-h) + var(--s-300)); }
  /* the lede steps down one notch so the whole first screen still fits on a
     short phone, and the key keeps a clear band of its own */
  .hero .sub { font-size: var(--f-0); margin-top: var(--s-200); }
  .hero-copy { margin-bottom: auto; }
  .hero-foot { margin-top: var(--s-400); }
  .sec-head { margin-bottom: var(--s-500); }
  .point .num { top: var(--s-100); right: var(--s-200); }
}

@media (min-width: 680px) {
  :root { --gutter: var(--s-400); }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-600); }
  .points { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-400); }
  .doors { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); align-items: start; }
}

/* ---------- the twelve column grid ----------
   Everything below the hero lands on the same twelve tracks, and none of it
   lands symmetrically: each section is cut at a different column. */

@media (min-width: 960px) {
  :root { --head-h: 76px; --gutter: var(--s-500); --col-gap: var(--s-500); }

  section { padding: var(--s-1200) 0; }
  .tagline { padding: var(--s-1400) 0; }
  .site-foot { padding: var(--s-1000) 0 var(--s-600); }
  .sec-head { margin-bottom: var(--s-800); }

  .hero { padding: 0; }
  .hero-copy { max-width: min(100%, 66%); }
  .hero .sub { max-width: 42ch; }

  .split, .points, .doors {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
  }

  .split { row-gap: var(--s-600); }
  .statement { grid-column: 1 / span 6; max-width: 17ch; }
  .split-body { grid-column: 8 / span 5; }

  /* 7/5 then 5/7: the four plates mirror across the middle of the section */
  .points { row-gap: var(--s-500); }
  .point:nth-child(1) { grid-column: 1 / span 7; }
  .point:nth-child(2) { grid-column: 8 / span 5; }
  .point:nth-child(3) { grid-column: 1 / span 5; }
  .point:nth-child(4) { grid-column: 6 / span 7; }

  /* the open source door is the primary one, so it gets the wider track and
     the cards sit to their own content rather than stretching to match */
  .doors { align-items: start; }
  .door-primary { grid-column: 1 / span 7; }
  .door-soft { grid-column: 8 / span 5; }

  /* the pull quote starts one column in, and the questions stop three short
     of the right edge: the empty tracks are the point */
  .tagline .wrap > * { margin-left: 8.333%; }
  .faq { max-width: none; width: 75%; }
}

@media (min-width: 1200px) {
  .point { padding: var(--s-600) var(--s-600) var(--s-500); }
  .card { padding: var(--s-600); }
  .tagline p { max-width: 15ch; }
}

/* ND-17: API pages add an "API index" header link; keep the header inside 375px. Same block as the repo site (ND-14). */
@media (max-width: 480px) {
  .site-head .wrap { gap: var(--s-75); }
  .wordmark svg { height: 17px; }
  .head-link { padding: var(--s-75) var(--s-50, 4px); margin-right: 0; white-space: nowrap; }
  .head-link span[aria-hidden="true"] { display: none; }
}
