/* Manrope is self-hosted. The weight range matches the variable file. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2");
}

:root {
  --ink: #17243b;
  --cobalt: #4267ee;
  --warm: #f8f7f3;
  --pale: #e7edff;
  --mint: #d9efdf;
  --fail: #c44e43;
  --line: #e3e0d8;
  --soft: #3e4e68;
  --pad: clamp(20px, 4vw, 40px);
  --measure: 62ch;
  --header-h: 77px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--warm);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--cobalt); }
button { font: inherit; cursor: pointer; }
p { margin: 0 0 12px; }
h1, h2, h3 { text-wrap: balance; margin: 0; font-weight: 800; letter-spacing: -0.034em; line-height: 1.08; }
h1 { font-size: clamp(2.25rem, 1.05rem + 3.5vw, 4.75rem); }
h2 { font-size: clamp(1.75rem, 1.15rem + 1.6vw, 2.5rem); letter-spacing: -0.03em; line-height: 1.12; }
h3 { font-size: clamp(1.25rem, 1.05rem + 0.5vw, 1.5rem); letter-spacing: -0.025em; line-height: 1.25; font-weight: 750; }

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
}
::selection { background: var(--pale); color: var(--ink); }

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 6;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--warm);
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
}
.skip:focus { top: 12px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--warm);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-height: 76px;
}
.brand { display: flex; align-items: center; min-height: 44px; color: var(--ink); }
.brand img { width: 168px; height: auto; display: block; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
}
.nav a:hover { background: var(--pale); }
.nav a.nav-guide { color: var(--cobalt); }

.hero {
  background: var(--warm);
  color: var(--ink);
  padding: 4px 0 16px;
}
.hero-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-width: 0;
  padding-top: 8px;
}
.hero-copy { min-width: 0; flex: 1 1 16rem; }
.hero h1 {
  font-size: clamp(1.45rem, 0.95rem + 1vw, 1.9rem);
  line-height: 1.15;
  max-width: 22em;
  font-weight: 750;
}
.hero .lead {
  max-width: 40em;
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 550;
  line-height: 1.35;
  letter-spacing: -0.011em;
  color: var(--ink);
}
.hero .note {
  max-width: 40em;
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 550;
  line-height: 1.35;
  letter-spacing: -0.011em;
  color: var(--soft);
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 28px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  background: var(--cobalt);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.button:hover { background: #3556d4; }
.hero .button:focus-visible,
.hero .quiet:focus-visible,
.hero button:focus-visible {
  outline-color: var(--cobalt);
}
.quiet {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-underline-offset: 4px;
}
.quiet:hover { color: var(--cobalt); }

.demo-frame {
  background: var(--warm);
  color: var(--ink);
  padding: 0;
}
.demo-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 4px 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
}
.demo-kicker i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cobalt);
  display: block;
}
/* First frame stays visible. Do not fade the scene out for motion. */
.team-demo { width: 100%; min-width: 0; }
.team-demo img, .team-demo svg { width: 100%; height: auto; display: block; }
.team-demo picture { display: block; }
#construction-story { margin-top: 8px; min-width: 0; }
#construction-story.is-scroll-linked::after {
  content: "";
  display: block;
  height: 165svh;
}
.construction-stage {
  position: relative;
  background: var(--warm);
  /* One em base so the text block and the canvas budget resolve to the same pixels. */
  font-size: 16px;
  --stage-sticky: var(--header-h);
  /* Track-end rounding pushes a zero-slack stage a couple of pixels under the header. */
  --stage-slack: 8px;
  --feature-gap: 6px;
  --feature-min: 2.7em;
  --analogy-gap: 4px;
  --analogy-min: 2.7em;
  --caption-gap: 4px;
  --caption-min: 4.2em;
  --stage-text: calc(var(--feature-gap) + var(--feature-min) + var(--analogy-gap) + var(--analogy-min) + var(--caption-gap) + var(--caption-min));
  --stage-canvas: clamp(160px, calc(90svh - var(--stage-sticky) - var(--stage-text) - var(--stage-slack)), 650px);
}
#construction-story.is-scroll-linked .construction-stage {
  position: sticky;
  top: var(--stage-sticky);
  z-index: 1;
}
#construction-viewport:not(:has(canvas)) { display: none; }
#construction-viewport:has(canvas) {
  position: relative;
  width: 100%;
  height: var(--stage-canvas);
}
#construction-annotations {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.construction-label {
  position: absolute;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warm) 88%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--line) 75%, transparent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}
 .construction-leaders { position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.construction-leaders line { stroke:var(--cobalt); stroke-opacity:.6; stroke-width:1; shape-rendering:crispEdges; }
.construction-leaders circle { fill:var(--cobalt); stroke:var(--warm); stroke-width:1.5; }

.construction-label[hidden] { display: none; }
span.construction-label:nth-of-type(n+3) { display: none; }
#construction-poster {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: var(--stage-canvas);
  margin: 0 auto;
}
#construction-story.is-scroll-linked #construction-viewport:has(canvas) ~ #construction-poster {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.construction-feature {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 14px;
  min-height: var(--feature-min);
  margin: var(--feature-gap) 0 0;
}
#construction-feature {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
#construction-feature-kind {
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
#construction-feature-kind::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--cobalt);
  vertical-align: -1px;
}
#construction-feature-kind[data-kind="host"] { color: var(--ink); }
#construction-feature-kind[data-kind="host"]::before {
  background: var(--warm);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
#construction-feature-kind[data-kind="library-host"] { color: var(--ink); }
#construction-feature-kind[data-kind="library-host"]::before {
  background: linear-gradient(90deg, var(--cobalt) 50%, var(--ink) 50%);
}
#construction-analogy {
  min-height: var(--analogy-min);
  max-width: 62ch;
  margin: var(--analogy-gap) 0 0;
  font-size: 1em;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.011em;
  color: var(--ink);
}
#construction-caption {
  min-height: var(--caption-min);
  max-width: 62ch;
  margin: var(--caption-gap) 0 0;
  font-size: 1em;
  line-height: 1.4;
  color: var(--ink);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.io {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 48px;
  margin-top: 22px;
}
.io div { padding-top: 18px; border-top: 1px solid var(--line); }
.io h3 { margin-bottom: 8px; }
.io p { margin: 0; max-width: var(--measure); }
.how { padding: 72px 0 64px; }
.how .deck {
  max-width: 38rem;
  margin: 14px 0 8px;
  font-size: 18px;
  line-height: 1.5;
}
.flow { list-style: none; margin: 28px 0 0; padding: 0; }
.flow li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(200px, 280px);
  gap: 8px 28px;
  align-items: start;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.flow .index {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--cobalt);
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}
.flow h3 { margin-bottom: 6px; }
.flow p { margin: 0; max-width: var(--measure); }
.flow .aside {
  margin: 4px 0 0;
  color: var(--soft);
  font-size: 16px;
  line-height: 1.45;
}

.metaphor { background: var(--pale); padding: 48px 0; }
.metaphor-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px 40px;
  align-items: center;
}
.metaphor img {
  width: min(200px, 46vw);
  height: auto;
  display: block;
  grid-column: 1;
  grid-row: 1;
}
.metaphor-copy { grid-column: 2; grid-row: 1; }
.metaphor h2 { max-width: 16em; }
.metaphor p { max-width: 46ch; margin: 12px 0 0; font-size: 18px; }

.declaration { padding: 72px 0 36px; }
.declaration .deck { max-width: var(--measure); margin: 14px 0 0; font-size: 18px; }
.specimen {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  margin: 28px 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--ink);
}
.specimen-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-height: 56px;
  padding: 8px 16px;
}
.specimen-label {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
}
.specimen-code { color: var(--warm); min-width: 0; }
.specimen-out {
  background: var(--warm);
  color: var(--ink);
  border-left: 4px solid var(--mint);
  min-width: 0;
}
.specimen pre {
  margin: 0;
  padding: 4px 18px 20px;
  overflow-x: auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0;
}
.specimen code { font: inherit; }
.copy {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(248, 247, 243, 0.45);
  background: transparent;
  color: var(--warm);
  font-size: 16px;
  font-weight: 700;
}
.copy[hidden] { display: none; }
.copy:hover { border-color: #fff; }
.note { max-width: var(--measure); margin: 0; font-size: 16px; color: var(--soft); }
.note strong { color: var(--ink); font-weight: 750; }

.usage { min-width: 0; padding: 8px 0 12px; }
.usage .wrap { min-width: 0; }
.usage h2 {
  max-width: 16em;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.usage-tag {
  margin: 6px 0 0;
  color: var(--soft);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}
.usage-code {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 14px 0 0;
  padding: 16px 18px;
  overflow-x: auto;
  background: var(--ink);
  color: var(--warm);
  border-radius: 10px;
  font: 14px/1.55 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
.usage-code code { display: block; font: inherit; }
.usage-inline { display: block; width: max-content; white-space: pre; }
.usage-stack { display: none; }
.usage-facts { margin: 16px 0 0; }
.usage-facts p {
  max-width: 62ch;
  margin: 4px 0 0;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.45;
}
.usage-facts p:first-child { margin-top: 0; }
.close { padding: 12px 0 48px; }
.close-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.close p { max-width: 62ch; margin: 0; font-size: 17px; color: var(--ink); }
.close a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  font-weight: 750;
  text-underline-offset: 4px;
}

.guide-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px 48px;
  padding-top: 36px;
  padding-bottom: 72px;
  align-items: start;
}
.contents { position: sticky; top: 92px; }
.contents-label {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.contents ol { list-style: none; margin: 0; padding: 0; }
.contents a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-left: 12px;
  border-left: 2px solid #d5d8e4;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}
.contents a:hover { border-left-color: var(--cobalt); color: var(--cobalt); }
.guide-intro { margin-bottom: 12px; }
.guide-main { min-width: 0; }
.guide .specimen { grid-template-columns: minmax(0, 1fr); }
.guide .specimen-out { border-left: 0; border-top: 1px solid var(--line); }
.guide-intro h1 { max-width: 15em; font-size: clamp(2.2rem, 3.5vw, 3.2rem); }
.guide-intro h1 span { display: block; }
.guide-intro .lead { max-width: 38rem; margin-top: 16px; font-size: 18px; }
.boundary {
  max-width: 46rem;
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 17px;
}
.block { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.block h2 { max-width: 18em; }
.block .deck { max-width: var(--measure); margin: 12px 0 0; font-size: 18px; }
.block h3 { margin: 28px 0 8px; }
.block p { max-width: var(--measure); }
.block ul, .block ol.plain { margin: 8px 0 0; padding: 0 0 0 1.2em; max-width: var(--measure); }
.block li { margin: 6px 0; }
.block code, p code, li code, dd code {
  overflow-wrap: anywhere;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.92em;
  letter-spacing: 0;
}
.lanes { margin: 18px 0 8px; }
.lane { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 8px; }
.lane-name { font-size: 16px; font-weight: 750; }
.track {
  display: flex;
  height: 40px;
  background: var(--pale);
  border-radius: 8px;
  overflow: hidden;
}
.track b {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  font-style: normal;
  letter-spacing: 0;
}
.span3 { width: 42.857%; }
.span2 { width: 28.5715%; }
.track b + b { border-left: 2px solid var(--pale); }
.command { max-width:100%; padding:16px 18px; overflow-x:auto; background:var(--ink); color:var(--warm); border-radius:10px; font:15px/1.55 ui-monospace, monospace; }
.command code { font:inherit; }
.copy:focus-visible { outline-color: var(--warm); }
.track .w0 { background: var(--cobalt); }
.track .w1 { background: var(--ink); }
.axis {
  display: flex;
  justify-content: space-between;
  margin-left: 102px;
  color: var(--soft);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.table-wrap { margin: 16px 0; overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
caption {
  caption-side: top;
  text-align: left;
  font-weight: 800;
  font-size: 16px;
  padding-bottom: 8px;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
th { font-weight: 800; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.license-details summary { cursor: pointer; min-height:44px; display:flex; align-items:center; font-weight:700; }
.license-details summary:focus-visible { outline:3px solid var(--cobalt); outline-offset:3px; }
.license {
  margin: 16px 0 0;
  max-width: 70ch;
  font-size: 16px;
  line-height: 1.55;
  white-space: pre-wrap;
  font-family: "Manrope", system-ui, sans-serif;
}

@media (max-width: 960px) {
  .hero { padding: 4px 0 12px; }
  .hero-grid, .specimen, .metaphor-grid, .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .metaphor img, .metaphor-copy { grid-column: auto; grid-row: auto; }
  .specimen-out { border-left: 0; border-top: 4px solid var(--mint); }
  .contents { position: static; }
  .contents ol { display: flex; flex-wrap: wrap; gap: 0 8px; }
  .contents a { border-left: 0; padding: 0 10px; background: #fff; border-radius: 8px; }
}
@media (max-width: 600px) {
  :root { --header-h: 65px; }
  .bar { flex-wrap: nowrap; min-height: 64px; gap: 8px; }
  .brand img { width: 136px; }
  .nav { flex-wrap: nowrap; gap: 0; }
  .nav a { font-size: 14px; padding: 0 8px; }
  .usage-code { overflow-x: hidden; }
  .usage-inline { display: none; }
  .usage-stack {
    display: block;
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}
@media (max-width: 720px) {
  .hero h1 { font-size: clamp(1.4rem, 4.8vw, 1.7rem); }
  .hero .lead { margin-top: 2px; font-size: 15px; line-height: 1.3; }
  .hero .note { font-size: 14px; line-height: 1.35; }
  .hero-grid { gap: 28px; }
  h1 { font-size: clamp(2.25rem, 8vw, 2.75rem); }
  .flow li { grid-template-columns: 1fr; }
  .flow .index { padding-top: 0; }
  .how, .declaration { padding: 48px 0 36px; }
  .axis { margin-left: 0; }
  .lane { grid-template-columns: 1fr; }
  .track b { font-size: 12px; }
  .io { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero {
    display: flex;
    flex-direction: column;
    height: calc(100svh - var(--header-h));
  }
  .hero-band { flex: 0 0 auto; }
  .hero > .wrap { min-width: 0; }
  .hero > .wrap:not(.hero-band) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  #construction-story {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .construction-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .construction-feature,
  #construction-analogy,
  #construction-caption { flex: 0 0 auto; }
  #construction-viewport:has(canvas) {
    flex: 1 1 auto;
    height: auto;
    min-height: 160px;
    max-height: 650px;
  }
  #construction-poster {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 160px;
    max-height: 650px;
    object-fit: contain;
  }
  #construction-story.is-scroll-linked::after { content: none; display: none; height: 0; }
  #construction-story.is-scroll-linked .construction-stage { position: static; }
  #construction-story.is-scroll-linked #construction-viewport:has(canvas) ~ #construction-poster {
    position: static;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 160px;
    max-height: 650px;
    margin: 0 auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    object-fit: contain;
  }
}
#construction-viewport canvas { display:block; width:100%; height:100%; }
#construction-poster[hidden], #construction-viewport[hidden] { display:none; }
