/* WorldEngine — typography, layout, chapters. The worldline lives in the canvas. */

@font-face {
  font-family: 'Hanken Grotesk';
  src: url('../fonts/HankenGrotesk-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('../fonts/HankenGrotesk-VariableItalic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #f4f1ea;
  --ink: #1c1b19;
  --ink-2: #6a655d;
  --ink-3: #a39f96;
  --accent: #d64a21;
  --rule: color-mix(in srgb, var(--ink) 14%, transparent);
  --font: 'Hanken Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --pad: clamp(20px, 5.5cqw, 88px);
  --nav-h: 64px;
  --col: min(46cqw, 900px);
  --ease: cubic-bezier(0.16, 0.7, 0.18, 1);
}

* { box-sizing: border-box; }
html {
  background: var(--bg);
  scrollbar-gutter: stable;
  color: var(--ink);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none; /* no rubber-banding, and no back/forward from a sideways trackpad swipe */
}
body {
  margin: 0;
  background: var(--bg);
  font-family: var(--font);
  font-size: clamp(16px, 0.55cqw + 13px, 19px);
  line-height: 1.45;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
}
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 5px; border-radius: 1px; }
a { color: inherit; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: fixed; top: 10px; left: 10px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 8px 12px; text-decoration: none; font-size: 14px;
  transform: translateY(-160%); transition: transform 0.2s;
}
.skip:focus { transform: none; }

/* ---------------------------------------------------------------- canvas */
#worldline {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%; display: block;
}
html.no-webgl #worldline { display: none; }
html.is-manifold-hover, html.is-manifold-hover #worldline { cursor: grab; }
html.is-manifold-dragging, html.is-manifold-dragging * { cursor: grabbing !important; user-select: none; }
.manifold-grip {
  position: fixed; left: -3px; top: -3px; width: 6px; height: 6px;
  border: 1px solid var(--accent); border-radius: 50%; background: var(--bg);
  z-index: 4; opacity: 0; pointer-events: none;
}
.fallback { display: none; }
html.no-webgl .fallback {
  display: block; position: absolute; right: 6cqw; top: 50%; width: min(44cqw, 640px); transform: translateY(-50%);
  color: var(--ink); opacity: 0.85;
}

/* ---------------------------------------------------------------- nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 22px var(--pad); pointer-events: none;
}
.nav > * { pointer-events: auto; }
.wordmark {
  font-weight: 540; letter-spacing: -0.015em; font-size: 1.02rem; text-decoration: none; color: var(--ink);
}
.nav-links { display: flex; gap: 30px; justify-self: center; }
.nav-links a, .nav-cta, .footer-links a {
  font-size: 0.92rem; color: var(--ink-2); text-decoration: underline; text-decoration-color: transparent;
  text-underline-offset: 0.28em; text-decoration-thickness: 1px; transition: color 0.3s, text-decoration-color 0.3s;
}
.nav-links a:hover, .nav-cta:hover, .footer-links a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.nav-cta { justify-self: end; color: var(--ink); }
.arr { display: inline-block; margin-left: 0.35em; font-weight: 400; transition: transform 0.35s var(--ease); }
a:hover .arr { transform: translate(2px, -2px); }
.cta-quiet:hover .arr, a[href^='#']:hover .arr { transform: translate(0, 2px); }

/* ---------------------------------------------------------------- stage */
.stage { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.act { position: absolute; inset: 0; }
.block { position: absolute; max-width: var(--col); }
.block.wide { max-width: min(82cqw, 1400px); }
.block.narrow { max-width: min(40cqw, 760px); }
.block.mid { max-width: min(56cqw, 1000px); }
.at-hero { left: var(--pad); top: 50%; transform: translateY(-56%); max-width: min(82cqw, 1400px); }
.at-ml { left: var(--pad); top: 50%; transform: translateY(-50%); }
.at-bl { left: var(--pad); bottom: clamp(48px, 9svh, 120px); }
.at-b { left: var(--pad); bottom: clamp(36px, 6svh, 80px); }
.at-tl { left: var(--pad); top: calc(var(--nav-h) + 2.5svh); }
.at-tr { right: var(--pad); top: calc(var(--nav-h) + 3svh); max-width: min(34cqw, 470px); }
.at-tc { left: var(--pad); right: var(--pad); top: 12svh; margin-inline: auto; width: fit-content; text-align: center; max-width: min(90cqw, 1500px); }
.at-br { right: var(--pad); bottom: clamp(36px, 6svh, 80px); text-align: right; }

[data-beat] { opacity: 0; }
[data-beat]:not(.is-live) { visibility: hidden; }
[data-beat].is-fading { will-change: opacity, transform; }
.is-live { pointer-events: auto; }
.mark.is-live, .ego-frame.is-live { pointer-events: none; }

/* ---------------------------------------------------------------- type */
.display {
  font-size: clamp(2.4rem, 4.25cqw + 0.4rem, 5.6rem);
  line-height: 1.01; letter-spacing: -0.03em; font-weight: 400; text-wrap: balance;
}
.display-2 {
  font-size: clamp(1.9rem, 2.85cqw + 0.5rem, 3.9rem);
  line-height: 1.06; letter-spacing: -0.024em; font-weight: 400; text-wrap: balance;
}
.display-3 {
  font-size: clamp(1.6rem, 2.1cqw + 0.5rem, 2.9rem);
  line-height: 1.08; letter-spacing: -0.02em; font-weight: 430; text-wrap: balance;
}
.lede {
  font-size: clamp(1.25rem, 1.15cqw + 0.72rem, 1.85rem);
  line-height: 1.22; letter-spacing: -0.014em; font-weight: 460; max-width: 24ch; margin-bottom: 0.5em;
}
.sub { color: var(--ink-2); max-width: 52ch; margin-bottom: 1.7em; text-wrap: pretty; font-size: clamp(1rem, 0.35cqw + 0.88rem, 1.18rem); line-height: 1.5; }
.support {
  color: var(--ink-2); margin-top: 1em; max-width: 58ch; font-size: clamp(1.02rem, 0.35cqw + 0.9rem, 1.2rem);
  line-height: 1.5; text-wrap: pretty;
}
.scale-counter { font-variant-numeric: tabular-nums; }
.insight {
  color: var(--ink); font-size: clamp(1.05rem, 0.5cqw + 0.85rem, 1.3rem); line-height: 1.45; max-width: 30ch;
  text-wrap: pretty; font-weight: 430;
}
.thesis { margin-top: clamp(28px, 4.5svh, 56px); }
.annot {
  font-size: 14px; letter-spacing: 0.012em; color: var(--ink-2); font-weight: 520; line-height: 1.4;
  margin-bottom: 1em; font-variant-numeric: tabular-nums;
}
.annot.legend { font-size: 15px; color: var(--ink); }
.mission { margin-top: 2.2em; }
.accent { color: var(--accent); }

.display .line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.display .line-in { display: block; transform: translateY(108%); transition: transform 1.25s var(--ease); }
.display .line:nth-child(2) .line-in { transition-delay: 0.14s; }
html.is-in .display .line-in { transform: none; }

.scroll-hint { position: absolute; left: var(--pad); bottom: 28px; color: var(--ink-3); margin: 0; }
.scroll-hint::after {
  content: ''; display: block; width: 1px; height: 28px; margin: 10px 0 0 2px; background: var(--ink-3);
  transform-origin: top; animation: hint 2.6s var(--ease) infinite;
}
@keyframes hint { 0% { transform: scaleY(0); } 45% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------------------------------------------------------------- calls to action */
.ctas { display: flex; flex-wrap: wrap; gap: 12px 30px; align-items: baseline; }
.cta {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 1rem; display: inline-flex; align-items: baseline;
  border-bottom: 1px solid var(--ink); padding-bottom: 3px; transition: border-color 0.3s, color 0.3s;
}
.cta:hover { border-color: var(--accent); }
.cta-quiet { color: var(--ink-2); border-color: transparent; }
.cta-quiet:hover { color: var(--ink); border-color: transparent; }
.block .ctas { margin-top: 1.6em; }
.thesis .ctas { margin-top: 0; }
.final .display-2 { font-size: clamp(1.6rem, 2.15cqw + 0.5rem, 3rem); }

/* ---------------------------------------------------------------- anchored annotations */
.mark {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font-size: 15px; font-weight: 500; color: var(--ink); line-height: 1.35; letter-spacing: 0.006em;
  font-variant-numeric: tabular-nums;
}
.mark.fig > span { font-size: 18px; font-weight: 500; }
.mark.cap.hl { font-size: 13px; color: var(--ink); font-weight: 480; }
.mark.cap.hl > span { font-size: 13px; }
.mark > span { display: inline-block; transform: translate(0, -100%); padding-bottom: 10px; }
.mark[data-place='left'] > span { transform: translate(-100%, -50%); padding: 0 12px 0 0; }
.mark[data-place='right'] > span { transform: translate(0, -50%); padding: 0 0 0 12px; }
.mark[data-place='below'] > span { transform: translate(-50%, 0); padding: 10px 0 0; }
.mark[data-place='above'] > span { transform: translate(-50%, -100%); padding: 0 0 10px; }
.mark.cap { color: var(--ink-2); font-weight: 450; }
/* captions select themselves: an inverted sweep passes over the words, in turn */
.mark.cap.hl > span { position: relative; padding: 3px 7px; margin: 0 0 0 -7px; }
.mark.cap.hl[data-place='right'] > span { margin-left: 5px; }
.mark.cap.hl > span::after {
  content: attr(data-text); position: absolute; inset: 0; padding: 3px 7px; box-sizing: border-box; white-space: nowrap;
  background: var(--ink); color: var(--bg); clip-path: inset(0 100% 0 0);
  animation: select 4.4s cubic-bezier(0.5, 0, 0.2, 1) infinite; animation-delay: var(--d, 0s);
}
@keyframes select {
  0% { clip-path: inset(0 100% 0 0); }
  14% { clip-path: inset(0 0 0 0); }
  38% { clip-path: inset(0 0 0 0); }
  52% { clip-path: inset(0 0 0 100%); }
  100% { clip-path: inset(0 0 0 100%); }
}
@media (prefers-reduced-motion: reduce) { .mark.cap.hl > span::after { animation: none; } }
.mark.req > span::after {
  content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  margin-left: 10px; vertical-align: middle; transform: translateY(-1px);
}
.mark.req[data-place='left'] > span { padding-right: 6px; }
.mark.ch { color: var(--ink-2); }
.mark small {
  display: block; font-size: 13px; letter-spacing: 0.01em; color: var(--ink-2); margin-top: 3px; font-weight: 450;
  opacity: calc(0.45 + 0.55 * var(--near, 0)); transition: opacity 0.25s;
}
.stage-mark > span { font-size: 16px; }
.stage-mark.first[data-place='above'] > span { transform: translate(0, -100%); }
.stage-mark.last[data-place='above'] > span { transform: translate(-100%, -100%); }
.stage-mark.ret > span { text-align: center; }

.stage-mark small { opacity: calc(0.75 + 0.25 * var(--near, 0)); }
.stage-mark small { white-space: nowrap; line-height: 1.35; }
.stage-mark.ret small { color: var(--ink-2); }
.mark.big > span { font-size: clamp(1.15rem, 1.4cqw + 0.45rem, 1.7rem); font-weight: 440; letter-spacing: -0.012em; }
.mark[data-anchor='stream'] > span, .mark[data-anchor='block'] > span { padding: 0; }
.mark.loop > span { padding: 0; }
.block.loop-legend { left: var(--pad); right: var(--pad); max-width: none; text-align: center; }
.loop-legend .legend { text-wrap: balance; }
@media (max-width: 760px), (max-aspect-ratio: 9/10) {
  .mark[data-anchor='looplabel:world'] > span { transform: translate(-50%, -100%); }
  .mark[data-anchor='looplabel:agent'] > span { transform: translate(-50%, 0); }
}
@media (max-height: 500px) and (min-aspect-ratio: 11/10) {
  .mark[data-anchor='looplabel:world'] > span { transform: translate(-100%, -50%); }
  .mark[data-anchor='looplabel:agent'] > span { transform: translate(0, -50%); }
}
.mark.loop-arrow > span {
  font-size: 1.35rem; padding: 0; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); color: var(--ink); line-height: 1;
}
.req-list { display: none; }
.narrow-only { display: none; }

/* the first-person frame */
.ego-frame {
  position: absolute; inset: 11svh 5cqw 11svh 5cqw; --c: var(--ink-2);
  background:
    linear-gradient(var(--c), var(--c)) top left / 26px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 1.5px 26px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 26px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 1.5px 26px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 26px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 1.5px 26px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 26px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 1.5px 26px no-repeat;
}
.ego-frame > span { position: absolute; left: 0; top: -24px; font-size: 14px; color: var(--ink-2); font-weight: 500; }

/* the close: statement, mission, calls to action, centred beneath the world */
.at-bc { left: var(--pad); right: var(--pad); bottom: clamp(40px, 7svh, 96px); margin-inline: auto; width: fit-content; text-align: center; max-width: min(90cqw, 1100px); }
.end .display-3 { font-size: clamp(1.4rem, 1.6cqw + 0.5rem, 2.4rem); color: var(--ink); }
.end .support { margin-top: 0.7em; max-width: 70ch; }
.end .mission-big { margin-top: 1.6em; color: var(--ink); font-weight: 440; font-size: clamp(1.6rem, 2.1cqw + 0.5rem, 3rem); }
.end .ctas { margin-top: 1.2em; }

/* the golden sentence never wraps mid-line */
.golden .display { font-size: min(clamp(2.4rem, 4.25cqw + 0.4rem, 5.6rem), 5cqw); }
.golden .nowrap { white-space: nowrap; }
.foot-row { display: flex; gap: 26px; justify-content: flex-end; font-size: 0.92rem; color: var(--ink-2); }
.foot-row a { color: var(--ink-2); text-decoration: none; }
.foot-row a:hover { color: var(--ink); }
.foot-row .fine { color: var(--ink-3); }


/* real text among the writing */
.snips { position: absolute; inset: 0; overflow: hidden; }
.snip {
  position: absolute; left: 0; top: 0; white-space: nowrap; color: var(--ink); font-weight: 500; line-height: 1;
  transform-origin: left center; opacity: 0; letter-spacing: 0.01em;
  font-family: 'Caveat', 'Long Cang', 'Zen Kurenaido', 'Nanum Pen Script', 'Kalam', 'Aref Ruqaa', cursive;
}
.snip.code { font-family: 'JetBrains Mono', Menlo, monospace; font-weight: 400; letter-spacing: 0; color: var(--ink-2); }
.snip.math { font-family: 'STIX Two Text', 'Times New Roman', serif; font-style: italic; font-weight: 400; letter-spacing: 0.02em; }

/* ---------------------------------------------------------------- scroll spans */
.scroll { position: relative; z-index: 1; }
.span { height: calc(var(--len) * max(680px, 100svh)); }
/* Enough document height to reach progress 8 and rest on the complete ending. */
.scroll::after { content: ''; display: block; height: 100svh; }
.span[data-act='threshold'] { --len: 2.6; }
.span[data-act='gap'] { --len: 4.8; }
.span[data-act='inversion'] { --len: 5.6; }
.span[data-act='structure'] { --len: 10.8; }
.span[data-act='hierarchy'] { --len: 9; }
.span[data-act='model'] { --len: 10.8; }
.span[data-act='engine'] { --len: 6.8; }
.span[data-act='expand'] { --len: 5.6; }


/* ---------------------------------------------------------------- footer: part of the final globe composition */
.closing-footer { position: absolute; z-index: 1; left: var(--pad); right: var(--pad); bottom: max(20px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; font-size: 13px; color: var(--ink-2); }
.closing-footer::before { content: ''; position: absolute; z-index: -1; inset: -32px calc(-1 * var(--pad)) -32px; background: linear-gradient(transparent, var(--bg) 55%); pointer-events: none; }
.footer-links { display: flex; align-items: center; gap: 28px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }

html.is-dark ::selection { background: var(--bg); color: var(--ink); }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 760px), (max-aspect-ratio: 9/10) {
  :root { --pad: 20px; --col: 100%; --nav-h: 56px; }
  body { font-size: 16px; }
  .nav { grid-template-columns: 1fr auto; padding: 18px var(--pad); }
  .nav-links { display: none; }
  .block { right: var(--pad); }
  .block.narrow, .block.wide, .block.mid { max-width: none; }
  .at-hero { top: calc(var(--nav-h) + 7svh); transform: none; max-width: none; }
  .at-ml { top: calc(var(--nav-h) + 7svh); transform: none; }
  .at-bl { top: 44%; bottom: auto; }
  .at-tl { top: calc(var(--nav-h) + 5svh); }
  .at-tr { left: var(--pad); right: var(--pad); top: calc(var(--nav-h) + 30svh); max-width: none; }
  .at-tc { top: calc(var(--nav-h) + 6svh); max-width: none; width: auto; margin: 0; text-align: left; }
  .end.at-bl { top: auto; bottom: 11svh; }
  .end .display-3 { font-size: clamp(1.2rem, 5cqw, 1.6rem); }
  .end .mission-big { margin-top: 1.1em; font-size: clamp(1.4rem, 6cqw, 1.9rem); }
  .ego-frame { inset: 10svh 4cqw 6svh 4cqw; }
  .display { font-size: clamp(1.9rem, 8.4cqw, 2.8rem); letter-spacing: -0.028em; }
  .display-2 { font-size: clamp(1.7rem, 7.4cqw, 2.4rem); }
  .display-3 { font-size: clamp(1.4rem, 6cqw, 1.9rem); }
  .final .display-2 { font-size: clamp(1.35rem, 5.6cqw, 1.8rem); }
  .lede { font-size: 1.28rem; }
  .thesis { margin-top: 22px; }
  .scroll-hint { display: none; }
  .mark.req, .mark.loop[data-anchor^='loop:0'] { display: none; }
  .mark.cap.hl, .mark.cap.hl > span { font-size: 12px; }
  .mark.fig > span { font-size: 16px; }
  .golden .display { font-size: clamp(1.7rem, 7.8cqw, 2.6rem); }
  .golden .nowrap { white-space: normal; }
  .at-br { left: var(--pad); right: var(--pad); bottom: 2.5svh; text-align: left; }
  .closing-footer { flex-direction: column-reverse; justify-content: center; gap: 0; font-size: 12px; }
  .footer-links { justify-content: center; gap: 24px; }
  .foot-row { justify-content: flex-start; gap: 18px; font-size: 0.85rem; }
  .stage-mark.alt { display: none; }
  .mark.ch { display: none; }
  .wide-only { display: none; }
  .narrow-only { display: block; }
  .req-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-top: 1.4em; color: var(--accent); font-size: 14px; font-weight: 500; }
  .req-list li::before { content: '· '; }
}

@media (min-width: 761px) and (max-width: 1080px) {
  .block.narrow { max-width: min(44cqw, 540px); }
  .at-hero { max-width: min(70cqw, 860px); }
  .stage-mark.alt { display: none; }
  .at-tr { max-width: 40cqw; }
}
@media (min-width: 761px) and (min-aspect-ratio: 9/10) {
  [data-act='structure'] .block.narrow { max-width: 37cqw; }
}

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .display .line-in { transition: none; transform: none; }
  .scroll-hint::after { animation: none; transform: none; }
  .arr, .cta, .nav-links a, .mark small { transition: none; }
}

/* The company signs the closing scene; its mission is the main headline. */
.block.closing-copy { left: var(--pad); right: var(--pad); top: clamp(88px, 12svh, 144px); transform: none; max-width: none; text-align: center; }
.closing-brand { font-size: clamp(1.25rem, 2.15cqw, 2rem); font-weight: 560; line-height: 1.15; letter-spacing: -0.035em; }
.closing-copy .display { margin-top: clamp(18px, 2.5svh, 28px); padding-bottom: 0.14em; font-size: clamp(2.8rem, 4.7cqw, 4.7rem); line-height: 1.04; text-wrap: balance; }
.closing-description { max-width: 54ch; margin: clamp(16px, 2.4svh, 24px) auto 0; color: var(--ink-2); font-size: clamp(1rem, 1.3cqw, 1.125rem); line-height: 1.45; text-wrap: balance; }

/* Headline padding keeps descenders inside the text-clipped background.
   A soft highlight travels through the letters, pausing between passes. */
@media (prefers-reduced-motion: no-preference) {
  @supports ((background-clip: text) or (-webkit-background-clip: text)) {
    .mission-shimmer {
      background-image: linear-gradient(110deg,
        var(--ink) 42%,
        color-mix(in srgb, var(--ink) 85%, var(--bg)) 46.5%,
        color-mix(in srgb, var(--ink) 60%, var(--bg)) 49.5%,
        color-mix(in srgb, var(--ink) 60%, var(--bg)) 50.5%,
        color-mix(in srgb, var(--ink) 85%, var(--bg)) 53.5%,
        var(--ink) 58%);
      background-size: 250% 100%;
      background-position: 100% 0;
      background-repeat: no-repeat;
      background-clip: text;
      -webkit-background-clip: text;
      color: transparent;
      -webkit-text-fill-color: transparent;
    }
    .mission-shimmer.is-live { animation: mission-sweep 9s linear infinite; }
  }
}
@keyframes mission-sweep {
  0%, 10% { background-position: 100% 0; }
  70%, 100% { background-position: 0% 0; }
}

.cta { min-height: 44px; align-items: center; }
.nav a { min-height: 24px; }
.engine-steps { display: none; margin: 0; padding: 0; list-style: none; }
.engine-headings { display: grid; }
.engine-headings > div { grid-area: 1 / 1; }
[data-act='engine'] .block.mid { max-width: 44cqw; }
.nav { padding-top: max(20px, env(safe-area-inset-top)); }
.nav::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(var(--bg) 20%, transparent); pointer-events: none; }

@media (max-width: 760px), (max-aspect-ratio: 9/10) {
  :root { --pad: clamp(20px, 5cqw, 40px); }
  .ego-frame { inset: calc(var(--nav-h) + 32px) 4cqw 68px; }
  .ego-frame > span { font-size: 11px; }
  .block.closing-copy { top: calc(var(--nav-h) + 5svh); }
  .closing-copy .display { font-size: clamp(1.8rem, 8.4cqw, 3.6rem); }
  .closing-brand { font-size: clamp(1.25rem, 4.7cqw, 1.6rem); }
  .closing-description { max-width: 36ch; font-size: 15px; margin-top: 18px; }
  [data-act='engine'] .block.mid { max-width: none; }
  [data-act='engine'] .at-tr { top: var(--insight-top, 40svh); }
  .stage-mark { display: none; }
  .engine-steps { position: absolute; left: var(--pad); right: var(--pad); top: var(--engine-steps-top, 44svh); display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 10px; font-size: 13px; }
  .engine-steps li span { display: block; color: var(--ink-2); font-size: 10px; margin-bottom: 4px; }
  .engine-steps li:last-child { color: var(--accent); }
  .foot-row, .footer-links { flex-wrap: wrap; }
  .nav { padding-block: 14px; }
  .nav a { min-height: 32px; display: inline-flex; align-items: center; }
  .nav-cta { font-size: 13px; }
  .mark.big > span { font-size: clamp(1rem, 3cqw, 1.5rem); }
  .mark[data-anchor='block'] > span { transform: translate(-50%, 0); }
  .mark[data-anchor='golden:post'] > span { white-space: normal; width: min(38cqw, 150px); text-align: center; }
  .block.at-bl.narrow { top: var(--structure-note-top, 40%); }
}

@media (min-width: 761px) and (min-aspect-ratio: 9/10) and (max-height: 700px) {
  .display { font-size: min(4.65cqw, 10svh); }
  .display-2 { font-size: min(3.35cqw, 7.5svh); }
  .support { font-size: 16px; }
  .closing-copy .display { font-size: min(4.7cqw, 8svh); }
  .block.closing-copy { top: max(76px, 11svh); }
  .closing-copy .display, .closing-description { margin-top: 16px; }
}


/* One centered viewing area on every display. The canvas and typography share
   its coordinates; extra-wide monitors gain breathing room at the sides. */
.stage, #worldline {
  left: 50%; right: auto; width: min(100%, 1600px); transform: translateX(-50%);
}
.stage { container-type: inline-size; }
.nav { left: 50%; right: auto; width: min(100%, 1600px); transform: translateX(-50%); }
@media (min-width: 1601px) {
  #worldline { mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); }
}
@media (max-height: 500px) and (min-aspect-ratio: 11/10) {
  :root { --nav-h: 48px; --pad: 24px; }
  .nav { padding-block: 10px; }
  .nav-links { display: flex; gap: 20px; }
  .nav { grid-template-columns: 1fr auto 1fr; }
  .at-hero { top: 53%; transform: translateY(-50%); max-width: 75cqw; }
  .display { font-size: clamp(26px, 4.2cqw, 40px); }
  .display-2, .display-3 { font-size: clamp(22px, 3cqw, 30px); }
  .block.narrow, .block.mid, .block { max-width: 44cqw; }
  .block.wide { max-width: 80cqw; }
  .at-ml { top: 52%; transform: translateY(-50%); }
  .at-tl { top: 70px; }
  .at-tc { top: 70px; }
  .at-tr { left: auto; top: 74px; max-width: 34cqw; }
  .at-bl { top: auto; bottom: 20px; }
  .support, .sub { font-size: 14px; line-height: 1.4; }
  .annot { font-size: 11px; margin-bottom: 0.6em; }
  .lede { font-size: 18px; }
  .thesis { margin-top: 16px; }
  .block.closing-copy { top: 62px; }
  .closing-copy .display { font-size: clamp(26px, 7.6svh, 34px); }
  .closing-brand { font-size: 19px; }
  .closing-copy .display { margin-top: 12px; }
  .closing-description { max-width: 62ch; font-size: 14px; margin-top: 10px; }
  .closing-footer { flex-direction: row; justify-content: space-between; bottom: 10px; font-size: 12px; }
  .footer-links { gap: 22px; }
  .golden .display { font-size: 4.5cqw; }
  .mark.fig > span { font-size: 13px; }
  .stage-mark small { display: none; }
  .ego-frame { inset: 70px 16px 20px; }
  .ego-frame > span { top: -16px; }
}

/* Standalone globe home and the shorter, continuous story. */
.home-page, .home-page body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.home-page body { position: fixed; inset: 0; }
.home-page .closing-copy, .home-page .closing-footer { pointer-events: auto; }
.home-page .closing-brand { font-size: clamp(42px, min(12cqw, 18svh), 144px); line-height: 1.02; font-weight: 540; letter-spacing: -.055em; }
.home-page .closing-copy .home-doctrine { margin-top: clamp(20px, 3.2svh, 36px); font-size: clamp(22px, min(3.4cqw, 6svh), 52px); line-height: 1.14; letter-spacing: -.025em; font-weight: 400; }
.home-page .nav-links { display: flex; }
.home-page .story-entry { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.story-page .span[data-act='hierarchy'] { --len: 7.2; }
.story-page .span[data-act='engine'] { --len: 5.8; }
.story-page .span[data-act='closing'] { --len: 2.8; }
.story-closing { left: var(--pad); right: var(--pad); top: clamp(96px,18svh,200px); max-width: none; text-align: center; }
.story-closing .display { margin-top: 24px; font-size: clamp(2.4rem,4.8cqw,4.8rem); line-height: 1.08; }
.story-closing .ctas { justify-content: center; margin-top: 30px; }
@media (max-width:760px), (max-aspect-ratio:9/10) {
  .home-page .nav { grid-template-columns: 1fr auto; }
  .home-page .nav-cta { display: none; }
  .home-page .nav-links { font-size: 14px; }
  .story-closing { top: calc(var(--nav-h) + 10svh); }
  .story-closing .display { font-size: clamp(1.85rem,8.1cqw,3.2rem); }
  .story-closing .ctas { gap: 12px 24px; margin-top: 24px; }
  .story-page .engine-steps { grid-template-columns: repeat(4,1fr); gap: 18px 8px; }
  .story-page .engine-steps li:last-child { display: none; }
  .story-page .stage-mark.ret { display: block; font-size: 14px; }
}
@media (max-height:500px) and (min-aspect-ratio:11/10) {
  .story-closing { top: 72px; }
  .story-closing .closing-brand { font-size: 18px; }
  .story-closing .display { font-size: clamp(24px,7svh,34px); margin-top: 12px; }
  .story-closing .ctas { margin-top: 14px; }
  .story-closing .cta { min-height:32px; font-size:14px; }
}

/* Notes belong to the stage they explain; the later notes travel with the story. */
.stage-note { white-space: normal; font-weight: 400; letter-spacing: 0; }
.stage-note > span { width: min(22cqw, 310px); font-size: clamp(16px, 1.3cqw, 20px); line-height: 1.45; padding-bottom: var(--note-gap, 76px) !important; }
.stage-note.first > span { transform: translate(0, -100%); }
.stage-note.last > span { transform: translate(-100%, -100%); }
.nav-links a[aria-current] { color: var(--ink); text-decoration-color: currentColor; }

.stage-note.between > span { text-align: center; width: min(26cqw, 360px); }
.stage-mark.ret > span { font-size: clamp(28px, 2.5cqw, 40px); font-weight: 500; letter-spacing: -.025em; background: var(--bg); padding: 4px 16px; }
.stage-mark.ret small { color: var(--ink-2); opacity: 1; font-size: 12px; letter-spacing: 0; }

@media (max-width:760px), (max-aspect-ratio:9/10) {
  .nav { grid-template-columns: 1fr auto; }
  .nav-links { display: flex; justify-self: end; gap: 24px; }
  .nav-links a { font-size: 13px; }
  .story-page .nav-cta { display: none; }
  .stage-note > span, .stage-note.between > span { width: min(64cqw, 290px); font-size: 15px; line-height: 1.4; padding-bottom: 0 !important; }
  .stage-note.between > span { width: min(44cqw, 230px); font-size: 14px; }
  .stage-note::after { content: ''; position: absolute; height: 12px; width: 1px; top: 0; left: 0; background: var(--accent); opacity: .55; }
  .stage-mark.ret > span { font-size: 28px; }
}
@media (max-height:500px) and (min-aspect-ratio:11/10) {
  .stage-note > span, .stage-note.between > span { font-size: 14px; line-height: 1.3; width: min(28cqw,230px); }
  .stage-mark.ret > span { display: flex; align-items: baseline; gap: 10px; font-size: 20px; padding: 2px 10px; transform: translate(-50%, 18px); }
  .stage-mark.ret small { display: block; font-size: 10px; margin-top: 0; }
}
@media (max-height:620px) and (max-width:760px) and (max-aspect-ratio:11/10) {
  [data-act='engine'] .display-2 { font-size: 24px; }
  [data-act='engine'] .support { font-size: 14px; line-height: 1.4; }
  .stage-note > span, .stage-note.between > span { width: min(64cqw, 240px); font-size: 13px; line-height: 1.35; }
  .stage-mark.ret > span { display: flex; align-items: baseline; gap: 9px; font-size: 22px; padding: 2px 8px; transform: translate(-50%, 14px); }
  .stage-mark.ret small { font-size: 10px; margin-top: 0; }
}

/* ---------------------------------------------------------------- About us
   The last act is set like the cover: one centered column in the story's own
   type scale, with two scaling plots drawn in ink beneath it. */
.block.about-copy { --about-top: clamp(88px, 12svh, 144px); left: var(--pad); right: var(--pad); top: var(--about-top); max-width: none; text-align: center; }
.about-kicker { margin-bottom: 1.6em; }
.about-body { margin: clamp(22px, 3.6svh, 40px) auto 0; max-width: 62ch; }
.about-body .lede { max-width: none; margin-bottom: 0.8em; text-wrap: balance; }
.about-body .sub { max-width: none; margin-bottom: 1.05em; text-wrap: balance; }
.about-body .ctas { justify-content: center; margin-top: 1.6em; gap: 10px 26px; }
.about-body .cta-quiet { font-weight: 420; }

@media (max-width: 760px), (max-aspect-ratio: 9/10) {
  .block.about-copy { --about-top: calc(var(--nav-h) + 6svh); }
  .about-kicker { margin-bottom: 1.1em; }
  .about-body { margin-top: 18px; }
  .about-body .sub { margin-bottom: 0.9em; }
  .about-body .ctas { margin-top: 1.1em; gap: 6px 20px; }
}
@media (min-width: 761px) and (min-aspect-ratio: 9/10) and (max-height: 760px) {
  .about-copy .display { font-size: min(4.25cqw + 0.4rem, 8svh); }
  .about-body { margin-top: 16px; max-width: 66ch; }
  .about-body .sub { font-size: 15px; line-height: 1.45; margin-bottom: 0.9em; }
  .about-body .ctas { margin-top: 1em; }
}
@media (max-height: 500px) and (min-aspect-ratio: 11/10) {
  .block.about-copy { --about-top: 58px; }
  .about-kicker { margin-bottom: 0.6em; }
  .about-body { margin-top: 10px; max-width: 72ch; }
  .about-body .lede { margin-bottom: 0.5em; }
  .about-body .sub { font-size: 13px; line-height: 1.35; margin-bottom: 0.7em; }
  .about-body .ctas { margin-top: 0.5em; }
  .about-body .cta { min-height: 30px; font-size: 14px; }
}
/* Short screens keep the type readable and can scroll the copy above the footer. */
@media (max-height: 740px) {
  .block.about-copy { max-height: calc(100svh - var(--about-top) - 56px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
  .about-copy:has(> .is-live) { pointer-events: auto; }
}
/* Scaling plots: labels anchored to the drawn axes, in the story's caption sizes. */
.plot-mark > span { font-size: 13px; font-weight: 450; color: var(--ink-2); letter-spacing: 0; }
.plot-title > span { font-size: 15px; font-weight: 500; color: var(--ink); padding-bottom: 12px; }
.plot-mark small { display: block; font-size: 13px; font-weight: 450; color: var(--ink-2); margin-top: 2px; opacity: 1; }
.plot-axis > span { font-size: 12px; transform: translate(0, 0); padding: 6px 0 0 10px; }
.plot-x > span { padding: 8px 0 0; }
.plot-point > span { color: var(--ink); font-weight: 500; }
.plot-today > span { color: var(--ink-2); font-weight: 450; }
.plot-ul > span { transform: translate(-100%, -100%); padding: 0 12px 8px 0; text-align: right; }
.no-plots .plot-mark { display: none; }
@media (max-width: 760px), (max-aspect-ratio: 9/10) {
  .plot-mark > span, .plot-mark small { font-size: 12px; }
  .plot-title > span { font-size: 13px; padding-bottom: 8px; }
  .plot-axis > span, .plot-tick > span { font-size: 11px; }
  .plot-mid, .plot-long, .plot-mark small.plot-long { display: none; }
}

/* Native SVG strokes stay monochrome on iOS, independently of emoji fonts. */
svg.arr, .return-icon { width: 1em; height: 1em; flex: none; vertical-align: -0.12em; }
.story-page .span[data-act='threshold'] { height: 100svh; }

@media (max-width: 760px), (max-aspect-ratio: 9/10) {
  .story-page .span[data-act='threshold'] { height: 80svh; }
  /* Paper follows the animated text's opacity, leaving the illustration open
     everywhere else. Its soft edge avoids a visible card behind the heading. */
  .story-page .block > [data-beat] {
    background: var(--bg);
    box-shadow: 0 0 20px 16px var(--bg);
    border-radius: 2px;
  }
  .nav { background: linear-gradient(to bottom, var(--bg) 72%, transparent); padding-bottom: 26px; }
  .ctas .cta { white-space: nowrap; }
}

/* Safari's collapsing toolbars must not resize and regenerate the story. */
@media (max-width: 760px), (max-aspect-ratio: 9/10) {
  .story-page .stage, .story-page #worldline { height: 100svh; bottom: auto; }
}
