/* Art direction shared with the Omniscient site: near-black ground, cyan to
   violet light, tight sans-serif headings, monospace eyebrows and HUD text. */

:root {
  color-scheme: dark;
  --radius-panel: 18px;
  --radius-control: 12px;
  --radius-small: 6px;
  --bg: #050507;
  --fg: #f0f0f5;
  --muted: #9696a5;
  --line: #ffffff16;
  --cyan: #82e9ff;
  --purple: #b7a0ff;
  --card: #ffffff05;
  --glass-line: #ffffff17;
  /* the frosted panels: each one is blurred again whenever the 3D behind it
     moves, and the cost grows with the radius */
  --glass-blur: blur(14px);
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.repo-unavailable { opacity: .5; cursor: default; }
button { font: inherit; color: inherit; cursor: pointer; }
code { font-family: var(--mono); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }
.skip { color: #000; z-index: 100; background: #fff; padding: 15px; position: fixed; top: -100px; }
.skip:focus { top: 10px; }
[hidden] { display: none !important; }

/* ---------- 3D layer ---------- */

/* Two layers, both placed by scene.js with a transform: the lights (still CSS
   gradients) and, over them, the canvas, only as large as the shape. */
#scene, .scene-lights {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  display: block;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform, opacity;
}
.scene-lights { transform-origin: 50% 50%; }
.stage-fallback { display: none; position: absolute; left: 50%; top: 50%; width: 76%; max-width: 300px; transform: translate(-50%, -50%); opacity: .8; filter: drop-shadow(0 0 30px #9b7eff55); }
.no-webgl .stage-fallback { display: block; }

/* ---------- nav ---------- */

.nav {
  border-bottom: 1px solid var(--line);
  justify-content: space-between;
  align-items: center;
  height: 72px;
  padding: 0 max(45px, calc((100% - 1320px) / 2 + 45px));
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #05050759;
  backdrop-filter: blur(18px) saturate(140%);
}
.logo { letter-spacing: -.7px; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; display: flex; }
.logo-icon { width: 24px; height: 24px; filter: drop-shadow(0 0 10px #a7b6ff55); }
.alpha { color: #b4b6c4; border: 1px solid #ffffff25; border-radius: var(--radius-small); margin-left: 4px; padding: 4px 6px; font: 10px var(--mono); }
.nav nav { color: var(--muted); gap: 32px; font-size: 12px; display: flex; }
.nav nav a:hover { color: #fff; }
.github { background: #ffffff0a; border: 1px solid var(--glass-line); border-radius: 999px; padding: 10px 16px; font-size: 11px; }
.github { transition: background .2s, box-shadow .2s; }
.github span { margin-left: 16px; }

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

main { position: relative; z-index: 1; }
.hero {
  text-align: center;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  max-width: 1320px;
  margin: auto;
  padding: 60px 30px 0;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  z-index: -1;
  background-image: linear-gradient(#ffffff05 1px, #0000 1px), linear-gradient(90deg, #ffffff05 1px, #0000 1px);
  background-size: 72px 72px;
  position: absolute;
  inset: 0;
  mask-image: linear-gradient(#000, #0000 90%);
}

h1 { letter-spacing: -6px; margin: 32px 0 23px; font-size: clamp(66px, 7.8vw, 108px); font-weight: 600; line-height: 1.02; }
h1 span { color: #0000; background: linear-gradient(110deg, #fff 10%, #b5c9ff 55%, #b78de6 90%) text; -webkit-background-clip: text; }
.hero-copy { color: var(--muted); max-width: 460px; margin: 0 auto 15px; font-size: 17px; line-height: 1.7; }

.actions { justify-content: center; align-items: center; gap: 12px; display: flex; flex-wrap: wrap; }
.primary, .secondary { border-radius: 999px; justify-content: center; align-items: center; gap: 26px; padding: 13px 20px; font-size: 12px; display: inline-flex; transition: background .2s, box-shadow .2s; }
.primary { color: #111; background: #ededf2; border: 1px solid #fff; box-shadow: 0 0 25px #ffffff08; }
.primary:hover { background: #fff; box-shadow: 0 0 25px #ffffff20; }
.secondary, .github { background: #ffffff0a; border: 1px solid var(--glass-line); backdrop-filter: blur(14px); }
.secondary:hover, a.github:hover { background: #ffffff14; }

/* The stage is an empty box: the WebGL core is drawn behind it, centred on it. */
.stage { width: 640px; max-width: 100%; height: 420px; margin: 0 auto; position: relative; }
.hero .stage:after { content: ''; background: #aacaff; height: 1px; position: absolute; bottom: 23px; left: 30%; right: 30%; box-shadow: 0 0 20px 4px #9b7eff44; }

.horizon {
  background-image: linear-gradient(#9d98f712 1px, #0000 1px), linear-gradient(90deg, #9d98f712 1px, #0000 1px);
  background-size: 45px 30px;
  border-top: 1px solid #b6a4ff35;
  height: 80px;
  position: absolute;
  bottom: 0;
  left: -250px;
  right: -250px;
  transform: perspective(250px) rotateX(55deg);
  box-shadow: 0 -15px 100px #9279ff1f;
  mask-image: linear-gradient(#0000, #000 10%, #0000);
}

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

.section { border-bottom: 1px solid var(--line); max-width: 1120px; margin: 0 auto; padding: 100px 0; }
.section:last-child { border-bottom: 0; }
.section-heading { justify-content: space-between; align-items: end; gap: 60px; margin-bottom: 40px; display: flex; }
.eyebrow { letter-spacing: 1.5px; color: #a9abbb; margin: 0 0 20px; font: 10px/1.6 var(--mono); }
h2 { letter-spacing: -1.8px; margin: 0; font-size: 44px; font-weight: 500; line-height: 1.12; }
.section-heading > p { max-width: 355px; color: var(--muted); margin: 0; font-size: 14px; line-height: 1.8; }
.fine { color: #9a9cad; max-width: 850px; margin: 0; font: 11px/1.8 var(--mono); }

/* Shared page typography: descriptions, supporting text, metadata and labels. */
:is(.home, .tool-page) {
  --text-body: 16px;
  --text-secondary: 14px;
  --text-meta: 12px;
  --text-label: 11px;
}
:is(.home, .tool-page) .overview-heading > p:last-child,
:is(.home, .tool-page) .overview-facts dd,
:is(.home, .tool-page) .section-heading > p,
:is(.home, .tool-page) .tool-card .line,
:is(.home, .tool-page) .tool-card p.body,
:is(.home, .tool-page) .receipt p,
:is(.home, .tool-page) .flow-description,
:is(.home, .tool-page) .flow-detail,
:is(.home, .tool-page) .start > p:not(.eyebrow) { font-size: var(--text-body); line-height: 1.7; }
:is(.home, .tool-page) .overview-facts dt { font-size: var(--text-body); line-height: 1.5; }
:is(.home, .tool-page) .hero-copy { font-size: 18px; }
:is(.home, .tool-page) .nav nav,
:is(.home, .tool-page) .github,
:is(.home, .tool-page) .primary,
:is(.home, .tool-page) .secondary,
:is(.home, .tool-page) .tool-links,
:is(.home, .tool-page) .command button,
:is(.home, .tool-page) footer { font-size: var(--text-secondary); }
:is(.home, .tool-page) .tool-card .cmd,
:is(.home, .tool-page) .receipt pre,
:is(.home, .tool-page) .command code { font-size: 13px; }
:is(.home, .tool-page) .tool-card .note,
:is(.home, .tool-page) .start > small,
:is(.home, .tool-page) footer > span { font-size: var(--text-meta); line-height: 1.7; }
:is(.home, .tool-page) .eyebrow,
:is(.home, .tool-page) .flow-card small,
:is(.home, .tool-page) .tool-card small,
:is(.home, .tool-page) .receipt small,
:is(.home, .tool-page) .status { font-size: var(--text-label); line-height: 1.6; }
:is(.home, .tool-page) .tool-card > div:first-child { flex-wrap: wrap; gap: 10px; }
/* Let larger explanations determine their panel height without clipping. */
:is(.home, .tool-page) .flow-back { bottom: auto; min-height: calc(100% + 2 * var(--flow-inset-y)); }

/* Tool-specific components use the same typography scale. */
.tool-page .family-card p,
.tool-page .bento p,
.tool-page .session-example p:not(.eyebrow),
.tool-page .layer p,
.tool-page .split-text,
.tool-page .facts .v,
.tool-page .facts .v small,
.tool-page .queries span,
.tool-page .keys dd,
.tool-page .install-note,
.tool-page .spec { font-size: var(--text-body); line-height: 1.7; }
.tool-page .terminal-caption,
.tool-page .inline-link,
.tool-page .family-link,
.tool-page .capture-tabs button,
.tool-page .install-head button { font-size: var(--text-secondary); line-height: 1.7; }
.tool-page .fine,
.tool-page .terminal-header,
.tool-page .stat-row { font-size: var(--text-meta); line-height: 1.7; }
.tool-page .family-card small,
.tool-page .family-card .chip,
.tool-page .layer small,
.tool-page .facts .k,
.tool-page .spec thead th,
.tool-page .alpha,
.tool-page .install-head { font-size: var(--text-label); line-height: 1.6; }
.tool-page .family-cmd,
.tool-page .layer pre,
.tool-page .queries code,
.tool-page .keys kbd,
.tool-page .layer kbd,
.tool-page .spec tbody th code,
.tool-page .install pre,
.tool-page .session-example pre,
.tool-page .tui { font-size: 13px; }
.tool-page .family-card { min-width: 0; }
.tool-page .family-card > div { flex-wrap: wrap; gap: 10px; }

.tool-page .capture-tabs { max-width: 100%; flex-wrap: wrap; border-radius: var(--radius-panel); }
.tool-page .terminal-header { flex-wrap: wrap; gap: 8px 16px; }
.tool-page .terminal-header code { overflow-wrap: anywhere; }
.tool-page .terminal-body { min-width: 0; }
.tool-page .session-example { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.tool-page .layer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (width <= 950px) {
  .tool-page .layer-grid { grid-template-columns: 1fr; }
}
@media (width <= 600px) {
  .tool-page .session-example { grid-template-columns: minmax(0, 1fr); }
  .tool-page .capture-tabs button { padding: 9px 12px; }
}

/* Home hero and introduction. */
:is(.home, .tool-page) .hero { padding-top: 48px; padding-bottom: 64px; border-bottom: 0; }
:is(.home, .tool-page) .hero-grid { mask-image: linear-gradient(#000 60%, #0000); }
:is(.home, .tool-page) .hero h1 { margin: 12px 0 20px; }
:is(.home, .tool-page) .hero-copy { max-width: 560px; margin-bottom: 26px; }
:is(.home, .tool-page) .hero .stage { height: 300px; }
.overview { display: grid; grid-template-columns: 1fr 1.2fr; gap: 80px; padding-top: 56px; padding-bottom: 56px; }
.overview-heading .eyebrow { margin-bottom: 14px; }
.overview-heading h2 { font-size: 32px; letter-spacing: -1px; }
.overview-heading > p:last-child { color: var(--muted); max-width: 350px; margin: 16px 0 0; font-size: 14px; line-height: 1.8; }
.overview-facts { display: grid; gap: 22px; margin: 0; }
.overview-facts > div { border-left: 1px solid var(--glass-line); padding-left: 22px; }
.overview-facts dt { font-size: 13px; font-weight: 500; }
.overview-facts dd { color: var(--muted); margin: 7px 0 0; font-size: 12px; line-height: 1.7; }

/* frosted glass: the lights show through. Blurring a smooth glow changes
   nothing a reader can see, and redoing it on every frame is what made
   scrolling slow, so only a panel over the 3D's square is blurred: page.js
   gives it .over-3d while the square is under it. */
.glass {
  border-radius: var(--radius-panel);
  position: relative;
  background: linear-gradient(135deg, #ffffff0f, #ffffff03 55%), #0a0b1033;
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 #ffffff1c, 0 30px 80px -40px #000d;
}
.glass:after, .flow-back:after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -20%), #ffffff0d, #0000 60%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.glass:hover:after, .flow-back:hover:after { opacity: 1; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* stages of the later sections: empty room for the scene */
.stage-start { height: 300px; margin: -60px auto 60px; }
.start .stage-start { width: 100%; }

/* pipeline (flow) */
.flow-cards { --flow-inset-y: 30px; --flow-inset-x: 24px; display: grid; grid-template-columns: repeat(var(--flow-columns, 5), minmax(0, 1fr)); border-radius: var(--radius-panel); }
.flow-cards + .fine { margin-top: calc(var(--flow-inset-y, 30px) + 28px); }
.flow-card { position: relative; min-width: 0; height: 330px; padding: 0; border: 0; border-radius: var(--radius-control); background: none; text-align: left; }
.flow-card[aria-expanded="true"] { z-index: 3; }
.flow-card-inner { display: block; position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.22, 1, .36, 1); }
.flow-card[aria-expanded="true"] .flow-card-inner { transform: translateY(-3px); }
.flow-front, .flow-back { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 26px 22px; }
.flow-front { justify-content: center; border-right: 1px solid var(--line); background: radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--tc) 6%, transparent), transparent 75%); transition: opacity .35s ease, visibility 0s; }
.flow-card:last-child .flow-front { border-right: 0; }
.flow-glyph { color: var(--tc); font: 30px var(--mono); margin-bottom: 35px; text-shadow: 0 0 18px color-mix(in srgb, var(--tc) 50%, transparent); }
.flow-card small { color: #a9abbb; font: 10px/1.6 var(--mono); letter-spacing: 1px; }
.flow-card strong { display: block; margin: 14px 0 20px; font-size: 23px; font-weight: 400; }
.flow-back { inset: calc(-1 * var(--flow-inset-y)) calc(-1 * var(--flow-inset-x)); opacity: 0; visibility: hidden; transform: translateY(6px); clip-path: inset(var(--flow-inset-y) var(--flow-inset-x) round var(--radius-panel)); pointer-events: none; border: 1px solid #ffffff25; border-radius: var(--radius-panel); background: linear-gradient(135deg, #ffffff0f, #ffffff03 55%), #0a0b10dc; box-shadow: inset 0 1px 0 #ffffff1c, 0 20px 50px -25px #000b; transition: opacity .45s ease, transform .55s cubic-bezier(.22, 1, .36, 1), clip-path .55s cubic-bezier(.22, 1, .36, 1), visibility 0s .55s; }
.flow-card[aria-expanded="true"] .flow-front { opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }
.flow-card[aria-expanded="true"] .flow-back { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); clip-path: inset(0 round var(--radius-panel)); transition-delay: 0s; }
.flow-back > * { opacity: 0; transform: translateY(5px); transition: opacity .3s ease, transform .4s ease; }
.flow-card[aria-expanded="true"] .flow-back > * { opacity: 1; transform: none; transition-delay: .09s; }
.flow-card[aria-expanded="true"] .flow-description { transition-delay: .14s; }
.flow-card[aria-expanded="true"] .flow-detail { transition-delay: .19s; }
.flow-back strong { margin: 10px 0 18px; }
.flow-back { border-color: color-mix(in srgb, var(--tc) 40%, transparent); }
.flow-back small { color: var(--tc); }
.flow-back:after { background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--tc) 9%, transparent), transparent 60%); }
.flow-description { color: #e2e3ed; font-size: 16px; line-height: 1.6; }
.flow-detail { color: #a9adbf; margin-top: 16px; font-size: 14px; line-height: 1.65; }
.flow-example { color: var(--tc); font-size: 13px; line-height: 1.7; margin-top: 18px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
  .flow-card-inner, .flow-front, .flow-back, .flow-back > *, .flow-card[aria-expanded="true"] .flow-front { transition: none; }
  .flow-card[aria-expanded="true"] .flow-card-inner { transform: none; }
}

/* receipts: a claim beside the real output that backs it (tool pages) */
.receipts { grid-template-columns: repeat(2, 1fr); gap: 14px; display: grid; }
.receipt { border-radius: var(--radius-panel); padding: 28px; display: flex; flex-direction: column; }
.receipt small { color: #a3a5b8; letter-spacing: 1px; font: 10px var(--mono); }
.receipt h3 { letter-spacing: -.6px; margin: 22px 0 10px; font-size: 21px; font-weight: 500; }
.receipt p { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 0 0 20px; }
.receipt pre { margin: auto 0 0; border: 1px solid var(--line); background: #00000040; border-radius: var(--radius-control); padding: 16px 18px; color: #c9ccd8; font: 11.5px/1.75 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* tool cards */
.tool-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; display: grid; }
.tool-card {
  border-radius: var(--radius-panel);
  padding: 25px;
  display: flex;
  flex-direction: column;
  transition: border-color .25s, background .25s, transform .25s;
  position: relative;
  overflow: hidden;
}
.tool-card:before { content: ''; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--tc) 9%, #0000), #0000 60%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.tool-card:hover { border-color: color-mix(in srgb, var(--tc) 40%, #0000); }
.tool-card:hover:before { opacity: 1; }
.tool-card.featured { grid-column: span 2; }
.tool-card > div:first-child { align-items: center; gap: 15px; display: flex; }
.tool-glyph { color: var(--tc); width: 29px; font: 25px var(--mono); text-shadow: 0 0 18px color-mix(in srgb, var(--tc) 50%, #0000); }
.tool-card small { color: #a3a5b8; letter-spacing: 1px; font: 10px var(--mono); }
.status { margin-left: auto; color: #c1b5ff; background: #a89aff0a; border: 1px solid #bcb1ff35; border-radius: 999px; padding: 6px 10px; letter-spacing: 1px; font: 10px var(--mono); text-transform: uppercase; }
.tool-card h3 { letter-spacing: -.6px; margin: 30px 0 6px; font-size: 22px; font-weight: 500; }
.tool-card .line { color: #c6c8d8; margin: 0 0 10px; font-size: 13px; }
.tool-card p.body { color: var(--muted); font-size: 12px; line-height: 1.9; margin: 0 0 18px; }
.tool-card .cmd { border: 1px solid var(--line); background: #00000040; border-radius: var(--radius-control); padding: 10px 12px; color: #b8bbc9; font-size: 10px; overflow-wrap: anywhere; line-height: 1.6; margin-bottom: 4px; }
.tool-card .cmd:before { content: '$ '; color: #8a8ca0; }
.tool-card .note { color: #a3a5b6; font: 11px/1.8 var(--mono); margin: 8px 0 18px; }
.tool-links { color: #d6d9ea; border-top: 1px solid var(--line); justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; font-size: 13px; display: flex; }
.tool-links a:hover { color: #fff; }
.tool-links .soon { color: #8e90a2; }
.tool-card .spacer { flex: 1; min-height: 18px; }

/* evidence bento */
.bento { grid-template-columns: repeat(3, 1fr); gap: 14px; display: grid; }
.bento article { border-radius: var(--radius-panel); min-height: 240px; padding: 30px; }
.bento .bento-big { grid-column: span 2; }
.bento h3 { letter-spacing: -.6px; margin: 26px 0 12px; font-size: 20px; font-weight: 500; }
.bento p { color: var(--muted); max-width: 500px; font-size: 13px; line-height: 1.8; }
.evidence-scale { letter-spacing: 1px; align-items: center; gap: 12px; height: 70px; font: 8px var(--mono); display: flex; }
.evidence-scale span { color: #c1b5ff; background: #a89aff0a; border: 1px solid #bcb1ff35; padding: 10px; }
.evidence-scale i { background: linear-gradient(90deg, #bcb1ff35, #82e9ff66, #bcb1ff35); background-size: 200% 100%; flex: 1; height: 1px; animation: flow 3s linear infinite; }
@keyframes flow { to { background-position: -200% 0; } }
.mini-symbol { color: #cccde0; min-height: 70px; font: 20px/1.25 var(--mono); }
.mini-symbol span { color: #8d9fb5; }
.refusal { grid-column: span 2; grid-template-columns: 1fr 1fr; align-items: center; column-gap: 30px; display: grid; }
.bento article.refusal { min-height: 0; }
.refusal code { color: #9ca4c1; grid-row: span 2; font-size: 12px; line-height: 2; }
.refusal code span { color: #e6a6bf; }
.refusal h3 { margin: 0; }
.refusal p { margin-top: 0; }

/* start */
.start { text-align: center; background: radial-gradient(at bottom, #7d6aff0c, #0000 70%); padding-top: 140px; padding-bottom: 140px; }
.start h2 { font-size: 54px; }
.start > p:not(.eyebrow) { color: var(--muted); margin: 24px 0 30px; font-size: 15px; }
.command { border-radius: 999px; align-items: center; gap: 30px; width: max-content; max-width: 100%; margin: 25px auto 18px; padding: 12px 15px; display: flex; }
.command code { color: #b8bbc9; font-size: 11px; }
.command code:before { content: '$ '; color: #8a8ca0; }
.command button { color: var(--muted); background: 0 0; border: 0; font-size: 10px; }
.command button:hover { color: #fff; }
.start > small { color: #a3a5b6; font: 11px var(--mono); }

footer { max-width: 1120px; color: var(--muted); align-items: center; gap: 25px; margin: 0 auto; padding: 30px 0 55px; font-size: 10px; display: flex; position: relative; z-index: 1; border-top: 1px solid var(--line); }
footer .logo { color: #fff; font-size: 15px; }
footer > span { font: 11px var(--mono); margin-right: auto; margin-left: 15px; }
footer a:hover { color: #fff; }

/* ---------- responsive ---------- */

@media (width >= 1400px) { .hero { border-bottom: 1px solid var(--line); } }

@media (width <= 1200px) {
  .section, footer { margin-left: 6%; margin-right: 6%; }
  .evidence-scale { gap: 7px; font-size: 7px; }
  .evidence-scale span { padding: 8px; }
}

@media (width <= 1100px) {
  .flow-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .flow-front { border-bottom: 1px solid var(--line); }
  .flow-card:nth-child(3n) .flow-front { border-right: 0; }
  .flow-cards { --flow-inset-y: 8px; --flow-inset-x: 8px; }
}

@media (width <= 950px) {
  .flow-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-card:nth-child(3n) .flow-front { border-right: 1px solid var(--line); }
  .flow-card:nth-child(2n) .flow-front, .flow-card:last-child .flow-front { border-right: 0; }
  .flow-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .tool-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (width <= 850px) {
  .overview { gap: 36px; }
  .section-heading { gap: 30px; }
  h2 { font-size: 36px; }
  .section-heading > p { max-width: 300px; font-size: 12px; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento .bento-big, .bento .refusal { grid-column: span 2; }

  footer > span { display: none; }
}

@media (width <= 600px) {
  /* a stack: each card sticks under the nav, the next one slides over it,
     and the card on top turns over on its own (initFlowCards) */
  .flow-cards { --flow-inset-y: 0px; --flow-inset-x: 0px; grid-template-columns: 1fr; gap: 18px; background: none; border: 0; box-shadow: none; backdrop-filter: none; }
  .flow-cards:after { display: none; }
  .flow-card { position: sticky; top: calc(86px + var(--i) * 12px); height: auto; }
  .flow-card[aria-expanded="true"] { z-index: auto; }
  .flow-card-inner { display: grid; }
  .flow-front, .flow-back { position: relative; grid-area: 1 / 1; inset: auto; min-height: 250px; padding: 24px; border-radius: var(--radius-panel); }
  :is(.home, .tool-page) .flow-back { min-height: 250px; }
  .flow-back { clip-path: inset(0 round var(--radius-panel)); }
  .flow-front, .flow-card .flow-front, .flow-card:nth-child(n) .flow-front { justify-content: flex-start; border: 1px solid var(--glass-line); background: radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--tc) 8%, transparent), transparent 75%), linear-gradient(135deg, #ffffff0f, #ffffff03 55%), #0a0b10a6; box-shadow: inset 0 1px 0 #ffffff1c, 0 -18px 40px -24px #000e; }
  .flow-glyph { margin-bottom: 20px; }
  :is(.home, .tool-page) .hero { padding-top: 32px; padding-bottom: 40px; }
  :is(.home, .tool-page) .hero h1 { font-size: clamp(42px, 10vw, 54px); }
  :is(.home, .tool-page) .hero .stage { height: 230px; }
  .overview { grid-template-columns: 1fr; gap: 28px; }
  .nav { height: 70px; padding: 0 18px; gap: 15px; }
  .nav nav { gap: 15px; margin-left: auto; font-size: 10px; }
  .github, .alpha { display: none; }
  .logo { font-size: 17px; }
  .hero { padding: 45px 16px 0; }

  h1 { letter-spacing: -3px; margin-top: 35px; font-size: 54px; }
  .hero-copy { font-size: 14px; }

  .primary, .secondary { gap: 15px; padding: 12px 15px; font-size: 11px; }
  .stage { height: 320px; }
  .stage-start { height: 240px; }

  .stage:after { bottom: 15px; }

  .section { padding: 65px 0; margin-left: 16px; margin-right: 16px; }
  .section-heading { display: block; }
  .section-heading > p { max-width: none; margin-top: 22px; font-size: 13px; }
  .eyebrow { letter-spacing: 1.2px; font-size: 9px; }
  h2 { font-size: 34px; }

  .fine { font-size: 10px; }
  .tool-grid, .bento, .receipts { grid-template-columns: 1fr; }
  .receipt { padding: 22px; }
  .tool-card.featured, .bento article, .bento .bento-big, .bento .refusal { grid-column: span 1; }
  .bento article { min-height: 0; padding: 24px; }
  .evidence-scale { gap: 5px; font-size: 6px; }
  .evidence-scale span { letter-spacing: .3px; padding: 7px 5px; }
  .refusal { display: block; }
  .refusal h3 { margin-top: 25px; }
  .start { padding-top: 90px; padding-bottom: 90px; }
  .start h2 { font-size: 38px; }
  .start > small { font-size: 10px; line-height: 1.7; display: block; }
  .command { gap: 18px; padding: 12px; }
  .command code { font-size: 10px; }
  footer { margin: 0 16px; gap: 15px; }
  footer .logo { margin-right: auto; font-size: 13px; }
}

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

/* Shared SVG navigation icons: stable across fonts and emoji renderers. */
.link-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.125em;
  overflow: visible;
}

/* Shared responsive navigation. */
.nav { gap: 28px; }
.nav > .logo { flex-shrink: 0; }
.nav-menu { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 28px; margin-left: 24px; }
.nav-menu nav { align-items: center; }
.nav-menu > .github { flex-shrink: 0; display: inline-flex; align-items: center; }
.lang-switch { flex-shrink: 0; margin-left: auto; margin-right: -12px; color: var(--muted); border: 1px solid var(--glass-line); border-radius: 999px; padding: 9px 12px; font: 11px var(--mono); letter-spacing: 1px; transition: color .2s, background .2s; }
.lang-switch:hover { color: #fff; background: #ffffff0a; }
.nav-toggle { display: none; }
/* Inline code follows the surrounding prose; terminal examples stay monospace. */
:is(.home, .tool-page) :is(p, dd, dt, li, td, th, small, h2, h3) code:not(pre code, .terminal code, .command code, [class]) {
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  color: #fff;
}

@media (width <= 1100px) {
  .nav { padding-inline: 24px; }
  .nav-toggle { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; margin-left: auto; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--glass-line); border-radius: var(--radius-control); background: #ffffff08; }
  .nav-toggle span { display: block; width: 18px; height: 1px; background: var(--fg); transition: transform .2s, opacity .2s; }
  .menu-open .nav-toggle span:first-child { transform: translateY(6px) rotate(45deg); }
  .menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .nav-toggle span:last-child { transform: translateY(-6px) rotate(-45deg); }
  .nav-menu { display: none; position: absolute; top: calc(100% + 8px); left: 18px; right: 18px; margin: 0; padding: 16px; max-height: calc(100dvh - 100px); overflow-y: auto; border: 1px solid var(--glass-line); border-radius: var(--radius-panel); background: #0a0b10fa; box-shadow: 0 20px 50px #0008; }
  .menu-open .nav-menu { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .nav .nav-menu nav { flex-direction: column; align-items: stretch; gap: 0; margin: 0; font-size: 14px; }
  .nav-menu nav a, .nav-menu nav .repo-unavailable { padding: 14px 12px; border-radius: var(--radius-control); }
  .nav-menu > .lang-switch { margin: 0 12px; align-self: flex-start; }
  .nav-menu nav a:is(:hover, :focus-visible) { background: #ffffff08; }
  .nav-menu > .github { justify-content: space-between; padding: 14px 16px; }
  .nav .alpha { display: none; }
}
@media (width <= 600px) {
  .nav { padding-inline: 16px; gap: 10px; }
  .nav .logo { font-size: 15px; gap: 7px; }
  .nav .crumb-home { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav .github, .nav-toggle span { transition: none; }
}

/* home: the link under the flow, to the page on how the tools cross */
.home #flow .inline-link { display: inline-block; margin-top: 20px; color: #c1c9e7; font-size: 13px; }
.home #flow .inline-link:hover { color: #fff; }

@media (prefers-reduced-transparency: reduce) {
  :root { --glass-blur: none; }
}

/* ?debug= switches (page.js, initDebug) */
.debug-fps { position: fixed; right: 12px; bottom: 12px; z-index: 100; padding: 6px 10px; border-radius: var(--radius-small); background: #000c; color: #9fe8c2; font: 12px var(--mono); pointer-events: none; }
.debug-nopanels .glass, .debug-nopanels .flow-back, .debug-nopanels .flow-front { backdrop-filter: none !important; background: #0b0c12 !important; }

.glass.over-3d, .over-3d .flow-back, .over-3d .flow-front { backdrop-filter: var(--glass-blur); }

/* From one page to the next: a short cross-fade, the bar staying in place,
   where the browser supports cross-document view transitions. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .nav { view-transition-name: site-nav; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }
}

/* Stable site destinations. Mobile wraps the four links onto a second row,
   keeping them visible and keyboard-accessible even without JavaScript. */
.nav.site-nav { gap: 24px; }
.site-nav .site-links { align-items: center; gap: 28px; margin-left: auto; font-size: 13px; }
.site-nav .site-links a { white-space: nowrap; padding: 8px 0; }
.site-nav .site-links a[aria-current] { color: #e0e4f5; box-shadow: 0 1px 0 #b7a0ff; }
.site-nav > .lang-switch { margin-left: 0; margin-right: 0; }
/* Page contents: quiet text rail, separate from the global navigation. */
.page-rail { display: none; }
.page-contents { max-width: 1120px; margin: 24px auto 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 13px; color: var(--muted); }
:is(.page-rail, .page-contents) [data-section-link][aria-current] { color: #fff; text-shadow: 0 0 18px #b7a0ff44; }
@media (min-width: 1360px) {
  .page-contents { display: none; }
  .page-rail { display: block; position: fixed; top: 50%; right: 16px; width: min(164px, calc((100vw - 1120px) / 2 - 32px)); transform: translateY(-50%); max-height: calc(100dvh - 180px); overflow-y: auto; z-index: 4; scrollbar-width: thin; }
  .page-rail nav { display: grid; gap: 3px; }
  .page-rail a { position: relative; display: block; padding: 8px 8px 8px 14px; color: var(--muted); font-size: 12px; line-height: 1.5; transition: color .15s; overflow-wrap: anywhere; }
  .page-rail a:hover { color: #d9deef; }
  .page-rail a[aria-current] { color: #fff; font-weight: 600; }
  .page-rail a[aria-current]:before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: linear-gradient(var(--cyan), var(--purple)); }
  .page-rail-resources { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
  .page-rail-resources .repo-unavailable { display: block; padding: 8px 14px; font-size: 12px; }
}
.hub-links { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.hub-links > a { padding: 28px; }
.hub-links h3 { margin: 0 0 16px; font-size: 24px; font-weight: 500; letter-spacing: -.6px; }
.hub-links p { color: var(--muted); line-height: 1.8; font-size: 15px; }
.hub-links a:hover { border-color: #a3b6ff55; }
@media (max-width: 1200px) { .page-contents { margin-inline: 6%; } }
@media (max-width: 1100px) {
  .nav.site-nav { height: auto; min-height: 72px; flex-wrap: wrap; padding: 14px 24px 10px; gap: 12px 20px; }
  .site-nav > .logo { order: 0; max-width: calc(100% - 130px); }
  .site-nav > .lang-switch { order: 1; margin-left: auto; }
  .site-nav > .github { order: 2; }
  .site-nav > .site-links { order: 3; flex-basis: 100%; justify-content: center; margin: 0; gap: 28px; font-size: 13px; }
  html:has(.site-nav) { scroll-padding-top: 140px; }
}
@media (max-width: 600px) {
  .nav.site-nav { padding-inline: 16px; gap: 8px 12px; }
  .site-nav > .logo { max-width: calc(100% - 90px); }
  .site-nav > .site-links { gap: 22px; font-size: 12px; }
  .page-contents { margin-inline: 16px; }
  .hub-links { grid-template-columns: 1fr; }
}
@media (max-width: 360px) { .site-nav > .site-links { gap: 14px; font-size: 11px; } }
/* Tool-page component styles must not hide the final global destination. */
.nav.site-nav .site-links a { display: block; }
:is(.home, .tool-page) footer { flex-wrap: wrap; row-gap: 16px; }

/* The home page introduces situations; the original technical cards live in Tools. */
.home .hero-copy { max-width: 570px; }
.home-platform { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 20px auto 0; max-width: 550px; }
.use-case-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.use-case { display: flex; flex-direction: column; padding: 30px; min-width: 0; }
.use-case:first-child { grid-column: 1 / -1; background: radial-gradient(ellipse at 0 0,#82e9ff0a,transparent 65%),linear-gradient(135deg,#ffffff0f,#ffffff03 55%),#0a0b1033; }
.use-case-top { display: flex; align-items: center; gap: 16px; }
.use-case-top small { color: var(--muted); font: 11px/1.7 var(--mono); }
.use-case h3 { font-size: clamp(25px,2.8vw,34px); line-height: 1.2; font-weight: 500; letter-spacing: -.8px; margin: 28px 0 16px; }
.use-case p { color: #b8b9cb; font-size: 16px; line-height: 1.8; max-width: 68ch; margin: 0 0 28px; }
.use-case-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.use-case-footer a { align-self: flex-start; color: #d3daee; font-size: 14px; }
.use-case-footer small { color: var(--muted); font-size: 12px; line-height: 1.7; }
.home-routes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.home-routes > a { padding: 28px; }
.home-routes small { color: var(--muted); font: 11px/1.7 var(--mono); }
.home-routes h3 { font-size: 24px; font-weight: 500; letter-spacing: -.5px; margin: 22px 0 16px; }
.home-routes p { color: var(--muted); font-size: 15px; line-height: 1.8; }
.home-routes a:hover, .use-case:hover { border-color: #a3b6ff55; }
@media (max-width: 850px) { .home-routes { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .use-case-grid { grid-template-columns: 1fr; } .use-case { padding: 24px; } .home-platform { font-size: 11px; max-width: 31ch; } }
.home .stage { margin-top: 28px; }
.home .start .actions { gap: 20px 24px; margin-top: 36px; }
.home .start > small { display: block; max-width: 64ch; margin: 28px auto 0; }
@media (max-width: 600px) {
  :is(.home, .tool-page) .hero-copy { font-size: 14px; }
}
