@font-face { font-family: "Cormorant"; src: url("assets/fonts/cormorant-garamond-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("assets/fonts/cormorant-garamond-latin-300-italic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("assets/fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("assets/fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("assets/fonts/manrope-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("assets/fonts/manrope-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("assets/fonts/manrope-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #030409;
  --ink: #ece6da;
  --ink-2: rgba(236, 230, 218, 0.66);
  --ink-3: rgba(236, 230, 218, 0.40);
  --hair: rgba(236, 230, 218, 0.16);
  --accent: #ece6da;
  --serif: "Cormorant", "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", -apple-system, system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --pad: clamp(18px, 3.2vw, 44px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus { outline: none; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; border-radius: 2px; }

/* ---------- stage ---------- */
#stage { position: fixed; inset: 0; z-index: 0; transition: opacity .5s var(--ease-io); }
#stage.dim { opacity: 0; }
#scene { display: block; width: 100%; height: 100%; touch-action: none; }
body.hovering #scene { cursor: pointer; }
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%);
}
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 22px;
  background: var(--bg); transition: opacity 1.1s var(--ease-io), visibility 1.1s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-mark { font-family: var(--serif); font-weight: 300; font-size: 34px; letter-spacing: .02em; }
.loader-mark span, .wordmark span { font-style: italic; color: var(--ink-2); }
.loader-bar { width: 140px; height: 1px; background: var(--hair); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .4s var(--ease-out); }
.loader-text { font-size: 10px; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- chrome ---------- */
.chrome { position: fixed; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.chrome > * { pointer-events: auto; }
.chrome.top { top: 0; padding: calc(var(--safe-t) + 14px) calc(var(--pad) + var(--safe-r)) 0 calc(var(--pad) + var(--safe-l)); }
.chrome.bottom { bottom: 0; padding: 0 calc(var(--pad) + var(--safe-r)) calc(var(--safe-b) + 12px) calc(var(--pad) + var(--safe-l)); }
.wordmark {
  font-family: var(--serif); font-weight: 300; font-size: 26px; letter-spacing: .02em; text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center;
}
.top-actions { display: flex; gap: 6px; }
.chip {
  min-height: 44px; padding: 0 14px; border: 0; background: transparent; cursor: pointer;
  font-size: 10.5px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-2);
  transition: color .3s;
}
.chip:hover, .chip[aria-expanded="true"], .chip[aria-pressed="true"] { color: var(--ink); }
.foot-links { display: flex; align-items: center; gap: 4px; margin-left: -10px; }
.foot-links a, .linklike {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px;
  font-size: 10.5px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); text-decoration: none;
  background: none; border: 0; cursor: pointer; transition: color .3s;
}
.foot-links a:hover, .linklike:hover, .linklike[aria-expanded="true"] { color: var(--ink); }
.foot-note { margin: 0; font-size: 11px; color: var(--ink-3); letter-spacing: .02em; }
body.focused .foot-note { opacity: 0; }
.foot-note { transition: opacity .6s; }

.chrome, #labels, #hint { transition: opacity 1.2s var(--ease-io); }
body.booting .chrome, body.booting #labels, body.booting #hint { opacity: 0; }

/* ---------- world labels ---------- */
#labels { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#labels[inert] .world-label { opacity: 0 !important; }
.world-label {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; touch-action: none;
  background: none; border: 0; padding: 0; margin: 0; text-align: left;
  display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 6px 4px;
  will-change: transform; opacity: 0; transition: opacity .9s var(--ease-io);
}
.world-label.shown { opacity: 1; }
.world-label .wl-line { width: 34px; height: 1px; background: var(--hair); flex: none; transition: width .5s var(--ease-out), background .4s; }
.world-label.side-left { flex-direction: row-reverse; text-align: right; }
.world-label .wl-text { display: grid; gap: 3px; }
.world-label .wl-meta {
  font-size: 10px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-3);
  transition: color .4s;
}
.world-label .wl-title {
  font-family: var(--serif); font-weight: 300; font-size: clamp(26px, 2.5vw, 36px); line-height: 1; color: var(--ink);
  letter-spacing: .005em;
}
.world-label.minor .wl-title { font-size: clamp(17px, 1.4vw, 21px); color: var(--ink-2); }
.world-label.minor .wl-line { width: 18px; }
.world-label.minor:hover .wl-title, .world-label.minor.hot .wl-title { color: var(--ink); }
.world-label:hover .wl-line, .world-label.hot .wl-line, .world-label:focus-visible .wl-line { width: 52px; background: var(--accent-w, var(--ink)); }
.world-label:hover .wl-meta, .world-label.hot .wl-meta { color: var(--accent-w, var(--ink)); }

.hint {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 68px); transform: translateX(-50%); z-index: 9; margin: 0;
  font-size: 10px; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-3); pointer-events: none;
  transition: opacity .8s;
}
body.focused .hint, body.touched .hint { opacity: 0; }

/* ---------- panel ---------- */
.scrim {
  display: none; position: fixed; inset: 0; z-index: 14; pointer-events: none; opacity: 0; transition: opacity 1s var(--ease-io);
  background: linear-gradient(to bottom, transparent 32vh, rgba(3, 4, 9, .6) 50vh, rgba(3, 4, 9, .92) 72vh);
}
body.focused .scrim { opacity: 1; }
#panel {
  position: fixed; z-index: 15; top: 0; bottom: 0; right: 0;
  width: min(560px, 46vw);
  padding: calc(var(--safe-t) + 96px) calc(var(--pad) + var(--safe-r)) calc(var(--safe-b) + 84px) 24px;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  display: flex; flex-direction: column; justify-content: center;
  opacity: 0; transform: translateX(26px); transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 84px, #000 calc(100% - 70px), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 84px, #000 calc(100% - 70px), transparent 100%);
}
#panel::-webkit-scrollbar { display: none; }
#panel.open { opacity: 1; transform: none; }
#panel[hidden] { display: none; }
.panel-inner { margin: auto 0; max-width: 470px; }
.p-eyebrow { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; font-size: 10.5px; font-weight: 500; letter-spacing: .28em; text-transform: uppercase; color: var(--ink-2); }
.p-eyebrow i { display: block; width: 36px; height: 1px; background: var(--accent); }
.p-title {
  font-family: var(--serif); font-weight: 300; margin: 0 0 22px;
  font-size: clamp(60px, 7.4vw, 112px); line-height: .9; letter-spacing: -.01em;
}
.p-title em { font-style: italic; color: var(--accent); }
.p-lede { font-family: var(--serif); font-weight: 300; font-style: italic; font-size: clamp(21px, 1.8vw, 26px); line-height: 1.35; color: var(--ink); margin: 0 0 34px; max-width: 30ch; }
.p-block { border-top: 1px solid var(--hair); padding: 18px 0 20px; display: grid; grid-template-columns: 112px 1fr; gap: 18px; }
.p-block h3 { margin: 2px 0 0; font-size: 10px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-3); }
.p-block p { margin: 0; font-size: 14.5px; line-height: 1.7; font-weight: 300; color: var(--ink-2); }
.p-block p + p { margin-top: 8px; }
.p-block a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
.p-block a:hover { color: var(--accent); }
.draft-tag { display: inline-block; margin-left: 2px; padding: 3px 7px 2px; border: 1px solid var(--hair); border-radius: 99px; font-size: 9px; letter-spacing: .2em; color: var(--ink-3); }
.p-nav { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; }
.p-btn {
  min-height: 44px; display: inline-flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 10.5px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-2); transition: color .3s;
}
.p-btn:hover { color: var(--ink); }
.p-btn .arrow { display: inline-block; width: 26px; height: 1px; background: currentColor; position: relative; transition: width .4s var(--ease-out); }
.p-btn .arrow::after { content: ""; position: absolute; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; }
.p-btn.back .arrow::after { left: 0; border-left: 1px solid currentColor; transform: rotate(-45deg); transform-origin: 0 0; top: 0; }
.p-btn.next .arrow::after { right: 0; border-right: 1px solid currentColor; transform: rotate(45deg); transform-origin: 100% 0; top: 0; }
.p-btn:hover .arrow { width: 38px; }
.p-btn.back { color: var(--ink); }

/* ---------- index overlay ---------- */
.index {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
  background: rgba(3, 4, 9, .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .5s var(--ease-io);
}
.index.open { opacity: 1; }
.index[hidden] { display: none; }
.index-inner { width: min(520px, 86vw); }
.index-eyebrow { font-size: 10.5px; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 16px; }
.index ol { list-style: none; padding: 0; margin: 0 0 22px; border-top: 1px solid var(--hair); }
.index li { border-bottom: 1px solid var(--hair); }
.index li button {
  width: 100%; min-height: 72px; display: flex; align-items: baseline; gap: 18px; padding: 14px 0; border: 0; background: none; cursor: pointer; text-align: left;
}
.index .ix-n { font-size: 10.5px; letter-spacing: .24em; color: var(--ink-3); width: 26px; }
.index .ix-t { font-family: var(--serif); font-weight: 300; font-size: 40px; line-height: 1; transition: transform .5s var(--ease-out); }
.index .ix-w { margin-left: auto; font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); }
.index li button:hover .ix-t { transform: translateX(8px); }
.index-close { margin-left: -14px; }

/* ---------- credits ---------- */
.credits {
  position: fixed; z-index: 31; left: calc(var(--pad) + var(--safe-l)); bottom: calc(var(--safe-b) + 64px);
  width: min(440px, calc(100vw - 2 * var(--pad))); padding: 20px 22px 8px;
  background: rgba(10, 11, 18, .9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--hair); font-size: 12.5px; line-height: 1.65; color: var(--ink-2);
}
.credits[hidden] { display: none; }
.credits p { margin: 0 0 10px; }
.credits strong { color: var(--ink); font-weight: 500; }
.credits a { color: var(--ink); }
.credits .chip { margin-left: -14px; }

/* ---------- static fallbacks ---------- */
.fallback-static { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; gap: 4px; z-index: 60; background: var(--bg); }
body.no-webgl #stage, body.no-webgl .hint, body.no-webgl .foot-note { display: none; }
body.no-webgl #labels { position: fixed; inset: 0; display: grid; place-content: center; gap: 18px; pointer-events: auto; }
body.no-webgl .world-label { position: static; opacity: 1; transform: none !important; }
body.no-webgl.focused #labels { display: none; }
body.no-webgl #panel { left: 0; width: auto; padding-left: calc(var(--pad) + var(--safe-l)); }
body.no-webgl .panel-inner { margin: auto; }

/* ---------- compact portrait ---------- */
@media (max-aspect-ratio: 4/5) {
  .wordmark { font-size: 23px; }
  .chip { padding: 0 10px; letter-spacing: .2em; }
  .foot-note { display: none; }
  .chrome.bottom { justify-content: center; }
  .foot-links { margin-left: 0; }
  .hint { bottom: calc(var(--safe-b) + 62px); white-space: nowrap; letter-spacing: .22em; font-size: 9.5px; }
  .world-label.minor .wl-title { font-size: 17px; }
  #panel {
    left: 0; width: auto; justify-content: flex-start;
    padding: calc(var(--safe-t) + 46vh) calc(var(--pad) + var(--safe-r)) calc(var(--safe-b) + 90px) calc(var(--pad) + var(--safe-l));
    transform: translateY(30px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent calc(var(--safe-t) + 70px), #000 calc(var(--safe-t) + 120px), #000 calc(100% - 60px), transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, transparent calc(var(--safe-t) + 70px), #000 calc(var(--safe-t) + 120px), #000 calc(100% - 60px), transparent 100%);
  }
  .scrim { display: block; }
  body.focused .foot-links { opacity: 0; pointer-events: none; }
  .foot-links { transition: opacity .6s; }
  .chrome.bottom::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 130px; z-index: -1; pointer-events: none; background: linear-gradient(to top, rgba(3,4,9,.85), transparent); }
  .panel-inner { margin: 0; pointer-events: auto; }
  #panel { pointer-events: none; }
  .p-title { font-size: clamp(58px, 17vw, 84px); margin-bottom: 16px; }
  .p-lede { font-size: 21px; margin-bottom: 26px; }
  .p-block { grid-template-columns: 1fr; gap: 8px; }
  .world-label .wl-title { font-size: 28px; }
  .world-label .wl-line { width: 22px; }
  .world-label:hover .wl-line, .world-label.hot .wl-line { width: 30px; }
}

/* ---------- short landscape (phones sideways) ---------- */
@media (max-height: 520px) and (min-aspect-ratio: 4/5) {
  .chrome.top { padding-top: calc(var(--safe-t) + 4px); }
  .chrome.bottom { padding-bottom: calc(var(--safe-b) + 2px); }
  .wordmark { font-size: 22px; }
  .foot-note { display: none; }
  .hint { display: none; }
  #panel { width: min(470px, 52vw); padding-top: calc(var(--safe-t) + 58px); padding-bottom: calc(var(--safe-b) + 50px); justify-content: flex-start;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 56px, #000 calc(100% - 46px), transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, #000 56px, #000 calc(100% - 46px), transparent 100%); }
  .p-title { font-size: 58px; margin-bottom: 12px; }
  .p-lede { font-size: 19px; margin-bottom: 20px; }
  .p-block { grid-template-columns: 90px 1fr; padding: 12px 0 14px; }
  .world-label .wl-title { font-size: 26px; }
  .world-label { min-height: 44px; }
  .index li button { min-height: 52px; padding: 8px 0; }
  .index .ix-t { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  #panel { transition: opacity .4s linear; transform: none !important; }
  .world-label, .world-label .wl-line, .index .ix-t { transition-duration: .01s; }
}
