/* InWorld project page — Murea Labs
   Colour tokens follow the technical report's musee.sty (Ink, Muted, Rule, Panel, Link),
   extended with a night surface taken from the report's teaser figure. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f1f4f7;
  --panel-2: #e7ecf1;
  --ink: #111111;
  --ink-2: #3a424b;
  --muted: #66717c;
  --rule: #d5dbe1;
  --link: #0066cc;
  --link-hover: #004c99;
  --night: #0b1526;
  --night-ink: #faf3e6;
  --night-muted: #b7c0cc;

  /* chart roles */
  --ours: #d4452e;
  --other: #7a8693;
  --bar-mid: #6f8396;
  --ghost: #e3e8ee;
  --grid: #e4e8ec;
  --heat-0: #dce7f0; --heat-1: #b9cfe2; --heat-2: #93b4d2; --heat-3: #6c97c0; --heat-4: #4677a8;

  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;

  /* type scale: major third from an 18px serif body */
  --fs-xs: 0.8125rem;   /* 13 */
  --fs-sm: 0.9375rem;   /* 15 */
  --fs-base: 1.125rem;  /* 18 */
  --fs-md: 1.375rem;    /* 22 */
  --fs-lg: 1.75rem;     /* 28 */
  --fs-xl: 2.25rem;     /* 36 */
  --fs-2xl: 2.875rem;   /* 46 */

  --measure: 40rem;
  --wide: 75rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 12px;       /* the report's museefront panel uses a 3.2 mm arc */
  --radius-sm: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b1526;
    --panel: #121f35;
    --panel-2: #1a2a45;
    --ink: #eef1f5;
    --ink-2: #c9d1db;
    --muted: #97a4b4;
    --rule: #26354f;
    --link: #74b4ff;
    --link-hover: #a3ccff;
    --ours: #e55c45;
    --other: #7c8ba0;
    --bar-mid: #7c8ba0;
    --ghost: #22324d;
    --grid: #1f2e47;
    --heat-0: #1b2c47; --heat-1: #24405f; --heat-2: #2f5579; --heat-3: #3d6c96; --heat-4: #5487b6;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-base);
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 3px; }
::selection { background: color-mix(in srgb, var(--link) 22%, transparent); }

.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 100; background: var(--ink); color: var(--bg); padding: 0.5rem 0.9rem; border-radius: var(--radius-sm); font-family: var(--sans); font-size: var(--fs-sm); }
.skip-link:focus { top: 1rem; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout primitives ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }

.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section + .section { border-top: 1px solid var(--rule); }
.section--panel { background: var(--panel); }
.section--panel + .section, .section + .section--panel { border-top: 0; }

h1, h2, h3, h4 { font-family: var(--sans); color: var(--ink); margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(var(--fs-xl), 4.2vw, var(--fs-2xl)); line-height: 1.08; letter-spacing: -0.025em; font-weight: 750; }
h3 { font-size: var(--fs-md); line-height: 1.25; }
h4 { font-size: var(--fs-base); line-height: 1.3; }

.section-head { display: grid; gap: 1.1rem; margin-bottom: clamp(2rem, 4vw, 3rem); max-width: 46rem; }
.section-head .lede { font-size: var(--fs-md); line-height: 1.45; color: var(--ink-2); margin: 0; }
.paper-ref { font-family: var(--sans); font-size: var(--fs-sm); color: var(--muted); margin: 0; }

.sub { margin-top: clamp(3.5rem, 7vw, 5.5rem); }
.sub > h3 { margin-bottom: 1rem; }

.cols { display: grid; gap: clamp(2rem, 5vw, 4.5rem); }
@media (min-width: 60rem) {
  .cols--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cols--text-aside { grid-template-columns: minmax(0, 40rem) minmax(0, 1fr); }
}

.sans { font-family: var(--sans); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }

/* grid children may hold horizontally scrolling content; never let them stretch the page */
.cols > *, .reels > *, .gallery > *, .demo > *, .loop > *, .coop > *, .parts > *, .team > * { min-width: 0; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  font-family: var(--sans);
  color: var(--night-ink);
  transition: background-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.nav__inner { display: flex; align-items: center; gap: 1.5rem; height: 4rem; }
.nav__brand { display: inline-flex; align-items: center; gap: 0.6rem; color: inherit; text-decoration: none; font-weight: 650; font-size: 1rem; letter-spacing: -0.005em; }
.nav__brand svg { width: 1.7rem; height: auto; }
.nav__links { display: flex; gap: 1.35rem; margin-left: auto; list-style: none; padding: 0; margin-block: 0; }
.nav__links a { color: inherit; text-decoration: none; font-size: var(--fs-sm); font-weight: 500; opacity: .86; }
.nav__links a:hover, .nav__links a[aria-current="true"] { opacity: 1; text-decoration: underline; text-underline-offset: .35em; }
.nav.is-solid { background: color-mix(in srgb, var(--bg) 92%, transparent); color: var(--ink); box-shadow: 0 1px 0 var(--rule); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
@media (max-width: 56rem) { .nav__links { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate;
  min-height: min(100svh, 62rem);
  display: grid; align-items: end;
  background: var(--night);
  color: var(--night-ink);
  overflow: hidden;
}
.hero__img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 58% 40%;
  /* The reconstructed artwork already contains crisp edges and balanced colour. */
  filter: none;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  /* Keep shade near the copy; let the airship and vortex retain their detail. */
  background:
    linear-gradient(90deg, rgb(11 21 38 / .66) 0%, rgb(11 21 38 / .42) 30%, rgb(11 21 38 / .08) 56%, rgb(11 21 38 / 0) 74%),
    linear-gradient(0deg, rgb(11 21 38 / .58) 0%, rgb(11 21 38 / .18) 18%, rgb(11 21 38 / 0) 40%),
    linear-gradient(180deg, rgb(11 21 38 / .4) 0%, rgb(11 21 38 / 0) 16%);
}
.hero__content { padding-block: 8rem clamp(3rem, 7vw, 5.5rem); display: grid; gap: 1.4rem; }
.hero__title, .hero__subtitle { text-shadow: 0 2px 14px rgb(0 0 0 / .5); }
.hero__byline, .hero__credit, .nav:not(.is-solid) { text-shadow: 0 1px 6px rgb(0 0 0 / .7); }
@media (max-width: 40rem) {
  .hero::before {
    background:
      linear-gradient(0deg, rgb(11 21 38 / .78) 0%, rgb(11 21 38 / .46) 28%, rgb(11 21 38 / .08) 58%, rgb(11 21 38 / 0) 72%),
      linear-gradient(180deg, rgb(11 21 38 / .42) 0%, rgb(11 21 38 / 0) 18%);
  }
}
.hero__title {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(4.5rem, 15vw, 11.5rem);
  line-height: .86;
  letter-spacing: -0.055em;
  color: var(--night-ink);
  margin-left: -0.04em;
}
.hero__subtitle {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem); line-height: 1.22;
  max-width: 19em; margin: 0; color: var(--night-ink); text-wrap: balance;
}
.hero__byline { font-family: var(--sans); font-size: var(--fs-sm); color: var(--night-muted); margin: 0; }
.hero__byline strong { color: var(--night-ink); font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .6rem; }
.hero__credit { position: absolute; right: var(--gutter); bottom: 1.25rem; margin: 0; font-family: var(--sans); font-size: var(--fs-xs); color: var(--night-muted); max-width: 22rem; text-align: right; }
@media (max-width: 40rem) { .hero__credit { display: none; } }

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--sans); font-weight: 600; font-size: var(--fs-sm);
  padding: .7rem 1.15rem; border-radius: 999px;
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn svg { width: 1.05rem; height: 1.05rem; flex: none; }
.btn--light { background: var(--night-ink); color: var(--night); }
.btn--light:hover { background: #ffffff; color: var(--night); }
.btn--ghost { color: var(--night-ink); border-color: rgb(250 243 230 / .45); background: rgb(11 21 38 / .25); }
.btn--ghost:hover { border-color: var(--night-ink); color: var(--night-ink); background: rgb(11 21 38 / .45); }
.btn[aria-disabled="true"] { opacity: .6; cursor: default; pointer-events: none; }

/* ---------- overview ---------- */
.overview__lead { font-size: clamp(1.35rem, 2.2vw, 1.65rem); line-height: 1.42; margin: 0 0 1.75rem; color: var(--ink); max-width: 34em; }
.abstract { font-size: var(--fs-base); color: var(--ink-2); }
.abstract summary { font-family: var(--sans); font-size: var(--fs-sm); font-weight: 600; color: var(--link); cursor: pointer; list-style: none; display: inline-flex; gap: .4rem; align-items: center; }
.abstract summary::-webkit-details-marker { display: none; }
.abstract summary::before { content: "+"; display: inline-block; width: 1em; text-align: center; }
.abstract[open] summary::before { content: "−"; }
.abstract[open] summary { margin-bottom: 1rem; }

.boards { display: grid; gap: 1.75rem; align-content: start; }
.board { font-family: var(--sans); }
.board__title { font-size: var(--fs-sm); font-weight: 650; margin: 0 0 .15rem; }
.board__note { font-size: var(--fs-xs); color: var(--muted); margin: 0 0 .6rem; }
.board ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.board li { display: grid; grid-template-columns: 1.4rem 1fr auto; gap: .5rem; align-items: baseline; padding: .5rem 0; border-bottom: 1px solid var(--rule); font-size: var(--fs-sm); color: var(--ink-2); }
.board li .rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.board li .val { font-weight: 600; color: var(--ink); }
.board li.is-ours { color: var(--ink); font-weight: 650; }
.board li.is-ours .name::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--ours); margin-right: .5rem; vertical-align: .05em; }
.board li .cov { display: block; color: var(--muted); font-weight: 400; font-size: var(--fs-xs); }
.board--plain li { grid-template-columns: 1fr auto; }
.board--realtime { background: var(--night); color: var(--night-ink); border: 1px solid #28465a; border-radius: var(--radius); padding: 1.5rem; }
.board__eyebrow { margin: 0 0 .5rem; color: #9ce6d3; font-size: var(--fs-xs); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.board--realtime .board__title { color: var(--night-ink); font-size: var(--fs-md); }
.board__metric { margin: 1.1rem 0 .3rem; font-size: 4.5rem; font-weight: 750; line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.board__metric span { font-size: 2rem; font-weight: 450; letter-spacing: -.02em; }
.board__result { margin: 0; font-size: var(--fs-sm); }
.board__hardware { margin: .45rem 0 1.1rem; color: #b7c0cc; font-size: var(--fs-xs); }
.board--realtime a { color: #9ce6d3; font-size: var(--fs-xs); font-weight: 600; }
.board--realtime a:hover { color: #d4fff1; }

/* ---------- worlds storyboard ---------- */
.worlds { background: var(--night); color: var(--night-ink); }
.worlds h2, .worlds h3 { color: var(--night-ink); }
.worlds .section-head .lede { color: var(--night-muted); }
.worlds a { color: #9ccaff; }

.world-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 52rem) { .world-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.world-grid figure { margin: 0; }
.world-grid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); }
.world-grid figcaption { font-family: var(--sans); font-size: var(--fs-sm); margin-top: .55rem; color: var(--night-ink); }

.reels { display: grid; gap: clamp(2.5rem, 5vw, 3.5rem); margin-top: clamp(3rem, 6vw, 4.5rem); }
.reel__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; margin-bottom: 1rem; }
.reel__head h3 { font-size: var(--fs-md); }
.reel__head p { margin: 0; font-family: var(--sans); font-size: var(--fs-sm); color: var(--night-muted); }
.reel__track { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-auto-flow: column; grid-auto-columns: minmax(15rem, 1fr); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .4rem; }
.reel__track > li { scroll-snap-align: start; position: relative; }
.reel__track img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); }
.turn { display: flex; gap: .6rem; align-items: baseline; margin-top: .65rem; font-family: var(--sans); font-size: var(--fs-sm); }
.turn__n { flex: none; font-variant-numeric: tabular-nums; color: var(--night-muted); font-size: var(--fs-xs); }
.turn__say { color: var(--night-ink); }
.turn__note { display: block; color: var(--night-muted); font-size: var(--fs-xs); margin-top: .1rem; }
.reel__track > li + li::before {
  content: ""; position: absolute; left: -0.95rem; top: calc((100% - 2.5rem) / 2 - 2.25rem);
  width: .9rem; height: 1px; background: rgb(250 243 230 / .5);
}
.coop { display: grid; gap: 1rem; }
@media (min-width: 52rem) { .coop { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); align-items: start; } }
.coop figure { margin: 0; }
.coop img { width: 100%; border-radius: var(--radius-sm); }
.coop__players { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .35rem; font-family: var(--sans); font-size: var(--fs-sm); }
.coop__players b { display: inline-block; min-width: 2rem; font-weight: 650; color: var(--night-muted); }
.coop__escape img { aspect-ratio: 1; object-fit: cover; }

/* ---------- the turn loop (signature) ---------- */
.loop { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 62rem) { .loop { grid-template-columns: minmax(0, 27rem) minmax(0, 1fr); } }

.loop__dial { position: relative; width: min(100%, 27rem); aspect-ratio: 1; margin-inline: auto; }
.loop__dial svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.loop__ring { fill: none; stroke: var(--rule); stroke-width: 1.5; }
.loop__arc { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dashoffset .5s cubic-bezier(.3,.7,.2,1); }
.loop__arrow { fill: var(--ink); }
.loop__core { position: absolute; inset: 27%; border-radius: 50%; background: var(--panel); display: grid; place-content: center; text-align: center; gap: .35rem; padding: 1rem; }
.loop__core .core-sym { font-size: clamp(2rem, 6vw, 2.9rem); line-height: 1; }
.loop__core .core-label { font-family: var(--sans); font-size: var(--fs-xs); color: var(--muted); }
.loop__core .core-parts { font-size: var(--fs-sm); color: var(--ink-2); }

.loop__node {
  position: absolute; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: .2rem;
  min-width: 6.2rem; padding: .55rem .7rem .5rem;
  border: 1px solid var(--rule); border-radius: 14px;
  background: var(--bg); color: var(--ink);
  font: inherit; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.loop__node .op { font-size: 1.45rem; line-height: 1.1; }
.loop__node .lbl { font-family: var(--sans); font-size: var(--fs-xs); font-weight: 600; }
.loop__node .who { font-family: var(--sans); font-size: 0.6875rem; color: var(--muted); }
.loop__node:hover { border-color: var(--ink); }
.loop__node[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.loop__node[aria-selected="true"] .who { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.loop__node[data-i="0"] { left: 50%; top: 4%; }
.loop__node[data-i="1"] { left: 96%; top: 50%; }
.loop__node[data-i="2"] { left: 50%; top: 96%; }
.loop__node[data-i="3"] { left: 4%; top: 50%; }

@media (max-width: 40rem) {
  .loop__dial { width: calc(100% - 5.5rem); margin-block: 1.5rem 2.5rem; }
  .loop__node { min-width: 5.2rem; padding: .45rem .5rem .4rem; }
  .loop__node .op { font-size: 1.2rem; }
}
.loop__panel { min-height: 21rem; }
.loop__panel[hidden] { display: none; }
.loop__step { font-family: var(--sans); font-size: var(--fs-sm); color: var(--muted); margin: 0 0 .4rem; font-variant-numeric: tabular-nums; }
.loop__panel h3 { font-size: var(--fs-lg); margin-bottom: .9rem; }
.loop__panel p { margin: 0 0 .9rem; max-width: 36rem; }
.loop__eq { margin: 1.1rem 0; overflow-x: auto; font-size: 1.05rem; }
.example { border-left: 2px solid var(--ours); padding: .15rem 0 .15rem 1rem; margin-top: 1.25rem; max-width: 36rem; }
.example__label { display: block; font-family: var(--sans); font-size: var(--fs-xs); font-weight: 650; color: var(--muted); margin-bottom: .2rem; }
.example p { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.55; }
.loop__nav { display: flex; gap: .5rem; margin-top: 1.5rem; }
.loop__nav button { font-family: var(--sans); font-size: var(--fs-sm); font-weight: 600; background: none; border: 1px solid var(--rule); color: var(--ink); padding: .45rem .9rem; border-radius: 999px; cursor: pointer; }
.loop__nav button:hover { border-color: var(--ink); }
.loop__nav button:disabled { opacity: .4; cursor: default; }

.equation-block { background: var(--panel); border-radius: var(--radius); padding: 1.25rem 1.5rem; overflow-x: auto; margin: 1.75rem 0 0; }
.equation-block p { margin: 0; font-family: var(--sans); font-size: var(--fs-xs); color: var(--muted); }

/* ---------- figures ---------- */
.figure { margin: clamp(2.5rem, 5vw, 3.5rem) 0 0; }
.figure__frame { background: #ffffff; border-radius: var(--radius); padding: clamp(.5rem, 1.5vw, 1.1rem); border: 1px solid var(--rule); }
.figure__frame img { width: 100%; border-radius: 4px; }
.figure figcaption { font-family: var(--serif); font-size: var(--fs-sm); line-height: 1.55; color: var(--ink-2); margin-top: .9rem; max-width: 52rem; }
.figure figcaption b { font-family: var(--sans); font-weight: 650; color: var(--ink); }
.figure__open { font-family: var(--sans); font-size: var(--fs-xs); margin-left: .3rem; white-space: nowrap; }

/* ---------- definition lists ---------- */
.state-list { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--rule); }
.state-list > div { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.state-list dt { font-size: 1.6rem; line-height: 1.2; }
.state-list dd { margin: 0; }
.state-list dd b { display: block; font-family: var(--sans); font-size: var(--fs-base); font-weight: 650; margin-bottom: .2rem; }
.state-list dd span { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.55; display: block; }

.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.4rem; }
.points li { max-width: 38rem; }
.points b { display: block; font-family: var(--sans); font-weight: 650; font-size: var(--fs-base); margin-bottom: .2rem; }
.points span { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; display: block; }

/* three generation parts */
.parts { display: grid; gap: 2.5rem; counter-reset: part; }
@media (min-width: 62rem) { .parts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem; } }
.part h3 { font-size: var(--fs-md); margin-bottom: .75rem; }
.part p { font-size: var(--fs-sm); color: var(--ink-2); margin: 0 0 .8rem; line-height: 1.6; }
.part .part__key { font-family: var(--sans); font-size: var(--fs-xs); color: var(--muted); margin-bottom: .5rem; display: block; }

/* streaming memory diagram */
.memory { margin-top: clamp(2.5rem, 5vw, 3.5rem); background: var(--panel); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.memory__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; align-items: baseline; margin-bottom: 1.25rem; }
.memory__head h3 { font-size: var(--fs-base); }
.memory__head p { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.section--panel .memory { background: var(--bg); }
.memory__rows { display: grid; gap: .65rem; font-family: var(--sans); font-size: var(--fs-xs); }
.memory__row { display: grid; grid-template-columns: 4rem repeat(8, minmax(0, 1fr)); gap: 4px; align-items: center; }
.memory__row .lab { font-weight: 650; font-size: var(--fs-sm); color: var(--ink); }
.memory__row .c { height: 2.2rem; border-radius: 4px; display: grid; place-items: center; color: var(--muted); background: transparent; border: 1px dashed var(--rule); font-variant-numeric: tabular-nums; }
.memory__row .c.h { background: var(--panel-2); border: 1px solid var(--panel-2); color: var(--ink-2); }
.memory__row .c.x { border-color: transparent; color: var(--muted); opacity: .7; }
.memory__row .c.t { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 650; }
.memory__axis { display: grid; grid-template-columns: 4rem repeat(8, minmax(0, 1fr)); gap: 4px; color: var(--muted); font-family: var(--sans); font-size: 0.6875rem; text-align: center; margin-top: .25rem; }
.memory__legend { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin-top: 1rem; font-family: var(--sans); font-size: var(--fs-xs); color: var(--muted); }
.memory__legend i { display: inline-block; width: .85rem; height: .85rem; border-radius: 3px; vertical-align: -.12em; margin-right: .4rem; }

/* ---------- charts ---------- */
.viz { font-family: var(--sans); margin-top: 1.75rem; }
.controls { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin-bottom: 1.25rem; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--panel); border-radius: 999px; }
.seg button { font: inherit; font-size: var(--fs-sm); font-weight: 550; border: 0; background: transparent; color: var(--ink-2); padding: .4rem .85rem; border-radius: 999px; cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--rule); font-weight: 650; }
.select { font: inherit; font-size: var(--fs-sm); color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 999px; padding: .42rem 2rem .42rem .9rem; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 1.05rem) 55%, calc(100% - .75rem) 55%; background-size: .3rem .3rem; background-repeat: no-repeat; }
.controls label { font-size: var(--fs-sm); color: var(--muted); display: inline-flex; gap: .5rem; align-items: center; }

.viz__title { font-size: var(--fs-base); font-weight: 650; margin: 0 0 .2rem; }
.viz__sub { font-size: var(--fs-sm); color: var(--muted); margin: 0 0 1rem; }
.viz__legend { display: flex; gap: 1.25rem; font-size: var(--fs-xs); color: var(--muted); margin: 0 0 .75rem; }
.viz__legend span::before { content: ""; display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .4rem; vertical-align: .02em; background: var(--other); }
.viz__legend .is-ours::before { background: var(--ours); }

.dots { position: relative; --dots-cols: minmax(8rem, 15rem) minmax(0, 1fr) 4.25rem; }
.dots__axis, .dots__row, .dots__overlay { display: grid; grid-template-columns: var(--dots-cols); gap: 0 1rem; align-items: center; }
.dots__overlay { position: absolute; inset: 0; pointer-events: none; align-items: stretch; }
.dots__overlay .g { position: relative; }
.dots__overlay i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.dots__axis { height: 1.6rem; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.dots__ticks { position: relative; height: 100%; }
.dots__ticks span { position: absolute; transform: translateX(-50%); bottom: .2rem; }
.dots__body { position: relative; transition: height .3s ease; }
.dots__row { position: absolute; left: 0; right: 0; height: 2rem; transition: transform .45s cubic-bezier(.3,.7,.2,1), opacity .25s ease; font-size: var(--fs-sm); }
.dots__row .nm { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots__row .nm small { color: var(--muted); font-size: var(--fs-xs); margin-left: .35rem; }
.dots__row .tr { position: relative; height: 100%; }
.dots__row .tr::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--rule); opacity: .6; }
.dots__row .dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--other); box-shadow: 0 0 0 2px var(--bg); transition: left .45s cubic-bezier(.3,.7,.2,1); }
.dots__row .hit { position: absolute; top: 0; bottom: 0; width: 28px; margin-left: -14px; transition: left .45s cubic-bezier(.3,.7,.2,1); }
.dots__row .v { text-align: right; color: var(--ink-2); }
.dots__row.is-ours .nm, .dots__row.is-ours .v { color: var(--ink); font-weight: 650; }
.dots__row.is-ours .dot { background: var(--ours); width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.dots__row:hover .nm, .dots__row:focus-within .nm { color: var(--ink); }
.dots__row:hover .dot { transform: scale(1.2); }
.dots__row.is-missing { opacity: 0; pointer-events: none; }
.viz__foot { font-size: var(--fs-xs); color: var(--muted); margin: 1rem 0 0; line-height: 1.55; max-width: 52rem; }
@media (max-width: 40rem) {
  .dots { --dots-cols: 9.25rem minmax(0, 1fr) 2.9rem; }
  .dots__row .nm small { display: none; }
  .dots__axis, .dots__row, .dots__overlay { gap: 0 .6rem; }
  .dots__row { font-size: var(--fs-xs); }
}

.tooltip { position: fixed; z-index: 80; pointer-events: none; background: var(--ink); color: var(--bg); font-family: var(--sans); font-size: var(--fs-xs); line-height: 1.4; padding: .5rem .7rem; border-radius: 6px; max-width: 16rem; opacity: 0; transform: translateY(4px); transition: opacity .12s ease, transform .12s ease; }
.tooltip.is-on { opacity: 1; transform: none; }
.tooltip strong { display: block; font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Real-time Pro result, followed by the H20 acceleration breakdown. */
.realtime { display: grid; gap: 2.5rem; padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid #28465a; border-radius: var(--radius); background: radial-gradient(ellipse at 100% 0%, #173c43 0%, transparent 60%), var(--night); color: var(--night-ink); font-family: var(--sans); }
.realtime > * { min-width: 0; }
.realtime__eyebrow { margin: 0; color: #9ce6d3; font-size: var(--fs-sm); font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.realtime__value { margin: 1rem 0 .4rem; font-size: clamp(5rem, 10vw, 8.5rem); font-weight: 750; line-height: .95; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.realtime__value span { font-size: .38em; font-weight: 450; letter-spacing: -.02em; }
.realtime__label { margin: 0; font-size: var(--fs-base); }
.realtime__hardware { margin: .65rem 0 0; max-width: 23rem; color: #b7c0cc; font-size: var(--fs-sm); line-height: 1.5; }
.realtime__comparison h3 { color: var(--night-ink); font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.15; }
.realtime__timeline { display: grid; gap: 1rem; margin-top: 1.5rem; }
.realtime__row p { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 .4rem; font-size: var(--fs-xs); color: #cdd6e1; }
.realtime__row b { color: var(--night-ink); font-variant-numeric: tabular-nums; }
.realtime__track { height: .6rem; border-radius: 999px; background: rgb(255 255 255 / .07); overflow: hidden; }
.realtime__fill { display: block; width: 100%; height: 100%; border-radius: inherit; background: #64778e; }
.realtime__fill--generation { width: 71.4286%; background: #9ce6d3; }
.realtime__speed { margin: 1.35rem 0 0; font-size: var(--fs-sm); color: #9ce6d3; }
.realtime__speed b { margin-right: .2rem; font-size: var(--fs-lg); font-weight: 700; }
.realtime__speed span { display: inline-block; color: #b7c0cc; font-size: var(--fs-xs); }
.realtime__note { margin: .85rem 0 0; max-width: 55rem; font-family: var(--sans); font-size: var(--fs-xs); line-height: 1.6; color: var(--muted); }
.inference-detail { margin-block: 3.5rem 2rem; max-width: 49rem; }
.inference-detail h3 { margin-bottom: .75rem; }
.inference-detail p { margin: 0; color: var(--ink-2); }
@media (min-width: 48rem) {
  .realtime { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .realtime__comparison { border-left: 1px solid rgb(183 192 204 / .22); padding-left: clamp(2rem, 4vw, 3rem); }
}
@media (max-width: 47.99rem) {
  .realtime__comparison { border-top: 1px solid rgb(183 192 204 / .22); padding-top: 1.75rem; }
}

/* bars (inference) */
.bars { display: grid; gap: .5rem; }
.bars__row { display: grid; grid-template-columns: minmax(9rem, 15rem) minmax(0, 1fr) 5.5rem; gap: 0 1rem; align-items: center; font-size: var(--fs-sm); }
.bars__lab b { display: block; font-weight: 650; color: var(--ink); }
.bars__lab span { display: block; font-size: var(--fs-xs); color: var(--muted); }
.bars__track { position: relative; height: 1.5rem; }
.bars__ghost, .bars__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; }
.bars__ghost { background: var(--ghost); }
.bars__fill { background: var(--bar-mid); }
.bars__row.is-ours .bars__fill { background: var(--ours); }
.bars__val { position: absolute; top: 50%; transform: translateY(-50%); padding-left: .45rem; font-weight: 650; color: var(--ink); white-space: nowrap; }
.bars__sp { text-align: right; }
.bars__sp b { display: block; font-weight: 700; color: var(--ink); }
.bars__sp span { font-size: var(--fs-xs); color: var(--muted); }
.bars__axis { display: grid; grid-template-columns: minmax(9rem, 15rem) minmax(0, 1fr) 5.5rem; gap: 0 1rem; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; margin-top: .25rem; }
.bars__axis .ticks { position: relative; height: 1.2rem; border-top: 1px solid var(--rule); }
.bars__axis .ticks span { position: absolute; transform: translateX(-50%); top: .2rem; }
.bars__group + .bars__group { margin-top: 2.25rem; }
.bars__group h4 { font-size: var(--fs-sm); margin-bottom: .2rem; }
.bars__group > p { font-size: var(--fs-xs); color: var(--muted); margin: 0 0 .9rem; }
@media (max-width: 40rem) {
  .bars__row, .bars__axis { grid-template-columns: 7rem minmax(0, 1fr) 3.5rem; gap: 0 .6rem; }
  .bars__sp span { display: none; }
}

.facts { display: grid; gap: 0; border-top: 1px solid var(--rule); font-family: var(--sans); margin-top: 2rem; }
.facts > div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.facts .fv { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.02em; }
.facts .fl { font-size: var(--fs-sm); color: var(--ink-2); }
.facts .fl small { display: block; color: var(--muted); font-size: var(--fs-xs); margin-top: .15rem; }

.techs { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.techs b { font-family: var(--sans); font-weight: 650; display: block; font-size: var(--fs-sm); }
.techs span { display: block; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.55; }

/* heat table */
.heat-wrap { overflow-x: auto; margin-top: 1rem; }
.heat { border-collapse: separate; border-spacing: 2px; font-family: var(--sans); font-size: var(--fs-sm); min-width: 40rem; width: 100%; }
.heat th { font-weight: 600; text-align: left; color: var(--ink-2); padding: .3rem .6rem; white-space: nowrap; }
.heat thead th { text-align: center; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.heat thead th:first-child { text-align: left; }
.heat thead th.is-ours { color: var(--ink); }
.heat thead th.is-ours::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--ours); margin-right: .35rem; }
.heat tbody th[scope="rowgroup"] { padding-top: 1rem; font-size: var(--fs-xs); color: var(--muted); font-weight: 650; }
.heat td { text-align: center; padding: .38rem .4rem; border-radius: 3px; font-variant-numeric: tabular-nums; min-width: 4.6rem; }
.heat td.best { font-weight: 750; text-decoration: underline; text-underline-offset: .2em; }
.heat td.is-ours { box-shadow: inset 0 0 0 2px var(--ours); }
.heat-scale { display: flex; align-items: center; gap: .6rem; font-family: var(--sans); font-size: var(--fs-xs); color: var(--muted); margin-top: .9rem; }
.heat-scale i { display: inline-block; width: 9rem; height: .55rem; border-radius: 2px; background: linear-gradient(90deg, var(--heat-0), var(--heat-1), var(--heat-2), var(--heat-3), var(--heat-4)); }

/* data tables */
.table-toggle { margin-top: 1.25rem; font-family: var(--sans); }
.table-toggle summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--link); list-style: none; display: inline-flex; gap: .4rem; }
.table-toggle summary::-webkit-details-marker { display: none; }
.table-toggle summary::before { content: "+"; width: 1em; text-align: center; }
.table-toggle[open] summary::before { content: "−"; }
.table-scroll { overflow-x: auto; margin-top: .9rem; border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.data { border-collapse: collapse; width: 100%; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.data caption { text-align: left; padding: .75rem .9rem; color: var(--muted); caption-side: bottom; white-space: normal; line-height: 1.5; border-top: 1px solid var(--rule); }
.data th, .data td { padding: .5rem .7rem; border-bottom: 1px solid var(--rule); text-align: right; }
.data th:first-child, .data td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg); }
.data thead th { font-weight: 650; color: var(--ink); background: var(--panel); }
.data thead th:first-child { background: var(--panel); }
.data tbody tr.group th { text-align: left; font-style: italic; font-weight: 500; color: var(--muted); background: var(--bg); }
.data tr.is-ours td, .data tr.is-ours th { font-weight: 700; }
.data .b1 { font-weight: 750; }
.data .b2 { text-decoration: underline; text-underline-offset: .2em; }

/* gallery */
.gallery { display: grid; gap: clamp(2rem, 4vw, 3rem); margin-top: 2rem; }
.demo { display: grid; gap: .75rem; }
.demo__refs { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.demo__refs img { height: 5.5rem; width: auto; background: #fff; border-radius: 4px; border: 1px solid var(--rule); }
@media (max-width: 40rem) { .demo__refs img { height: 4rem; } }
.demo__frames { list-style: none; margin: 0; padding: 0 0 .25rem; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(11rem, 1fr); gap: 4px; overflow-x: auto; scroll-snap-type: x proximity; }
.demo__frames--portrait { grid-auto-columns: minmax(5.5rem, 1fr); }
.demo__frames li { scroll-snap-align: start; }
.demo__frames a { display: block; border-radius: 3px; overflow: hidden; }
.demo__frames img { width: 100%; height: auto; display: block; }
.demo__frames li:first-child a { border-radius: var(--radius-sm) 3px 3px var(--radius-sm); }
.demo__frames li:last-child a { border-radius: 3px var(--radius-sm) var(--radius-sm) 3px; }
.demo__cap { font-family: var(--sans); font-size: var(--fs-sm); color: var(--ink-2); margin: .6rem 0 0; }
.demo__cap span { color: var(--muted); }
.demo__label { font-family: var(--sans); font-size: var(--fs-xs); color: var(--muted); margin: 0 0 .4rem; grid-column: 1 / -1; }

/* team */
.team { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) { .team { grid-template-columns: 2fr 1fr; } }
.team h3 { font-size: var(--fs-base); margin-bottom: .75rem; }
.team__names { font-family: var(--sans); font-size: var(--fs-md); line-height: 1.6; margin: 0; }
.team__names sup { font-size: .55em; color: var(--muted); margin-left: .08em; font-weight: 500; }
.team__names .n { white-space: nowrap; }
.env { display: inline-block; width: .95em; height: .72em; vertical-align: 0; }
.team__key { font-family: var(--sans); font-size: var(--fs-sm); color: var(--muted); margin: 1rem 0 0; line-height: 1.7; }
.team__plain { font-family: var(--sans); font-size: var(--fs-base); line-height: 1.7; margin: 0; }
.team__aside { display: grid; gap: 2rem; align-content: start; }

/* citation */

/* Generated worlds, grouped into parent-connected story sequences. */
.motion {
  color: #edf3fb;
  background: radial-gradient(ellipse at 15% 0, #123033 0, transparent 32rem), radial-gradient(ellipse at 95% 50%, #1c1832 0, transparent 40rem), #080e17;
  padding: clamp(3rem, 6vw, 5rem) 0;
  font-family: var(--sans);
}
.motion__head { display: grid; gap: 1.5rem 3rem; align-items: end; margin-bottom: 2rem; }
.motion__head h2 { font-size: clamp(2.7rem, 5vw, 4.5rem); letter-spacing: -.055em; line-height: 1.02; margin: 0; color: #fff; }
.motion__head > p { color: #acbccc; margin: 0; max-width: 36rem; font: 400 1rem/1.65 var(--sans); }
.motion__eyebrow { color: #87e4ce; text-transform: uppercase; letter-spacing: .13em; font: 650 .7rem/1.4 var(--sans); margin: 0 0 .9rem; }
.motion__eyebrow::before { content: ""; display: inline-block; width: .45rem; height: .45rem; border-radius: 50%; background: #80e2cc; box-shadow: 0 0 15px #4fc4ad; margin-right: .7rem; }
.motion__toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem; margin: 0 0 1rem; }
.motion__toolbar p { margin: 0; color: #a7b7c9; font: 400 .8rem/1.6 var(--sans); }
.motion__toolbar b { color: #fff; font-size: 1.05rem; font-weight: 650; }
.motion__toolbar span { padding: 0 .6rem; color: #6e8398; }
.motion-control { min-height: 44px; padding: .55rem .9rem; border: 1px solid #8195a56b; border-radius: 999px; color: inherit; background: transparent; cursor: pointer; font: 600 .75rem/1.2 var(--sans); white-space: nowrap; }
.motion-control:hover { border-color: currentColor; }
.motion-control[hidden], .motion-card__toggle[hidden], .story-nav[hidden], .story-nav button[hidden] { display: none; }
.story-index { border-block: 1px solid #91a5bc30; padding: .9rem 0; margin-bottom: 2rem; }
.story-index summary { width: fit-content; cursor: pointer; font: 600 .8rem/1.5 var(--sans); color: #afd4db; }
.story-index nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .45rem 1rem; padding: 1rem 0 .25rem; }
.story-index a { padding: .4rem .5rem; border-radius: 4px; color: #cad9e8; font: 500 .75rem/1.5 var(--sans); text-decoration: none; }
.story-index a:hover { background: #ffffff10; color: #9ff5de; }
.story-world { margin: 2.2rem 0 0; padding-top: 1.6rem; border-top: 1px solid var(--rule); min-width: 0; scroll-margin-top: 5rem; }
.motion .story-world, .worlds .story-world { border-color: #91a5bc30; }
.story-world__head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: .85rem; }
.story-world__eyebrow { margin: 0 0 .35rem; color: var(--muted); font: 600 .65rem/1.4 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.motion .story-world__eyebrow, .worlds .story-world__eyebrow { color: #81c9bd; }
.story-world__head h3 { margin: 0; font: 650 clamp(1.1rem, 2vw, 1.4rem)/1.2 var(--sans); letter-spacing: -.025em; }
.story-world__head h3 small { display: inline-block; margin: .4rem 0 0 .65rem; font: 400 .7rem/1.3 var(--sans); color: var(--muted); letter-spacing: 0; }
.motion .story-world__head h3 small, .worlds .story-world__head h3 small { color: #a7b7c9; }
.motion .story-world__head h3, .motion .motion-card__copy h4, .worlds .motion-card__copy h4 { color: #edf3fb; }
.story-nav { display: flex; gap: .35rem; flex-shrink: 0; }
.story-nav button { width: 44px; height: 44px; border: 1px solid #899ca254; background: transparent; border-radius: 50%; color: inherit; cursor: pointer; font: 400 1.1rem/1 var(--sans); }
.story-nav button:disabled { opacity: .24; cursor: default; }
.story-nav button:hover:not(:disabled) { border-color: currentColor; }
.story-track { display: flex; gap: .8rem; list-style: none; margin: 0; padding: .2rem .1rem .9rem; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: #749c9b65 transparent; align-items: flex-start; }
.motion-card { position: relative; flex: 0 0 clamp(15rem, 22vw, 18rem); width: clamp(15rem, 22vw, 18rem); max-width: 18rem; min-width: 0; border-radius: 9px; overflow: hidden; background: var(--bg); border: 1px solid var(--rule); color: var(--ink); scroll-snap-align: start; font-family: var(--sans); }
.motion .motion-card, .worlds .motion-card { background: #121e2a; border-color: #a3c6d522; color: #edf3fb; }
.motion-card__media { position: relative; width: 100%; aspect-ratio: 7 / 4; background: #080e15; }
.motion-card__media img, .motion-card__media video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.motion-card__media video { opacity: 0; }
.motion-card.is-ready video { opacity: 1; }
.motion-card__copy { padding: .65rem .8rem .75rem; }
.motion-card__copy h4 { display: flex; align-items: center; gap: .45rem; margin: 0 0 .5rem; font: 650 .7rem/1.4 var(--sans); letter-spacing: .035em; }
.motion-card__copy h4 span { color: #277260; font: 600 .68rem/1.4 var(--sans); }
.motion .motion-card__copy h4 span, .worlds .motion-card__copy h4 span { color: #90d9c9; }
.motion-card__copy h4::after { content: "→"; margin-left: auto; color: #80939d; font-size: .8rem; }
.motion-card:last-child .motion-card__copy h4::after { content: "•"; }
.motion-card__caption { margin: 0; color: var(--ink-2); font: 400 .75rem/1.65 var(--sans); height: 2.5rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.motion .motion-card__caption, .worlds .motion-card__caption { color: #c2cfda; }
.motion-card__context { margin-top: .5rem; color: var(--muted); font: 400 .7rem/1.6 var(--sans); }
.motion .motion-card__context, .worlds .motion-card__context { color: #97adbe; }
.motion-card__context summary { cursor: pointer; width: fit-content; }
.motion-card__context p { margin: .5rem 0 0; overflow-wrap: anywhere; }
.motion-card__toggle { position: absolute; top: .25rem; right: .25rem; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #07111bba; color: #fff; cursor: pointer; }
.motion-card__toggle span { font: 600 .75rem/1 var(--sans); }
.motion-card__toggle:hover { background: #07111bed; }
.motion-card.is-playing .motion-card__copy h4 span::before { content: ""; display: inline-block; width: 4px; height: 4px; background: currentColor; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.motion-control:focus-visible, .story-nav button:focus-visible, .motion-card__toggle:focus-visible, .story-track:focus-visible { outline: 2px solid #44ac9a; outline-offset: 3px; }
.story-collection { margin-top: 4rem; min-width: 0; }
.story-collection__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.story-collection__head h3 { margin: 0 0 .5rem; }
.story-collection__head p { margin: 0; font: 400 .9rem/1.6 var(--sans); color: var(--muted); max-width: 40rem; }
.worlds .story-collection__head p { color: #b7c5d4; }
.story-collection .story-world { margin-top: 1.5rem; }
/* Short worlds share a row, with each story retaining its own heading and track. */
.story-mosaic .story-world__head h3 small { display: block; margin: .4rem 0 0; }
@media (min-width: 36rem) {
  .story-mosaic { display: grid; grid-template-columns: repeat(2, minmax(0, 18rem)); gap: .9rem 1.25rem; margin-top: 1.5rem; align-items: start; }
  .story-mosaic .story-world { --story-span: 2; grid-column: span var(--story-span); grid-row: span 2; display: grid; grid-template-rows: auto 1fr; gap: .85rem; margin: 0; padding-top: 1.3rem; }
  .story-mosaic .story-world[data-turn-count="1"] { --story-span: 1; }
  .story-mosaic .story-world__head { align-items: flex-start; min-height: 6.5rem; margin: 0; }
  .story-mosaic .story-world__head h3 { font-size: clamp(1.05rem, 1.5vw, 1.25rem); }
  .story-mosaic .story-track { gap: 1.25rem; padding-inline: 0; }
  .story-mosaic .motion-card { flex-basis: calc((100% - (var(--story-span) - 1) * 1.25rem) / var(--story-span)); width: calc((100% - (var(--story-span) - 1) * 1.25rem) / var(--story-span)); }
  @supports (grid-template-rows: subgrid) {
    .story-mosaic .story-world { grid-template-rows: subgrid; }
    .story-mosaic .story-world__head { min-height: 0; }
  }
}
@media (min-width: 52rem) {
  .story-mosaic { grid-template-columns: repeat(3, minmax(0, 18rem)); }
  .story-mosaic .story-world[data-turn-count="3"] { --story-span: 3; }
}
@media (min-width: 70rem) {
  .story-mosaic { grid-template-columns: repeat(4, minmax(0, 18rem)); }
}
.story-note { margin: 1rem 0 0; color: #91a6b9; font: 400 .75rem/1.6 var(--sans); }
@media (min-width: 52rem) { .motion__head { grid-template-columns: 1.1fr 1fr; } }
@media (max-width: 35rem) {
  .motion__toolbar span { padding: 0 .3rem; }
  .story-world__head h3 small { display: block; margin-left: 0; }
  .story-world__head { align-items: flex-start; }
  .story-world__eyebrow { font-size: .6rem; }
  .story-nav { gap: .2rem; }
  .story-nav button { width: 38px; }
}
@media print { .motion-control, .motion-card__toggle, .story-nav { display: none; } }

.cite { position: relative; background: var(--panel); border-radius: var(--radius); }
.cite pre { margin: 0; padding: 1.5rem 1.75rem; overflow-x: auto; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.875rem; line-height: 1.65; color: var(--ink); }
.cite button { position: absolute; top: .9rem; right: .9rem; font-family: var(--sans); font-size: var(--fs-xs); font-weight: 650; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); cursor: pointer; }
.cite button:hover { border-color: var(--ink); }

/* footer */
.footer { background: var(--night); color: var(--night-muted); font-family: var(--sans); font-size: var(--fs-sm); padding-block: 3rem; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.footer__brand { display: inline-flex; gap: .6rem; align-items: center; color: var(--night-ink); font-weight: 650; }
.footer__brand svg { width: 1.6rem; }
.footer a { color: var(--night-ink); }

/* KaTeX sizing inside serif text */
.katex { font-size: 1.04em; }
.katex-display { margin: 0; overflow-x: auto; overflow-y: hidden; padding: .2rem 0; }

@media print {
  .nav, .hero__actions, .controls, .loop__nav, .cite button { display: none !important; }
  .hero { min-height: auto; }
  .section { padding-block: 2rem; }
}
