/* Shorecut — site styles (v2, the scroll story). Tokens are the design bible's own.
   Single theme, on purpose: Sixteen Bells is lamplit at all hours.
   Every scene is laid out at its RESTING state here; site.js (GSAP) animates FROM elsewhere
   INTO these values, so the page reads fully with scripts off or reduced motion on. */

:root {
  --abyss: #070C12; --hull: #0E1721; --fathom: #16283A; --rule: #22384C;
  --linen: #E4DAC6; --linen-dim: #9BA9B4; --silver: #9FB6C4;
  --brass: #C08A2E; --brass-hi: #E0B15A; --brass-lo: #8A5F1C;
  --oxide: #8E3B2E; --gyre: #3FD0CC; --present: #2E7C86;
  --sunken: #3E5C4B; --kingdoms: #8A5A2B; --steamfall: #B5651D; --quiet: #7C8C99;

  --display: 'IM Fell English', Georgia, 'Times New Roman', serif;
  --smallcaps: 'IM Fell English SC', Georgia, serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --maxw: 1180px; --measure: 62ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4.5rem, 10vw, 9rem);
  --t-hero: clamp(2.2rem, min(5.4vw, 7vh), 4.8rem); --t-h2: clamp(1.9rem, 3.6vw, 3.1rem); --t-h3: clamp(1.35rem, 1.9vw, 1.7rem);
  --t-lead: clamp(1.05rem, 1.35vw, 1.25rem); --t-body: 1.0625rem; --t-small: 0.9rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0; background: var(--abyss); color: var(--linen);
  font-family: var(--body); font-size: var(--t-body); line-height: 1.6; font-weight: 400;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brass-hi); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--linen); }
p { margin: 0 0 1.1em; } p:last-child { margin-bottom: 0; }
strong { font-weight: 500; color: var(--linen); }
:focus-visible { outline: 2px solid var(--gyre); outline-offset: 3px; border-radius: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; color: var(--linen); text-wrap: balance; }
h2 { font-size: var(--t-h2); line-height: 1.06; letter-spacing: -0.005em; }
h3 { font-size: var(--t-h3); line-height: 1.2; }
.eyebrow { font-family: var(--smallcaps); font-size: 0.98rem; letter-spacing: 0.14em; color: var(--brass); margin: 0 0 1rem; display: flex; align-items: center; gap: 0.75rem; }
.eyebrow::before { content: ""; width: 2.2rem; height: 1px; background: var(--brass-lo); flex: none; }
.lead { font-size: var(--t-lead); line-height: 1.5; color: var(--linen); max-width: var(--measure); }
.dim { color: var(--linen-dim); }
.head { display: grid; gap: 1rem; }
.head .lead { margin-top: 0.3rem; }

/* ---------- glyphs (the game's own symbol atlas, masked + tinted) ---------- */
.glyph { display: inline-block; width: 2.6rem; height: 2.6rem; flex: none; background-color: var(--brass);
  -webkit-mask: var(--g) center / contain no-repeat; mask: var(--g) center / contain no-repeat; }
.glyph.lg { width: 3.4rem; height: 3.4rem; }
.glyph.oxide { background-color: var(--oxide); }

/* ---------- layout ---------- */
.wrap { width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: var(--section); position: relative; }
.scene { position: relative; }
.stage { position: relative; height: 100svh; overflow: hidden; display: grid; align-content: center; padding-block: clamp(4.5rem, 11vh, 7rem) clamp(2.5rem, 6vh, 4rem); }
.layer { position: absolute; inset: 0; pointer-events: none; }
.layer.bg img { width: 100%; height: 100%; object-fit: cover; }
.plate-cap { position: absolute; left: var(--gutter); bottom: 1.1rem; margin: 0; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--silver); text-shadow: 0 1px 8px rgba(7,12,18,.9); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--smallcaps); font-size: 1.02rem; letter-spacing: 0.08em; line-height: 1;
  padding: 0.95rem 1.5rem; border: 1px solid var(--brass-lo); color: var(--linen); text-decoration: none; background: rgba(14, 23, 33, 0.55); backdrop-filter: blur(6px);
  transition: border-color .2s, background-color .2s, color .2s; }
.btn:hover { border-color: var(--brass-hi); color: var(--linen); background: rgba(22, 40, 58, 0.75); }
.btn-brass { background: linear-gradient(180deg, #DBA84A 0%, #B47F27 100%); border-color: #E8BE6C; color: #1A1206; text-shadow: 0 1px 0 rgba(255,255,255,.25); }
.btn-brass:hover { background: linear-gradient(180deg, #E8B75A 0%, #C08A2E 100%); color: #120C04; }
.btn .glyph { width: 1.1rem; height: 1.1rem; background-color: currentColor; }
.btn.is-soon { border-style: dashed; color: var(--linen-dim); background: transparent; }
.btn.is-soon small { font-family: var(--mono); letter-spacing: 0; font-size: 0.72rem; color: var(--brass); }

/* ---------- mast: the wheel turns as you scroll ---------- */
.mast { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem var(--gutter);
  transition: background-color .3s, border-color .3s; border-bottom: 1px solid transparent; }
.mast.is-scrolled { background: rgba(7, 12, 18, 0.78); backdrop-filter: blur(10px); border-color: var(--rule); }
.mast-brand { display: block; text-decoration: none; opacity: 0; transition: opacity .4s; }
.mast.is-scrolled .mast-brand { opacity: 1; }
.wheel-sprite { display: block; width: 176px; height: 88px; background: url("assets/sprite/wordmark-wheel.webp?v=95d33cc4") 0 0 / 704px 704px no-repeat; filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.mast .btn { padding: 0.7rem 1.1rem; font-size: 0.92rem; }
@media (max-width: 720px) { .wheel-sprite { width: 132px; height: 66px; background-size: 528px 528px; } }

/* ---------- chapter rail ---------- */
.rail { position: fixed; right: 1.1rem; top: 50%; transform: translateY(-50%); z-index: 40; display: grid; gap: 0.55rem; }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem; text-decoration: none; color: var(--linen-dim); font-family: var(--smallcaps); font-size: 0.78rem; letter-spacing: 0.12em; }
.rail a span { opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .25s; }
.rail a::after { content: ""; width: 6px; height: 6px; border: 1px solid var(--linen-dim); transform: rotate(45deg); transition: background-color .25s, border-color .25s; }
.rail a:hover span, .rail:hover a span, .rail a:focus-visible span { opacity: 1; transform: none; }
.rail a.is-active { color: var(--brass-hi); }
.rail a.is-active::after { background: var(--brass); border-color: var(--brass-hi); }
@media (max-width: 899px) { .rail { display: none; } }

/* ---------- 1 · cast off ---------- */
.s-cast .stage { align-content: end; padding-top: clamp(4.5rem, 9vh, 7rem); background: linear-gradient(180deg, #070C12 0%, #0B1A24 55%, #0E1721 100%); }
.s-cast canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-shade { position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(180deg, rgba(7,12,18,0) 0%, rgba(7,12,18,0.75) 100%); pointer-events: none; }
.hero-copy { position: relative; display: grid; gap: clamp(0.8rem, 2vh, 1.6rem); justify-items: start; }
.hero-mark { width: min(760px, 92%, 86vh); margin-left: -1.5%; }
.hero-mark img { width: 100%; filter: drop-shadow(0 18px 40px rgba(0,0,0,.55)); }
.hero-copy h1 { font-size: var(--t-hero); line-height: 1.02; max-width: 16ch; text-shadow: 0 2px 24px rgba(7,12,18,.8); }
.hero-copy .lead { max-width: 52ch; text-shadow: 0 1px 12px rgba(7,12,18,.9); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero-meta { font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.06em; color: var(--silver); display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0; }
.hero-meta span::before { content: "·"; margin-right: 1.2rem; color: var(--brass); }
.hero-meta span:first-child::before { content: none; margin: 0; }
.sound { position: absolute; right: var(--gutter); bottom: 1.4rem; display: flex; align-items: center; gap: 0.6rem; font-family: var(--smallcaps); font-size: 0.82rem; letter-spacing: 0.14em; color: var(--linen-dim); text-decoration: none; }
.sound .glyph { width: 1.2rem; height: 1.2rem; background-color: var(--linen-dim); animation: sound 2.8s ease-in-out infinite; }
@keyframes sound { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@media (max-width: 720px) { .sound { display: none; } }

/* ---------- 2 · the word ---------- */
.s-word .stage { background: var(--hull); }
.word-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .word-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: end; } }
.entry-word { font-family: var(--display); font-size: clamp(2.6rem, 6.4vw, 5.6rem); line-height: 1; letter-spacing: -0.01em; }
.entry-word i { font-style: italic; color: var(--brass); font-size: 0.5em; margin-left: 0.3em; vertical-align: 0.35em; }
.entry-def { font-family: var(--display); font-style: italic; font-size: clamp(1.45rem, 2.6vw, 2.35rem); line-height: 1.32; max-width: 34ch; color: var(--linen); margin: 1rem 0 0; }
.entry-def b { font-style: normal; font-weight: 400; color: var(--brass-hi); }
.entry-def .w { display: inline-block; }
.entry-marg { display: grid; gap: 1rem; align-content: start; border-left: 1px solid var(--rule); padding-left: 1.6rem; }
.entry-marg p { margin: 0; color: var(--linen-dim); font-size: var(--t-small); line-height: 1.5; }
.entry-marg q { font-family: var(--display); font-size: 1.25rem; color: var(--linen); quotes: "“" "”"; display: block; }

/* ---------- 3 · landfall ---------- */
.s-landfall .stage { align-content: start; }
.s-landfall .layer.bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,12,18,.55) 0%, rgba(7,12,18,.15) 35%, rgba(7,12,18,.25) 70%, rgba(7,12,18,.9) 100%); }
.s-landfall .layer.bg img { transform-origin: 50% 60%; }
.layer.night { background: linear-gradient(180deg, #070C12 0%, #0B1620 60%, #0E1721 100%); opacity: 0; mix-blend-mode: multiply; }
.layer.fg { display: flex; align-items: flex-end; justify-content: flex-start; }
.lf-treasure { position: relative; width: clamp(260px, 32vw, 480px); margin: 0 0 1% 2%; }
.lf-chest { position: relative; width: 100%; aspect-ratio: 1; background: url("assets/chest/chest-open.webp?v=709af9ee") 0 0 / 800% 400% no-repeat; filter: drop-shadow(0 26px 30px rgba(0,0,0,.7));  -webkit-mask: linear-gradient(180deg, transparent 0%, #000 30%); mask: linear-gradient(180deg, transparent 0%, #000 30%); }
/* Outer boxes are centred by margins and only ever touched by the scroll timeline (opacity/scale). Anything that loops — the spin,
   the breathing — runs on an inner ::before, so a CSS animation and the scroll tween never fight over one transform. */
.lf-glow, .lf-rays, .lf-flash { position: absolute; left: 50%; top: 38%; aspect-ratio: 1; pointer-events: none; transform-origin: 50% 50%; }
.lf-glow { width: 230%; margin: -115% 0 0 -115%; mix-blend-mode: screen; }
.lf-rays { width: 300%; margin: -150% 0 0 -150%; mix-blend-mode: screen; }
.lf-flash { width: 260%; margin: -130% 0 0 -130%; opacity: 0; mix-blend-mode: screen; border-radius: 50%; background: radial-gradient(closest-side, #fff8e0, rgba(255,220,140,.8) 30%, transparent 70%); }
.lf-glow::before, .lf-rays::before { content: ""; position: absolute; inset: 0; border-radius: 50%; transform-origin: 50% 50%; }
.lf-glow::before { background: radial-gradient(closest-side, rgba(255,214,120,.95), rgba(240,170,60,.55) 22%, rgba(224,140,40,.22) 48%, transparent 72%); animation: glowBreathe 2.4s ease-in-out infinite alternate; }
.lf-rays::before { animation: raysTurn 26s linear infinite;
  background: repeating-conic-gradient(from 0deg, rgba(255,210,110,.5) 0deg 5deg, transparent 5deg 17deg, rgba(255,190,80,.3) 17deg 20deg, transparent 20deg 31deg);
  -webkit-mask: radial-gradient(closest-side, #000 0%, rgba(0,0,0,.7) 26%, transparent 66%); mask: radial-gradient(closest-side, #000 0%, rgba(0,0,0,.7) 26%, transparent 66%); }
.lf-sparks { position: absolute; inset: -60% -30% 35% -30%; pointer-events: none; }
.lf-sparks i { position: absolute; left: var(--x); bottom: 0; width: calc(7px * var(--s)); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, #fff, #ffd77a 45%, transparent 72%); mix-blend-mode: screen;
  animation: sparkRise var(--t) ease-out var(--d) infinite; opacity: 0; }
@keyframes glowBreathe { from { transform: scale(.92); filter: brightness(.9); } to { transform: scale(1.08); filter: brightness(1.2); } }
@keyframes raysTurn { to { transform: rotate(360deg); } }
@keyframes sparkRise { 0% { transform: translateY(0) scale(.4); opacity: 0; } 12% { opacity: 1; } 55% { opacity: .9; transform: translateY(-16vh) scale(1.15); } 100% { transform: translateY(-30vh) translateX(14px) scale(.2); opacity: 0; } }
html.no-gsap .lf-chest { background: url("assets/chest/chest-opened.webp?v=7be25de1") center bottom / contain no-repeat; }
.lf-copy { position: relative; display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .lf-copy { grid-template-columns: minmax(0, 1fr) minmax(0, 470px); align-items: start; } .lf-panel { width: 100%; } }
.lf-head h2 { max-width: 20ch; text-shadow: 0 2px 20px rgba(7,12,18,.9); }
.lf-panel { justify-self: end; width: min(100%, 470px); background: rgba(7,12,18,.72); backdrop-filter: blur(10px); border: 1px solid var(--rule); padding: 1.1rem 1.3rem 0.4rem; display: grid; gap: 0.6rem; }
.ring-chart { width: 100%; display: block; }
.ring-chart text { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; fill: var(--silver); }
.ring-chart .arm { stroke: var(--brass); stroke-dasharray: 5 6; fill: none; }
.ring-chart .ext { stroke: var(--gyre); fill: none; }
.ring-chart .isle { fill: var(--fathom); stroke: var(--linen-dim); stroke-width: 1; }
.ring-chart .ship { fill: var(--linen); }
.ring-chart .lbl-arm { fill: var(--brass-hi); } .ring-chart .lbl-ext { fill: var(--gyre); }
.ring-chart .clock { fill: var(--linen); font-size: 13px; font-weight: 500; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.2rem 1fr; gap: 0.3rem 0.8rem; padding: 0.7rem 0; border-top: 1px solid var(--rule); transition: opacity .3s; }
.steps li::before { content: counter(step, upper-roman); font-family: var(--smallcaps); color: var(--brass); font-size: 1rem; line-height: 1.5; }
.steps h3 { font-size: 1.15rem; }
.steps p { color: var(--linen-dim); font-size: 0.84rem; grid-column: 2; margin: 0; line-height: 1.45; }
.steps.is-live li { opacity: .38; }
.steps.is-live li.is-on { opacity: 1; }
.steps.is-live li:not(.is-on) p { display: none; }
@media (max-width: 899px) {
  .s-landfall .stage { align-content: end; }
  .lf-treasure { width: 46vw; margin-bottom: 0; }
  .lf-panel { width: 100%; }
  .steps p { display: none; }
  .steps li { padding: 0.45rem 0; }
}
@media (min-width: 900px) and (max-height: 820px) { .steps p { font-size: 0.78rem; } .steps li { padding: 0.5rem 0; } }

/* ---------- 4 · the crew ---------- */
.s-crew .stage { background: var(--hull); align-content: end; }
.crew-sea { position: absolute; inset: 0; width: 100%; height: 100%; }
.crew-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(14,23,33,.55) 0%, rgba(14,23,33,0) 26%, rgba(14,23,33,0) 48%, rgba(14,23,33,.82) 78%, var(--hull) 100%), linear-gradient(90deg, rgba(14,23,33,.5) 0%, rgba(14,23,33,0) 45%); }
.crew-copy { position: relative; display: grid; gap: clamp(0.7rem, 1.4vw, 1.1rem); }
.crew-copy .head h2 { max-width: 22ch; text-shadow: 0 2px 20px rgba(14,23,33,.9); }
.s-crew .crew-copy { position: static; }
.crew-copy .head { position: absolute; left: var(--gutter); right: var(--gutter); top: clamp(4.5rem, 11vh, 7rem); width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto; }
@media (max-width: 899px) { .crew-copy .head { top: 5rem; } .crew-copy .head h2 { max-width: 14ch; } }
.stations { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.station { padding: 0.7rem 1.2rem 0.7rem 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.8rem; align-items: center; align-content: start; }
.station .glyph.lg { width: 2.4rem; height: 2.4rem; grid-row: span 2; }
.station p { grid-column: 2; }
.station h3 { font-size: 1.35rem; }
.station p { color: var(--linen-dim); font-size: 0.86rem; margin: 0; line-height: 1.45; }
@media (min-width: 960px) { .station + .station { border-left: 1px solid var(--rule); padding-left: 1.2rem; } }
.invader { display: grid; gap: 0.6rem 1.4rem; align-items: center; padding: clamp(0.7rem, 1.4vw, 1.1rem) clamp(1rem, 2vw, 1.6rem); border: 1px solid var(--oxide);
  background: linear-gradient(120deg, rgba(142,59,46,.18), rgba(14,23,33,0) 60%); }
@media (min-width: 900px) { .invader { grid-template-columns: auto 1fr auto; } }
.invader h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); }
.invader .glyph.lg { width: 2.6rem; height: 2.6rem; }
.invader h3 small { display: block; font-family: var(--smallcaps); font-size: 0.85rem; letter-spacing: 0.14em; color: #D9705E; margin-bottom: 0.3rem; }
.invader p { color: var(--linen-dim); margin: 0; font-size: var(--t-small); }
.invader .plate { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; color: #F0A090; border: 1px solid var(--oxide); padding: 0.6rem 0.9rem; display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.invader .plate .glyph { width: 1rem; height: 1rem; background-color: #F0A090; }
@media (max-width: 899px) { .station p { display: none; } .station { grid-template-columns: auto 1fr; align-items: center; padding: 0.55rem 0; } .station .glyph.lg { width: 2.4rem; height: 2.4rem; } .crew-copy .head .lead { display: none; } .invader p { display: none; } .invader { gap: 0.6rem 1rem; grid-template-columns: auto 1fr; } .invader .plate { grid-column: 1 / -1; justify-self: start; } .crew-copy { gap: 1rem; } }
@media (min-width: 900px) and (max-height: 820px) { .crew-copy .head .lead { display: none; } .station p { font-size: 0.8rem; } }

/* ---------- 5 · the gyre ---------- */
.s-gyre .stage { background: var(--abyss); align-content: end; padding: 0; }
.s-gyre canvas { position: absolute; inset: 0; width: 100%; height: 100%; transform: scale(1.06); }
.gyre-copy { position: relative; padding: 0 0 clamp(2.5rem, 7vh, 5rem); }
.gyre-copy .wrap { display: grid; gap: 1rem; }
.gyre-copy .eyebrow { margin: 0; }
.gyre-steps { display: grid; }
.gyre-step { grid-area: 1 / 1; align-self: end; max-width: 40ch; margin: 0; font-family: var(--display); font-size: clamp(1.35rem, 2.4vw, 2rem); line-height: 1.3; color: var(--linen);
  opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; text-shadow: 0 2px 18px rgba(7,12,18,.9); }
.gyre-step.is-on { opacity: 1; transform: none; }
.gyre-step b { font-weight: 400; color: var(--gyre); }
.gyre-gauge { display: flex; gap: 0.5rem; align-items: center; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.12em; color: var(--silver); }
.gyre-gauge i { width: 2.4rem; height: 2px; background: var(--rule); display: block; position: relative; overflow: hidden; }
.gyre-gauge i::after { content: ""; position: absolute; inset: 0; background: var(--gyre); transform: scaleX(var(--p, 0)); transform-origin: left; }
.gyre-gauge .lbl { min-width: 5ch; }
.bell { position: absolute; right: var(--gutter); top: clamp(5.5rem, 14vh, 8rem); width: clamp(56px, 6vw, 96px); height: auto; opacity: 0; transform-origin: 50% 8%; filter: drop-shadow(0 10px 18px rgba(0,0,0,.7)); }
html.no-gsap .gyre-step, html.no-gsap .bell { opacity: 1; transform: none; }
html.no-gsap .eras-copy .phase { grid-area: auto; } html.no-gsap .phase-id { opacity: 1; }
html.no-gsap .gyre-step { grid-area: auto; }
html.no-gsap .gyre-steps { gap: 1rem; }

/* ---------- 6 · five eras: one card, the eras pass through it ---------- */
.s-eras .stage { background: var(--abyss); }
.eras-grid { position: relative; display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; height: 100%; }
@media (min-width: 900px) { .eras-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.eras-copy { display: grid; align-content: center; }
.eras-copy .phase { grid-area: 1 / 1; display: grid; gap: 1rem; align-content: center; }
.phase-id { opacity: 0; pointer-events: none; }
.phase-id .ledgers { margin-top: 0.6rem; }
.era-line { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; gap: 0.6rem; align-items: center; }
.era-line li { --c: var(--present); width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 50%; transition: border-color .3s, background-color .3s; }
.era-line li .glyph { width: 1.3rem; height: 1.3rem; background-color: var(--linen-dim); transition: background-color .3s, transform .3s; }
.era-line li.is-on { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); }
.era-line li.is-on .glyph { background-color: var(--c); filter: brightness(1.35); transform: scale(1.12); }
.era-card { --c: var(--present); position: relative; min-height: 15rem; border: 1px solid var(--rule); padding: clamp(1.2rem, 2.4vw, 2rem);
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c) 28%, transparent) 0%, transparent 55%), var(--abyss); transition: background .4s; }
.era { position: absolute; inset: clamp(1.2rem, 2.4vw, 2rem); display: grid; gap: 0.9rem; align-content: start; opacity: 0; }
.era.is-rest { opacity: 1; }
.era-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.era .glyph { background-color: var(--c); filter: brightness(1.3); }
.era h3 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
.era h3 small { display: block; font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.1em; color: var(--silver); margin-top: 0.35rem; }
.era p { color: var(--linen-dim); font-size: 0.95rem; margin: 0; }
.chip { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 0.35rem 0.6rem; border: 1px solid var(--rule); color: var(--linen-dim); }
.chip.now { border-color: var(--gyre); color: var(--gyre); } .chip.next { border-color: var(--steamfall); color: #E0955A; }
.era-figure { position: relative; height: min(80svh, 1000px); }
.era-figure::before { content: ""; position: absolute; inset: 8% -12% -4%; background: radial-gradient(52% 58% at 50% 74%, color-mix(in srgb, var(--c, var(--present)) 30%, transparent) 0%, transparent 72%); pointer-events: none; }
.era-art { position: absolute; inset: 0; margin: auto 0 0; height: 100%; width: auto; max-width: 100%; margin-inline: auto; object-fit: contain; object-position: bottom center; opacity: 0; filter: drop-shadow(0 30px 40px rgba(0,0,0,.7)); }
.era-art.is-rest { opacity: 1; }
@media (max-width: 899px) { .era-figure { order: -1; height: 34svh; } .eras-copy { gap: 0.6rem; } .era-card { min-height: 12rem; } .era h3 { font-size: 1.4rem; } .era p { font-size: 0.88rem; } .era-line li { width: 2.2rem; height: 2.2rem; } }
@media (min-width: 900px) and (max-height: 720px) { .era-figure { height: 72svh; } }

/* ---------- 7 · identity ---------- */
.props { position: absolute; inset: 0; pointer-events: none; }
.prop { position: absolute; left: var(--x); top: var(--y); width: max(var(--w), 44px); height: auto; transform: rotate(var(--r)); opacity: .7; filter: drop-shadow(0 12px 18px rgba(0,0,0,.55)); }
.id-grid { position: relative; display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 960px) { .id-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ledgers { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; }
.ledgers li { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: 0.8rem 0; border-top: 1px solid var(--rule); }
.ledgers li:last-child { border-bottom: 1px solid var(--rule); }
.ledgers b { font-family: var(--smallcaps); font-weight: 400; letter-spacing: 0.1em; color: var(--brass); font-size: 0.98rem; }
.ledgers span { color: var(--linen-dim); font-size: 0.88rem; }
.ledgers em { color: var(--linen); font-family: var(--display); font-size: 1.05rem; }
.wardrobe { --c: var(--present); position: relative; height: min(84svh, 1100px); }
.wardrobe::before { content: ""; position: absolute; inset: 8% -12% -4%; background: radial-gradient(52% 58% at 50% 74%, color-mix(in srgb, var(--c) 36%, transparent) 0%, transparent 72%); pointer-events: none; }
.costumes { position: absolute; inset: 0; }
.costume { position: absolute; inset: 0; margin: auto 0 0; height: 100%; width: auto; max-width: 100%; margin-inline: auto; object-fit: contain; object-position: bottom center; opacity: 0; filter: drop-shadow(0 30px 40px rgba(0,0,0,.7)); }
.costume.is-rest { opacity: 1; }
.id-cap { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em; line-height: 1.5; color: var(--linen-dim); opacity: .8; margin: 1rem 0 0; max-width: 52ch; }
.era-tag { position: absolute; right: 0; bottom: 0; margin: 0; display: grid; justify-items: end; gap: 0.25rem; text-align: right; }
.era-tag b { font-family: var(--smallcaps); font-weight: 400; letter-spacing: 0.14em; font-size: 1.15rem; color: var(--c); line-height: 1.1; }
.era-tag span { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--linen-dim); }
.era-tag i { display: block; width: 2.4rem; height: 1px; background: var(--c); margin-top: 0.35rem; }
@media (max-width: 959px) { .wardrobe { order: -1; height: 28svh; } .id-cap { display: none; } .era-tag b { font-size: 0.95rem; } .ledgers li { grid-template-columns: 1fr; gap: 0.1rem; padding: 0.4rem 0; } .ledgers { margin-top: 0.8rem; } .id-copy .lead { display: none; } .prop { opacity: .35; } .prop:nth-child(even) { display: none; }  .ledgers span { font-size: 0.8rem; } }

/* ---------- 8 · late ---------- */
.s-late .stage { background: var(--hull); }
.late-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 960px) { .late-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.pillar { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); font-family: var(--display); font-size: 1.3rem; color: var(--linen); }
.pillar small { display: block; font-family: var(--smallcaps); font-size: 0.85rem; letter-spacing: 0.14em; color: var(--brass); margin-bottom: 0.3rem; }
.chartline { margin-top: 1.4rem; display: grid; gap: 0.4rem; }
.chartline .node { font-family: var(--mono); font-size: 0.95rem; color: var(--silver); display: inline-flex; align-items: center; gap: 0.6rem; position: relative; width: max-content; }
.chartline .node .glyph { width: 1rem; height: 1rem; background-color: var(--silver); }
.chartline .strike { position: absolute; left: 1.6rem; right: 0; top: 55%; height: 1px; background: var(--oxide); transform-origin: left; }
.chartline .now { font-family: var(--display); font-style: italic; color: var(--linen-dim); }
.ledger { font-family: var(--mono); font-size: clamp(0.84rem, 1.1vw, 0.98rem); line-height: 1.75; color: var(--linen); border: 1px solid var(--brass-lo); padding: clamp(1.2rem, 2.4vw, 2rem); background: var(--abyss);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.8), inset 0 0 0 1px rgba(192,138,46,.08); font-variant-numeric: tabular-nums; overflow-x: auto; }
.ledger-head { color: var(--brass); letter-spacing: 0.14em; text-align: center; margin-bottom: 1.1rem; }
.ledger .row { display: flex; gap: 0.6rem; white-space: nowrap; }
.ledger .row .k { flex: none; }
.ledger .row .dots { flex: 1; overflow: hidden; color: var(--rule); }
.ledger .row .dots::before { content: "........................................................................"; letter-spacing: 0.1em; }
.ledger .row .v { flex: none; color: var(--linen-dim); }
.ledger .row .v.bad { color: #E08A78; } .ledger .row .v.warn { color: var(--brass-hi); }
.ledger .gone { margin-top: 1.1rem; color: var(--linen-dim); text-align: center; }
.ledger .gone b { color: var(--linen); font-weight: 500; }
@media (max-width: 959px) { .ledger { font-size: 0.78rem; } .s-late .dim, .s-late .pillar, .ledger .gone { display: none; } }

/* ---------- 9 · sixteen bells ---------- */
.s-bells .stage { background: var(--abyss); align-content: end; }
.port { position: absolute; inset: 0; overflow: hidden; }
.port-plate { position: absolute; left: 50%; top: 50%; width: max(100%, calc(100svh * 1.7915)); aspect-ratio: 2560 / 1429; translate: -50% -50%; transform-origin: 80% 78%; will-change: transform; }
.port-base { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.port-lights { position: absolute; left: var(--l); top: var(--t); width: var(--w); height: auto; display: block; }
.port-scrim { position: absolute; inset: 0; background: rgba(7,12,18,.34); }
.port-fog { position: absolute; left: -20%; right: -20%; bottom: 0; height: 50%; pointer-events: none;
  background: radial-gradient(60% 80% at 30% 100%, rgba(159,182,196,.17), transparent 70%), radial-gradient(50% 70% at 78% 92%, rgba(159,182,196,.12), transparent 70%);
  animation: fogDrift 24s ease-in-out infinite alternate; }
.port-fog.two { opacity: .7; height: 38%; animation-duration: 33s; animation-direction: alternate-reverse; }
@keyframes fogDrift { from { transform: translateX(-4%); } to { transform: translateX(4%); } }
.port-veil { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(7,12,18,.82) 0%, rgba(7,12,18,.5) 30%, rgba(7,12,18,0) 58%), linear-gradient(0deg, rgba(7,12,18,.8) 0%, rgba(7,12,18,0) 42%), linear-gradient(180deg, rgba(7,12,18,.55) 0%, rgba(7,12,18,0) 22%); }
.bells-grid { position: relative; display: grid; }
.bells-copy { max-width: 48ch; }
.rules { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.rules li { font-family: var(--display); font-size: 1.15rem; color: var(--linen); display: flex; gap: 0.7rem; align-items: baseline; }
.rules li::before { content: "—"; color: var(--brass); }
.gantry { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem 0.8rem; }
.trader { display: grid; gap: 0.35rem; }
.trader img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--rule); filter: saturate(.9); box-shadow: 0 20px 30px -18px rgba(0,0,0,.9); }
.trader b { font-family: var(--smallcaps); font-weight: 400; letter-spacing: 0.1em; color: var(--linen); font-size: 1rem; line-height: 1.2; }
.trader b small { display: block; font-family: var(--mono); letter-spacing: 0.06em; font-size: 0.66rem; color: var(--brass); margin-top: 0.15rem; }
.trader span { color: var(--linen-dim); font-size: 0.78rem; line-height: 1.4; }
.trader.hidden-trader img { filter: saturate(.4) brightness(.8); }
.s-traders { background: var(--hull); overflow: hidden; }
.s-traders .head { margin-bottom: clamp(1.4rem, 3vw, 2.4rem); }
@media (max-width: 959px) { .gantry { grid-template-columns: repeat(2, 1fr); gap: 1rem 0.8rem; } .trader b { font-size: 0.85rem; letter-spacing: 0.06em; } .trader b small { font-size: 0.6rem; } .s-bells .dim { display: none; } .rules li { font-size: 1rem; } }
@media (min-width: 960px) and (max-height: 820px) { .s-bells .dim { display: none; } }

/* ---------- the log (gallery) ---------- */
.s-log { background: var(--hull); border-top: 1px solid var(--rule); }
.s-log .head { margin-bottom: 2rem; }
.gallery-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
.gallery-grid figure { margin: 0; position: relative; }
.gallery-grid button { all: unset; display: block; cursor: zoom-in; width: 100%; }
.gallery-grid button:focus-visible { outline: 2px solid var(--gyre); outline-offset: 3px; }
.gallery-grid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--hull); transition: filter .25s; }
.gallery-grid button:hover img { filter: brightness(1.08); }
.gallery-grid figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.7rem 0.8rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--silver); background: linear-gradient(180deg, rgba(7,12,18,0), rgba(7,12,18,.8)); pointer-events: none; }
@media (max-width: 600px) { .gallery-grid figcaption { font-size: 0.62rem; padding: 0.5rem 0.55rem; } }
.gallery-note { margin-top: 1rem; font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.06em; color: var(--linen-dim); }
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1600px); max-height: 96vh; }
dialog.lightbox::backdrop { background: rgba(7,12,18,.92); backdrop-filter: blur(4px); }
dialog.lightbox figure { margin: 0; display: grid; gap: 0.6rem; justify-items: center; }
dialog.lightbox img { max-width: 96vw; max-height: 86vh; width: auto; height: auto; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
dialog.lightbox figcaption { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--silver); }
dialog.lightbox .lb-close { position: fixed; top: 1rem; right: 1rem; }

/* ---------- sign on ---------- */
.s-follow { background: var(--abyss); position: relative; overflow: hidden; border-top: 1px solid var(--rule); }
.follow-bg { position: absolute; inset: 0; background: url("assets/shots/fog-approach.webp?v=0c5cb980") center 60% / cover no-repeat; opacity: .35; filter: saturate(.7); }
.follow-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--abyss) 0%, rgba(7,12,18,.55) 40%, rgba(7,12,18,.7) 75%, var(--abyss) 100%); }
.s-follow .wrap { position: relative; z-index: 1; display: grid; gap: 2rem; }
@media (min-width: 960px) { .s-follow .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.follow-links { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.2rem; }
.crewlist { border: 1px solid var(--rule); padding: clamp(1.3rem, 2.6vw, 2rem); background: rgba(14,23,33,.8); backdrop-filter: blur(8px); display: grid; gap: 1rem; }
.crewlist h3 { font-size: 1.5rem; }
.crewlist p { color: var(--linen-dim); font-size: var(--t-small); margin: 0; }
.crewlist form { display: grid; gap: 0.7rem; grid-template-columns: 1fr auto; align-items: stretch; }
.crewlist label { grid-column: 1 / -1; }
.crewlist input[type="email"] { width: 100%; font: inherit; font-family: var(--mono); font-size: 0.95rem; color: var(--linen); background: var(--abyss); border: 1px solid var(--rule); padding: 0.85rem 1rem; outline: none; }
.crewlist input[type="email"]:focus { border-color: var(--brass); }
.crewlist .btn { justify-content: center; }
.crewlist .soon { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--brass); border: 1px dashed var(--brass-lo); padding: 0.9rem 1rem; }
.crewlist .note { font-family: var(--mono); font-size: 0.74rem; color: var(--linen-dim); }
@media (max-width: 520px) { .crewlist form { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--rule); padding: 2.4rem 0 3rem; background: var(--abyss); color: var(--linen-dim); font-size: var(--t-small); }
.foot .wrap { display: grid; gap: 1.2rem; }
@media (min-width: 760px) { .foot .wrap { grid-template-columns: auto 1fr auto; align-items: center; } }
.foot-brand { display: flex; align-items: center; gap: 0.7rem; }
.foot-brand img { width: 2rem; height: 2rem; }
.foot-brand span { font-family: var(--smallcaps); letter-spacing: 0.18em; color: var(--linen); }
.foot-studio { font-family: var(--smallcaps); letter-spacing: 0.2em; color: var(--linen); }
.foot p { margin: 0; }
.foot .proverb { font-family: var(--display); font-style: italic; color: var(--linen-dim); }

/* ---------- reduced motion: the rest states above are the whole page ---------- */
@media (prefers-reduced-motion: reduce) {
  .port-fog, .lf-glow::before, .lf-rays::before, .lf-sparks i { animation: none; }
  .eras-copy .phase { grid-area: auto; } .phase-id { opacity: 1; }
  .sound .glyph { animation: none; }
  .gyre-step { opacity: 1; transform: none; grid-area: auto; }
  .gyre-steps { gap: 1rem; }
  .bell { opacity: 1; }
  .mast-brand { opacity: 1; }
  .steps.is-live li { opacity: 1; }
}

@media (min-width: 900px) and (max-height: 860px) { .id-copy .lead { display: none; } .ledgers li { padding: 0.6rem 0; } }

/* ---------- short desktop viewports ---------- */
@media (min-width: 900px) and (max-height: 720px) {
  :root { --t-h2: clamp(1.7rem, 3vw, 2.5rem); --t-lead: 1rem; }
  .stage { padding-block: 4.5rem 2.5rem; }
  .crew-copy .head .lead, .s-bells .dim, .s-late .dim, .id-copy .lead { display: none; }
  .station p { display: none; }
  .wardrobe { height: min(70svh, 900px); }
  .id-cap { display: none; }
  .ledgers li { padding: 0.55rem 0; }
}

/* ---------- phones: tall scenes start at the top instead of overflowing both ways ---------- */
@media (max-width: 899px) {
  .s-word .stage, .s-landfall .stage, .s-eras .stage, .s-late .stage { align-content: start; padding-top: 5.5rem; }
  .s-crew .stage { align-content: end; padding-bottom: 1.5rem; }
  .s-bells .stage { padding-bottom: 3rem; }
  .port-fog { display: none; }
}
