/* AEON project page */

/* ---------- Fonts (OFL, self-hosted) ---------- */
@font-face { font-family: "Spectral SC"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("../fonts/spectral-sc-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("../fonts/spectral-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 300; font-display: swap;
  src: url("../fonts/spectral-latin-300-italic.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/spectral-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/spectral-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/spectral-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-600-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --font-mark: "Spectral SC", "Spectral", Georgia, serif;
  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --font-ui: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", "PingFang SC", sans-serif;
  --font-body: var(--font-ui);
  --body-size: 17px;
  --body-lh: 1.62;
  /* one reading width: headings, text, tables, figures and captions share both edges */
  --col: 960px;
  --col-wide: 960px;
  --col-full: 1240px;
  --pad: clamp(20px, 4vw, 40px);
  --sec-space: clamp(64px, 7.5vw, 104px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --topbar-h: 56px;
}

/* Night scheme: hero, worlds gallery, top bar, viewer dialog */
.sec--night, .topbar, .world-dialog {
  --bg: #0B1430;
  --bg-deep: #070D20;
  --fg: #EEF2FA;
  --fg-soft: #C5CFE3;
  --muted: #8D9AB8;
  --line: rgba(197, 207, 227, .14);
  --line-strong: rgba(197, 207, 227, .30);
  --accent: #F0B054;
  --ours-bg: rgba(240, 176, 84, .085);
  --plate: #F3F5F9;
  --tick: rgba(197, 207, 227, .26);
  --tick-major: rgba(197, 207, 227, .6);
  --p1: #F0B054; --p2: #C5CFE3; --p3: #7FB8F0;
  color-scheme: dark;
}
/* Day scheme: the reading sections; the top bar switches to it over them */
.sec:not(.sec--night), .topbar.topbar--day {
  --bg: #F2F4F8;
  --bg-deep: #E7EBF2;
  --fg: #10172B;
  --fg-soft: #2E3852;
  --muted: #5C6682;
  --line: rgba(16, 23, 43, .10);
  --line-strong: rgba(16, 23, 43, .24);
  --accent: #9A5B0E;
  --ours-bg: rgba(240, 176, 84, .16);
  --plate: #FFFFFF;
  --tick: rgba(16, 23, 43, .25);
  --tick-major: rgba(16, 23, 43, .55);
  --p1: #B9700F; --p2: #5C6682; --p3: #2F6FB8;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: #0B1430; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 8px); }
/* the page now ends on a light section, so overscroll past the bottom shows the light ground */
html.ends-light { background: #F2F4F8; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--body-lh);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, video, canvas, svg { max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: color-mix(in srgb, var(--accent, #F0B054) 34%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 200; padding: 10px 14px; background: #fff; color: #111; font: 500 14px/1 var(--font-ui); border-radius: 6px; }
.skip-link:focus { top: 12px; }

.sec { background: var(--bg); color: var(--fg); padding-block: var(--sec-space); }
/* consecutive light sections read as one flow */
.sec:not(.sec--night) + .sec:not(.sec--night) { padding-top: 8px; }
.col { width: min(100% - 2 * var(--pad), var(--col)); margin-inline: auto; }
.col--wide { width: min(100% - 2 * var(--pad), var(--col-wide)); }
.col--full { width: min(100% - 2 * var(--pad), var(--col-full)); }

h2 {
  font-family: var(--font-display);
  font-weight: 300;
  text-wrap: balance;
  font-size: clamp(32px, 4.2vw, 46px);
  line-height: 1.08;
  letter-spacing: -.012em;
  margin: 0 0 22px;
}
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 2.3vw, 26px);
  line-height: 1.2;
  margin: 64px 0 12px;
}
h2 + h3 { margin-top: 8px; }
h4 { font: 600 16px/1.35 var(--font-ui); margin: 0 0 4px; }
.sec p { color: var(--fg-soft); }
/* every section below the hero uses one column; on wide screens text is justified so it is exactly as wide as the figures
   (phones keep ragged-right text: a 350 px justified column opens gaps between words) */
@media (min-width: 721px) {
  .sec:not(.hero) p, .figure figcaption, .explainer figcaption {
    text-align: justify; -webkit-hyphens: auto; hyphens: auto;
  }
}
.sec:not(.hero) p { line-height: 1.7; text-wrap: pretty; }
.sec h2 + p { color: var(--fg-soft); }
i { font-family: var(--font-display); font-style: italic; }
sub { font-size: .72em; }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  color: var(--fg);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.topbar.is-solid {
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
.topbar-inner {
  width: min(100% - 2 * var(--pad), var(--col-full)); margin: 0 auto;
  height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.topbar-mark {
  font-family: var(--font-mark); font-weight: 300; font-size: 25px; line-height: 1;
  color: var(--fg); text-decoration: none; opacity: 0; transition: opacity .3s;
}
.topbar.is-solid .topbar-mark { opacity: 1; }
.topbar-links { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; }
.topbar-links a { color: var(--muted); text-decoration: none; font: 500 14px/1 var(--font-ui); transition: color .2s; }
.topbar-links a:hover, .topbar-links a[aria-current="true"] { color: var(--fg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(100vh, 1040px); display: flex; align-items: center;
  padding-top: calc(var(--topbar-h) + clamp(28px, 5vh, 64px));
  padding-bottom: clamp(40px, 6vh, 80px);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(40% 55% at 73% 44%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 72%);
}
.hero-grid {
  position: relative;
  width: min(100% - 2 * var(--pad), var(--col-full)); margin: 0 auto;
  /* the generated videos are 448 x 448: never display them larger than that */
  --stage: clamp(300px, min(58vh, 40vw), 448px);
  --thumb: calc((var(--stage) - 56px) / 8);
  display: grid; grid-template-columns: minmax(0, 1fr) calc(var(--stage) + var(--thumb) + 16px);
  gap: clamp(32px, 5vw, 80px); align-items: center;
}
.venue { font: 500 14px/1 var(--font-ui); letter-spacing: .02em; color: var(--accent); margin: 0 0 22px; }
.wordmark {
  font-family: var(--font-mark); font-weight: 300;
  font-size: clamp(92px, 11.4vw, 160px); line-height: .8; letter-spacing: .012em;
  margin: 0 0 22px -.045em; color: var(--fg);
}
.subtitle {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(24px, 2.35vw, 32px); line-height: 1.18;
  margin: 0 0 22px; text-wrap: balance;
}
.hero .subtitle { color: var(--fg); }
.lede { font-size: 17px; max-width: 33em; }
.authors { list-style: none; padding: 0; margin: 30px 0 8px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 16px; }
.authors a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--line-strong); transition: border-color .2s; }
.authors a:hover { border-bottom-color: var(--accent); }
.authors sup { color: var(--accent); margin-left: 2px; font-size: .75em; }
.hero .affiliation { color: var(--muted); font-size: 14.5px; margin: 0; font-family: var(--font-ui); }
.affiliation .note { margin-left: 14px; white-space: nowrap; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px 0 12px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: transparent;
  color: var(--fg); text-decoration: none; font: 500 14.5px/1 var(--font-ui); cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.is-soon { color: var(--muted); border-style: dashed; cursor: default; }
.btn.is-soon:hover { border-color: var(--line-strong); color: var(--muted); }
.btn.is-soon::after { content: "soon"; font-size: 11.5px; font-weight: 400; opacity: .8; margin-left: 1px; }

/* hero figure: viewer + picker + caption */
.hero-figure {
  margin: 0; display: grid; gap: 12px 16px; min-width: 0;
  grid-template-columns: minmax(0, var(--stage)) var(--thumb);
  grid-template-areas: "viewer picker" "caption caption";
}
.hero-figure > .viewer { grid-area: viewer; }
.hero-figure > .picker { grid-area: picker; }
.hero-figure > .world-caption { grid-area: caption; }
.picker { display: flex; flex-direction: column; gap: 8px; align-self: start; }
.picker button {
  position: relative; width: var(--thumb); height: var(--thumb); padding: 0; border: 0; border-radius: 4px;
  overflow: hidden; background: #000; cursor: pointer; opacity: .5; transition: opacity .2s, box-shadow .2s;
}
.picker button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.picker button:hover { opacity: .85; }
.picker button[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 3px var(--accent); }

/* ---------- World viewer ---------- */
.viewer { min-width: 0; }
.viewer-stage {
  position: relative; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; background: #02040a;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .75);
}
.viewer-canvas { position: relative; display: block; width: 100%; height: 100%; }
.viewer-src { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.band-labels { position: absolute; inset: 0; pointer-events: none; }
.band-label {
  position: absolute; top: 12px; left: 0; transform: translateX(12px);
  font: 500 12px/1 var(--font-ui); letter-spacing: .01em; color: #fff; white-space: nowrap;
  padding: 6px 9px; border-radius: 999px; background: rgba(6, 10, 24, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: opacity .2s;
}
.band-label.is-hidden { opacity: 0; }
.divider { position: absolute; top: 0; bottom: 0; left: 33.33%; width: 36px; margin-left: -18px; cursor: ew-resize; z-index: 2; outline: none; touch-action: none; }
.divider::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; margin-left: -.5px; background: rgba(255, 255, 255, .9); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .25); }
.divider .grip {
  position: absolute; left: 50%; top: 44%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .85);
  background: rgba(6, 10, 24, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .2s var(--ease);
}
.divider[data-divider="1"] .grip { top: 56%; }
.divider .grip::before, .divider .grip::after {
  content: ""; position: absolute; top: 50%; width: 5px; height: 5px; margin-top: -3px;
  border: solid #fff; border-width: 0 0 1.5px 1.5px;
}
.divider .grip::before { left: 7px; transform: rotate(45deg); }
.divider .grip::after { right: 7px; transform: rotate(-135deg); }
.divider.at-start .grip { margin-left: 2px; }
.divider.at-end .grip { margin-left: -32px; }
.divider:hover .grip, .divider.is-dragging .grip { transform: scale(1.12); }
.divider:focus-visible .grip { outline: 2px solid var(--accent); outline-offset: 3px; }

.viewer-controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.play {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: transparent; color: var(--fg); display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: border-color .2s, color .2s;
}
.play:hover { border-color: var(--accent); color: var(--accent); }
.play svg { width: 16px; height: 16px; grid-area: 1 / 1; }
.play .i-pause { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.play .i-play { fill: currentColor; display: none; }
.viewer.is-paused .play .i-play { display: block; }
.viewer.is-paused .play .i-pause { display: none; }
.timeline { position: relative; flex: 1; height: 36px; min-width: 0; }
.ticks, .ticks-done {
  position: absolute; top: 50%; height: 14px; transform: translateY(-50%);
  background-image: linear-gradient(to right, var(--tick) 1px, transparent 1px), linear-gradient(to right, var(--tick-major) 1px, transparent 1px);
  background-size: calc((100% - 1px) / 80) 6px, calc((100% - 1px) / 5) 14px;
  background-repeat: repeat-x; background-position: 0 50%, 0 50%;
}
.ticks { left: 8px; right: 8px; }
.ticks-done {
  inset: 0; transform: none; height: auto; top: 0;
  --tick: var(--accent); --tick-major: var(--accent);
  clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0);
}
.time { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.time::-webkit-slider-runnable-track { height: 36px; background: transparent; border: 0; }
.time::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 36px; border: 0; background: linear-gradient(var(--accent), var(--accent)) center / 2px 26px no-repeat; }
.time::-moz-range-track { height: 36px; background: transparent; border: 0; }
.time::-moz-range-thumb { width: 16px; height: 36px; border: 0; border-radius: 0; background: linear-gradient(var(--accent), var(--accent)) center / 2px 26px no-repeat; }
.time:focus-visible { outline-offset: 0; }
.readout { flex: none; min-width: 4.4em; text-align: right; font-size: 14.5px; line-height: 1; color: var(--muted); }
.viewer-modes { display: inline-flex; gap: 2px; margin-top: 8px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.viewer-modes button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: 500 12.5px/1 var(--font-ui); padding: 7px 12px; border-radius: 999px; transition: background-color .2s, color .2s;
}
.viewer-modes button:hover { color: var(--fg); }
.viewer-modes button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* caption of a world: condition + prompt */
.world-caption { display: grid; gap: 8px; margin: 4px 0 0; }
.world-caption .cond { font: 500 13px/1.2 var(--font-ui); color: var(--muted); }
.world-caption .cond-body { display: flex; gap: 14px; align-items: flex-start; }
.world-caption .cond-img { flex: none; width: 56px; height: 56px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.world-caption .prompt {
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  font-size: 17px; line-height: 1.5; color: var(--fg-soft); quotes: "\201C" "\201D";
}

/* ---------- Overview: paradigm matrix ---------- */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 10px; }
table { border-collapse: collapse; width: 100%; font-family: var(--font-ui); }
/* counters are set in Spectral with tabular lining figures so they don't jitter */
.readout, .dialog-count { font-family: var(--font-display); font-variant-numeric: tabular-nums lining-nums; }
caption { caption-side: bottom; text-align: left; color: var(--muted); font-size: 13.5px; padding-top: 14px; }
.paradigms { min-width: 640px; font-size: 15px; }
.paradigms th, .paradigms td { padding: 15px 12px; text-align: center; }
.paradigms thead th { font-weight: 500; font-size: 13px; line-height: 1.3; color: var(--muted); border-bottom: 1px solid var(--line-strong); vertical-align: bottom; }
.paradigms thead th:first-child, .paradigms tbody th { text-align: left; }
.paradigms tbody th { font-weight: 500; color: var(--fg); }
.paradigms tbody tr + tr > * { border-top: 1px solid var(--line); }
.paradigms tr.ours > * { background: var(--ours-bg); }
.paradigms td::before {
  content: ""; display: inline-block; width: 18px; height: 18px; vertical-align: middle;
  -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat;
}
.paradigms td[data-yes]::before {
  background: var(--accent);
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10.5l4 4 8-9' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.paradigms td[data-no]::before {
  background: var(--muted); opacity: .65;
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 6l8 8M14 6l-8 8' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
.eg { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: .9em; white-space: nowrap; }

/* ---------- Abstract ---------- */
.abstract { font-size: calc(var(--body-size) + .5px); }

/* ---------- Figures ---------- */
.figure { margin-top: 40px; margin-bottom: 8px; }
.plate { background: var(--plate); border-radius: 8px; padding: clamp(10px, 1.6vw, 22px); }
.plate img { display: block; width: 100%; height: auto; }
.figure figcaption { margin-top: 14px; color: var(--muted); font: 14.5px/1.55 var(--font-ui); }
.figure figcaption b { color: var(--fg-soft); font-weight: 600; }

/* ---------- Method ---------- */
.explainer { margin-top: 28px; margin-bottom: 8px; }
.explainer-stage { border: 1px solid var(--line); border-radius: 8px; background: var(--bg-deep); padding: 6px; }
.explainer-svg { display: block; width: 100%; height: auto; touch-action: pan-y; cursor: ew-resize; user-select: none; -webkit-user-select: none; }
.explainer figcaption { margin-top: 12px; color: var(--muted); font: 14px/1.55 var(--font-ui); }
.explainer-svg .band-title { font: 500 12.5px var(--font-ui); fill: var(--muted); }
.explainer-svg .axis { stroke: var(--line-strong); stroke-width: 1; }
.explainer-svg .axis-label { font: 400 12px var(--font-ui); fill: var(--muted); }
.explainer-svg .sym { font: italic 400 15px var(--font-display); fill: var(--fg-soft); }
.explainer-svg .sym-sub { font: 400 10px var(--font-ui); fill: var(--fg-soft); }
.explainer-svg .note { font: 400 12px var(--font-ui); fill: var(--fg-soft); }
.explainer-svg .tval { font: italic 400 13px var(--font-display); fill: var(--fg); font-variant-numeric: tabular-nums lining-nums; }
.explainer-svg .axis.faint { stroke: var(--line); stroke-dasharray: 2 5; }
.explainer-svg .trail { stroke-width: 1.2; stroke-dasharray: 2 4; opacity: .7; }
.explainer-svg .trail-head { fill: none; stroke-width: 1.2; opacity: .8; stroke-linecap: round; stroke-linejoin: round; }
.explainer-svg .curve { fill: none; stroke-width: 1.6; }
.explainer-svg .area { stroke: none; opacity: .14; }
.explainer-svg .ghost { fill: none; stroke-dasharray: 3 4; stroke-width: 1; }
.explainer-svg .playhead { stroke: var(--fg); stroke-width: 1.4; }
.explainer-svg .playhead-knob { fill: var(--fg); }
.explainer-svg .bracket { stroke: var(--p1); stroke-width: 1.2; fill: none; }

.stages { list-style: none; padding: 0; margin: 22px 0 10px; }
.stages li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; padding: 20px 0; border-top: 1px solid var(--line); }
.stages li:last-child { border-bottom: 1px solid var(--line); }
.stage-num { font: 300 32px/1 var(--font-display); color: var(--accent); }
.stages h4 { margin-top: 3px; color: var(--fg); }
.stages p { margin: 0; }
.aside { font-family: var(--font-display); font-style: italic; font-size: calc(var(--body-size) + .5px); color: var(--fg-soft); margin-top: 1.2em; }

/* ---------- Worlds gallery ---------- */
.worlds-head p { margin-bottom: 26px; }
.world-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.tile {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; padding: 0; border: 0; border-radius: 4px;
  overflow: hidden; background: #02040a; cursor: pointer; color: #fff; text-align: left;
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.tile video { position: absolute; top: 0; left: 0; width: 300%; max-width: none; height: 100%; object-fit: fill; opacity: 0; transition: opacity .25s; }
.tile.is-playing video { opacity: 1; }
.tile:hover img { transform: scale(1.03); }
.tile-text {
  position: absolute; inset: auto 0 0 0; padding: 36px 12px 11px;
  background: linear-gradient(to bottom, transparent, rgba(3, 6, 16, .86));
  font: 400 13px/1.42 var(--font-ui); opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s var(--ease);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.tile:hover .tile-text, .tile:focus-visible .tile-text { opacity: 1; transform: none; }
.tile .mode-mark {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(3, 6, 16, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.tile .mode-mark svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
@media (hover: none) { .tile-text { display: none; } }

/* ---------- Dialog ---------- */
.world-dialog {
  padding: 0; border: 0; width: min(1040px, 100vw - 32px); max-width: none; max-height: calc(100vh - 32px);
  background: var(--bg); color: var(--fg); border-radius: 10px; overflow: auto;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .5);
}
.world-dialog::backdrop { background: rgba(3, 6, 15, .76); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog-body { display: grid; gap: 18px; padding: 18px 28px 28px; }
.dialog-body > .viewer { width: 100%; }
.dialog-body > .world-caption { max-width: 760px; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-nav { display: flex; align-items: center; gap: 10px; }
.btn--quiet { height: 36px; padding: 0 14px; font-size: 14px; }
.dialog-count { font-size: 15px; line-height: 1; color: var(--muted); min-width: 4.5em; text-align: center; }
.dialog-close {
  flex: none; width: 38px; height: 38px; border-radius: 50%; padding: 0;
  border: 1px solid var(--line-strong); background: transparent; color: var(--fg); display: grid; place-items: center; cursor: pointer;
}
.dialog-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; fill: none; }
.dialog-close:hover { border-color: var(--accent); color: var(--accent); }

/* triptych: RGB | depth | normal side by side; each panel is smaller than its native 448 px, so it stays sharp */
.viewer--triptych .viewer-stage { aspect-ratio: auto; background: transparent; box-shadow: none; border-radius: 0; overflow: visible; }
.viewer--triptych .divider, .viewer--triptych .viewer-modes { display: none; }

/* ---------- BibTeX ---------- */
.bibtex-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.bibtex pre {
  margin: 0; padding: 20px 22px; overflow-x: auto;
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: 8px;
  font: 12.5px/1.75 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--fg-soft);
}
.copy {
  flex: none; border: 1px solid var(--line-strong); background: transparent;
  color: var(--fg); font: 500 13px/1 var(--font-ui); padding: 9px 13px; border-radius: 999px; cursor: pointer;
}
.copy:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero { min-height: 0; }
  .hero-grid { --stage: min(448px, calc(100vw - 2 * var(--pad) - 68px)); grid-template-columns: minmax(0, 1fr); }
  .hero-figure { width: calc(var(--stage) + var(--thumb) + 16px); max-width: 100%; }
}
@media (max-width: 720px) {
  :root { --body-size: 16px; }
  .topbar-links { display: none; }
  .topbar-mark { opacity: 1; }
  .hero-figure { width: min(100%, 448px); grid-template-columns: minmax(0, 1fr); grid-template-areas: "viewer" "picker" "caption"; }
  .picker { flex-direction: row; overflow-x: auto; padding: 3px; margin: -3px; scrollbar-width: none; }
  .picker::-webkit-scrollbar { display: none; }
  .picker button { flex: none; width: 48px; height: 48px; }
  .viewer-modes { display: flex; width: 100%; }
  .viewer-modes button { flex: 1; padding-inline: 6px; }
  .dialog-body { padding: 12px 14px 16px; gap: 14px; }
  .dialog-body > .viewer { max-width: 448px; }
  .hero .affiliation .note { display: block; margin: 4px 0 0; }
  .world-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
