@font-face {
  font-family: "Cinzel";
  src: url("fonts/Cinzel.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #030509;
  --pewter: #b8bec4;
  --pewter-hi: #d9dde1;
  --pewter-dim: #7c848b;
  --verdi-hi: #8fd3bb;
  --verdi: #5fb398;
  --verdi-mid: #4fa38a;
  --verdi-lo: #2a5f50;
  --glow: rgba(79, 163, 138, .38);
  --serif: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--pewter);
  font-family: var(--serif);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#sky, #trace {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#sky { z-index: 0; background: radial-gradient(ellipse at 50% 20%, #0b1220 0%, #04060b 55%, #020306 100%); }
#trace { z-index: 1; touch-action: none; cursor: crosshair; outline: none; }
/* the cemetery: a static silhouette canvas pinned to the bottom (top/height set by sky.js) */
#yard, #yardfx { position: fixed; z-index: 0; left: 0; top: 50%; width: 100%; height: 50%; display: block; pointer-events: none; }
/* low ground mist drifting between the stones */
.mist {
  position: fixed;
  z-index: 0;
  left: -50%;
  bottom: 0;
  width: 200%;
  height: 30vh;
  pointer-events: none;
  background:
    radial-gradient(ellipse 14% 30% at 10% 82%, rgba(120, 140, 168, .05), transparent 72%),
    radial-gradient(ellipse 20% 24% at 31% 90%, rgba(120, 140, 168, .045), transparent 72%),
    radial-gradient(ellipse 13% 28% at 52% 84%, rgba(120, 140, 168, .05), transparent 72%),
    radial-gradient(ellipse 22% 22% at 72% 91%, rgba(120, 140, 168, .04), transparent 72%),
    radial-gradient(ellipse 15% 26% at 91% 85%, rgba(120, 140, 168, .05), transparent 72%);
  animation: mist-drift 80s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes mist-drift { from { transform: translate3d(-6%, 0, 0); } to { transform: translate3d(6%, 0, 0); } }
#trace:focus-visible { box-shadow: inset 0 0 0 1px rgba(143, 211, 187, .35); }

/* ---------- UI layers ---------- */
.top {
  position: fixed;
  z-index: 3;
  top: 0;
  right: 0;
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: calc(var(--safe-t) + 14px) 16px 0 16px;
}
.icon-btn, .text-btn, .pill {
  font-family: var(--serif);
  color: var(--pewter);
  background: rgba(6, 9, 14, .35);
  border: 1px solid rgba(184, 190, 196, .28);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .3s, color .3s, background .3s, box-shadow .3s;
}
.icon-btn:hover, .text-btn:hover, .pill:hover,
.icon-btn:focus-visible, .text-btn:focus-visible, .pill:focus-visible {
  color: var(--pewter-hi);
  border-color: rgba(143, 211, 187, .6);
  box-shadow: 0 0 18px rgba(79, 163, 138, .25);
  outline: none;
}
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.icon-btn .stroke { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.icon-btn .ico-on { display: none; }
.icon-btn[aria-pressed="true"] .ico-on { display: block; }
.icon-btn[aria-pressed="true"] .ico-off { display: none; }
.icon-btn[aria-pressed="true"] { color: var(--verdi-hi); border-color: rgba(143, 211, 187, .5); }
.text-btn { height: 40px; padding: 0 16px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; }

.stage {
  position: fixed;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-b) + clamp(84px, 10.6vh, 106px));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 16px;
  pointer-events: none;
}
.stage button { pointer-events: auto; }
/* a soft dark pool behind the words, so they read over the graves */
.stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: -10%;
  width: min(120vw, 1000px);
  height: 80%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(1, 2, 4, .42), rgba(1, 2, 4, .2) 58%, rgba(1, 2, 4, 0));
  pointer-events: none;
}

.brand {
  margin: 0;
  font-weight: 500;
  font-size: clamp(28px, min(8.6vw, 8.4vh), 96px);
  letter-spacing: .13em;
  padding-left: .13em; /* optically centre the tracked caps */
  line-height: 1.05;
  color: var(--verdi);
  background: linear-gradient(180deg, var(--verdi-hi) 0%, var(--verdi) 42%, var(--verdi-mid) 62%, var(--verdi-lo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: .5px rgba(20, 48, 40, .7);
  filter: drop-shadow(0 0 14px var(--glow)) drop-shadow(0 2px 1px rgba(0, 0, 0, .9));
}
.tagline {
  margin: clamp(8px, 1.6vh, 16px) 0 0;
  font-size: clamp(11px, min(3.3vw, 2.2vh), 17px);
  letter-spacing: .32em;
  padding-left: .32em;
  color: var(--pewter);
  text-shadow: 0 0 10px rgba(120, 140, 170, .35), 0 1px 1px #000;
}
.countdown {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(8px, 2.6vw, 22px);
  margin-top: clamp(12px, 2.4vh, 24px);
  color: var(--pewter);
}
.unit { display: flex; flex-direction: column; align-items: center; min-width: 2.4em; }
.num {
  font-size: clamp(24px, min(7.4vw, 5.4vh), 46px);
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--pewter);
  background: linear-gradient(180deg, #d4d8dc 0%, #b8bec4 45%, #7d858c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(110, 130, 160, .3)) drop-shadow(0 1px 1px #000);
}
.lab {
  margin-top: 6px;
  font-size: clamp(8px, 2.2vw, 11px);
  letter-spacing: .28em;
  padding-left: .28em;
  text-transform: uppercase;
  color: var(--pewter-dim);
}
.sep { font-size: clamp(16px, 4vw, 26px); line-height: 1.3; color: var(--pewter-dim); opacity: .6; }
body.open .countdown { display: none; }

.actions { display: flex; gap: 10px; margin-top: clamp(14px, 2.6vh, 26px); flex-wrap: wrap; justify-content: center; }
.pill { height: 40px; padding: 0 20px; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; }
.pill span { font-size: 10px; margin-right: .5em; color: var(--verdi-hi); }
.kb-only { position: absolute; left: -9999px; }
.kb-only:focus-visible { position: static; }

.foot {
  position: fixed;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 16px calc(var(--safe-b) + 12px);
  text-align: center;
  font-size: clamp(9px, 2.5vw, 11px);
  letter-spacing: .16em;
  color: var(--pewter-dim);
  pointer-events: none;
}
.foot p { margin: 4px 0 0; }
.foot em { font-style: normal; color: var(--pewter); }
.foot a { color: var(--pewter-dim); text-decoration: none; border-bottom: 1px solid rgba(124, 132, 139, .35); pointer-events: auto; }
.foot a:hover, .foot a:focus-visible { color: var(--verdi-hi); border-color: var(--verdi); outline: none; }
.foot a.book { border-bottom-color: transparent; transition: color .3s, border-color .3s; }
.foot a.book:hover em, .foot a.book:focus-visible em { color: var(--verdi-hi); }
.soon {
  font-family: var(--serif);
  font-size: clamp(9px, 2.4vw, 11px);
  letter-spacing: .14em;
  color: rgba(124, 132, 139, .75);
  background: transparent;
  border: 1px dashed rgba(124, 132, 139, .3);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 6px;
  cursor: not-allowed;
}

.hint {
  position: fixed;
  z-index: 2;
  margin: 0;
  transform: translate(-50%, 0);
  font-size: clamp(11px, 2.8vw, 14px);
  letter-spacing: .3em;
  padding-left: .3em;
  white-space: nowrap;
  color: var(--pewter);
  text-shadow: 0 0 12px rgba(79, 163, 138, .55), 0 1px 1px #000;
  opacity: 0;
  transition: opacity 1.6s ease;
  pointer-events: none;
}
.hint.show { opacity: .8; animation: hint-breathe 4.5s ease-in-out infinite; }
@keyframes hint-breathe { 50% { opacity: .45; } }

/* ---------- the Prophecy ---------- */
.prophecy {
  position: fixed;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-t) + 20px) 16px calc(var(--safe-b) + 20px);
  background: radial-gradient(ellipse at 50% 50%, rgba(2, 4, 8, .9) 0%, rgba(2, 4, 8, .74) 60%, rgba(2, 4, 8, .45) 100%);
  animation: fade-in 1.2s ease both;
  overflow: auto;
}
.prophecy[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } }
.scroll { width: 100%; max-width: 44em; text-align: center; }
.verses { font-size: clamp(11px, min(3.05vw, 2.3vh), 21px); line-height: 1.62; letter-spacing: .04em; }
.line { text-wrap: balance; }
.stanza + .stanza { margin-top: 1.1em; }
.line { margin: 0; min-height: 1.62em; color: var(--pewter); }
.line .w { display: inline-block; white-space: nowrap; }
.line .c {
  display: inline-block;
  opacity: 0;
  animation: ink 1.3s var(--d, 0s) cubic-bezier(.2, .7, .2, 1) forwards;
}
@keyframes ink {
  0% { opacity: 0; filter: blur(7px); transform: translateY(.18em); color: #f2fffa; text-shadow: 0 0 16px rgba(143, 211, 187, 1); }
  30% { opacity: 1; filter: blur(0); transform: none; color: #e6fbf3; text-shadow: 0 0 14px rgba(111, 191, 163, .95); }
  100% { opacity: 1; color: var(--pewter-hi); text-shadow: 0 0 10px rgba(79, 163, 138, .5), 0 1px 1px #000; }
}
.line.locked { opacity: .3; }
.glyphblur {
  display: inline-block;
  vertical-align: middle;
  height: .8em;
  max-width: 100%;
  border-radius: .3em;
  background:
    repeating-linear-gradient(90deg, rgba(184, 190, 196, .55) 0 .38em, transparent .38em .52em, rgba(184, 190, 196, .35) .52em .9em, transparent .9em 1.02em, rgba(184, 190, 196, .5) 1.02em 1.3em, transparent 1.3em 1.75em),
    linear-gradient(180deg, transparent 0 20%, rgba(184, 190, 196, .15) 20% 80%, transparent 80%);
  filter: blur(3.5px);
}
.next { margin: 1.6em 0 0; font-size: clamp(10px, 2.6vw, 12px); letter-spacing: .24em; color: var(--pewter-dim); min-height: 1em; }
.prophecy .pill { margin-top: 1.4em; }

/* ---------- film modal ---------- */
.film {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  overflow: visible;
}
.film::backdrop { background: rgba(1, 2, 4, .88); }
.film-frame {
  height: min(86vh, 86dvh, calc(92vw * 16 / 9));
  aspect-ratio: 9 / 16;
  max-width: 92vw;
  border: 1px solid rgba(184, 190, 196, .2);
  box-shadow: 0 0 60px rgba(79, 163, 138, .18);
  background: #000;
}
.film video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.film .close { position: absolute; top: -14px; right: -14px; background: rgba(3, 5, 9, .9); }

.toast {
  position: fixed;
  z-index: 6;
  left: 50%;
  top: calc(var(--safe-t) + 66px);
  transform: translateX(-50%);
  padding: 8px 16px;
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--pewter-hi);
  background: rgba(6, 9, 14, .8);
  border: 1px solid rgba(143, 211, 187, .35);
  border-radius: 999px;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

.noscript { position: fixed; z-index: 5; bottom: 30%; width: 100%; text-align: center; letter-spacing: .2em; }

/* Open Graph still */
body.og .top, body.og .foot, body.og .actions, body.og .countdown, body.og .hint { display: none; }
body.og .stage { bottom: 15vh; }

/* wide screens: the words hang between the anti-sun and the graves, so the gate stands clear beneath them */
@media (orientation: landscape) and (min-height: 521px) {
  .stage { bottom: calc(var(--safe-b) + 28vh); }
  .brand { font-size: clamp(28px, min(8.6vw, 7.2vh), 96px); }
  body.og .stage { bottom: 30vh; }
  body.og .brand { font-size: 62px; }
}

@media (orientation: portrait) {
  .tagline { margin-top: clamp(6px, 1.1vh, 12px); }
  .countdown { margin-top: clamp(10px, 1.7vh, 18px); }
  .actions { margin-top: clamp(12px, 1.8vh, 20px); }
}

/* phones: more presence at arm's length (brighter tagline + labels, a deeper pool behind the words) */
@media (max-width: 600px) and (orientation: portrait) {
  .stage::before {
    top: -14%;
    height: 92%;
    background: radial-gradient(closest-side, rgba(1, 2, 4, .66), rgba(1, 2, 4, .38) 60%, rgba(1, 2, 4, 0));
  }
  .tagline {
    font-weight: 500;
    color: var(--pewter-hi);
    text-shadow: 0 0 3px #000, 0 0 12px rgba(0, 0, 0, .85), 0 0 14px rgba(130, 150, 180, .4), 0 1px 1px #000;
  }
  .num {
    background: linear-gradient(180deg, #eef0f2 0%, #cdd2d6 45%, #8e969d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(130, 150, 180, .38)) drop-shadow(0 1px 1px #000);
  }
  .lab {
    font-size: clamp(9px, 2.5vw, 11px);
    font-weight: 500;
    color: #aeb5bb;
    text-shadow: 0 0 2px #000, 0 0 8px rgba(0, 0, 0, .9);
  }
  .sep { color: var(--pewter); opacity: .7; }
  .hint { color: var(--pewter-hi); text-shadow: 0 0 3px #000, 0 0 12px rgba(79, 163, 138, .7), 0 1px 1px #000; }
  .hint.show { opacity: .92; }
  .foot { color: #949ca3; }
  .foot a { color: #949ca3; }
  .soon { color: rgba(150, 158, 165, .85); }
}

@media (orientation: landscape) and (max-height: 520px) {
  .stage { bottom: calc(var(--safe-b) + 58px); }
  .soon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .line .c { animation: none; opacity: 1; color: var(--pewter-hi); text-shadow: 0 0 10px rgba(79, 163, 138, .5); }
  .hint.show { animation: none; }
  .prophecy { animation: none; }
  .mist { animation: none; }
}
body.rm .mist { animation: none; }
body.rm .line .c { animation: none; opacity: 1; color: var(--pewter-hi); text-shadow: 0 0 10px rgba(79, 163, 138, .5); }
body.rm .prophecy { animation: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stage, .foot { transition: opacity .8s ease, visibility .8s; }
body.p-open .stage, body.p-open .foot { opacity: 0; visibility: hidden; }

/* ---------- share panel ---------- */
.sharer { border: 1px solid rgba(143, 211, 187, .28); border-radius: 18px; background: rgba(4, 7, 12, .96); color: var(--pewter-hi);
  padding: 28px 24px 22px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 80px rgba(0, 0, 0, .7), 0 0 40px rgba(79, 163, 138, .12); }
.sharer::backdrop { background: rgba(1, 2, 4, .72); backdrop-filter: blur(3px); }
.sharer-title { margin: 0 0 18px; text-align: center; font-family: inherit; font-size: 14px; letter-spacing: .32em; text-transform: uppercase; color: var(--verdi-hi); }
.sharer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.sh { display: flex; align-items: center; justify-content: center; height: 42px; padding: 0 12px; border: 1px solid rgba(184, 190, 196, .28); border-radius: 999px;
  background: transparent; color: var(--pewter-hi); font: inherit; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.sh:hover, .sh:focus-visible { border-color: var(--verdi); color: #fff; box-shadow: 0 0 14px rgba(95, 179, 152, .35); outline: none; }
.sharer-note { margin: 16px 0 0; text-align: center; font-size: 12px; line-height: 1.5; color: var(--pewter-dim); }
.sharer .close { position: absolute; top: 10px; right: 10px; }
