/* CANTERA — editorial layer over the WebGL world */
:root {
  --sand: #d9c9a8;
  --slate: #101418;
  --ember: #e0a458;
  --ink: #ece4d4;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
  --serif: "Gilda Display", Georgia, serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-width: thin; scrollbar-color: var(--sand) var(--slate); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--slate); }
::-webkit-scrollbar-thumb { background: var(--sand); border-radius: 5px; }
html, body { background: var(--slate); color: var(--ink); }
body { font-family: var(--serif); overflow-x: hidden; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#poster { display: none; }
#track { position: relative; z-index: 1; pointer-events: none; }
#hud { display: none; position: fixed; bottom: 12px; left: 12px; z-index: 90;
  color: var(--ember); font: 11px var(--mono); white-space: pre; pointer-events: none; }
body.debug #hud { display: block; }

.mono { font-family: var(--mono); letter-spacing: 0.14em; font-size: 11px; }

/* chrome */
.chrome { position: fixed; left: 0; right: 0; z-index: 40; display: flex;
  align-items: center; justify-content: space-between; padding: 28px 40px; }
.chrome-top { top: 0; }
.chrome-bottom { bottom: 0; pointer-events: none; }
.wordmark { display: flex; align-items: center; gap: 10px; color: var(--ink);
  text-decoration: none; }
.wm-glyph { width: 22px; height: 22px; color: var(--ember); }
.wm-text { font-family: var(--serif); font-size: 19px; letter-spacing: 0.34em; }
.nav { display: flex; gap: 26px; }
.nav a { color: var(--ink); text-decoration: none; opacity: 0.75; transition: opacity .3s, color .3s; }
.nav a:hover { opacity: 1; color: var(--ember); }

/* chapter rail */
.rail { position: fixed; left: 34px; top: 50%; transform: translateY(-50%);
  z-index: 40; display: flex; flex-direction: column; gap: 22px; }
.rail-dot { display: flex; align-items: center; gap: 12px; background: none;
  border: 0; cursor: pointer; color: var(--ink); padding: 0; }
.rail-dot i { width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid rgba(236,228,212,.55); background: transparent;
  transition: background .4s, border-color .4s, box-shadow .4s; }
.rail-dot span { opacity: 0; transform: translateX(-4px);
  transition: opacity .4s, transform .4s; letter-spacing: .18em; }
.rail-dot.active i { background: var(--ember); border-color: var(--ember);
  box-shadow: 0 0 10px rgba(224,164,88,.8); }
.rail-dot.active span { opacity: .95; transform: none; }
.rail-dot:hover span { opacity: .7; transform: none; }

/* progress + skip */
.progress { flex: 1; max-width: 340px; height: 1px; background: rgba(236,228,212,.18); }
.progress-fill { height: 100%; width: 0; background: var(--ember);
  box-shadow: 0 0 8px rgba(224,164,88,.7); }
.skip { pointer-events: auto; background: none; border: 1px solid rgba(236,228,212,.25);
  color: var(--ink); padding: 10px 18px; cursor: pointer; letter-spacing: .18em;
  transition: border-color .3s, color .3s; border-radius: 2px; }
.skip:hover { border-color: var(--ember); color: var(--ember); }

/* editorial overlays */
.overlays { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.ov { position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: center; padding: 0 8vw 0 12vw; opacity: 0; visibility: hidden; }
.ov > * { transform: translateY(24px); transition: transform 1s cubic-bezier(.16,1,.3,1); }
.ov.on > * { transform: none; }
.ov.on { visibility: visible; }
.ov-right { align-items: flex-end; text-align: right; padding-right: 10vw; }
.ov-low { justify-content: flex-end; padding-bottom: 14vh; }
.ov-center { align-items: center; text-align: center; padding: 0 6vw; }

.kicker { color: var(--ember); margin-bottom: 26px; opacity: .9; }
.chapnum { color: var(--ember); margin-bottom: 20px; }
.display { font-size: clamp(52px, 8.4vw, 128px); line-height: 1.02; font-weight: 400;
  text-shadow: 0 2px 40px rgba(16,20,24,.65); }
.display em { font-style: italic; color: var(--sand); }
.display-sm { font-size: clamp(34px, 4.6vw, 68px); line-height: 1.08; font-weight: 400;
  text-shadow: 0 2px 30px rgba(16,20,24,.65); }
.sub { margin-top: 34px; opacity: .65; }
.body-line { margin-top: 26px; opacity: .65; }
.stats { list-style: none; margin-top: 38px; display: flex; flex-direction: column; gap: 14px; }
.stats li { letter-spacing: .18em; opacity: .8; }
.stats b { font-family: var(--serif); font-size: 26px; color: var(--sand);
  font-weight: 400; margin-right: 10px; letter-spacing: 0; }

.scroll-hint { position: absolute; bottom: 12vh; left: 50%; width: 1px; height: 56px;
  background: rgba(236,228,212,.2); overflow: hidden; }
.scroll-hint span { position: absolute; left: 0; top: -40%; width: 100%; height: 40%;
  background: var(--ember); animation: hint 2.2s cubic-bezier(.65,0,.35,1) infinite; }
@keyframes hint { to { top: 110%; } }

.cta { pointer-events: auto; margin-top: 44px; display: inline-block;
  font-family: var(--mono); font-size: 12px; letter-spacing: .22em;
  color: var(--slate); background: var(--ember); padding: 18px 38px;
  text-decoration: none; border-radius: 2px; transition: background .3s, transform .3s;
  text-transform: uppercase; }
.cta:hover { background: var(--sand); transform: translateY(-2px); }
.foot { position: absolute; bottom: 30px; left: 0; right: 0; text-align: center;
  opacity: .45; letter-spacing: .2em; }

/* reduced motion: native scroll + poster world (single rendered frame) */
@media (prefers-reduced-motion: reduce) {
  .scroll-hint span { animation: none; }
  .ov > * { transition: none; transform: none; }
}
body.reduced .overlays { position: static; pointer-events: auto; }
body.reduced .ov { position: relative; inset: auto; min-height: 100vh;
  opacity: 1; visibility: visible; }
body.reduced #track, body.reduced .skip, body.reduced .rail { display: none; }

@media (max-width: 768px) {
  .chrome { padding: 18px 16px; gap: 10px; }
  .nav { gap: 10px; flex: none; }
  .nav a { font-size: 9px; letter-spacing: .08em; white-space: nowrap; }
  .wm-glyph { width: 17px; height: 17px; }
  .wm-text { font-size: 13px; letter-spacing: .2em; }
  .rail { left: 14px; }
  .rail-dot span { display: none; }
  .ov { padding: 0 8vw; }
  .ov-right { padding-right: 8vw; }
  .progress { max-width: 130px; }
  .skip { padding: 8px 12px; font-size: 10px; }
}
