/* Big Brain landing page. Tokens come from tokens.css. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------------------------------------------------------------- hero */
.hero { display: grid; grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); gap: 56px; align-items: center;
  padding: 56px 0 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 28px; }
.brand img { width: 28px; height: 28px; }
.brand a, footer > span a { color: inherit; text-decoration: none; }
.brand a:hover, footer > span a:hover { color: var(--link); text-decoration: underline; }
.hero h1 { font-size: clamp(36px, 4.3vw, 60px); line-height: 1.05; letter-spacing: -.035em; font-weight: 700;
  margin: 0 0 20px; }
.hero h1 span { display: block; }
@media (min-width: 981px) { .hero h1 span { white-space: nowrap; } }
.hero h1 .accent { color: var(--accent); }
.lede { font-size: 19px; line-height: 1.5; color: var(--muted); max-width: 48ch; margin: 0 0 10px; }
.compat { font-size: 14px; color: var(--muted); margin: 0 0 28px; }
.compat strong { color: var(--text); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px;
  border-radius: 11px; font-size: 15.5px; font-weight: 600; text-decoration: none;
  transition: background-color var(--fast), border-color var(--fast), color var(--fast), box-shadow var(--fast); }
.btn.primary { background: var(--button); color: var(--button-text); border: 1px solid var(--button);
  box-shadow: 0 1px 2px rgba(31, 29, 26, .08), 0 6px 18px rgba(91, 75, 214, .22); }
.btn.primary:hover { background: var(--button-hover); border-color: var(--button-hover); }
.btn.secondary { color: var(--text); border: 1px solid var(--line-strong); background: var(--panel); }
.btn.secondary:hover { border-color: var(--accent); color: var(--link); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.meta { font-size: 13px; color: var(--muted); margin: 0; }
.meta span + span::before { content: "·"; margin: 0 8px; }

/* The shared-memory demo: two agents, one memory. Static except one gentle draw of the links. */
.demo { position: relative; isolation: isolate; margin: 0; display: grid; gap: 0; max-width: 500px; justify-self: end; width: 100%; }
.demo::before { content: ""; position: absolute; inset: -12% -14% -10% -14%; z-index: -1;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 72%); }
.agent-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--muted); }
.agent { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 9px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line-strong); color: var(--text); font-weight: 600; font-size: 13px;
  box-shadow: var(--shadow); }
.agent i { width: 8px; height: 8px; border-radius: 50%; background: #d97757; }
/* The two agent chips: four labels stacked in one cell each (as wide as the longest, so nothing
   shifts). Slot 1 is the static design (Claude Code writes, Codex reads); with the spark running
   the pair rotates round the ring, one pair per spark cycle. Each agent keeps its own dot. */
.agent.ring { padding-left: 12px; }
.agent.ring .names { display: grid; }
.agent.ring .rn { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 7px; }
.agent.ring .rs2, .agent.ring .rs3, .agent.ring .rs4 { opacity: 0; }
.ag-claude i { background: #d97757; }
.ag-codex i { background: #10a37f; }
.ag-grok i { background: #71717a; }
.ag-copilot i { background: #2f81f7; }
@media (prefers-color-scheme: dark) { .ag-grok i { background: #a1a1aa; } }
.agent-row code { font-family: var(--mono); font-size: 12px; color: var(--link); background: none; padding: 0; white-space: nowrap; }
.link { height: 26px; margin-left: 32px; border-left: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  transform-origin: top; }
.memory { position: relative; z-index: 2; background: var(--panel); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 14px; padding: 16px 18px 15px; box-shadow: 0 10px 34px rgba(91, 75, 214, .12); }
.memory-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.memory-head img { width: 20px; height: 20px; }
.memory-head .count { margin-left: auto; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--link);
  background: var(--accent-soft); border-radius: 999px; padding: 1px 9px; }
.memory h3 { font-size: 17px; line-height: 1.3; letter-spacing: -.01em; margin: 0 0 6px; }
.memory .entry-meta { font: 12.5px/1.5 var(--mono); color: var(--muted); margin: 0 0 8px; }
.memory .entry-meta .kind { color: var(--ok); font-weight: 600; }
.memory .entry-body { font-size: 14px; line-height: 1.5; color: var(--text); margin: 0; }
.memory .entry-body code { font-size: 12.5px; }
.terminal { position: relative; z-index: 2; margin-top: 12px; border-radius: 12px; background: var(--term-bg); border: 1px solid var(--term-line);
  box-shadow: 0 12px 32px rgba(15, 14, 19, .22); overflow: hidden; }
.term-bar { display: flex; gap: 6px; padding: 10px 12px 0; }
.term-bar span { width: 9px; height: 9px; border-radius: 50%; background: #3b3944; }
.terminal pre { margin: 0; padding: 10px 16px 14px; border: 0; background: none; color: var(--term-text);
  font: 12.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.t-p { color: var(--term-purple); } .t-d { color: var(--term-dim); } .t-g { color: var(--term-green); }
.t-c { color: var(--term-cyan); } .t-b { font-weight: 700; }
.agent-row { position: relative; z-index: 2; }
.t-hit { display: block; position: relative; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; }
.t-caret { display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -2px;
  background: var(--term-text); opacity: 0; }
.spark { position: absolute; left: 0; top: 0; z-index: 1; width: 13px; height: 13px; margin: -6.5px 0 0 -5.5px; border-radius: 50%;
  background: var(--spark); border: 1.5px solid #fff6dc;
  box-shadow: 0 0 0 5px rgba(255, 211, 110, .3), 0 0 24px 8px rgba(255, 211, 110, .6);
  opacity: 0; pointer-events: none; }
.memory::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 2px rgba(255, 211, 110, .8), 0 0 30px 6px rgba(255, 211, 110, .3); }
.t-hit::before { content: ""; position: absolute; inset: -2px -10px; border-radius: 6px; opacity: 0;
  background: rgba(255, 211, 110, .13); box-shadow: inset 2px 0 0 #ffd36e; }

/* ---------------------------------------------------------------- hero animation
   One variant, chosen at build time (data-anim on the hero; build.sh GIGABRAIN_HERO_ANIM):
     current  the connectors draw once, then everything is still (CSS only, no controls)
     spark    a gold spark carries the entry from Claude Code into memory and on to Codex, every 7 s
     story    the whole exchange replays: record, the entry appears, Codex types the search, the result
     breathe  the glow behind the picture slowly pulses
   The moving variants run only once hero.js has added .anim-on, so without JavaScript the picture is
   the static design. The base styles ARE the final state: Stop just removes the animations.
   Only transform and opacity animate. */
.hero[data-anim="current"] .link { animation: draw 700ms ease-out both; }
.hero[data-anim="current"] .link.second { animation-delay: 350ms; }
@keyframes draw { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* spark: one gold dot. Where offset-path is supported (motion.js measures the connectors and sets
   --spark-path), it rides from Claude Code to the terminal in one eased journey, gliding under the
   memory card, and fades/grows in and out softly; elsewhere it falls back to steps. */
.hero.anim-on[data-anim="spark"]:not(.stopped) .memory::after { animation: spark-card 7s ease-in-out infinite; }
.hero.anim-on[data-anim="spark"]:not(.stopped) .t-hit::before { animation: spark-hit 7s ease-in-out infinite; }
@keyframes spark-card { 0%, 12% { opacity: 0; } 16.5% { opacity: 1; } 21% { opacity: 1; } 32%, 100% { opacity: 0; } }
@keyframes spark-hit { 0%, 38% { opacity: 0; } 42.5% { opacity: 1; } 50% { opacity: 1; } 62%, 100% { opacity: 0; } }
/* The pair rotates over 28 s: exactly four spark cycles on the same timeline (started together by
   .anim-on, paused and stopped together), so it never drifts from the spark. Each swap is a 250 ms
   cross-fade at 75% of a cycle, while the spark is resting. Both chips use the same slot timing. */
.hero.anim-on[data-anim="spark"]:not(.stopped) .agent.ring .rs1 { animation: ring-1 28s linear infinite; }
.hero.anim-on[data-anim="spark"]:not(.stopped) .agent.ring .rs2 { animation: ring-2 28s linear infinite; }
.hero.anim-on[data-anim="spark"]:not(.stopped) .agent.ring .rs3 { animation: ring-3 28s linear infinite; }
.hero.anim-on[data-anim="spark"]:not(.stopped) .agent.ring .rs4 { animation: ring-4 28s linear infinite; }
@keyframes ring-1 { 0%, 18.75% { opacity: 1; } 19.64%, 93.75% { opacity: 0; } 94.64%, 100% { opacity: 1; } }
@keyframes ring-2 { 0%, 18.75% { opacity: 0; } 19.64%, 43.75% { opacity: 1; } 44.64%, 100% { opacity: 0; } }
@keyframes ring-3 { 0%, 43.75% { opacity: 0; } 44.64%, 68.75% { opacity: 1; } 69.64%, 100% { opacity: 0; } }
@keyframes ring-4 { 0%, 68.75% { opacity: 0; } 69.64%, 93.75% { opacity: 1; } 94.64%, 100% { opacity: 0; } }
@keyframes spark-fade {
  0%, 3% { opacity: 0; transform: scale(.4); }
  6% { opacity: 1; transform: scale(1); }
  39% { opacity: 1; transform: scale(1); }
  43%, 100% { opacity: 0; transform: scale(.55); }
}
@supports (offset-path: path("M0 0H1")) {
  .spark { margin: 0; offset-path: var(--spark-path, path("M33 0 V300")); offset-rotate: 0deg; offset-anchor: 50% 50%;
    offset-distance: 0%; }
  .hero.anim-on[data-anim="spark"]:not(.stopped) .spark {
    animation: spark-ride 7s linear infinite, spark-fade 7s ease-in-out infinite; }
  /* One continuous eased journey: it glides under the card without stopping, so there are no joints. */
  @keyframes spark-ride {
    0%, 3% { offset-distance: 0%; animation-timing-function: cubic-bezier(.45, 0, .25, 1); }
    42%, 100% { offset-distance: 100%; }
  }
}
@supports not (offset-path: path("M0 0H1")) {
  .hero.anim-on[data-anim="spark"]:not(.stopped) .spark { animation: spark-move 7s linear infinite; }
  @keyframes spark-move {
    0% { transform: translate3d(var(--sx, 33px), var(--y0, 0px), 0); opacity: 0; }
    3% { opacity: 1; }
    16% { transform: translate3d(var(--sx, 33px), var(--y1, 40px), 0); }
    30% { transform: translate3d(var(--sx, 33px), var(--y2, 200px), 0); }
    44% { transform: translate3d(var(--sx, 33px), var(--y3, 280px), 0); opacity: 1; }
    48%, 100% { transform: translate3d(var(--sx, 33px), var(--y3, 280px), 0); opacity: 0; }
  }
}

/* story */
.hero.anim-on[data-anim="story"]:not(.stopped) .a-record { animation: st-record 11s ease-out infinite; }
.hero.anim-on[data-anim="story"]:not(.stopped) .link { animation: st-link1 11s ease-out infinite; }
.hero.anim-on[data-anim="story"]:not(.stopped) .link.second { animation-name: st-link2; }
.hero.anim-on[data-anim="story"]:not(.stopped) .memory { animation: st-card 11s cubic-bezier(.2, .8, .2, 1) infinite; }
.hero.anim-on[data-anim="story"]:not(.stopped) .memory .count { animation: st-count 11s ease-out infinite; }
.hero.anim-on[data-anim="story"]:not(.stopped) .a-codex { animation: st-codex 11s ease-out infinite; }
.hero.anim-on[data-anim="story"]:not(.stopped) .terminal { animation: st-term 11s ease-out infinite; }
.hero.anim-on[data-anim="story"]:not(.stopped) .t-cmd .ch { animation: st-char 11s linear infinite backwards; }
.hero.anim-on[data-anim="story"]:not(.stopped) .t-caret { animation: st-caret 11s linear infinite; }
.hero.anim-on[data-anim="story"]:not(.stopped) .t-count { animation: st-count-line 11s ease-out infinite; }
.hero.anim-on[data-anim="story"]:not(.stopped) .t-hit { animation: st-hit 11s ease-out infinite; }
.t-count { display: inline-block; }
@keyframes st-record { 0% { opacity: 0; transform: translateY(6px); } 5%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes st-link1 { 0%, 5% { transform: scaleY(0); } 9%, 90% { transform: scaleY(1); opacity: 1; } 97%, 100% { transform: scaleY(1); opacity: 0; } }
@keyframes st-card { 0%, 8% { opacity: 0; transform: translateY(10px) scale(.98); } 15%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes st-count { 0%, 15% { opacity: 0; transform: scale(.6); } 19% { opacity: 1; transform: scale(1.12); } 22%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes st-link2 { 0%, 22% { transform: scaleY(0); } 26%, 90% { transform: scaleY(1); opacity: 1; } 97%, 100% { transform: scaleY(1); opacity: 0; } }
@keyframes st-codex { 0%, 25% { opacity: 0; transform: translateY(6px); } 29%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes st-term { 0%, 28% { opacity: 0; transform: translateY(8px); } 32%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes st-char { 0%, 33% { opacity: 0; } 33.3%, 92% { opacity: 1; } 96%, 100% { opacity: 0; } }
/* The caret travels with the typing: each character shows it for its own 55 ms, then the end
   caret holds until the result appears. */
.t-cmd .ch { position: relative; }
.t-cmd .ch::after { content: ""; position: absolute; left: 100%; top: .12em; bottom: .02em; width: 7px; margin-left: 1px;
  background: var(--term-text); opacity: 0; }
.hero.anim-on[data-anim="story"]:not(.stopped) .t-cmd .ch::after { animation: st-char-caret 11s linear infinite backwards;
  animation-delay: inherit; }
@keyframes st-char-caret { 0%, 33.29% { opacity: 0; } 33.3%, 33.79% { opacity: 1; } 33.8%, 100% { opacity: 0; } }
@keyframes st-caret { 0%, 48.3% { opacity: 0; } 48.4%, 52% { opacity: 1; } 52.1%, 100% { opacity: 0; } }
@keyframes st-count-line { 0%, 51% { opacity: 0; transform: translateY(3px); } 54%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes st-hit { 0%, 54% { opacity: 0; transform: translateY(6px); } 59%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
.t-cmd .ch:nth-child(1) { animation-delay: 0ms !important; }
.t-cmd .ch:nth-child(2) { animation-delay: 55ms !important; }
.t-cmd .ch:nth-child(3) { animation-delay: 110ms !important; }
.t-cmd .ch:nth-child(4) { animation-delay: 165ms !important; }
.t-cmd .ch:nth-child(5) { animation-delay: 220ms !important; }
.t-cmd .ch:nth-child(6) { animation-delay: 275ms !important; }
.t-cmd .ch:nth-child(7) { animation-delay: 330ms !important; }
.t-cmd .ch:nth-child(8) { animation-delay: 385ms !important; }
.t-cmd .ch:nth-child(9) { animation-delay: 440ms !important; }
.t-cmd .ch:nth-child(10) { animation-delay: 495ms !important; }
.t-cmd .ch:nth-child(11) { animation-delay: 550ms !important; }
.t-cmd .ch:nth-child(12) { animation-delay: 605ms !important; }
.t-cmd .ch:nth-child(13) { animation-delay: 660ms !important; }
.t-cmd .ch:nth-child(14) { animation-delay: 715ms !important; }
.t-cmd .ch:nth-child(15) { animation-delay: 770ms !important; }
.t-cmd .ch:nth-child(16) { animation-delay: 825ms !important; }
.t-cmd .ch:nth-child(17) { animation-delay: 880ms !important; }
.t-cmd .ch:nth-child(18) { animation-delay: 935ms !important; }
.t-cmd .ch:nth-child(19) { animation-delay: 990ms !important; }
.t-cmd .ch:nth-child(20) { animation-delay: 1045ms !important; }
.t-cmd .ch:nth-child(21) { animation-delay: 1100ms !important; }
.t-cmd .ch:nth-child(22) { animation-delay: 1155ms !important; }
.t-cmd .ch:nth-child(23) { animation-delay: 1210ms !important; }
.t-cmd .ch:nth-child(24) { animation-delay: 1265ms !important; }
.t-cmd .ch:nth-child(25) { animation-delay: 1320ms !important; }
.t-cmd .ch:nth-child(26) { animation-delay: 1375ms !important; }
.t-cmd .ch:nth-child(27) { animation-delay: 1430ms !important; }
.t-cmd .ch:nth-child(28) { animation-delay: 1485ms !important; }
.t-cmd .ch:nth-child(29) { animation-delay: 1540ms !important; }
.t-cmd .ch:nth-child(30) { animation-delay: 1595ms !important; }
.t-cmd .ch:nth-child(31) { animation-delay: 1650ms !important; }
.t-cmd .ch:nth-child(32) { animation-delay: 1705ms !important; }
.t-cmd .ch:nth-child(33) { animation-delay: 1760ms !important; }
.t-cmd .ch:nth-child(34) { animation-delay: 1815ms !important; }
.t-cmd .ch:nth-child(35) { animation-delay: 1870ms !important; }
.t-cmd .ch:nth-child(36) { animation-delay: 1925ms !important; }
.t-cmd .ch:nth-child(37) { animation-delay: 1980ms !important; }
.t-cmd .ch:nth-child(38) { animation-delay: 2035ms !important; }
.t-cmd .ch:nth-child(39) { animation-delay: 2090ms !important; }
.t-cmd .ch:nth-child(40) { animation-delay: 2145ms !important; }
.t-cmd .ch:nth-child(41) { animation-delay: 2200ms !important; }
.t-cmd .ch:nth-child(42) { animation-delay: 2255ms !important; }
.t-cmd .ch:nth-child(43) { animation-delay: 2310ms !important; }
.t-cmd .ch:nth-child(44) { animation-delay: 2365ms !important; }
.t-cmd .ch:nth-child(45) { animation-delay: 2420ms !important; }
.t-cmd .ch:nth-child(46) { animation-delay: 2475ms !important; }
.t-cmd .ch:nth-child(47) { animation-delay: 2530ms !important; }
.t-cmd .ch:nth-child(48) { animation-delay: 2585ms !important; }

/* breathe */
.hero.anim-on[data-anim="breathe"]:not(.stopped) .demo::before { animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .5; transform: scale(.95); } 50% { opacity: 1; transform: scale(1.05); } }

/* hero controls sit under the picture (shared look in motion.css) */
.demo .anim-controls { right: 0; bottom: -40px; }

/* ---------------------------------------------------------------- why */
.why { margin: 0 0 44px; }
.why-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.why-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow); min-width: 0; }
.why-ico { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--accent-soft);
  fill: none; stroke: var(--link); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; display: block; margin-bottom: 12px; }
.why-card h3 { font-size: 15.5px; margin: 0 0 6px; letter-spacing: -.01em; }
.why-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
@media (min-width: 981px) { .why-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .why-card { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; padding: 14px 16px; }
  .why-ico { grid-row: span 2; margin: 2px 0 0; }
  .why-card h3 { margin-top: 4px; }
}

/* ---------------------------------------------------------------- architecture (diagram.css styles the picture) */
.arch { margin: 0 0 52px; }
.arch-lede { font-size: clamp(19px, 2vw, 24px); font-weight: 650; letter-spacing: -.015em; margin: 0 0 18px; }

/* ---------------------------------------------------------------- install */
.install { scroll-margin-top: 24px; }
.section-title { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--link); margin: 0 0 14px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.step { counter-increment: step; position: relative; min-width: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px 18px 66px; box-shadow: var(--shadow); }
.step::before { content: counter(step); position: absolute; left: 22px; top: 21px; width: 28px; height: 28px;
  display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--link);
  font-weight: 700; font-size: 13.5px; }
.step h2 { font-size: 17px; margin: 1px 0 6px; letter-spacing: -.01em; }
.step p { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.step .fine { font-size: 14px; margin-bottom: 2px; }
.step details { margin: -4px 0 8px; font-size: 14px; color: var(--muted); }
.step details summary { cursor: pointer; color: var(--link); width: fit-content; }
.step details ul { margin: 6px 0 4px; padding-left: 20px; }
.step details li { margin: 3px 0; }

/* Code: blocks scroll inside themselves, with a soft shadow at an edge that has more to show. */
code { background: var(--well); padding: 1px 6px; border-radius: 5px; font-size: .88em; font-family: var(--mono); }
pre { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; max-width: 100%;
  font-size: 13.5px; line-height: 1.55; margin: 10px 0 12px;
  background:
    linear-gradient(to right, var(--well) 30%, transparent) left center / 28px 100% no-repeat local,
    linear-gradient(to left, var(--well) 30%, transparent) right center / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .16), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .16), transparent) right center / 12px 100% no-repeat scroll,
    var(--well); }
pre code { background: none; padding: 0; font-size: inherit; }
.step pre { white-space: pre; }
.codebox { position: relative; min-width: 0; max-width: 100%; }
.codebox pre { padding-right: 76px; }
.codebox .copy { position: absolute; top: 8px; right: 8px; }

/* ---------------------------------------------------------------- buttons */
button { font: inherit; font-size: 14.5px; font-weight: 600; padding: 9px 16px; border-radius: 9px;
  border: 1px solid var(--button); background: var(--button); color: var(--button-text); cursor: pointer;
  transition: background-color var(--fast), border-color var(--fast), color var(--fast), opacity var(--fast); }
button:hover { background: var(--button-hover); border-color: var(--button-hover); }
button:disabled, button[aria-busy="true"] { opacity: .6; cursor: progress; }
button.quiet { background: transparent; color: var(--link); border-color: var(--line-strong); }
button.quiet:hover { border-color: var(--link); background: transparent; }
button.copy { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 7px; background: var(--panel);
  color: var(--muted); border: 1px solid var(--line-strong); }
button.copy:hover { color: var(--text); border-color: var(--muted); background: var(--panel); }
button.copy.done { color: var(--ok); border-color: var(--ok); }

/* ---------------------------------------------------------------- guide */
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 48px; padding: 56px 0 80px; }
.toc { position: sticky; top: 24px; align-self: start; font-size: 14px; max-height: calc(100vh - 48px); overflow: auto; }
/* Wide screens show the list beside the guide; narrow ones a closed disclosure. Two renders of the
   same list, picked by CSS, so nothing flashes open or closed while the page loads. */
.toc-narrow { display: none; }
.toc-label, .toc summary { list-style: none; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px; cursor: default; }
.toc summary::-webkit-details-marker { display: none; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc ul ul { padding-left: 12px; }
.toc a { color: var(--muted); text-decoration: none; display: block; padding: 3px 0 3px 10px; border-left: 2px solid transparent;
  transition: color var(--fast), border-color var(--fast); }
.toc a:hover { color: var(--text); border-left-color: var(--accent); }
main { min-width: 0; max-width: 760px; }
main h2 { font-size: 25px; letter-spacing: -.015em; margin: 52px 0 12px; padding-top: 10px; border-top: 1px solid var(--line); }
main > h2:first-of-type { margin-top: 28px; }
main h3 { font-size: 18px; margin: 28px 0 6px; }
main hr { display: none; }
main li { margin: 3px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; margin: 14px 0; display: block; overflow-x: auto; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
footer { border-top: 1px solid var(--line); padding: 22px 0 44px; font-size: 13px; color: var(--muted);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--link); text-decoration: underline; }

/* ---------------------------------------------------------------- smaller screens */
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 36px 0 48px; }
  .demo { justify-self: start; max-width: 560px; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 36px; }
  .toc-wide { display: none; }
  .toc-narrow { display: block; }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 16px; background: var(--panel); margin-bottom: 8px; }
  .toc summary { cursor: pointer; margin: 0; }
  .toc summary::after { content: " ▾"; }
  .toc[open] summary { margin-bottom: 8px; }
  .toc[open] summary::after { content: " ▴"; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .hero { padding-top: 24px; gap: 32px; }
  .brand { margin-bottom: 18px; }
  .hero h1 { margin-bottom: 14px; }
  .lede { font-size: 17.5px; }
  .compat { margin-bottom: 20px; }
  .actions .btn { flex: 1 1 auto; }
  .step { padding: 18px 18px 14px; }
  .step::before { left: 18px; top: 17px; }
  .step h2 { margin: 2px 0 10px 40px; }
  .codebox pre { padding: 42px 14px 12px; }
  .codebox .copy { top: 7px; right: 7px; }
}
