:root {
  --ink: #0c141c;
  --ink-soft: #172432;
  --gold: #d4af5c;
  --gold-soft: #e8d4a0;
  --teal: #5ec4c8;
  --cream: #f2ebe0;
  --muted: rgba(242, 235, 224, 0.72);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --azure: #3eb7ff;
  --azure-soft: #7ad0ff;
  --parallax-x: 0px;
  --parallax-y: 0px;
  --arc-progress: 0;
  --ken: 1;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--cream);
  background: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.55;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--gold-soft);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--teal);
}

a:focus-visible,
.cta:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink-soft);
  color: var(--cream);
  border-radius: 4px;
}

.skip-link:focus {
  top: 1rem;
}

/* Continuous story arc */
.story-arc {
  position: fixed;
  top: 0.4rem;
  left: 0;
  right: 0;
  z-index: 40;
  height: 4.5rem;
  pointer-events: none;
  color: rgba(212, 175, 92, 0.55);
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
}

.story-arc.is-active {
  opacity: 1;
}

.story-arc svg {
  width: 100%;
  height: 100%;
  display: block;
}

#story-arc-path {
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--arc-progress));
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  isolation: isolate;
  overflow: visible;
  padding: clamp(1.5rem, 5vh, 3rem) 0 clamp(3rem, 8vh, 5rem);
}

.hero-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: none;
  overflow: visible;
}

.hero-layer {
  position: absolute;
  inset: -3%;
  background-image: url("assets/hero.webp");
  background-size: cover;
  background-position: center;
  filter: saturate(1.05) contrast(1.02);
  transform: translate(var(--parallax-x), var(--parallax-y)) scale(calc(1.05 * var(--ken)));
  will-change: transform;
}

.hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.5) 0%, rgba(8, 12, 18, 0.22) 38%, rgba(8, 12, 18, 0.78) 100%);
  pointer-events: none;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.hotspots {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hotspot {
  --hx: 50%;
  --hy: 50%;
  position: absolute;
  left: var(--hx);
  top: var(--hy);
  transform: translate(-50%, -50%);
  width: 6.8rem;
  height: 6.8rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 183, 255, 0.22) 0%, rgba(62, 183, 255, 0.08) 45%, transparent 70%);
  box-shadow: 0 0 0 1px rgba(62, 183, 255, 0.35), 0 0 18px rgba(62, 183, 255, 0.25);
  cursor: none;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: inherit;
  animation: hotspot-pulse 2.8s ease-in-out infinite;
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s ease, background 0.25s ease;
}

.hotspot-eye {
  left: calc(var(--hx) - 30px);
  top: calc(var(--hy) - 25px);
}

.hotspot-talk {
  left: calc(var(--hx) + 200px);
  top: calc(var(--hy) + 70px);
}

.hotspot-spyglass {
  left: calc(var(--hx) + 300px);
  top: calc(var(--hy) + 300px);
}

.hotspot:nth-child(2) { animation-delay: 0.4s; }
.hotspot:nth-child(3) { animation-delay: 0.8s; }

.hotspot img {
  width: 3.7rem;
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.hotspot-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hotspot:hover,
.hotspot:focus-visible {
  transform: translate(-50%, -50%) scale(1.14);
  background: radial-gradient(circle, rgba(62, 183, 255, 0.38) 0%, rgba(62, 183, 255, 0.12) 50%, transparent 72%);
  box-shadow: 0 0 0 2px rgba(122, 208, 255, 0.7), 0 0 28px rgba(62, 183, 255, 0.45);
  outline: none;
}

@keyframes hotspot-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(62, 183, 255, 0.3), 0 0 14px rgba(62, 183, 255, 0.2); }
  50% { box-shadow: 0 0 0 2px rgba(122, 208, 255, 0.55), 0 0 26px rgba(62, 183, 255, 0.4); }
}

.hotspot-bark {
  position: absolute;
  left: 50%;
  bottom: 5.5rem;
  z-index: 4;
  transform: translateX(-50%);
  margin: 0;
  max-width: min(28rem, calc(100% - 2rem));
  padding: 0.65rem 1.1rem;
  border-radius: 0.5rem;
  background: rgba(8, 12, 18, 0.78);
  border: 1px solid rgba(62, 183, 255, 0.35);
  color: var(--cream);
  font-size: 0.98rem;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.hotspot-bark[hidden] {
  display: none;
}

.game-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  z-index: 50;
  pointer-events: none;
  background: url("assets/cursor_hand.png") center / contain no-repeat;
  transform: translate(-2px, -2px);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.hero-stage.is-cursor-active .game-cursor {
  opacity: 1;
}

.hero-stage[data-cursor="eye"] .game-cursor {
  background-image: url("assets/cursor_eye.png");
  transform: translate(-20px, -20px);
}

.hero-stage[data-cursor="spyglass"] .game-cursor {
  background-image: url("assets/spyglass.png");
  width: 44px;
  height: 52px;
  transform: translate(-10px, -10px);
}

.hero-stage[data-cursor="talk"] .game-cursor {
  background-image: url("assets/cursor_talk.png");
  width: 44px;
  height: 40px;
  transform: translate(-8px, -28px);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(48rem, calc(100% - 2.5rem));
  text-align: center;
  padding: 2.5rem 1.5rem 1rem;
  border-radius: 1.25rem;
  background: radial-gradient(ellipse at 50% 42%, rgba(8, 12, 18, 0.58) 0%, rgba(8, 12, 18, 0.3) 58%, transparent 82%);
  pointer-events: none;
  overflow: visible;
}

.hero-content .cta {
  pointer-events: auto;
}

.logo {
  width: min(26.4rem, 86.4vw);
  margin: 0.75rem auto 0.85rem;
  filter:
    drop-shadow(0 0 4px rgba(122, 208, 255, 0.95))
    drop-shadow(0 0 14px rgba(62, 183, 255, 0.75))
    drop-shadow(0 0 32px rgba(46, 150, 255, 0.55))
    drop-shadow(0 0 54px rgba(30, 120, 255, 0.35))
    drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease-out) 0.15s, transform 1s var(--ease-out) 0.15s;
  animation: logo-azure 3.4s ease-in-out infinite;
}

@keyframes logo-azure {
  0%, 100% {
    filter:
      drop-shadow(0 0 4px rgba(122, 208, 255, 0.9))
      drop-shadow(0 0 14px rgba(62, 183, 255, 0.7))
      drop-shadow(0 0 30px rgba(46, 150, 255, 0.45))
      drop-shadow(0 0 50px rgba(30, 120, 255, 0.28))
      drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
  }
  50% {
    filter:
      drop-shadow(0 0 6px rgba(180, 230, 255, 1))
      drop-shadow(0 0 20px rgba(90, 200, 255, 0.9))
      drop-shadow(0 0 40px rgba(62, 183, 255, 0.65))
      drop-shadow(0 0 70px rgba(40, 140, 255, 0.4))
      drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
  }
}

.headline {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease-out) 0.4s, transform 0.9s var(--ease-out) 0.4s;
}

.pitch {
  margin: 0 auto 1.25rem;
  max-width: 34rem;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: var(--muted);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease-out) 0.55s, transform 0.9s var(--ease-out) 0.55s;
}

.cta {
  --pull-x: 0px;
  --pull-y: 0px;
  display: inline-block;
  padding: 0.85rem 1.55rem;
  border: 1px solid rgba(212, 175, 92, 0.65);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(28, 36, 44, 0.55), rgba(12, 18, 24, 0.72));
  color: var(--gold-soft);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 1px rgba(94, 196, 200, 0.08), 0 10px 30px rgba(0, 0, 0, 0.35);
  transform: translate(var(--pull-x), var(--pull-y));
  transition: color 0.25s ease, border-color 0.25s ease, box-shadow 0.35s ease, opacity 0.9s var(--ease-out) 0.7s, transform 0.2s var(--ease-out);
  opacity: 0;
}

.cta:hover {
  color: var(--cream);
  border-color: var(--teal);
  box-shadow: 0 0 24px rgba(94, 196, 200, 0.28), 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hero.is-ready .logo,
.hero.is-ready .headline,
.hero.is-ready .pitch,
.hero.is-ready .cta {
  opacity: 1;
  transform: translateY(0);
}

.hero.is-ready .cta {
  transform: translate(var(--pull-x), var(--pull-y));
}

.look-hint {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(242, 235, 224, 0.45);
  opacity: 0;
  transition: opacity 0.8s ease 1.1s;
}

@media (max-height: 720px) {
  .logo {
    width: min(19.8rem, 74vw);
    margin-bottom: 0.55rem;
  }

  .look-hint {
    display: none;
  }

  .pitch {
    margin-bottom: 1rem;
  }
}

.hero.is-ready .look-hint {
  opacity: 1;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  z-index: 3;
  width: 1.6rem;
  height: 2.4rem;
  margin-left: -0.8rem;
  border: 1px solid rgba(232, 212, 160, 0.45);
  border-radius: 999px;
  display: grid;
  place-items: start center;
  padding-top: 0.45rem;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.8s ease 1.2s;
}

.hero.is-ready .scroll-cue {
  opacity: 1;
}

.scroll-cue span {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--gold);
  animation: cue-drop 1.8s var(--ease-out) infinite;
}

@keyframes cue-drop {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(0.85rem); opacity: 0.15; }
  100% { transform: translateY(0); opacity: 0; }
}

/* Chapter I */
.beat-ch1 {
  position: relative;
  padding: clamp(4rem, 10vh, 7rem) 1.25rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(212, 175, 92, 0.12), transparent 55%),
    linear-gradient(180deg, #101820 0%, #0c141c 100%);
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.beat-ch1.is-in {
  opacity: 1;
  transform: none;
}

.beat-inner {
  width: min(44rem, 100%);
  margin: 0 auto;
  text-align: center;
}

.beat-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
}

.beat-ch1 h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
}

.beat-status {
  margin: 0 auto 1.75rem;
  max-width: 34rem;
  color: var(--muted);
}

.iris {
  --iris-scale: 0.92;
  width: min(38rem, 100%);
  margin: 0 auto 1.5rem;
  aspect-ratio: 16 / 9;
  border-radius: 50% / 46%;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(94, 196, 200, 0.25), 0 20px 50px rgba(0, 0, 0, 0.45);
  transform: scale(var(--iris-scale));
  transition: transform 0.2s linear;
}

.iris img,
.iris video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.journal-link {
  margin: 0;
  font-size: 1.05rem;
}

.journal-link a {
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 175, 92, 0.45);
}

.journal-link a:hover {
  border-bottom-color: var(--teal);
}

/* Narrow chapter bands */
.chapter-band {
  position: relative;
  min-height: clamp(28vh, 34vh, 38vh);
  display: grid;
  align-items: end;
  overflow: hidden;
  background-image: var(--band-art);
  background-size: cover;
  background-position: center 40%;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
}

.chapter-band.is-in {
  opacity: 1;
  transform: none;
}

.chapter-band::before {
  content: "";
  position: absolute;
  inset: -3%;
  background-image: var(--band-art);
  background-size: cover;
  background-position: center 40%;
  transform: scale(1.08) translateY(var(--band-shift, 0px));
  will-change: transform;
  z-index: 0;
}

.band-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.grade-academy .band-shade {
  background: linear-gradient(90deg, rgba(18, 28, 40, 0.78) 0%, rgba(18, 28, 40, 0.35) 55%, rgba(40, 28, 18, 0.45) 100%);
}

.grade-dune .band-shade {
  background: linear-gradient(90deg, rgba(42, 24, 12, 0.8) 0%, rgba(42, 24, 12, 0.35) 60%, rgba(20, 16, 12, 0.5) 100%);
}

.grade-lunar .band-shade {
  background: linear-gradient(90deg, rgba(16, 28, 40, 0.82) 0%, rgba(20, 36, 52, 0.4) 55%, rgba(12, 18, 28, 0.55) 100%);
}

.grade-colony .band-shade {
  background: linear-gradient(90deg, rgba(12, 24, 36, 0.84) 0%, rgba(18, 40, 48, 0.4) 55%, rgba(10, 16, 28, 0.55) 100%);
}

.grade-core .band-shade {
  background: linear-gradient(90deg, rgba(12, 18, 24, 0.85) 0%, rgba(28, 22, 12, 0.4) 55%, rgba(8, 20, 24, 0.55) 100%);
}

.band-copy {
  position: relative;
  z-index: 2;
  padding: 2rem clamp(1.25rem, 4vw, 3.5rem) 2.2rem;
  max-width: 40rem;
}

.band-copy h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s var(--ease-out) 0.12s, transform 0.7s var(--ease-out) 0.12s;
}

.band-copy .state {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-soft);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s var(--ease-out) 0.25s, transform 0.7s var(--ease-out) 0.25s;
}

.chapter-band.is-in .band-copy h2,
.chapter-band.is-in .band-copy .state {
  opacity: 1;
  transform: none;
}

.grade-academy .state { color: #9fd4e0; }
.grade-dune .state { color: #e8c48a; }
.grade-lunar .state { color: #c5d8e8; }
.grade-colony .state { color: #a8d4e0; }
.grade-core .state { color: var(--gold-soft); }

.chapter-gap {
  display: grid;
  place-items: center;
  padding: 1.4rem 0;
  color: rgba(232, 212, 160, 0.4);
  letter-spacing: 0.55em;
  font-size: 1.1rem;
  background: #0a1016;
}

/* Footer coda */
.coda {
  padding: 3.5rem 1.25rem 3rem;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(94, 196, 200, 0.1), transparent 50%),
    #080e14;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.coda.is-in {
  opacity: 1;
  transform: none;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.4rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.footer-links a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-links a:hover {
  border-bottom-color: currentColor;
}

.copyright {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(242, 235, 224, 0.45);
}

@media (max-width: 700px) {
  .hero-stage {
    cursor: auto;
  }

  .game-cursor {
    display: none;
  }

  .hotspot {
    width: 5.5rem;
    height: 5.5rem;
  }

  .hotspot img {
    width: 3rem;
  }

  .hotspot-spyglass {
    left: calc(var(--hx) + 180px);
    top: calc(var(--hy) + 180px);
  }

  .look-hint {
    display: none;
  }

  .chapter-band {
    min-height: 42vh;
    align-items: center;
  }

  .band-copy {
    text-align: left;
  }

  .story-arc {
    height: 3.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .logo,
  .headline,
  .pitch,
  .cta,
  .look-hint,
  .scroll-cue,
  .beat-ch1,
  .chapter-band,
  .band-copy h2,
  .band-copy .state,
  .coda,
  .story-arc {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  .logo {
    filter:
      drop-shadow(0 0 6px rgba(122, 208, 255, 0.95))
      drop-shadow(0 0 18px rgba(62, 183, 255, 0.7))
      drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
  }

  .scroll-cue span,
  .hotspot {
    animation: none;
  }

  .hero-layer,
  .chapter-band::before {
    transform: none !important;
  }

  .cta {
    --pull-x: 0px !important;
    --pull-y: 0px !important;
  }
}
