/* ==========================================================
   A Voyage Through Planetary Motion
   Vintage star atlas: night ink + old parchment + brass
   ========================================================== */
:root {
  --night: #0b1024;
  --night-2: #141b38;
  --cream: #f3e6c8;
  --cream-dim: #c9bd9f;
  --brass: #e9b44c;
  --brass-dk: #8a6420;
  --rust: #9c3d1a;
  --rust-lt: #c2582a;
  --parch: #efe2c2;
  --parch-2: #e4d2a6;
  --parch-3: #cdb57f;
  --ink: #2e2010;
  --ink-soft: #5b4528;
  --ink-faint: rgba(46, 32, 16, .18);
  --sepia-blue: #2f4a63;
  --ease: cubic-bezier(.2, .75, .2, 1);
  --pop: cubic-bezier(.34, 1.56, .64, 1);

  --fell: 'IM Fell English', 'Times New Roman', serif;
  --fell-sc: 'IM Fell English SC', 'Times New Roman', serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --type: 'Special Elite', 'Courier New', monospace;
  --hand: 'Caveat', 'Segoe Print', cursive;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--night);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
img, canvas, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--rust); color: var(--parch); }

/* ---------- starfield + film layers ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.nebula {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: screen;
  background:
    radial-gradient(700px 480px at 82% 18%, rgba(233, 180, 76, .10), transparent 65%),
    radial-gradient(800px 600px at 8% 85%, rgba(156, 61, 26, .14), transparent 60%),
    radial-gradient(600px 500px at 45% 50%, rgba(47, 74, 99, .18), transparent 70%);
  transition: opacity .8s;
}
.grain {
  position: fixed; inset: -50%; z-index: 400; pointer-events: none; opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(5) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); } 40% { transform: translate(3%, -5%); }
  60% { transform: translate(-2%, 6%); } 80% { transform: translate(5%, 1%); } 100% { transform: translate(0, 0); }
}
.vignette {
  position: fixed; inset: 0; z-index: 390; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(10, 6, 2, .55) 100%);
  animation: flicker 4s infinite;
}
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: .92; } 49% { opacity: 1; } 73% { opacity: .95; } }
.scratches { position: fixed; inset: 0; z-index: 395; pointer-events: none; opacity: .22; }
.scratches i { position: absolute; top: 0; bottom: 0; width: 1px; background: linear-gradient(transparent, var(--cream) 20%, transparent 45%, var(--cream) 70%, transparent); }
.scratches i:nth-child(1) { left: 18%; animation: scratch 3.1s steps(1) infinite; }
.scratches i:nth-child(2) { left: 63%; animation: scratch 4.7s steps(1) infinite .8s; }
.scratches i:nth-child(3) { left: 84%; animation: scratch 2.3s steps(1) infinite 1.6s; }
@keyframes scratch { 0% { opacity: 0; } 10% { opacity: 1; transform: translateX(14px); } 18% { opacity: 0; } 55% { opacity: .7; transform: translateX(-30px); } 60% { opacity: 0; } }
body.in-past .scratches i { background: linear-gradient(transparent, var(--ink) 20%, transparent 45%, var(--ink) 70%, transparent); }
body.in-past .scratches { opacity: .12; }

.sound-btn {
  position: fixed; top: 16px; right: 16px; z-index: 500;
  background: rgba(11, 16, 36, .55); color: var(--cream); border: 1px solid rgba(243, 230, 200, .35);
  border-radius: 999px; padding: 5px 13px; font-family: var(--fell-sc); font-size: 14px; letter-spacing: .04em;
  backdrop-filter: blur(4px); transition: background .3s, color .3s, border-color .3s;
}
.sound-btn:hover { border-color: var(--brass); }
.sound-btn[aria-pressed="false"] { opacity: .65; }
body.in-past .sound-btn { background: rgba(239, 226, 194, .8); color: var(--ink); border-color: var(--ink-faint); }

/* ---------- scenes ---------- */
.scene { position: fixed; inset: 0; z-index: 10; opacity: 0; visibility: hidden; transition: opacity .6s, visibility 0s .6s; }
.scene.active { opacity: 1; visibility: visible; transition: opacity .6s; }

/* =====================================================
   SCENE 1 · SPACE
   ===================================================== */
#space { display: grid; grid-template-rows: auto 1fr; padding: clamp(46px, 7vh, 80px) 16px 40px; overflow: hidden; }

.plate-frame {
  position: absolute; inset: 14px; pointer-events: none;
  border: 1px solid rgba(243, 230, 200, .35); outline: 1px solid rgba(243, 230, 200, .18); outline-offset: 5px;
}
.plate-frame span { position: absolute; font-family: var(--fell-sc); font-size: 13px; letter-spacing: .12em; color: var(--cream-dim); background: var(--night); padding: 0 10px; white-space: nowrap; }
.pf-tl { top: -10px; left: 24px; } .pf-tr { top: -10px; right: 150px; }
.pf-bl { bottom: -10px; left: 24px; } .pf-br { bottom: -10px; right: 24px; }

.saturn { position: absolute; width: clamp(140px, 18vw, 240px); top: 9%; right: 6%; opacity: .85; animation: drift 14s ease-in-out infinite; }
.moonlet { position: absolute; width: clamp(60px, 7vw, 96px); bottom: 12%; left: 7%; opacity: .75; animation: drift 11s ease-in-out infinite reverse; }
@keyframes drift { 0%, 100% { transform: translate(0, 0) rotate(-6deg); } 50% { transform: translate(-10px, 12px) rotate(-2deg); } }

.space-title { position: relative; text-align: center; max-width: 820px; margin: 0 auto; transition: opacity .6s, transform .8s var(--ease); animation: fadeDown 1.4s var(--ease) both .3s; }
.space-title.gone { animation: fadeOutUp .6s var(--ease) forwards; }
@keyframes fadeOutUp { to { opacity: 0; transform: translateY(-30px); } }
#space.warping .saturn, #space.warping .moonlet, #space.warping .plate-frame { opacity: 0; transition: opacity .6s; }
.eyebrow { font-family: var(--fell-sc); font-size: 15px; letter-spacing: .16em; color: var(--brass); }
.space-title h1 { font-family: var(--fell); font-weight: 400; font-size: clamp(34px, 6vw, 72px); line-height: 1.02; margin: 10px 0 12px; color: var(--cream); text-shadow: 0 0 30px rgba(233, 180, 76, .18); }
.space-title h1 em { color: var(--brass); }
.lede { font-size: clamp(17px, 2vw, 21px); color: var(--cream-dim); }
.lede i { color: var(--cream); }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: none; } }

.space-stage { display: flex; align-items: center; justify-content: center; gap: clamp(20px, 5vw, 70px); position: relative; min-height: 0; }

/* the ship */
.ship { width: clamp(96px, 12vw, 150px); flex: none; opacity: 0; }
.ship.arrive { animation: shipArrive 2.6s cubic-bezier(.22, .9, .3, 1) forwards; }
.ship.launch { animation: shipLaunch 1.1s cubic-bezier(.6, 0, .9, .4) forwards; }
.ship.return { animation: shipReturn 2.2s cubic-bezier(.22, .9, .3, 1) forwards; }
.ship-bob { animation: bob 3.2s ease-in-out infinite; }
.rocket { width: 100%; height: auto; filter: drop-shadow(0 0 22px rgba(233, 180, 76, .25)); overflow: visible; }
.flame { transform-origin: 60px 204px; animation: flame .12s ease-in-out infinite alternate; }
.ship.launch .flame, .ship.boost .flame { animation: flameBig .08s ease-in-out infinite alternate; }
@keyframes flame { from { transform: scaleY(.82) scaleX(.95); } to { transform: scaleY(1.05) scaleX(1.04); } }
@keyframes flameBig { from { transform: scaleY(1.6) scaleX(1.15); } to { transform: scaleY(2.1) scaleX(1.25); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
@keyframes shipArrive {
  0% { opacity: 0; transform: translate(-70vw, 80vh) rotate(42deg) scale(.4); }
  12% { opacity: 1; }
  75% { transform: translate(14px, -18px) rotate(6deg) scale(1.04); opacity: 1; }
  100% { opacity: 1; transform: none; }
}
@keyframes shipLaunch {
  0% { opacity: 1; transform: none; }
  25% { transform: translateY(14px) scale(1.02); }
  100% { opacity: 0; transform: translateY(-120vh) scale(.35); }
}
@keyframes shipReturn {
  0% { opacity: 0; transform: translateY(-90vh) scale(.4); }
  15% { opacity: 1; }
  80% { transform: translateY(12px) scale(1.02); opacity: 1; }
  100% { opacity: 1; transform: none; }
}

/* the transmission box */
.transmission {
  position: relative; width: min(440px, 100%);
  background: linear-gradient(180deg, #f4ead1, #e8d7ac);
  color: var(--ink); border-radius: 4px; padding: 18px 22px 20px;
  box-shadow: 0 0 0 1px var(--ink), 0 0 0 5px var(--parch-2), 0 0 0 6px var(--ink), 0 24px 60px rgba(0, 0, 0, .55);
  opacity: 0; transform: scale(.6) rotate(-3deg); transform-origin: left center; pointer-events: none;
  transition: opacity .5s, transform .6s var(--pop);
}
.transmission::before { /* paper noise */
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: .35; mix-blend-mode: multiply; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.6' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .1 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}
.transmission::after { /* speech tail */
  content: ""; position: absolute; left: -15px; top: 50%; width: 22px; height: 22px; margin-top: -11px;
  background: #eee0bd; border-left: 1px solid var(--ink); border-bottom: 1px solid var(--ink); transform: rotate(45deg);
}
.transmission.show { opacity: 1; transform: none; pointer-events: auto; }
.transmission.hide { opacity: 0; transform: scale(.8) translateY(20px); pointer-events: none; }
.tx-head { font-family: var(--fell-sc); font-size: 14px; letter-spacing: .08em; color: var(--rust); display: flex; align-items: center; gap: 8px; border-bottom: 1px dashed var(--ink-faint); padding-bottom: 8px; margin-bottom: 12px; }
.tx-head i { font-family: var(--fell); }
.tx-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rust-lt); box-shadow: 0 0 0 3px rgba(194, 88, 42, .25); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.tx-text { font-family: var(--type); font-size: clamp(18px, 2.2vw, 22px); line-height: 1.45; min-height: 3em; position: relative; white-space: pre-line; }
.tx-text strong { color: var(--rust); font-weight: 400; }
.tx-text.typing::after { content: "▌"; animation: blink .7s steps(2) infinite; color: var(--rust); }
.tx-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s var(--ease); position: relative; }
.tx-actions.show { opacity: 1; transform: none; }

.btn { border: 0; border-radius: 3px; padding: 11px 20px; font-family: var(--fell-sc); font-size: 18px; letter-spacing: .04em; line-height: 1.1; transition: transform .2s var(--ease), box-shadow .2s, background .2s, opacity .4s; }
.btn-brass {
  color: #2a1a05; background: linear-gradient(180deg, #f2cf74, #c89332);
  box-shadow: 0 0 0 1px var(--ink), 0 3px 0 var(--brass-dk), 0 8px 16px rgba(0, 0, 0, .25);
  animation: glow 1.8s ease-in-out infinite;
}
.btn-brass:hover { transform: translateY(-2px); }
.btn-brass:active { transform: translateY(2px); box-shadow: 0 0 0 1px var(--ink), 0 1px 0 var(--brass-dk); }
@keyframes glow { 50% { box-shadow: 0 0 0 1px var(--ink), 0 3px 0 var(--brass-dk), 0 0 22px rgba(233, 180, 76, .65); } }
.btn-ghost { background: transparent; color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--ink-faint); }
.btn-ghost:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-ghost.shrink { transform: scale(.82); opacity: .7; }
.btn-ghost.gone { opacity: 0; pointer-events: none; transform: scale(.4) rotate(-12deg); }
.btn:focus-visible { outline: 2px dashed var(--rust); outline-offset: 3px; }

/* =====================================================
   TIME WARP
   ===================================================== */
.warp { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .5s; }
.warp.on { opacity: 1; }
.warp-rings { position: absolute; inset: 0; display: grid; place-items: center; }
.warp-rings i { position: absolute; width: 40vmin; height: 40vmin; border-radius: 50%; border: 2px solid rgba(233, 180, 76, .5); opacity: 0; }
.warp.on .warp-rings i { animation: ring 1.2s linear infinite; }
.warp.on .warp-rings i:nth-child(2) { animation-delay: .3s; }
.warp.on .warp-rings i:nth-child(3) { animation-delay: .6s; }
.warp.on .warp-rings i:nth-child(4) { animation-delay: .9s; }
@keyframes ring { 0% { transform: scale(3.2); opacity: 0; } 30% { opacity: .7; } 100% { transform: scale(.05); opacity: 0; } }
.warp.forward.on .warp-rings i { animation-name: ringOut; }
@keyframes ringOut { 0% { transform: scale(.05); opacity: 0; } 30% { opacity: .7; } 100% { transform: scale(3.2); opacity: 0; } }

.clock { position: absolute; width: min(64vmin, 520px); opacity: .32; filter: drop-shadow(0 0 18px rgba(233, 180, 76, .35)); }
.clock text { font-family: var(--fell); fill: var(--cream); font-size: 22px; text-anchor: middle; dominant-baseline: central; }
.hand { transform-origin: 0 0; }
.warp.on .hand-m { animation: spinBack .35s linear infinite; }
.warp.on .hand-h { animation: spinBack 2.8s linear infinite; }
.warp.forward.on .hand-m { animation: spinFwd .35s linear infinite; }
.warp.forward.on .hand-h { animation: spinFwd 2.8s linear infinite; }
@keyframes spinBack { to { transform: rotate(-360deg); } }
@keyframes spinFwd { to { transform: rotate(360deg); } }

.warp-text { position: relative; text-align: center; }
.warp-label { font-family: var(--fell-sc); letter-spacing: .3em; font-size: clamp(13px, 1.6vw, 17px); color: var(--brass); }
.warp-year {
  font-family: var(--fell); font-size: clamp(76px, 15vw, 170px); line-height: 1; color: var(--cream);
  font-variant-numeric: tabular-nums; text-shadow: 3px 0 rgba(194, 88, 42, .7), -3px 0 rgba(47, 74, 99, .8), 0 0 40px rgba(233, 180, 76, .4);
}
.warp-year small { font-size: .28em; color: var(--brass); margin-left: .2em; }
.warp-dest { font-family: var(--type); font-size: clamp(14px, 1.8vw, 18px); color: var(--cream-dim); margin-top: 8px; }

body.shake .scene.active, body.shake .warp-text { animation: shake .09s linear infinite; }
@keyframes shake { 0% { transform: translate(0, 0); } 25% { transform: translate(-3px, 2px); } 50% { transform: translate(3px, -2px); } 75% { transform: translate(-2px, -3px); } 100% { transform: translate(2px, 3px); } }

.flash { position: fixed; inset: 0; z-index: 300; background: #fbf3dc; opacity: 0; pointer-events: none; transition: opacity .35s ease-in; }
.flash.on { opacity: 1; }
.flash.out { transition: opacity .9s ease-out; }

/* short hop between chapters */
.hop {
  position: fixed; inset: 0; z-index: 220; display: grid; place-items: center; pointer-events: none;
  background: radial-gradient(ellipse at center, #efe2c2 30%, #cdb57f 120%);
  clip-path: circle(0% at 50% 50%); transition: clip-path .55s cubic-bezier(.7, 0, .3, 1);
}
.hop.on { clip-path: circle(150% at 50% 50%); pointer-events: auto; }
.hop-inner { text-align: center; color: var(--ink); }
.hop-label { font-family: var(--fell-sc); letter-spacing: .25em; font-size: 15px; color: var(--rust); }
.hop-year { font-family: var(--fell); font-size: clamp(70px, 13vw, 140px); line-height: 1; font-variant-numeric: tabular-nums; }
.hop-line { width: min(320px, 70vw); height: 3px; margin: 14px auto 0; background: var(--ink-faint); overflow: hidden; }
.hop-line span { display: block; height: 100%; width: 0; background: var(--rust); }

/* =====================================================
   SCENE 2 · THE PAST (parchment)
   ===================================================== */
#past {
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 250, 230, .55), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(150, 105, 40, .22), transparent 50%),
    radial-gradient(ellipse at center, var(--parch) 40%, var(--parch-3) 130%);
  display: flex; flex-direction: column;
}
#past::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.5' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .33 0 0 0 0 .15 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}
.past-head {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 4vw, 44px) 12px 16px; padding-right: 150px;
  border-bottom: 1px solid var(--ink-faint); box-shadow: 0 1px 0 rgba(255, 250, 230, .6);
}
.ph-brand { display: flex; align-items: center; gap: 10px; font-family: var(--fell); font-size: 19px; }
.ph-brand svg { width: 32px; animation: spinSlow 30s linear infinite; }
.ph-brand i { color: var(--rust); }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.ph-where { font-family: var(--fell-sc); font-size: 14px; letter-spacing: .14em; color: var(--ink-soft); white-space: nowrap; }

.stage { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; padding: clamp(18px, 4vh, 40px) 16px 40px; outline: none; scroll-behavior: smooth; }
.stage::-webkit-scrollbar { width: 10px; }
.stage::-webkit-scrollbar-thumb { background: var(--parch-3); border-radius: 10px; border: 2px solid var(--parch); }

/* ---------- astronomer card ---------- */
.card {
  position: relative; max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(250px, 340px) 1fr; gap: clamp(22px, 4vw, 52px);
  background: linear-gradient(180deg, rgba(250, 243, 222, .9), rgba(240, 228, 196, .9));
  padding: clamp(22px, 4vw, 46px);
  box-shadow: 0 0 0 1px var(--ink), 0 0 0 7px rgba(250, 243, 222, .9), 0 0 0 8px var(--ink), 0 26px 60px rgba(70, 45, 10, .3);
  border-radius: 2px;
}
.card::before, .card::after { content: "✦"; position: absolute; font-size: 18px; color: var(--rust); line-height: 1; }
.card::before { top: 8px; left: 10px; } .card::after { bottom: 8px; right: 10px; }

.card.pop { animation: cardPop .8s var(--pop) both; }
@keyframes cardPop { from { opacity: 0; transform: scale(.82) rotate(-1.5deg) translateY(30px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(14px); animation: rise .7s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 1ms + 400ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

.card-left { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 26px; }
.frame { position: relative; width: 100%; max-width: 280px; }
.frame-oval {
  position: relative; aspect-ratio: 4 / 5; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 3px var(--parch), 0 0 0 5px var(--brass-dk), 0 0 0 9px #d6b469, 0 0 0 11px var(--ink), 0 18px 34px rgba(60, 40, 10, .45);
  animation: framePop 1s var(--pop) both .15s;
}
.frame-oval img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; filter: sepia(.35) contrast(1.05) saturate(.85); transition: filter .5s, transform 6s ease-out; }
.frame:hover .frame-oval img { filter: sepia(0) contrast(1.05); transform: scale(1.06); }
.frame-oval::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 40px rgba(60, 35, 5, .55); }
@keyframes framePop { 0% { opacity: 0; transform: scale(.3) rotate(-14deg); } 100% { opacity: 1; transform: none; } }

.who-note {
  position: absolute; top: -40px; left: -22px; z-index: 2; white-space: nowrap;
  text-shadow: 0 0 6px var(--parch), 0 0 2px var(--parch);
  font-family: var(--hand); font-weight: 700; font-size: 30px; color: var(--rust); transform: rotate(-12deg);
  opacity: 0; animation: scribble .7s var(--pop) forwards 1s;
}
.who-note svg { position: absolute; left: 78%; top: 62%; width: 46px; overflow: visible; }
.who-note path { stroke: var(--rust); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-dasharray: 90; stroke-dashoffset: 90; animation: draw .6s ease-out forwards 1.5s; }
@keyframes scribble { from { opacity: 0; transform: rotate(-12deg) scale(.4); } to { opacity: 1; transform: rotate(-12deg) scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.plaque {
  text-align: center; padding: 8px 18px 10px; min-width: 70%;
  background: linear-gradient(180deg, #e8c773, #b98a33); color: #2a1a05;
  box-shadow: 0 0 0 1px var(--ink), inset 0 1px 0 rgba(255, 245, 210, .7), 0 6px 12px rgba(60, 40, 10, .25); border-radius: 2px;
}
.plaque b { display: block; font-family: var(--fell-sc); font-weight: 400; font-size: 20px; letter-spacing: .04em; }
.plaque span { font-family: var(--serif); font-style: italic; font-size: 16px; }

.stamp {
  position: absolute; top: clamp(14px, 3vw, 30px); right: clamp(14px, 3vw, 34px); z-index: 3;
  font-family: var(--fell-sc); color: var(--rust); border: 3px double var(--rust); border-radius: 6px;
  padding: 4px 12px; text-align: center; line-height: 1.1; transform: rotate(8deg); opacity: 0; mix-blend-mode: multiply;
  animation: stamp .45s cubic-bezier(.5, 1.8, .6, 1) forwards 1.2s;
}
.stamp small { display: block; font-size: 11px; letter-spacing: .2em; }
.stamp b { font-weight: 400; font-size: 22px; letter-spacing: .04em; }
@keyframes stamp { 0% { opacity: 0; transform: rotate(8deg) scale(2.6); } 100% { opacity: .82; transform: rotate(8deg) scale(1); } }


.card-right { min-width: 0; }
.chapter-line { font-family: var(--fell-sc); font-size: 15px; letter-spacing: .14em; color: var(--rust); padding-right: 120px; }
.name { font-family: var(--fell); font-weight: 400; font-size: clamp(38px, 5.4vw, 64px); line-height: 1; margin: 6px 0 10px; }
.model-tag { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-family: var(--fell-sc); font-size: 19px; padding: 3px 12px 4px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.model-tag i { font-family: var(--serif); font-size: 19px; color: var(--ink-soft); }

.who-title { font-family: var(--hand); font-size: 30px; color: var(--rust); margin: 20px 0 2px; line-height: 1.1; }
.bio { font-size: 20px; }
.bio::first-letter { float: left; font-family: var(--fell); font-size: 3.4em; line-height: .82; padding: 6px 8px 0 0; color: var(--rust); }

.idea-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 34px); margin-top: 24px; align-items: start; }
.section-label { font-family: var(--fell-sc); font-size: 15px; letter-spacing: .18em; color: var(--rust); display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--ink-faint); }
.idea { font-size: 20px; font-style: italic; }
.points { list-style: none; counter-reset: p; margin-top: 12px; display: grid; gap: 10px; }
.points li { counter-increment: p; position: relative; padding-left: 38px; font-size: 18px; line-height: 1.5; }
.points li::before { content: counter(p, lower-roman) "."; position: absolute; left: 0; top: 0; width: 30px; text-align: right; font-family: var(--fell); color: var(--rust); font-size: 20px; }
.points b { font-weight: 700; color: var(--ink); }

.model {
  background: radial-gradient(ellipse at center, #f9f1da, #ead9ae);
  box-shadow: 0 0 0 1px var(--ink), 0 0 0 4px #f9f1da, 0 0 0 5px var(--ink-faint);
  padding: 8px 8px 10px; border-radius: 2px;
}
.model canvas { width: 100%; height: auto; aspect-ratio: 32 / 23; }
.model figcaption { font-family: var(--serif); font-style: italic; font-size: 15px; text-align: center; color: var(--ink-soft); line-height: 1.35; margin-top: 6px; }
.model figcaption b { font-family: var(--fell-sc); font-style: normal; color: var(--rust); font-weight: 400; letter-spacing: .06em; }


.card-nav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--ink-faint); }
.btn-ink { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-ink:hover { background: var(--ink); color: var(--parch); }
.btn-ink[disabled] { opacity: .3; pointer-events: none; }
.btn-next { margin-left: auto; }
.next-hint { font-family: var(--hand); font-size: 20px; color: var(--ink-soft); }

/* ---------- timeline bar ---------- */
.tl-bar {
  position: relative; flex: none; display: flex; align-items: flex-start; justify-content: center; gap: 0;
  padding: 10px 16px 12px; overflow-x: auto; scrollbar-width: none;
  background: linear-gradient(180deg, rgba(205, 181, 127, .35), rgba(205, 181, 127, .6));
  border-top: 1px solid var(--ink-faint); box-shadow: inset 0 1px 0 rgba(255, 250, 230, .6);
}
.tl-bar::-webkit-scrollbar { display: none; }
.tl-node { position: relative; flex: none; width: clamp(74px, 11vw, 120px); display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; color: var(--ink); padding: 0; }
.tl-node::before { content: ""; position: absolute; top: 22px; left: -50%; width: 100%; height: 2px; background: var(--ink-faint); z-index: 0; }
.tl-node:first-child::before { display: none; }
.tl-node.visited::before { background: var(--rust); }
.tl-dot { position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px var(--parch), 0 0 0 3px var(--ink-soft); filter: grayscale(1) sepia(.4) opacity(.55); transition: filter .4s, box-shadow .3s, transform .3s var(--pop); background: var(--parch-2); display: grid; place-items: center; font-family: var(--fell); font-size: 22px; color: var(--rust); }
.tl-dot img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.tl-node.visited .tl-dot { filter: sepia(.3); }
.tl-node.current .tl-dot { filter: none; transform: scale(1.12); box-shadow: 0 0 0 2px var(--parch), 0 0 0 4px var(--rust), 0 0 14px rgba(156, 61, 26, .5); }
.tl-node:hover .tl-dot { filter: sepia(.2); transform: scale(1.08); }
.tl-name { font-family: var(--fell-sc); font-size: 13.5px; line-height: 1.1; letter-spacing: .03em; }
.tl-year { font-family: var(--type); font-size: 12px; color: var(--ink-soft); line-height: 1; }
.tl-node.current .tl-name { color: var(--rust); }
.tl-node:focus-visible { outline: 2px dashed var(--rust); outline-offset: 2px; }

/* ---------- arrival line-up (the six pop up) ---------- */
.lineup { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(10px, 2vw, 24px); max-width: 1000px; margin: 34px auto 26px; }
.lineup::before { content: ""; position: absolute; left: 4%; right: 4%; top: 34%; height: 2px; background: repeating-linear-gradient(90deg, var(--rust) 0 8px, transparent 8px 14px); opacity: .6; }
.lu {
  position: relative; background: none; border: 0; color: var(--ink); padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  opacity: 0; animation: luPop .75s var(--pop) forwards; animation-delay: calc(700ms + var(--i) * 220ms);
}
.lu-pic {
  display: block; width: 100%; aspect-ratio: 4 / 5; border-radius: 50%; overflow: hidden; margin-bottom: 8px;
  box-shadow: 0 0 0 3px var(--parch), 0 0 0 5px var(--brass-dk), 0 0 0 8px #d6b469, 0 0 0 9px var(--ink), 0 12px 22px rgba(60, 40, 10, .35);
  transition: transform .35s var(--pop);
}
.lu-pic img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; filter: sepia(.4) contrast(1.05); transition: filter .4s; }
.lu:hover .lu-pic, .lu:focus-visible .lu-pic { transform: translateY(-8px) rotate(-3deg); }
.lu:hover .lu-pic img { filter: none; }
.lu:focus-visible { outline: none; }
.lu-num { position: absolute; top: -6px; right: 2px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--rust); color: var(--parch); font-family: var(--fell); font-size: 15px; box-shadow: 0 0 0 2px var(--parch), 0 0 0 3px var(--ink); }
.lu b { font-family: var(--fell-sc); font-weight: 400; font-size: clamp(16px, 1.8vw, 20px); line-height: 1.1; }
.lu-when { font-family: var(--type); font-size: 13px; color: var(--rust); }
@keyframes luPop { 0% { opacity: 0; transform: scale(.2) translateY(50px) rotate(-12deg); } 100% { opacity: 1; transform: none; } }
.intro .next-hint { margin-top: 10px; }

/* ---------- the whole story (summary) ---------- */
.story { max-width: 1060px; margin: 0 auto; text-align: center; }
.story .eyebrow { color: var(--rust); }
.story h2 { font-family: var(--fell); font-weight: 400; font-size: clamp(40px, 6vw, 68px); line-height: 1; margin: 6px 0 8px; }
.story .lede { color: var(--ink-soft); }
.story .lede i { color: var(--ink); }

.dominoes { display: flex; justify-content: center; gap: clamp(6px, 1.6vw, 18px); margin: 30px auto 10px; flex-wrap: wrap; perspective: 600px; }
.domino {
  width: clamp(86px, 12vw, 128px); padding: 8px 8px 10px; background: #fbf3dc; border-radius: 6px; transform-origin: 100% 100%;
  box-shadow: 0 0 0 1px var(--ink), 0 0 0 4px #fbf3dc, 0 0 0 5px var(--ink-faint), 0 10px 18px rgba(60, 40, 10, .25);
  display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; color: var(--ink);
}
.domino img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center 20%; border-radius: 3px; filter: sepia(.35); }
.domino b { font-family: var(--fell-sc); font-weight: 400; font-size: 15px; line-height: 1.05; }
.domino span { font-family: var(--type); font-size: 12px; color: var(--rust); }
.dominoes.tip .domino { animation: tip .9s var(--ease) both; animation-delay: calc(var(--i) * 180ms); }
@keyframes tip { 0% { transform: rotate(0); } 35% { transform: rotate(16deg); } 70% { transform: rotate(-3deg); } 100% { transform: rotate(0); } }

.chain { list-style: none; text-align: left; max-width: 760px; margin: 30px auto 0; position: relative; }
.chain::before { content: ""; position: absolute; left: 21px; top: 10px; bottom: 10px; width: 2px; background: repeating-linear-gradient(var(--rust) 0 6px, transparent 6px 11px); }
.chain li { position: relative; padding: 0 0 22px 62px; }
.chain .yr { position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--parch); box-shadow: 0 0 0 1px var(--ink), 0 0 0 4px var(--parch); font-family: var(--fell); font-size: 20px; color: var(--rust); }
.chain h3 { font-family: var(--fell); font-weight: 400; font-size: 25px; line-height: 1.15; }
.chain h3 small { font-family: var(--type); font-size: 13px; color: var(--rust); margin-left: 8px; }
.chain p { font-size: 18.5px; color: var(--ink); }

.thanks { margin: 36px auto 0; max-width: 760px; padding: 26px 22px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); position: relative; }
.thanks::before, .thanks::after { content: "✦"; position: absolute; left: 50%; transform: translateX(-50%); background: var(--parch); padding: 0 10px; color: var(--rust); font-size: 22px; line-height: 1; }
.thanks::before { top: -12px; } .thanks::after { bottom: -12px; transform: translateX(-50%) rotate(180deg); }
.thanks h3 { font-family: var(--hand); font-size: 46px; color: var(--rust); line-height: 1; }
.thanks .made { font-family: var(--fell-sc); letter-spacing: .1em; font-size: 15px; color: var(--ink-soft); margin-top: 10px; }
.thanks .names { font-family: var(--fell); font-size: 23px; }
.credits { margin: 22px auto 0; max-width: 760px; font-size: 15px; color: var(--ink-soft); line-height: 1.5; }
.credits b { font-family: var(--fell-sc); font-weight: 400; color: var(--ink); }
.story-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .card { grid-template-columns: 1fr; }
  .card-left { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
  .frame { max-width: 220px; }
  .idea-grid { grid-template-columns: 1fr; }
  .model { max-width: 460px; width: 100%; margin: 0 auto; }
  .chapter-line { padding-right: 0; }
}
@media (max-width: 700px) {
  body { font-size: 18px; }
  .space-stage { flex-direction: column; justify-content: center; gap: 22px; }
  .ship { width: 84px; }
  .transmission { transform-origin: center top; }
  .transmission::after { left: 50%; top: -12px; margin: 0 0 0 -11px; border-bottom: 0; border-top: 1px solid var(--ink); }
  .plate-frame span { font-size: 11px; }
  .pf-tr, .pf-br { display: none; }
  .saturn { top: auto; bottom: 7%; right: 4%; width: 120px; opacity: .55; }
  .moonlet { display: none; }
  .past-head { padding-right: 130px; }
  .ph-brand span { display: none; }
  .tl-bar { justify-content: flex-start; }
  .stamp { position: relative; top: auto; right: auto; justify-self: end; width: fit-content; margin: -6px 0 -10px; }
  .tx-ship { display: none; }
  .chain li { padding-left: 56px; }
  .lineup { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 26px; max-width: 420px; }
  .lineup::before { display: none; }
  .btn { font-size: 17px; padding: 10px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .scratches i, .vignette, .ship-bob, .saturn, .moonlet, .btn-brass { animation: none !important; }
  body.shake .scene.active, body.shake .warp-text { animation: none; }
}
