/* ===========================================================================
   SHALL — site styles

   The identity is a drafting instrument, not a SaaS landing page: near-black
   blue-biased ground, bone ink, hairline rules, and exactly two semantic
   accents that mean something — coral for disagreement, verdigris for accord.
   Prose is set in a serif and machine output in a mono, so the typography
   itself carries the thesis: English on one side, programs on the other.
   =========================================================================== */

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

:root {
  --ground:   #0B0E12;
  --raise:    #12161C;
  --panel:    #171C23;
  --ink:      #E9ECF1;
  --muted:    #838C98;
  --faint:    #5A6470;
  --rule:     rgba(233, 236, 241, 0.10);
  --rule-hi:  rgba(233, 236, 241, 0.20);
  --discord:  #FF6B4A;
  --accord:   #5FD3B0;

  --serif: 'Spectral', ui-serif, Georgia, serif;
  --mono:  'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.22, 0.75, 0.18, 1);
  --gutter: clamp(20px, 5vw, 64px);
  --measure: 60ch;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--discord); color: #0B0E12; }

.wrap { max-width: 1140px; margin: 0 auto; padding-inline: var(--gutter); }

/* --- navigation ---------------------------------------------------------- */

nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11, 14, 18, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
nav.scrolled { border-bottom-color: var(--rule); }
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; color: var(--ink); }
.brand svg { display: block; }
.brand b { font-weight: 600; font-size: 13px; letter-spacing: .34em; padding-left: .34em; }
.navlinks { display: flex; align-items: center; gap: 28px; }
.navlinks a {
  color: var(--muted); text-decoration: none; font-size: 12.5px; letter-spacing: .04em;
  transition: color .2s var(--ease);
}
.navlinks a:hover, .navlinks a:focus-visible { color: var(--ink); }
@media (max-width: 720px) { .navlinks a.hide-sm { display: none; } }

.ghbtn {
  border: 1px solid var(--rule-hi); padding: 7px 15px; border-radius: 3px;
  color: var(--ink) !important; transition: background .2s var(--ease), border-color .2s var(--ease);
}
.ghbtn:hover { background: rgba(233,236,241,.06); border-color: var(--ink); }

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

.hero {
  padding: 168px 0 96px;
  position: relative;
  /* The glow below bleeds 20% past every edge. On the horizontal axis that
     widened the document by ~240px and gave the whole page a sideways scroll.
     `overflow-x: clip` removes the layout overflow without making this a
     scroll container, so the vertical bleed that softens the gradient stays.
     (clip-path was the first attempt and does not work here: it clips what is
     painted and leaves the scrollable area exactly as wide.) */
  overflow-x: clip;
}
.hero::before {
  content: ""; position: absolute; inset: -20% -20% 40% -20%; pointer-events: none;
  background: radial-gradient(ellipse 50% 40% at 50% 30%, rgba(255,107,74,.09), transparent 70%);
}
.eyebrow {
  font-size: 10.5px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 26px;
}

/* the sentence that fractures */
.stage { position: relative; min-height: 210px; margin-bottom: 18px; }
.sentence {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.5rem, 4.2vw, 3.1rem); line-height: 1.28;
  letter-spacing: -.015em; margin: 0; position: relative; z-index: 2;
}
.sentence .kw { font-variant: small-caps; letter-spacing: .06em; font-weight: 500; }
.sentence .tok { position: relative; display: inline-block; }
.sentence .tok.flagged { color: var(--discord); font-weight: 500; }
.squiggle { position: absolute; left: 0; bottom: -.34em; width: 100%; height: .3em; overflow: visible; }
.squiggle path {
  fill: none; stroke: var(--discord); stroke-width: 2.4; stroke-linecap: round;
  stroke-dasharray: 200; stroke-dashoffset: 200;
}
.stage.lit .squiggle path { animation: draw .7s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.word { opacity: 0; transform: translateY(.35em); display: inline-block; }
.stage.lit .word { animation: rise .5s var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* the three programs that drift out of it */
.shards { position: absolute; inset: auto 0 0; display: flex; gap: 12px; flex-wrap: wrap; z-index: 1; }
.shard {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--rule); background: var(--raise);
  padding: 9px 13px; border-radius: 3px;
  opacity: 0; transform: translateY(-14px) scale(.97);
  display: flex; align-items: center; gap: 10px;
}
.stage.lit .shard { animation: shardIn .6s var(--ease) forwards; }
@keyframes shardIn { to { opacity: 1; transform: none; } }
.shard b { color: var(--ink); font-weight: 600; font-size: 14px; }
.shard.a b { color: var(--ink); }
.shard.b b { color: var(--discord); }
.dotline { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5; }

h1 {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: 1.02; letter-spacing: -.03em;
  margin: 44px 0 0; max-width: 15ch; text-wrap: balance;
}
h1 em { font-style: italic; font-weight: 500; }
.lede {
  font-family: var(--serif); font-weight: 300; color: var(--muted);
  font-size: clamp(1.02rem, 1.9vw, 1.28rem); line-height: 1.58;
  max-width: 52ch; margin: 26px 0 0;
}

.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 40px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-size: 13px; letter-spacing: .03em; padding: 12px 20px; border-radius: 3px;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--ground); font-weight: 600; }
.btn.primary:hover { background: #fff; }
.btn.ghost { border: 1px solid var(--rule-hi); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink); background: rgba(233,236,241,.05); }

.runstrip {
  display: flex; gap: 30px; flex-wrap: wrap; margin-top: 52px;
  padding-top: 22px; border-top: 1px solid var(--rule);
  font-size: 11.5px; color: var(--faint); letter-spacing: .06em;
}
.runstrip b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

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

section { padding: clamp(72px, 11vw, 130px) 0; }
.sec-head { margin-bottom: 44px; }
h2 {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .34em; text-transform: uppercase; color: var(--faint); margin: 0 0 14px;
}
.sec-title {
  font-family: var(--serif); font-weight: 300; letter-spacing: -.02em;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem); line-height: 1.16; margin: 0; max-width: 20ch;
  text-wrap: balance;
}
.sec-note {
  font-family: var(--serif); font-weight: 300; color: var(--muted);
  font-size: 1.05rem; max-width: var(--measure); margin: 18px 0 0;
}

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.seen { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .stage .word, .stage .shard { opacity: 1; transform: none; animation: none; }
  .squiggle path { stroke-dashoffset: 0; animation: none; }
}

/* --- witness explorer ---------------------------------------------------- */

.explorer { border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: var(--raise); }
.exp-top { display: grid; grid-template-columns: 260px 1fr; }
@media (max-width: 780px) { .exp-top { grid-template-columns: 1fr; } }

.inputs { border-right: 1px solid var(--rule); padding: 8px; }
@media (max-width: 780px) {
  /* A horizontal rail, not a squeezed column. Each option needs a real width or
     the label wraps to one word per line and becomes unreadable. */
  .inputs {
    border-right: none; border-bottom: 1px solid var(--rule);
    display: flex; gap: 8px; overflow-x: auto; padding: 10px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  }
  .inputs::-webkit-scrollbar { height: 3px; }
  .inputs::-webkit-scrollbar-thumb { background: var(--rule-hi); border-radius: 3px; }
  .inp { flex: 0 0 208px; scroll-snap-align: start; white-space: normal; margin-bottom: 0; }
  .readout { padding: 22px 20px; min-height: 0; }
  .group { grid-template-columns: 70px 1fr; gap: 14px; padding: 13px 15px; }
  .group .val { font-size: 1.7rem; }
}
.inp {
  display: block; width: 100%; text-align: left; cursor: pointer;
  margin-bottom: 2px;
  background: transparent; border: 1px solid transparent; border-radius: 3px;
  color: var(--muted); font-family: var(--mono); font-size: 12px;
  padding: 10px 12px; transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
  overflow: hidden; text-overflow: ellipsis;
}
.inp:hover { background: rgba(233,236,241,.04); color: var(--ink); }
.inp[aria-selected="true"] {
  background: rgba(255,107,74,.12); border-color: rgba(255,107,74,.4); color: var(--ink);
}
.inp .tag {
  font-size: 10px; letter-spacing: .02em; color: var(--faint);
  display: block; margin-bottom: 4px; white-space: normal; line-height: 1.35;
}
.inp[aria-selected="true"] .tag { color: var(--discord); }

.readout { padding: 26px 28px; min-height: 260px; }
.readout .q {
  font-size: 11.5px; letter-spacing: .04em; color: var(--faint);
  margin-bottom: 18px; line-height: 1.5;
}
.groups { display: flex; flex-direction: column; gap: 12px; }
.group {
  display: grid; grid-template-columns: 92px 1fr; gap: 18px; align-items: center;
  border: 1px solid var(--rule); border-radius: 3px; padding: 15px 18px;
  background: var(--panel);
  animation: pop .38s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(9px) scale(.99); } }
.group .val {
  font-family: var(--serif); font-size: 2.1rem; font-weight: 500; line-height: 1;
  font-variant-numeric: tabular-nums; word-break: break-all;
}
.group.one .val { color: var(--ink); }
.group.two .val { color: var(--discord); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 10.5px; color: var(--muted); border: 1px solid var(--rule);
  padding: 4px 9px; border-radius: 2px; white-space: nowrap;
}
.agree { color: var(--accord); font-size: 12.5px; display: flex; align-items: center; gap: 10px; }

.exp-foot {
  border-top: 1px solid var(--rule); padding: 14px 20px;
  font-size: 11.5px; color: var(--faint); display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}

/* --- code / diff --------------------------------------------------------- */

.split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .split2 { grid-template-columns: 1fr; } }

.pane { border: 1px solid var(--rule); border-radius: 4px; background: var(--raise); overflow: hidden; }
.pane-head {
  padding: 11px 16px; border-bottom: 1px solid var(--rule);
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.pane-head .state { letter-spacing: .1em; }
.pane-head .bad { color: var(--discord); }
.pane-head .good { color: var(--accord); }
pre {
  margin: 0; padding: 18px 16px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.2px; line-height: 1.72; color: var(--ink);
}
pre .c { color: var(--faint); }
pre .k { color: var(--muted); }
pre .bad { color: var(--discord); }
pre .good { color: var(--accord); }
pre .em { color: var(--ink); font-weight: 500; }

/* --- pipeline ------------------------------------------------------------ */

.steps { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.step { background: var(--raise); padding: 26px 28px; display: grid; grid-template-columns: 42px 1fr; gap: 22px; }
@media (max-width: 640px) { .step { grid-template-columns: 1fr; gap: 10px; } }
.step .n {
  font-family: var(--serif); font-size: 1.3rem; color: var(--faint); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.step h3 { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; }
.step p { margin: 0; color: var(--muted); font-family: var(--serif); font-weight: 300; font-size: 1rem; max-width: var(--measure); }

/* --- findings ------------------------------------------------------------ */

.finds { display: grid; grid-template-columns: repeat(auto-fit, minmax(266px, 1fr)); gap: 16px; }
.find {
  border: 1px solid var(--rule); border-radius: 4px; padding: 24px;
  background: var(--raise); transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.find:hover { border-color: var(--rule-hi); transform: translateY(-3px); }
.find .no {
  font-size: 10px; letter-spacing: .2em; color: var(--discord); text-transform: uppercase;
  margin-bottom: 12px;
}
.find h3 { margin: 0 0 10px; font-family: var(--serif); font-weight: 500; font-size: 1.16rem; line-height: 1.3; }
.find p { margin: 0; color: var(--muted); font-size: 12.8px; line-height: 1.62; }

/* --- video --------------------------------------------------------------- */

.video {
  border: 1px solid var(--rule); border-radius: 4px; overflow: hidden;
  aspect-ratio: 16 / 9; background: var(--raise); position: relative;
}
.video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* --- get started --------------------------------------------------------- */

.term {
  border: 1px solid var(--rule); border-radius: 4px; background: #070A0D; overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-bottom: 1px solid var(--rule);
}
.dot3 { width: 9px; height: 9px; border-radius: 50%; background: var(--rule-hi); }
.term-bar span { margin-left: 8px; font-size: 11px; color: var(--faint); letter-spacing: .08em; }
.copy {
  margin-left: auto; background: transparent; border: 1px solid var(--rule);
  color: var(--muted); font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  padding: 5px 11px; border-radius: 2px; cursor: pointer; text-transform: uppercase;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.copy:hover { color: var(--ink); border-color: var(--rule-hi); }
.copy.done { color: var(--accord); border-color: var(--accord); }

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

footer {
  border-top: 1px solid var(--rule); padding: 44px 0 60px;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  color: var(--faint); font-size: 11.5px; letter-spacing: .05em;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ink); }

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

/* --- narrow screens ------------------------------------------------------
   The hero shards carry long reader lists ("gpt-4.1 · o4-mini · gpt-5.2 …")
   which cannot wrap inside a chip, so on a phone they forced the page wider
   than the viewport and every section inherited the overflow. Below 720px the
   shards leave the absolute layer, stack, and drop the reader names — the
   number is the point there; who said it is detail for a wider screen.        */

@media (max-width: 720px) {
  .hero { padding: 116px 0 64px; }
  .stage { min-height: 0; margin-bottom: 26px; }
  .shards { position: static; flex-direction: column; align-items: flex-start; margin-top: 24px; }
  .shard { max-width: 100%; }
  .shard span { display: none; }
  .shard::after { content: attr(data-short); color: var(--muted); font-size: 11px; }
  h1 { margin-top: 30px; }
  .runstrip { gap: 10px 22px; margin-top: 36px; }
  .cta .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 420px) {
  .sentence { font-size: 1.32rem; }
  .eyebrow { letter-spacing: .22em; font-size: 9.5px; }
}

/* Nothing may make the document wider than the screen. */
html, body { max-width: 100%; }
img, svg, pre, table { max-width: 100%; }

/* ── one step past the boundary ──────────────────────────────────────────
   The two panels are deliberately identical in every way except their
   readings, so the only thing the eye can catch is the split. */

.bnd {
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--raise);
  overflow: hidden;
}

.bnd-clause {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 20px clamp(16px, 3vw, 26px);
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
}

.bnd-id {
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--discord);
  padding: 5px 8px;
  border: 1px solid rgba(255, 107, 74, 0.35);
  border-radius: 5px;
  flex: none;
}

.bnd-clause code {
  font: 400 clamp(12.5px, 1.5vw, 14px)/1.6 var(--mono);
  color: var(--ink);
}

.bnd-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* The divider carries the comparison, so it stays on every viewport - it just
   moves from between the columns to between the stacked rows. */
.bnd-side + .bnd-side { border-left: 1px solid var(--rule); }

.bnd-side { padding: 20px clamp(16px, 3vw, 26px) 24px; }

.bnd-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.bnd-when {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.bnd-input {
  font: 400 clamp(13px, 1.7vw, 15px)/1.5 var(--mono);
  color: var(--ink);
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--ground);
  margin-bottom: 16px;
  overflow-x: auto;
  white-space: nowrap;
}

.bnd-readings { display: grid; gap: 8px; }

.bnd-foot {
  padding: 13px clamp(16px, 3vw, 26px);
  border-top: 1px solid var(--rule);
  background: var(--panel);
  font: 400 11.5px/1.5 var(--mono);
  color: var(--faint);
}

@media (max-width: 720px) {
  .bnd-pair { grid-template-columns: 1fr; }
  .bnd-side + .bnd-side { border-left: 0; border-top: 1px solid var(--rule); }
}

/* The panels are half-width, so the reading blocks are scaled to match rather
   than inheriting the explorer's full-width proportions. */
.bnd-head .state {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bnd-head .state.ok  { color: var(--accord); }
.bnd-head .state.bad { color: var(--discord); }

.bnd-readings .group { grid-template-columns: 64px 1fr; gap: 14px; padding: 12px 14px; }
.bnd-readings .group .val { font-size: 1.55rem; }

.bnd-note {
  margin-top: 14px;
  font: 400 11.5px/1.5 var(--mono);
  color: var(--faint);
}
