@layer reset, base, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body, h1, h2, h3, p, blockquote, pre, ol { margin: 0; }
  button, input { font: inherit; }
  img, svg, canvas { display: block; max-width: 100%; }
  a { color: inherit; }
}

@layer base {
  :root {
    color-scheme: dark;
  }

  html { background: var(--ink); color: var(--bone); }

  body {
    min-width: 320px;
    overflow-x: hidden;
    background:
      radial-gradient(circle at 82% 9%, oklch(24% 0.04 135 / 0.46), transparent 30rem),
      linear-gradient(90deg, transparent 49.94%, oklch(34% 0.025 140 / 0.2) 50%, transparent 50.06%),
      var(--ink);
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
  }

  ::selection { background: var(--sulfur); color: var(--ink); }

  :focus-visible {
    outline: 2px solid var(--sulfur);
    outline-offset: 4px;
  }

  h1, h2, h3 {
    font-family: var(--display);
    font-variation-settings: "SHRP" 45, "CRSV" 0;
    letter-spacing: -0.045em;
  }

  em { font-weight: 300; color: var(--sulfur); }

  .skip-link {
    position: fixed;
    z-index: 100;
    left: 1rem;
    top: 1rem;
    translate: 0 -200%;
    background: var(--sulfur);
    color: var(--ink);
    padding: 0.65rem 1rem;
    font-weight: 700;
    text-decoration: none;
  }

  .skip-link:focus { translate: 0; }
}

@layer components {
  .masthead {
    position: absolute;
    z-index: 20;
    top: 0;
    left: 50%;
    width: var(--page);
    min-height: 5.25rem;
    translate: -50% 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border-bottom: 1px solid var(--line);
  }

  .wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    width: max-content;
    font-family: var(--display);
    font-weight: 650;
    letter-spacing: 0.16em;
    text-decoration: none;
  }

  .wordmark svg { width: 1.55rem; color: var(--sulfur); }
  .wordmark svg circle { fill: currentColor; }
  .wordmark svg path { stroke: currentColor; stroke-width: 1.2; }

  .masthead-status {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--bone-dim);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .status-pulse {
    width: 0.44rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--sulfur);
    box-shadow: 0 0 0 0.28rem var(--sulfur-soft);
  }

  .masthead nav { justify-self: end; display: flex; gap: clamp(1rem, 2.5vw, 2.4rem); }
  .masthead nav a {
    position: relative;
    color: var(--bone-soft);
    font-size: 0.84rem;
    text-decoration: none;
  }
  .masthead nav a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -0.45rem;
    left: 0;
    height: 1px;
    background: var(--sulfur);
    scale: 0 1;
    transform-origin: right;
    transition: scale 240ms var(--ease-out);
  }
  .masthead nav a:hover::after, .masthead nav a:focus-visible::after { scale: 1; transform-origin: left; }

  /* The control loop, drawn once. The plate keeps its own dark ground because
     the drawing is lit for one: it is an instrument reading, not page chrome. */
  .control-loop {
    width: var(--page);
    margin-inline: auto;
    padding-block: clamp(7rem, 13vh, 9rem) clamp(4rem, 7vw, 6.5rem);
    display: grid;
    gap: clamp(2.25rem, 3.4vw, 3rem);
    border-bottom: 1px solid var(--line);
  }

  .control-loop-copy { max-width: 47rem; }

  /* Smaller than the orrery's overlaid hero: here the type shares the first
     screen with the drawing instead of standing in front of it. */
  .control-loop h1 { max-width: 16ch; font-size: clamp(3rem, 5.2vw, 5.4rem); }
  .control-loop .hero-deck { margin-top: clamp(1.3rem, 2vw, 1.9rem); max-width: 44rem; }
  .control-loop .hero-actions { margin-top: 1.7rem; }

  .control-loop-figure { display: grid; gap: 1.15rem; margin: 0; }

  .control-loop-plate {
    padding: 0.5rem;
    border: 1px solid var(--line-bright);
    border-radius: 14px;
    background: oklch(19% 0.016 145);
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  /* Below this width the labels stop being readable, so the plate scrolls
     rather than shrinking the drawing into decoration. */
  .control-loop-plate img { width: 100%; min-width: 58rem; height: auto; }

  .control-loop-figure figcaption {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
    gap: 0.5rem 2.5rem;
    color: var(--bone-dim);
    font-size: 0.86rem;
    line-height: 1.5;
  }

  .control-loop-figure figcaption strong { color: var(--bone-soft); font-weight: 500; }

  .orrery {
    position: relative;
    isolation: isolate;
    min-height: max(47rem, 100svh);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
  }

  .orrery::before {
    content: "";
    position: absolute;
    z-index: -2;
    inset: 0;
    background-image:
      linear-gradient(var(--line) 1px, transparent 1px),
      linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: min(12vw, 11rem) min(12vw, 11rem);
    opacity: 0.16;
    mask-image: linear-gradient(90deg, transparent, black 34%, black 100%);
  }

  #field, .field-fallback {
    position: absolute;
    z-index: -1;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  #field { touch-action: pan-y; cursor: crosshair; }
  .field-fallback { display: grid; place-items: center; opacity: 0.38; }
  .field-fallback svg { width: min(74vmin, 42rem); color: var(--line-bright); }
  .field-fallback circle, .field-fallback path { fill: none; stroke: currentColor; stroke-width: 1; }
  html[data-state="ready"] .field-fallback { display: none; }

  .hero-copy {
    position: absolute;
    z-index: 2;
    top: clamp(9rem, 19vh, 13rem);
    left: max(4vw, calc((100vw - 1440px) / 2));
    width: min(43rem, 48vw);
    pointer-events: none;
  }

  .hero-copy > * { pointer-events: auto; }
  .eyebrow, .section-number, .proof-index {
    color: var(--bone-dim);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }
  .eyebrow { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.6rem; }
  .eyebrow span { color: var(--sulfur); }
  .eyebrow::after { content: ""; width: 4rem; height: 1px; background: var(--line-bright); }

  h1 {
    max-width: 13ch;
    font-size: clamp(3.65rem, 7.3vw, 7.6rem);
    font-weight: 430;
    line-height: 0.86;
  }

  /* The orrery is no longer the page's opening claim, so its heading drops a
     level; it keeps the hero's proportions because it is still a hero. */
  .hero-copy h2 {
    max-width: 13ch;
    font-size: clamp(3rem, 6vw, 6.2rem);
    font-weight: 430;
    line-height: 0.88;
  }
  h1 em, h2 em { font-variation-settings: "SHRP" 20, "slnt" -12; }

  .hero-deck {
    max-width: 38rem;
    margin-top: clamp(1.7rem, 3vw, 2.75rem);
    color: var(--bone-soft);
    font-size: clamp(1.05rem, 1.35vw, 1.32rem);
    line-height: 1.45;
  }

  .hero-actions { display: flex; align-items: center; gap: 2rem; margin-top: 2rem; }
  .primary-action, .text-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1.3rem;
    border: 0;
    color: inherit;
    font: 700 0.78rem/1 var(--body);
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
  }
  .primary-action {
    min-height: 3.2rem;
    padding: 0 1.2rem;
    background: var(--sulfur);
    color: var(--ink);
    box-shadow: inset 0 -1px 0 oklch(30% 0.08 112 / 0.45);
    transition: background 180ms ease, translate 180ms var(--ease-out);
  }
  .primary-action:hover { background: var(--bone); translate: 0 -2px; }
  .text-action { min-height: 2.75rem; padding: 0; background: transparent; color: var(--bone-soft); }
  .text-action:hover { color: var(--sulfur); }
  .text-action .play-symbol { color: var(--sulfur); font-size: 0.9rem; }
  .anchor { border-bottom: 1px solid var(--line-bright); }

  .instrument {
    position: absolute;
    z-index: 4;
    right: max(4vw, calc((100vw - 1440px) / 2));
    bottom: 2rem;
    width: min(40rem, 48vw);
    padding-top: 0.9rem;
    border-top: 1px solid var(--line-bright);
  }
  .instrument-readout {
    display: grid;
    grid-template-columns: 5rem 1fr auto;
    align-items: baseline;
    gap: 1rem;
  }
  .instrument-readout > span { color: var(--bone-dim); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
  .instrument-readout strong { font: 500 1rem var(--display); }
  .instrument-readout #event-detail { text-align: right; }
  .timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.35rem; margin-top: 0.9rem; }
  .timeline button {
    position: relative;
    height: 1.5rem;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
  }
  .timeline button::before { content: ""; position: absolute; inset: 0.68rem 0; background: var(--line); }
  .timeline button span { position: absolute; inset: 0.68rem 100% 0.68rem 0; background: var(--sulfur); }
  .timeline button.is-complete span { right: 0; }
  .timeline button.is-active span { animation: timeline-fill 5.8s linear forwards; }
  .is-paused .timeline button.is-active span { animation-play-state: paused; }
  .instrument-key { margin-top: 0.35rem; color: var(--bone-dim); font-size: 0.68rem; letter-spacing: 0.05em; text-align: right; }

  .field-label {
    position: absolute;
    z-index: 3;
    top: 9rem;
    right: max(4vw, calc((100vw - 1440px) / 2));
    display: grid;
    text-align: right;
  }
  .field-label span, .render-budget span { color: var(--bone-dim); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; }
  .field-label strong { font: 430 1.05rem var(--display); }

  .render-budget {
    position: absolute;
    z-index: 3;
    right: max(4vw, calc((100vw - 1440px) / 2));
    bottom: 7.8rem;
    display: grid;
    text-align: right;
  }
  .render-budget strong { color: var(--bone-soft); font-size: 0.7rem; font-weight: 400; }

  .premise, .atlas, .verification, .architecture, .closing, footer {
    width: var(--page);
    margin-inline: auto;
  }

  .premise {
    display: grid;
    grid-template-columns: 0.55fr 2fr 0.85fr;
    gap: clamp(2rem, 6vw, 7rem);
    padding-block: clamp(6rem, 11vw, 11rem);
    align-items: start;
    border-bottom: 1px solid var(--line);
  }
  .premise blockquote {
    max-width: 25ch;
    font: 430 clamp(2rem, 3.6vw, 4.1rem)/1.06 var(--display);
    letter-spacing: -0.04em;
  }
  .premise > p:last-child { max-width: 23rem; color: var(--bone-soft); font-size: 1.05rem; }

  .atlas { display: grid; grid-template-columns: minmax(18rem, 0.78fr) 1.45fr; gap: clamp(3rem, 9vw, 9rem); padding-block: clamp(6rem, 10vw, 10rem); }
  .section-heading { position: sticky; top: 2rem; align-self: start; }
  .section-heading h2, .architecture h2, .closing h2 {
    margin-top: 1.4rem;
    font-size: clamp(2.8rem, 5.5vw, 6rem);
    font-weight: 430;
    line-height: 0.95;
  }
  .section-heading > p:last-child { max-width: 28rem; margin-top: 2rem; color: var(--bone-soft); }

  .atlas-list { border-top: 1px solid var(--line-bright); }
  .capability {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 2.3rem 4rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
    min-height: 6.1rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 0;
    background: transparent;
    color: var(--bone);
    text-align: left;
    cursor: pointer;
    transition: color 200ms ease, padding 300ms var(--ease-out);
  }
  .capability::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--sulfur); scale: 0 1; transform-origin: right; transition: scale 320ms var(--ease-out); }
  .capability:hover::before, .capability.is-active::before { scale: 1; transform-origin: left; }
  .capability:hover, .capability.is-active { color: var(--ink); padding-inline: 1rem; }
  .capability-index, .capability-count { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
  .capability strong { display: block; font: 500 1.25rem var(--display); letter-spacing: -0.02em; }
  .capability small { display: block; color: var(--bone-dim); font-size: 0.82rem; }
  .capability:hover small, .capability.is-active small { color: oklch(32% 0.03 110); }

  .capability-mark { position: relative; width: 2.8rem; aspect-ratio: 1; display: block; color: var(--sulfur); transition: rotate 500ms var(--ease-out), color 200ms; }
  .capability:hover .capability-mark, .capability.is-active .capability-mark { color: var(--ink); rotate: 45deg; }
  .capability-mark::before, .capability-mark::after, .capability-mark i { content: ""; position: absolute; border: 1px solid currentColor; }
  .mark-all::before { inset: 0; border-radius: 50%; }
  .mark-all::after { inset: 0.55rem; border-radius: 50%; }
  .mark-all i { inset: 1.15rem; background: currentColor; border-radius: 50%; }
  .mark-selection::before { inset: 0.2rem; clip-path: polygon(50% 0, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%); }
  .mark-selection::after { inset: 0.85rem; rotate: 45deg; }
  .mark-affinity::before { inset: 0.15rem 0.55rem; border-top: 0; border-radius: 0 0 50% 50%; }
  .mark-affinity::after { left: 50%; top: 0.15rem; bottom: 0.3rem; border-width: 0 0 0 1px; }
  .mark-topology::before { inset: 0.2rem 0.5rem 0.8rem 0; }
  .mark-topology::after { inset: 0.8rem 0 0.2rem 0.5rem; }
  .mark-health::before { inset: 0.1rem; border-radius: 50%; border-width: 1px 0; }
  .mark-health::after { inset: 0.65rem; border-radius: 50%; border-width: 0 1px; }
  .mark-discovery::before { inset: 0.2rem; border-radius: 50%; }
  .mark-discovery::after { inset: 0.75rem; border-radius: 50%; }
  .mark-discovery i { inset: 1.2rem; background: currentColor; border-radius: 50%; }
  .mark-observe::before { inset: 0.55rem 0; border-radius: 50%; }
  .mark-observe::after { inset: 0.95rem; border-radius: 50%; background: currentColor; }
  .mark-runtime::before { inset: 0.3rem 0; border-radius: 50% 50% 0 0; border-bottom: 0; }
  .mark-runtime::after { inset: 1.1rem 0.45rem 0.15rem; border-top: 0; }

  .verification {
    display: grid;
    grid-template-columns: minmax(18rem, 0.7fr) 1.55fr;
    gap: clamp(3rem, 9vw, 9rem);
    padding-block: clamp(6rem, 10vw, 10rem);
    border-top: 1px solid var(--line);
  }
  .verification-heading h2 { font-size: clamp(2.8rem, 5vw, 5.6rem); }
  .provenance { display: flex; gap: 0.8rem; margin-top: 2rem; color: var(--bone-soft); font-size: 0.8rem; }
  .provenance-mark { flex: 0 0 auto; width: 0.65rem; height: 0.65rem; margin-top: 0.3rem; border: 1px solid var(--sulfur); rotate: 45deg; }
  .provenance p { margin: 0; }
  .provenance strong { color: var(--bone); font-weight: 500; }
  .provenance a { text-decoration-color: var(--line-bright); text-underline-offset: 0.22rem; }

  .ledger { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-bright); }
  .ledger article {
    position: relative;
    min-height: 21rem;
    padding: 2rem clamp(1.25rem, 3vw, 2.5rem) 2.2rem 0;
    border-bottom: 1px solid var(--line);
  }
  .ledger article:nth-child(even) { padding-left: clamp(1.25rem, 3vw, 2.5rem); border-left: 1px solid var(--line); }
  .ledger article:last-child { grid-column: 1 / -1; min-height: 16rem; }
  .ledger h3 { margin-top: 4rem; font-size: 1.7rem; font-weight: 500; }
  .ledger article > p:not(.proof-index) { max-width: 31rem; margin-top: 0.85rem; color: var(--bone-soft); }
  .proof-value { display: block; margin-top: 2rem; color: var(--sulfur); font: 430 clamp(2.5rem, 4vw, 4rem)/1 var(--display); letter-spacing: -0.05em; }
  .proof-unit { color: var(--bone-dim); font-size: 0.76rem; }
  .proof-index { display: flex; justify-content: space-between; gap: 1rem; }
  .proof-index span { color: var(--sulfur); }
  .ledger article[data-status="failed"] .proof-index span,
  .ledger article[data-status="failed"] .proof-value { color: var(--oxide); }
  .ledger article[data-status="unavailable"] .proof-index span { color: var(--bone-dim); }
  .proof-symbol { position: absolute; top: 1.6rem; right: 1.4rem; width: 3.5rem; aspect-ratio: 1; color: var(--sulfur); }
  .proof-symbol i, .proof-symbol::before, .proof-symbol::after { content: ""; position: absolute; border: 1px solid currentColor; }
  .symbol-ordinary i { width: 0.38rem; aspect-ratio: 1; top: 50%; left: 50%; border-radius: 50%; background: currentColor; }
  .symbol-ordinary i:nth-child(1) { translate: -1.2rem -1rem; }
  .symbol-ordinary i:nth-child(2) { translate: 0.8rem -0.1rem; }
  .symbol-ordinary i:nth-child(3) { translate: -0.7rem 1rem; }
  .symbol-property::before { inset: 0.25rem; border-radius: 50%; }
  .symbol-property::after { inset: 0.75rem; border-radius: 50%; border-style: dashed; }
  .symbol-property i { width: 0.45rem; aspect-ratio: 1; top: 0.1rem; left: 50%; border-radius: 50%; background: currentColor; }
  .symbol-mutation::before { inset: 0.25rem; clip-path: polygon(50% 0, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%); }
  .symbol-mutation::after { left: 48%; top: 0.2rem; height: 3.1rem; rotate: 18deg; border-width: 0 0 0 1px; }
  .symbol-loom i { inset: 0.1rem 1.5rem; border-width: 0 0 0 1px; transform-origin: center; }
  .symbol-loom i:nth-child(1) { rotate: -35deg; }
  .symbol-loom i:nth-child(2) { rotate: 0deg; }
  .symbol-loom i:nth-child(3) { rotate: 35deg; }
  .symbol-msrv i { left: 0.4rem; right: 0.4rem; height: 0.7rem; border-width: 1px 0 0; }
  .symbol-msrv i:nth-child(1) { top: 0.8rem; }
  .symbol-msrv i:nth-child(2) { top: 1.65rem; }
  .symbol-msrv i:nth-child(3) { top: 2.5rem; }

  .architecture {
    position: relative;
    padding-block: clamp(6rem, 10vw, 10rem);
    border-top: 1px solid var(--line);
  }
  .architecture h2 { max-width: 9ch; }
  .architecture ol {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    margin-top: 5rem;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line-bright);
  }
  .architecture li { position: relative; min-height: 8rem; padding: 1.1rem 1rem 1rem 0; border-bottom: 1px solid var(--line); }
  .architecture li:not(:last-child) { border-right: 1px solid var(--line); }
  .architecture li::before { content: ""; position: absolute; top: -0.27rem; left: 0; width: 0.5rem; aspect-ratio: 1; border-radius: 50%; background: var(--sulfur); }
  .architecture li span, .architecture li small { display: block; color: var(--bone-dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
  .architecture li strong { display: block; margin-top: 1.2rem; font: 500 1rem var(--display); }
  .architecture pre {
    width: min(52rem, 72%);
    margin: 5rem 0 0 auto;
    padding: 2rem 0 2rem clamp(1.5rem, 4vw, 4rem);
    overflow-x: auto;
    border-top: 1px solid var(--line-bright);
    border-bottom: 1px solid var(--line);
    color: var(--bone-soft);
    font: 0.9rem/1.8 "Atkinson Hyperlegible Mono", ui-monospace, monospace;
  }
  .architecture code span { color: var(--oxide); }
  .architecture code b { color: var(--sulfur); font-weight: 400; }

  .closing {
    padding-block: clamp(6rem, 11vw, 11rem);
    border-top: 1px solid var(--line);
  }
  .closing h2 { max-width: 19ch; }
  .closing > div { display: flex; align-items: center; gap: 2rem; margin-top: 3rem; }

  footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 8rem;
    border-top: 1px solid var(--line);
    color: var(--bone-dim);
    font-size: 0.72rem;
  }
  footer p:last-child { justify-self: end; }

  .noscript {
    position: fixed;
    z-index: 99;
    right: 1rem;
    bottom: 1rem;
    max-width: 28rem;
    padding: 1rem;
    background: var(--bone);
    color: var(--ink);
  }
}

@layer utilities {
  .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;
  }

  @keyframes timeline-fill { to { right: 0; } }
  @keyframes status-breathe { 50% { opacity: 0.48; scale: 0.72; } }
  html[data-state="ready"] .status-pulse { animation: status-breathe 2.4s ease-in-out infinite; }
  html[data-verification="failed"] .status-pulse { background: var(--oxide); box-shadow: 0 0 0 0.28rem oklch(69% 0.17 38 / 0.2); }
  html[data-verification="failed"] .provenance-mark { border-color: var(--oxide); }
  html[data-freshness="stale"] .status-pulse { background: var(--oxide); box-shadow: 0 0 0 0.28rem oklch(69% 0.17 38 / 0.2); }
}

@media (max-width: 900px) {
  :root { --page: min(90vw, 720px); }
  .control-loop { padding-block: 7.5rem clamp(3rem, 8vw, 4.5rem); }
  .control-loop-plate img { min-width: 52rem; }
  .masthead { grid-template-columns: 1fr auto; }
  .masthead-status { display: none; }
  .masthead nav a:not(:last-child) { display: none; }
  .orrery { min-height: 54rem; }
  .orrery::before { mask-image: linear-gradient(transparent, black 24%); }
  .hero-copy { top: 8.5rem; left: 5vw; width: 90vw; }
  h1 { max-width: 10ch; font-size: clamp(3.25rem, 13vw, 6rem); }
  .hero-deck { max-width: 31rem; }
  #field, .field-fallback { top: 18rem; height: 64%; }
  .field-label { top: 28rem; right: 5vw; }
  .render-budget { bottom: 7.4rem; right: 5vw; }
  .instrument { right: 5vw; bottom: 1.5rem; width: 90vw; }
  .premise { grid-template-columns: 1fr; gap: 2rem; }
  .premise blockquote { max-width: 19ch; }
  .atlas, .verification { grid-template-columns: 1fr; }
  .section-heading { position: static; }
  .architecture ol { grid-template-columns: 1fr; }
  .architecture li { min-height: 5rem; border-right: 0 !important; }
  .architecture li::before { top: 1.2rem; left: -0.25rem; }
  .architecture li { padding-left: 1.5rem; }
  .architecture pre { width: 100%; }
  footer { grid-template-columns: 1fr auto; }
  footer p:nth-child(2) { display: none; }
}

@media (max-width: 580px) {
  .control-loop { padding-block: 6.5rem 3rem; }
  .control-loop-figure figcaption { font-size: 0.8rem; }
  .hero-copy h2 { max-width: 10ch; font-size: clamp(2.6rem, 11vw, 4.6rem); }
  .masthead { min-height: 4.5rem; }
  .orrery { min-height: 51rem; }
  .hero-copy { top: 7rem; }
  h1 { font-size: clamp(3rem, 14.3vw, 4.6rem); }
  .hero-deck { font-size: 1rem; max-width: 29rem; }
  .hero-actions { gap: 1rem; flex-wrap: wrap; }
  .primary-action { min-height: 2.9rem; }
  #field, .field-fallback { top: 20.5rem; height: 55%; }
  .field-label { top: 29rem; }
  .render-budget { display: none; }
  .instrument { bottom: 1rem; }
  .instrument-readout { grid-template-columns: auto 1fr; }
  .instrument-readout #event-detail { grid-column: 1 / -1; text-align: left; }
  .instrument-key { display: none; }
  .premise, .atlas, .verification, .architecture, .closing { padding-block: 5rem; }
  .atlas { gap: 3rem; }
  .capability { grid-template-columns: 1.6rem 3rem minmax(0, 1fr); gap: 0.7rem; min-height: 5.4rem; }
  .capability-count { display: none; }
  .capability-mark { width: 2.25rem; }
  .capability strong { font-size: 1.05rem; }
  .ledger { grid-template-columns: 1fr; }
  .ledger article, .ledger article:nth-child(even), .ledger article:last-child { grid-column: auto; min-height: 18rem; padding: 1.5rem 0 2rem; border-left: 0; }
  .ledger h3 { margin-top: 3rem; }
  .proof-symbol { right: 0; }
  .architecture pre { font-size: 0.72rem; padding-left: 0; }
  .closing > div { align-items: flex-start; flex-direction: column; }
  footer { min-height: 7rem; }
  footer p:last-child { max-width: 13rem; text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  #replay-button { display: none; }
  .instrument-key { display: none; }
}

@media (prefers-contrast: more) {
  :root { --bone-soft: var(--bone); --bone-dim: oklch(82% 0.02 88); --line: oklch(70% 0.02 88); }
}
