/* The home page. One frame of hairlines down the page, a plus where each section meets it,
   the fork tree as the only moving picture, and the signal colour only on what is kept. */

body.home { background: var(--bg); font-family: var(--sans); }

/* Hero: the copy on the left, the fork tree on a dot grid filling the frame */
.x-hero { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: clamp(600px, 80vh, 820px); padding: 0 var(--gut) clamp(40px, 5vw, 64px); overflow: hidden; isolation: isolate;
  background: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.2px) 0 0 / 24px 24px; }
.x-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
  /* The tree dims where the headline sits (bottom left), so the copy always reads over it. */
  -webkit-mask-image: radial-gradient(ellipse 78% 62% at 0% 100%, rgba(0,0,0,.16) 0, rgba(0,0,0,.16) 45%, #000 100%); mask-image: radial-gradient(ellipse 78% 62% at 0% 100%, rgba(0,0,0,.16) 0, rgba(0,0,0,.16) 45%, #000 100%); }
.x-hero .copy { max-width: 760px; }
.x-hero .cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 30px; }
.x-hero .x-sub { color: var(--fg-2); }
.x-hero .x-h1 { animation: land 900ms var(--ease) 120ms backwards; }
.x-hero .x-sub, .x-hero .cta { animation: land 900ms var(--ease) 320ms backwards; }
@keyframes land { from { opacity: 0; transform: translateY(12px); } }

/* Readout: what the drawing above is doing, said in numbers. It is a simulation and says so. */
.x-readout { display: flex; align-items: stretch; min-height: 44px; border-top: 1px solid var(--hair); font: 400 12px/16px var(--mono); color: var(--fg-2); overflow-x: auto; scrollbar-width: none; }
.x-readout > span { display: flex; align-items: center; gap: 8px; padding: 0 var(--gut); border-right: 1px solid var(--hair); white-space: nowrap; }
.x-readout > span:last-child { border-right: 0; flex: 1; justify-content: flex-end; }
.x-readout b { font-weight: 400; color: var(--fg); font-variant-numeric: tabular-nums; }
.x-readout .sim { color: var(--fg-3); letter-spacing: 0.06em; text-transform: uppercase; }
.x-readout .kept b { color: var(--signal); }

/* Logos in cells */
.x-logos { display: grid; grid-template-columns: minmax(180px, 1.2fr) repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--hair); }
.x-logos > * { display: flex; align-items: center; justify-content: center; min-height: 104px; padding: 0 20px; border-left: 1px solid var(--hair); }
.x-logos > :first-child { justify-content: flex-start; border-left: 0; padding-left: var(--gut); }
.x-logos img { max-height: 26px; max-width: 110px; width: auto; filter: brightness(0) invert(1); opacity: 0.72; }

/* Thesis */
.x-thesis { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px clamp(40px, 6vw, 96px); align-items: start; }
.x-ratio { display: flex; gap: clamp(32px, 4vw, 64px); margin-top: 40px; }
.x-ratio b { display: block; font: 300 clamp(56px, 6vw, 84px)/1 var(--sans); letter-spacing: -0.05em; color: var(--fg); }
.x-ratio span { color: var(--fg-2); font-size: 15px; }
.x-amdahl { display: grid; gap: 14px; margin-top: 8px; }
.x-amdahl .row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; align-items: center; }
.x-amdahl .track { display: flex; height: 32px; }
.x-amdahl .m { background: var(--fg); }
.x-amdahl .c { display: flex; align-items: center; padding-left: 10px; border: 1px solid var(--fg-2); color: var(--fg); font: 400 12px var(--mono); white-space: nowrap;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,.18) 0 1px, transparent 1px 6px); }
.x-amdahl .axis { display: flex; justify-content: space-between; margin-left: 98px; padding-top: 6px; border-top: 1px solid var(--hair-2); }
.x-thesis p { margin-top: 26px; color: var(--fg-2); max-width: 34em; }
.x-thesis p a { color: var(--fg); }

/* Fork drawing */
.x-fork { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr); gap: 40px clamp(32px, 5vw, 80px); align-items: center; }
.x-fork svg { width: 100%; height: auto; overflow: visible; }
.x-fork text { font: 400 11px var(--mono); letter-spacing: 0.06em; fill: var(--fg-3); }
.x-fork .t-ink { fill: var(--fg); }
.dr { fill: none; stroke-linecap: square; }
.in .dr.draw { animation: trace 1400ms var(--ease) backwards; }
.in .dr.draw.late { animation-delay: 700ms; }
.in .fade-in { animation: fadein 600ms var(--ease) 1200ms backwards; }
@keyframes trace { from { stroke-dashoffset: 1; } }
@keyframes fadein { from { opacity: 0; } }

/* Loop: four steps, numbered because they are a sequence */
.x-loop { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--hair); }
.x-loop > div { padding: 28px 24px 8px; border-left: 1px solid var(--hair); }
.x-loop > div:first-child { border-left: 0; padding-left: 0; }
.x-loop svg { display: block; width: 100%; max-width: 220px; height: 120px; margin: 8px 0 28px; overflow: visible; }
.x-loop h3 { font: 400 28px/1.1 var(--sans); letter-spacing: -0.03em; margin-top: 6px; }
.x-loop p { margin-top: 10px; color: var(--fg-2); font-size: 15px; }
.x-loop small a { display: inline-block; margin-top: 14px; font-size: 14px; color: var(--fg); text-underline-offset: 4px; }
.g-h { stroke: var(--hair-3); stroke-width: 1; fill: none; }
.g-i { stroke: var(--fg); stroke-width: 1.4; fill: none; }
.g-k { stroke: var(--signal); stroke-width: 1.6; fill: none; }
.g-dot { fill: var(--fg); }
.g-dead { fill: var(--bg); stroke: var(--fg-4); }
.g-sq { fill: var(--signal); }

/* Layers */
.x-layers { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr); gap: 40px clamp(32px, 5vw, 80px); margin-top: clamp(40px, 5vw, 64px); align-items: start; }
.x-stack { position: sticky; top: 96px; }
.x-stack svg { width: 100%; height: auto; overflow: visible; }
.x-stack .pl { fill: var(--bg); stroke: var(--hair-3); stroke-width: 1; transition: stroke var(--t-move) var(--ease), fill var(--t-move) var(--ease); }
.x-stack .post { stroke: var(--hair-2); stroke-dasharray: 2 4; }
.x-stack .vx { fill: var(--fg-4); transition: fill var(--t-move) var(--ease); }
.x-stack text { font: 400 11px var(--mono); letter-spacing: 0.06em; fill: var(--fg-3); transition: fill var(--t-move) var(--ease); }
.x-stack [data-l].on .pl { stroke: var(--fg); fill: var(--bg-1); }
.x-stack [data-l].on .vx { fill: var(--signal); }
.x-stack [data-l].on text { fill: var(--fg); }
.x-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
.x-tabs button { position: relative; height: 44px; padding: 0; border: 0; background: none; color: var(--fg-2); font: 400 15px var(--sans); white-space: nowrap; cursor: pointer; }
.x-tabs button:hover { color: var(--fg); }
.x-tabs button[aria-selected='true'] { color: var(--fg); }
.x-tabs button[aria-selected='true']::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--fg); }
.x-pane h3 { margin: 26px 0 4px; font: 400 24px/1.2 var(--sans); letter-spacing: -0.03em; }
.x-pane > p { color: var(--fg-2); }
.x-rows { margin-top: 18px; border-top: 1px solid var(--hair); }
.x-rows > div { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--hair); }
.x-rows b { font-weight: 500; color: var(--fg); }
.x-rows b a { text-decoration: none; }
.x-rows b a:hover { text-decoration: underline 1px; text-underline-offset: 4px; }
.x-rows span { color: var(--fg-2); font-size: 15px; }

/* Lower sections keep their markup and take the tokens */
.x-legacy > section { padding-top: var(--sec); }
.x-legacy > section + section { border-top: 1px solid var(--hair); }
.x-legacy .bar .inner { padding-top: 0; }
.x-legacy .gutter { padding-left: var(--gut); padding-right: var(--gut); }
.x-legacy .bar .inner { padding-bottom: var(--sec); }
.x-legacy .price { padding-bottom: var(--sec); }
.x-legacy .stats { gap: 0; border-top: 1px solid var(--hair); }
.x-legacy .stats > div { padding: 28px 24px 28px 0; border-bottom: 1px solid var(--hair); }
.x-legacy .stats b { font-weight: 300; letter-spacing: -0.05em; }
.x-legacy .wl-list b { font-weight: 400; letter-spacing: -0.035em; color: var(--fg-3); }
.x-legacy .wl-list button:hover b, .x-legacy .wl-list button[aria-selected='true'] b { color: var(--fg); }
.x-legacy .wl-list button[aria-selected='true'] { box-shadow: inset 2px 0 0 var(--signal); padding-left: 14px; transition: padding var(--t-move) var(--ease); }
.x-legacy .num, .x-legacy .h2 { font-weight: 300; }
.x-legacy .price table td, .x-legacy .price table th { font-size: 15px; }
.x-legacy tr.us th, .x-legacy tr.us td { color: var(--fg); }
.x-legacy tr.us th { box-shadow: inset 2px 0 0 var(--signal); padding-left: 12px; }
.x-legacy .calc input { accent-color: var(--fg); }
.x-legacy pre b, .x-legacy .code-s b { color: var(--signal); }
.x-legacy .lane.w, .x-legacy .g-hot { stroke: var(--signal); }
.x-legacy .wbar.w { fill: var(--signal); }
.x-legacy .quad h3 { font-weight: 500; }

/* Close: scale, drawn geometrically. One fork doubled into an H-tree; one path kept. */
.x-close { padding-bottom: clamp(48px, 6vw, 80px); }
.x-scale { position: relative; height: clamp(240px, 30vw, 400px); }
.x-scale canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.x-scale-read { margin-top: 28px; border-bottom: 1px solid var(--hair); }
.x-scale-read > span:first-child { padding-left: 0; }
.x-scale-read > span:last-child { padding-right: 0; }
.x-close-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 40px; margin-top: clamp(40px, 5vw, 72px); }
.x-close-row h2 { font: 400 clamp(52px, 8vw, 116px)/0.95 var(--sans); letter-spacing: -0.055em; }


@media (max-width: 1000px) {
  .x-thesis, .x-fork, .x-layers { grid-template-columns: minmax(0, 1fr); }
  .x-stack { position: relative; top: 0; max-width: 520px; }
  .x-loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .x-loop > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .x-loop > div:nth-child(n+3) { border-top: 1px solid var(--hair); }
  .x-logos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .x-logos > :first-child { grid-column: 1 / -1; min-height: 56px; border-bottom: 1px solid var(--hair); }
  .x-logos > :nth-child(5) { border-left: 0; }
  .x-logos > :nth-child(n+5) { border-top: 1px solid var(--hair); }
}
@media (max-width: 760px) {
  .x-hero { min-height: 680px; }
  .x-hero canvas { -webkit-mask-image: linear-gradient(180deg, #000 30%, rgba(0,0,0,.2) 70%); mask-image: linear-gradient(180deg, #000 30%, rgba(0,0,0,.2) 70%); }
  .x-loop { grid-template-columns: minmax(0, 1fr); }
  .x-loop svg { height: 72px; margin: 4px 0 16px; }
  .x-loop > div { border-left: 0 !important; padding-left: 0 !important; border-top: 1px solid var(--hair); }
  .x-loop > div:first-child { border-top: 0; }
  .x-rows > div { grid-template-columns: minmax(0, 1fr) auto; }
  .x-rows > div > span { grid-column: 1 / -1; grid-row: 2; }
  .x-readout > span:nth-child(n+4):not(:last-child) { display: none; }
  .x-ratio { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .x-hero .x-h1, .x-hero .x-sub, .x-hero .cta, .in .dr.draw, .in .fade-in { animation: none !important; }
}
