@font-face {
  font-family: "Anemone Hand";
  src: url("../assets/fonts/anemone-hand.woff2") format("woff2"), url("../assets/fonts/anemone-hand.otf") format("opentype");
  font-display: swap;
}
@font-face { font-family: "Anemone Wild"; src: url("../assets/fonts/anemone-wild.woff2") format("woff2"), url("../assets/fonts/anemone-wild.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Anemone Brush"; src: url("../assets/fonts/anemone-brush.woff2") format("woff2"), url("../assets/fonts/anemone-brush.otf") format("opentype"); font-display: swap; }

:root {
  --paper: #efe6d2;
  --paper-2: #c9bda6;
  --ink: #2a211b;
  --dim: #8d8170;
  /* The Boat's pattern: one quiet book serif for the narration, our own hand-lettering for every voice and the UI. */
  --serif: "Source Serif 4", Georgia, serif;
  --hand: "Anemone Hand", "Segoe Print", cursive;   /* the boy's pen: labels, the note, the UI */
  --wild: "Anemone Wild", "Anemone Brush", sans-serif; /* the title and the big story hits */
  --brush: "Anemone Brush", sans-serif;               /* chapter titles */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  --lx: 0px;
  --ly: 0px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: #000; scrollbar-gutter: stable; }
body { margin: 0; background: #000; color: var(--paper); font-family: var(--serif); overflow-x: hidden; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }

.stage, .dust, .vignette { position: fixed; inset: 0; width: 100%; height: 100%; }
.stage { z-index: 0; }
.stage .gl, .stage .css3d { position: absolute; inset: 0; }
.stage .css3d { pointer-events: none; }
.dust { z-index: 1; pointer-events: none; mix-blend-mode: screen; }
.vignette {
  z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 48%, transparent 55%, rgba(0, 0, 0, 0.72) 100%);
}

main { position: relative; z-index: 3; pointer-events: none; }
.section { position: relative; height: 330vh; }
.section-2 { height: 620vh; }
.section-3 { height: 560vh; }
.section-4 { height: 640vh; }
.section-5 { height: 1100vh; }
.section-6 { height: 620vh; }
.section-7 { height: 900vh; }
.section-8 { height: 1150vh; }
.section-9 { height: 420vh; }
.section-end { height: 100vh; }
.cap-box { width: 1100px; text-align: center; }
.caption {
  margin: 0; font-family: var(--serif); font-size: 40px; line-height: 1.25; color: #f2eee6; opacity: 0;
  text-shadow: var(--lx) calc(var(--ly) + 3px) 8px rgba(0, 0, 0, 0.75);
}
html.over-tin { cursor: pointer; }

/* ----- Title: cut letters hanging on threads ----- */
.title { opacity: 0; text-align: center; width: 1100px; }
.title-word {
  margin: 0; font-family: var(--wild); font-weight: 400; font-size: 168px; line-height: 1; letter-spacing: -0.01em;
  color: #f2eee6; white-space: nowrap;
}
.letter {
  display: inline-block;
  /* A small soft shadow right behind the letters, moving with the lamp. */
  text-shadow: calc(var(--lx) * 0.8) calc(var(--ly) * 0.8 + 4px) 6px rgba(0, 0, 0, 0.55);
}
.title-sub {
  margin: 2px 0 0; font-family: var(--serif); font-style: italic; font-size: 30px; color: var(--paper-2); opacity: 0;
  text-shadow: var(--lx) calc(var(--ly) + 3px) 6px rgba(0, 0, 0, 0.6);
}

/* ----- Words on paper in the scene ----- */
.tag-label {
  width: 150px; font-family: var(--hand); font-size: 14px; line-height: 1.1; color: #3b2e24; text-align: center;
  opacity: 0.9; transform-origin: center;
}
.note-box { text-align: center; width: 800px; }
.note-not-yet {
  margin: 0; font-family: var(--wild); font-size: 78px; letter-spacing: 0.02em; color: var(--paper); opacity: 0;
  text-shadow: var(--lx) calc(var(--ly) + 4px) 8px rgba(0, 0, 0, 0.7);
}
.hint {
  margin: 0; font-family: var(--hand); font-size: 30px; color: var(--paper-2); opacity: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

/* ----- Film subtitles ----- */
.subtitle {
  position: fixed; z-index: 4; left: 50%; bottom: max(7vh, 40px); transform: translateX(-50%);
  width: min(90vw, 980px); margin: 0; text-align: center; pointer-events: none; opacity: 0;
  font-family: var(--serif); font-size: clamp(22px, 1.1rem + 0.9vw, 34px); line-height: 1.3; color: #f4f1ea;
  text-shadow: 0 0 2px #000, 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 18px rgba(0, 0, 0, 0.7);
}
/* The voice inside him in the flashback: bigger, blood-warm, and it will not keep still. */
.subtitle.is-inner {
  font-style: italic; font-size: clamp(28px, 1.2rem + 1.4vw, 46px); letter-spacing: 0.02em; color: #f0d2c4;
  text-shadow: 0 0 2px #000, 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 22px rgba(120, 10, 6, 0.85);
  animation: inner-shake 0.11s steps(2) infinite;
}
@keyframes inner-shake {
  0% { translate: 0 0; }
  50% { translate: 1.5px -1px; }
  100% { translate: -1.5px 1px; }
}
@media (prefers-reduced-motion: reduce) { .subtitle.is-inner { animation: none; } }

/* The hint in section 7: held down, he stands. */
.hold-hint {
  position: fixed; z-index: 4; left: 50%; top: 18vh; transform: translateX(-50%); margin: 0; pointer-events: none;
  font-family: var(--hand); font-size: 22px; letter-spacing: 0.06em; color: #efe6d2; opacity: 0;
  text-shadow: 0 1px 3px #000, 0 0 14px rgba(0, 0, 0, 0.8); transition: opacity 0.6s ease;
}
.hold-hint.is-on { opacity: 0.85; animation: hint-breathe 2.4s ease-in-out infinite; }
@keyframes hint-breathe { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .hold-hint.is-on { animation: none; } }

/* How far his hand is open (section 7): a thin line of warm light that fills, and jolts when a voice fights back. */
.pry-bar {
  position: fixed; z-index: 4; left: 50%; top: calc(18vh + 40px); width: min(46vw, 360px); height: 3px;
  transform: translateX(-50%); background: rgba(239, 230, 210, 0.16); border-radius: 2px; opacity: 0;
  pointer-events: none; transition: opacity 0.5s ease; box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}
.pry-bar.is-on { opacity: 1; }
.pry-bar span {
  display: block; height: 100%; border-radius: 2px; transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, #8e1a14, #e0763a 70%, #ffd9a0); box-shadow: 0 0 12px rgba(224, 118, 58, 0.7);
}
.pry-bar.is-hit { animation: pry-hit 0.35s ease-out; }
@keyframes pry-hit { 0% { translate: 0 0; } 25% { translate: -6px 0; } 50% { translate: 5px 0; } 75% { translate: -3px 0; } 100% { translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .pry-bar.is-hit { animation: none; } }

/* Sound: a small moving mark, top right, once the film has begun. Muted, it lies flat. */
.sound-toggle {
  position: fixed; z-index: 11; top: max(14px, env(safe-area-inset-top)); right: 16px; display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 0; background: none; color: rgba(239, 230, 210, 0.7); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity 1.2s ease 1.5s, color 0.3s ease;
}
html.is-lit .sound-toggle { opacity: 1; pointer-events: auto; }
.sound-toggle:hover, .sound-toggle:focus-visible { color: #f2c79a; }
.sound-toggle .btn-bars { height: 14px; }
.sound-toggle .btn-bars i { width: 2px; }
.sound-toggle.is-muted .btn-bars i { animation: none; transform: scaleY(0.18); transition: transform 0.5s ease; }
.sound-note {
  font: 11px var(--serif); letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap; opacity: 0;
  transform: translateX(6px); transition: opacity 0.6s ease, transform 0.6s ease; pointer-events: none;
}
.sound-toggle:hover .sound-note, .sound-toggle:focus-visible .sound-note { opacity: 0.8; transform: none; }
.sound-toggle.is-noting .sound-note { animation: sound-note 3.4s ease both; }
@keyframes sound-note { 0% { opacity: 0; transform: translateX(6px); } 15%, 75% { opacity: 0.9; transform: none; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sound-toggle .btn-bars i { animation: none; } }

/* The signature: small, bottom left, always there (above the epilogue too). */
.signature {
  position: fixed; z-index: 11; left: 18px; bottom: 14px; font-family: var(--serif); font-size: 12px;
  letter-spacing: 0.06em; color: rgba(239, 230, 210, 0.55); text-decoration: none; transition: color 0.3s ease;
}
.signature:hover, .signature:focus-visible { color: #efe6d2; outline: none; }
.signature-site { left: auto; right: 18px; }

/* ----- The epilogue: a black page, written by hand ----- */
.epilogue {
  position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; background: #000;
  opacity: 0; pointer-events: none; transition: opacity 1.6s ease;
}
.epilogue.is-on { opacity: 1; }
.epilogue.is-credits { pointer-events: auto; }
.epilogue::after { /* film grain over the black */
  content: ""; position: absolute; inset: -50%; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: ep-grain 0.6s steps(4) infinite;
}
@keyframes ep-grain { 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } }
.ep-verses { position: relative; width: min(92vw, 1080px); height: 60vh; }
.ep-verse {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.5em;
  transition: opacity 1.4s ease, transform 1.8s cubic-bezier(0.2, 0.7, 0.2, 1), filter 1.4s ease;
}
.ep-verse.is-past { opacity: 0; transform: translateY(-6vh); filter: blur(6px); }
/* Narrow screens: the verses wrap taller, so the old one leaves faster and further, out of the new one's way. */
@media (max-width: 600px) {
  .ep-verse.is-past { transform: translateY(-18vh); transition-duration: 0.7s, 1s, 0.7s; }
}
.ep-line {
  margin: 0; text-align: center; font-family: var(--serif); font-size: clamp(24px, 1rem + 1.8vw, 48px);
  line-height: 1.3; color: #efe4d2; text-shadow: 0 0 18px rgba(255, 200, 150, 0.12);
}
/* Each letter bleeds into the paper like ink; a word never breaks across lines. */
.ep-word { display: inline-block; white-space: nowrap; }
.ep-ink { display: inline-block; white-space: pre; animation: ep-ink 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes ep-ink {
  0% { opacity: 0; filter: blur(7px); transform: translateY(0.12em) scale(1.12); color: #c8452a; }
  35% { opacity: 1; color: #f6c9a8; }
  100% { opacity: 1; filter: blur(0); transform: none; color: #efe4d2; }
}
.ep-skip {
  position: absolute; z-index: 2; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 56px); transform: translateX(-50%);
  padding: 9px 20px; border: 1px solid rgba(239, 230, 210, 0.22); border-radius: 999px; background: rgba(0, 0, 0, 0.4);
  font: 12px var(--serif); letter-spacing: 0.24em; text-transform: uppercase; color: rgba(239, 230, 210, 0.6); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity 0.8s ease, color 0.3s, border-color 0.3s, background 0.3s;
}
.ep-skip.is-on { opacity: 1; pointer-events: auto; }
.ep-skip:hover, .ep-skip:focus-visible { color: #120c08; background: #efe6d2; border-color: #efe6d2; outline: none; }
.ep-credits {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 760px);
  max-height: 100vh; overflow-y: auto; padding: 3vh 0 6vh; scrollbar-width: none;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  font-family: var(--serif); color: #cfc4b2; pointer-events: none;
}
.epilogue.is-credits .ep-credits { pointer-events: auto; }
.ep-credits { transition: opacity 0.8s ease, filter 0.8s ease, transform 0.8s ease; }
/* The meaning: the credits step back into the dark, and its lines ink in over them. */
.epilogue.is-meaning .ep-credits { opacity: 0; filter: blur(8px); transform: translate(-50%, -50%) scale(0.97); pointer-events: none; }
.ep-meaning {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(88vw, 660px); max-height: 100vh;
  overflow-y: auto; scrollbar-width: none; padding: 5vh 0; display: flex; flex-direction: column; align-items: center;
  text-align: center; font-family: var(--serif); color: #e9dfcf; pointer-events: none;
}
.epilogue.is-meaning .ep-meaning { pointer-events: auto; }
.em-in { opacity: 0; filter: blur(6px); transform: translateY(10px); }
.epilogue.is-meaning .em-in { animation: ec-in 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s) both; }
.epilogue:not(.is-meaning) .ep-meaning .em-in { transition: opacity 0.6s ease; }
.em-kicker { margin: 0; font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: #8f8474; }
.em-title { margin: 0.4em 0 0; font-family: var(--wild); font-weight: 400; font-size: clamp(40px, 2rem + 3vw, 76px); line-height: 1; letter-spacing: 0.03em; color: #f2eee6; text-shadow: 0 0 40px rgba(255, 140, 60, 0.22); outline: none; }
.ep-meaning .ec-thread { margin: 2.6vh 0 3vh; }
.em-line { margin: 0 0 1.25em; font-size: clamp(17px, 0.9rem + 0.55vw, 23px); line-height: 1.6; color: #e2d7c4; text-wrap: balance; }
.em-word { font-style: italic; color: #f2c79a; }
.em-red { color: #e0353f; text-shadow: 0 0 14px rgba(179, 18, 27, 0.7); }
.em-white { color: #fffaf2; text-shadow: 0 0 14px rgba(255, 245, 230, 0.45); }
.em-close { margin: 1.4em 0 0; font-style: italic; font-size: clamp(16px, 0.85rem + 0.4vw, 20px); color: #b9ab95; }
.em-back { margin-top: 4vh; }
@media (prefers-reduced-motion: reduce) {
  .epilogue.is-meaning .em-in { animation: none; opacity: 1; filter: none; transform: none; }
}
.ep-credits p { margin: 0; }
/* Each line inks in after the one before (--d set in js). */
.ec-in { opacity: 0; filter: blur(6px); transform: translateY(10px); }
.epilogue.is-credits .ec-in { animation: ec-in 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s) both; }
@keyframes ec-in { to { opacity: 1; filter: blur(0); transform: none; } }
/* The paper anemone from the start, swaying on its stem. */
.ec-flower { width: clamp(40px, 4.5vw, 60px); margin-bottom: 1vh; opacity: 0; transform-origin: 50% 100%; }
.epilogue.is-credits .ec-flower { animation: ec-in 2s ease 0.2s both, ec-sway 5.5s ease-in-out 2.2s infinite; }
.ec-flower img { display: block; width: 100%; height: auto; filter: drop-shadow(0 0 18px rgba(255, 220, 190, 0.25)); }
@keyframes ec-sway { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }
.ec-title {
  font-family: var(--wild); font-size: clamp(52px, 3rem + 3vw, 96px); line-height: 0.95; letter-spacing: 0.03em; color: #f2eee6;
  text-shadow: 0 0 40px rgba(255, 140, 60, 0.25);
}
.ec-sub { font-style: italic; font-size: clamp(16px, 0.8rem + 0.6vw, 22px); color: #b9ad9a; margin-top: 0.3em !important; }
/* A thread of blood red: the one colour that runs through the story. */
.ec-thread {
  display: block; width: min(220px, 50vw); height: 1px; margin: 2.4vh 0;
  background: linear-gradient(90deg, transparent, #b3121b 30%, #e0763a 50%, #b3121b 70%, transparent);
  box-shadow: 0 0 10px rgba(179, 18, 27, 0.6);
}
.ec-role, .ec-roles dt {
  font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: #8f8474;
}
.ec-name {
  font-family: var(--wild); font-size: clamp(34px, 1.6rem + 2vw, 58px); letter-spacing: 0.04em; color: #f4e2c8; margin-top: 0.4em !important;
}
.ec-who { font-style: italic; font-size: clamp(15px, 0.8rem + 0.4vw, 19px); color: #a99c88; margin-top: 0.3em !important; }
.ec-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 2.2vh 0 3.2vh !important; }
.ec-links a, .ec-btn {
  position: relative; display: inline-block; padding: 11px 22px; border: 1px solid rgba(242, 199, 154, 0.35); border-radius: 999px;
  font: 14px var(--serif); letter-spacing: 0.14em; text-transform: uppercase; color: #f2c79a; text-decoration: none; background: rgba(0, 0, 0, 0.3);
  transition: color 0.35s, background 0.35s, border-color 0.35s, transform 0.35s, box-shadow 0.35s;
}
.ec-links a:hover, .ec-links a:focus-visible, .ec-btn:hover, .ec-btn:focus-visible {
  color: #120c08; background: #f2c79a; border-color: #f2c79a; transform: translateY(-2px); outline: none;
  box-shadow: 0 0 28px rgba(242, 160, 90, 0.35);
}
.ec-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2vh 40px; margin: 0; width: min(100%, 560px); }
.ec-roles div { display: flex; flex-direction: column; gap: 6px; }
.ec-roles dd { margin: 0; font-size: clamp(15px, 0.8rem + 0.3vw, 18px); color: #e4d8c4; line-height: 1.35; }
.ec-roles dd span { font-size: 0.82em; color: #9d917f; }
.ec-end { font-style: italic; font-size: clamp(16px, 0.8rem + 0.5vw, 21px); color: #c9b9a2; margin-top: 3.6vh !important; }
.ec-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 2.4vh !important; }
.ec-btn { cursor: pointer; font-size: 12px; padding: 10px 20px; color: #cfc4b2; border-color: rgba(239, 230, 210, 0.25); }
.ec-meaning-open { color: #f2c79a; border-color: rgba(242, 199, 154, 0.45); }
/* Petals drifting down through the dark. */
.ec-petal {
  position: absolute; top: -5vh; left: var(--x); width: var(--s); height: calc(var(--s) * 1.35); pointer-events: none;
  background: radial-gradient(ellipse at 40% 35%, #fbf6ee, #cfc5b8 70%); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: 0; animation: ec-fall var(--t) linear var(--delay) infinite;
}
.ec-petal.is-red { background: radial-gradient(ellipse at 40% 35%, #c8202a, #5e0a0e 75%); }
.epilogue.is-credits .ec-petal { opacity: 0.75; }
@keyframes ec-fall {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(calc(var(--sway) * 0.5), 55vh) rotate(200deg); }
  100% { transform: translate(var(--sway), 112vh) rotate(420deg); }
}
@media (max-width: 600px) {
  .ec-roles { grid-template-columns: 1fr; gap: 2vh; }
  .ec-links a { padding: 10px 18px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .epilogue.is-credits .ec-in, .epilogue.is-credits .ec-flower { animation: none; opacity: 1; filter: none; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .ep-ink { animation: none; } .epilogue::after { animation: none; } }

/* ----- Gate: the grave at sunrise behind the title, and the one way in ----- */
.gate {
  position: fixed; inset: 0; z-index: 10; display: grid; align-content: end; justify-items: center;
  padding-bottom: 64px;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 30%, rgba(0, 0, 0, 0) 50%),
    radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.6) 100%);
  transition: opacity 0.7s ease, visibility 0s linear 0.7s;
}
.gate.is-gone { opacity: 0; visibility: hidden; }
.gate-main { position: relative; z-index: 2; display: grid; justify-items: center; text-align: center; padding: 0 16px; }
.gate-note {
  margin: 0; font-family: var(--serif); font-size: 13px; letter-spacing: 0.32em; text-transform: uppercase;
  color: rgba(239, 230, 210, 0.7);
}
.gate-title {
  margin: 2px 0 18px; font-family: var(--wild); font-weight: 400; line-height: 0.9; letter-spacing: 0.03em;
  font-size: clamp(56px, 7.5vw, 128px); color: var(--paper);
  text-shadow: 0 0 40px rgba(255, 140, 60, 0.35), 0 6px 30px rgba(0, 0, 0, 0.8);
  animation: gate-title-breathe 6s ease-in-out infinite;
}
@keyframes gate-title-breathe { 50% { text-shadow: 0 0 70px rgba(255, 120, 50, 0.55), 0 6px 30px rgba(0, 0, 0, 0.8); } }
.btn-sound {
  display: inline-flex; align-items: center; gap: 14px;
  font: 400 15px var(--serif); letter-spacing: 0.24em; text-transform: uppercase; color: var(--paper);
  background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(239, 230, 210, 0.45); border-radius: 999px;
  padding: 16px 30px; cursor: pointer; min-height: 52px; backdrop-filter: blur(6px);
  transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
}
.btn-sound:hover, .btn-sound:focus-visible {
  background: var(--paper); color: #120c08; border-color: var(--paper); transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(255, 150, 80, 0.35);
}
.btn-sound:active { transform: translateY(0) scale(0.98); }
/* The mark: four bars of a sound wave, always moving. */
.btn-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.btn-bars i { display: block; width: 3px; height: 100%; background: currentColor; transform-origin: bottom; animation: gate-bar 1.1s ease-in-out infinite; }
.btn-bars i:nth-child(2) { animation-delay: -0.35s; }
.btn-bars i:nth-child(3) { animation-delay: -0.7s; }
.btn-bars i:nth-child(4) { animation-delay: -0.2s; }
@keyframes gate-bar { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }
.gate-hint { margin: 14px 0 0; font-family: var(--serif); font-size: 12px; letter-spacing: 0.12em; color: rgba(239, 230, 210, 0.5); }
.gate.is-entering .gate-main { opacity: 0; transition: opacity 0.5s ease; }
:focus-visible { outline: 1px solid var(--paper); outline-offset: 4px; }
@media (max-width: 600px) {
  .gate-note { font-size: 11px; letter-spacing: 0.2em; margin-bottom: 8px; }
  .btn-sound { letter-spacing: 0.14em; padding: 14px 22px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .gate { transition: none; }
  .gate-title, .btn-bars i { animation: none; }
}

/* ----- Section 4: ages written on the shadow-theatre wall, in brush ----- */

/* While the trailer plays, the film's words and hints stay hidden (the scenes run without them). */
html:not(.is-lit) .subtitle, html:not(.is-lit) .hold-hint, html:not(.is-lit) .pry-bar { visibility: hidden; }

/* Without JavaScript: say what this is, plainly. */
.noscript { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; gap: 12px; padding: 24px; text-align: center; background: #000; color: #efe6d2; font-family: var(--serif); }
.noscript h2 { margin: 0; font-family: var(--wild); font-weight: 400; font-size: 64px; }
.noscript a { color: #f2c79a; }

/* The loading bar on the gate: a thin line of warm light that fills; the way in appears once all is in. */
.gate-load { display: grid; justify-items: center; gap: 12px; width: min(320px, 70vw); margin: 4px 0 6px; transition: opacity 0.6s ease; }
.gate-load-line { position: relative; display: block; width: 100%; height: 2px; background: rgba(239, 230, 210, 0.14); border-radius: 2px; overflow: hidden; }
.gate-load-line::after {
  content: ""; position: absolute; inset: 0; transform-origin: left center; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, #8e1a14, #e0763a 70%, #ffd9a0); box-shadow: 0 0 12px rgba(224, 118, 58, 0.7);
  transition: transform 0.4s ease-out;
}
.gate-load-text { font: 12px var(--serif); letter-spacing: 0.24em; text-transform: uppercase; color: rgba(239, 230, 210, 0.6); }
.gate-load-pc { display: inline-block; min-width: 3.2em; text-align: left; color: #f2c79a; }
html.is-loaded .gate-load { opacity: 0; height: 0; margin: 0; overflow: hidden; }
html:not(.is-loaded) .btn-sound, html:not(.is-loaded) .gate-hint { opacity: 0; pointer-events: none; transform: translateY(8px); }
.btn-sound, .gate-hint { transition: opacity 0.9s ease 0.2s, transform 0.9s ease 0.2s, background 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease; }

/* Nothing animates where it cannot be seen (the gate after the way in, the epilogue before its page). */
html.is-lit .gate *, html.is-lit .gate::before, html.is-lit .gate::after { animation: none !important; }
.epilogue:not(.is-on)::after { animation: none; }
