:root {
  --sky-1: #070912;
  --sky-2: #17142b;
  --ink: #f8f1df;
  --warm: #f2c078;
  --line: rgba(255,255,255,.12);
  --speed-multiplier: 1;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; }
body {
  min-height: 100vh;
  overflow: hidden;
  background: var(--sky-1);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button { font: inherit; }

.experience {
  position: relative;
  width: 100vw;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 22% 24%, rgba(122,105,194,.18), transparent 24%),
    linear-gradient(180deg, #080914 0%, #111127 48%, #24172a 72%, #0b0b11 100%);
}

.sky { position: absolute; inset: 0; z-index: -6; overflow: hidden; }
.moon {
  position: absolute;
  width: clamp(180px, 20vw, 330px);
  aspect-ratio: 1;
  left: 9vw;
  top: 9vh;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 32%, #fff8d8 0 9%, transparent 10%),
    radial-gradient(circle at 62% 67%, rgba(102,82,84,.2) 0 12%, transparent 13%),
    radial-gradient(circle at 33% 67%, rgba(105,89,96,.17) 0 8%, transparent 9%),
    radial-gradient(circle at 40% 35%, #fff4d4, #e5c7ac 58%, #a98486 100%);
  box-shadow: 0 0 35px rgba(255,224,180,.2), 0 0 120px rgba(255,200,180,.11);
  opacity: .88;
}

.stars { position: absolute; inset: 0; opacity: .55; }
.stars::before, .stars::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
}
.stars-a::before {
  left: 5%; top: 12%;
  box-shadow: 95px 80px #fff, 210px 28px #fff, 410px 115px #fff, 590px 47px #fff, 760px 144px #fff,
    930px 76px #fff, 1120px 26px #fff, 1300px 160px #fff, 1470px 68px #fff, 1660px 121px #fff;
}
.stars-a::after {
  left: 1%; top: 39%;
  box-shadow: 130px 12px #fff, 355px 98px #fff, 505px 38px #fff, 740px 165px #fff, 910px 50px #fff,
    1190px 120px #fff, 1380px 20px #fff, 1590px 94px #fff;
}
.stars-b { animation: twinkle 3.2s ease-in-out infinite alternate; opacity: .25; }
.stars-b::before { left: 12%; top: 24%; box-shadow: 165px 30px #fff, 500px 95px #fff, 820px 15px #fff, 1210px 76px #fff, 1490px 40px #fff; }
@keyframes twinkle { to { opacity: .75; } }

.city {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 15vh;
  width: 220%;
  transform: translate3d(0,0,0);
  background-repeat: repeat-x;
  will-change: transform;
}

.city-far {
  z-index: -5;
  height: 44vh;
  opacity: .42;
  background-image:
    linear-gradient(90deg,
      transparent 0 1%, rgba(34,31,60,.92) 1% 7%, transparent 7% 9%, rgba(31,29,55,.95) 9% 15%, transparent 15% 17%,
      rgba(38,31,59,.95) 17% 22%, transparent 22% 24%, rgba(29,28,51,.95) 24% 31%, transparent 31% 33%,
      rgba(37,31,57,.95) 33% 40%, transparent 40% 42%, rgba(31,27,48,.95) 42% 49%, transparent 49% 51%,
      rgba(40,32,57,.95) 51% 57%, transparent 57% 60%, rgba(31,28,49,.95) 60% 66%, transparent 66% 69%,
      rgba(35,29,54,.95) 69% 76%, transparent 76% 79%, rgba(30,27,47,.95) 79% 85%, transparent 85% 89%, rgba(39,31,56,.95) 89% 96%, transparent 96% 100%);
  background-size: 900px 100%;
  animation: cityScrollFar calc(54s / var(--speed-multiplier)) linear infinite;
}
.city-far::after {
  content: ""; position: absolute; inset: 16% 0 8%; opacity: .22;
  background-image: radial-gradient(circle, #ffd18a 0 1px, transparent 1.7px);
  background-size: 38px 32px;
  mix-blend-mode: screen;
}

.city-mid {
  z-index: -4;
  height: 36vh;
  opacity: .78;
  background-image:
    linear-gradient(90deg,
      #101020 0 8%, transparent 8% 10%, #151122 10% 19%, transparent 19% 21%, #11101e 21% 27%, transparent 27% 29%,
      #171223 29% 38%, transparent 38% 40%, #100f1c 40% 46%, transparent 46% 49%, #161122 49% 58%, transparent 58% 60%,
      #11101f 60% 70%, transparent 70% 73%, #161121 73% 81%, transparent 81% 84%, #100f1d 84% 92%, transparent 92% 95%, #151121 95% 100%);
  background-size: 760px 100%;
  animation: cityScrollMid calc(30s / var(--speed-multiplier)) linear infinite;
}
.city-mid::after {
  content: ""; position: absolute; inset: 12% 0 10%; opacity: .34;
  background-image: linear-gradient(90deg, transparent 0 12px, rgba(255,197,103,.55) 12px 15px, transparent 15px 35px);
  background-size: 35px 28px;
}

.city-near {
  z-index: -3;
  height: 27vh;
  bottom: 14vh;
  opacity: .98;
  background-image:
    linear-gradient(90deg,
      #080911 0 10%, transparent 10% 12%, #0b0b13 12% 22%, transparent 22% 25%, #080910 25% 32%, transparent 32% 34%,
      #0c0b13 34% 47%, transparent 47% 50%, #080910 50% 59%, transparent 59% 62%, #0b0b13 62% 72%, transparent 72% 75%,
      #080910 75% 87%, transparent 87% 90%, #0c0b13 90% 100%);
  background-size: 620px 100%;
  animation: cityScrollNear calc(18s / var(--speed-multiplier)) linear infinite;
}
.city-near::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: -18px; height: 20px;
  background: #07080d; box-shadow: 0 -10px 24px rgba(0,0,0,.6);
}

@keyframes cityScrollFar { to { transform: translate3d(-900px,0,0); } }
@keyframes cityScrollMid { to { transform: translate3d(-760px,0,0); } }
@keyframes cityScrollNear { to { transform: translate3d(-620px,0,0); } }

.street {
  position: absolute;
  z-index: -2;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18vh;
  background: linear-gradient(180deg, #101015 0%, #09090d 55%, #050507 100%);
  border-top: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}
.street::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.035), transparent 60%);
  transform: skewX(-20deg);
}
.road-lines {
  position: absolute; left: 0; right: 0; top: 47%; height: 5px;
  background: repeating-linear-gradient(90deg, transparent 0 65px, rgba(248,204,112,.8) 65px 125px, transparent 125px 190px);
  background-size: 190px 5px;
  animation: roadScroll calc(1.1s / var(--speed-multiplier)) linear infinite;
  filter: drop-shadow(0 0 5px rgba(248,204,112,.24));
}
.street-glow {
  position: absolute; left: 0; right: 0; top: -45px; height: 100px;
  background: linear-gradient(180deg, rgba(255,125,80,.08), transparent 70%);
  filter: blur(15px);
}
@keyframes roadScroll { to { background-position-x: -190px; } }


.runner-wrap {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: calc(8vh - 4px);
  width: 240px;
  height: 330px;
  transform: translateX(-50%);
  transform-origin: center bottom;
  pointer-events: none;
  filter: drop-shadow(0 18px 12px rgba(0,0,0,.45));
}

/*
  The viewport below is EXACTLY one frame wide.
  The sprite strip contains 10 frames:
  10 × 240px = 2400px.
*/
.runner {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 240px;
  height: 330px;
  overflow: hidden;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.runner-strip {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 2400px;
  height: 330px;
  max-width: none;
  animation: runFrames calc(.72s / var(--speed-multiplier)) steps(10, end) infinite;
  will-change: transform;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.runner-shadow {
  position: absolute;
  width: 145px;
  height: 20px;
  left: 48px;
  bottom: 4px;
  border-radius: 50%;
  background: rgba(0,0,0,.58);
  filter: blur(8px);
  animation: shadowPulse calc(.36s / var(--speed-multiplier)) ease-in-out infinite alternate;
}

@keyframes runFrames {
  from { transform: translate3d(0,0,0); }
  to   { transform: translate3d(-2400px,0,0); }
}

@keyframes shadowPulse {
  to { transform: scaleX(.78); opacity: .45; }
}

.story {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: grid;
  place-items: center end;
  padding: 8vh clamp(28px, 7vw, 120px) 18vh 38vw;
  pointer-events: none;
}
.story-card {
  width: min(700px, 100%);
  text-align: left;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .9s ease, transform .9s ease, filter .9s ease;
  text-shadow: 0 4px 30px rgba(0,0,0,.65);
}
.story-card.is-out { opacity: 0; transform: translateY(18px); filter: blur(5px); }
.chapter {
  margin: 0 0 18px;
  color: rgba(242,192,120,.74);
  font-size: clamp(10px, .9vw, 13px);
  letter-spacing: .42em;
  font-weight: 700;
}
.story h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(54px, 7vw, 118px);
  line-height: .86;
  font-weight: 400;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.subtitle {
  margin: 26px 0 0;
  max-width: 620px;
  color: rgba(248,241,223,.76);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(18px, 1.7vw, 28px);
  line-height: 1.5;
}

.hud {
  position: absolute;
  z-index: 8;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px clamp(18px, 3vw, 42px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(5,6,12,.48), transparent);
  backdrop-filter: blur(3px);
}
.brand { font-size: 11px; letter-spacing: .3em; font-weight: 800; opacity: .7; }
.hud-actions { display: flex; gap: 8px; }
.hud-btn {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(8,8,16,.42);
  color: rgba(255,255,255,.76);
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 10px;
  letter-spacing: .13em;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.hud-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.progress {
  position: absolute;
  z-index: 8;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,.06);
}
.progress span { display: block; width: 0; height: 100%; background: rgba(242,192,120,.88); }


/* =========================================================
   CLEAN INTRO SCREEN
   The main scene is completely covered until the visitor
   presses ENTER THE CITY, preventing overlapping titles.
========================================================= */

.start-screen {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 28px;

  /* Deliberately opaque: nothing from the main scene shows through. */
  background:
    radial-gradient(circle at 50% 38%, #171529 0%, #0b0c18 42%, #05060c 78%, #030408 100%);

  transition:
    opacity .7s ease,
    visibility .7s ease;
}

.start-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Very restrained intro stars */
.start-stars {
  position: absolute;
  inset: 0;
  opacity: .38;
  pointer-events: none;
}

.start-stars::before,
.start-stars::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
}

.start-stars::before {
  left: 8%;
  top: 13%;
  box-shadow:
    120px 48px rgba(255,255,255,.55),
    280px 120px rgba(255,255,255,.32),
    430px 30px rgba(255,255,255,.58),
    610px 150px rgba(255,255,255,.34),
    760px 64px rgba(255,255,255,.52),
    920px 115px rgba(255,255,255,.28),
    1090px 38px rgba(255,255,255,.48),
    1270px 142px rgba(255,255,255,.31),
    1450px 55px rgba(255,255,255,.44);
}

.start-stars::after {
  left: 2%;
  top: 56%;
  box-shadow:
    180px 40px rgba(255,255,255,.25),
    410px 90px rgba(255,255,255,.36),
    650px 20px rgba(255,255,255,.22),
    880px 100px rgba(255,255,255,.34),
    1180px 48px rgba(255,255,255,.27),
    1390px 105px rgba(255,255,255,.31);
}

/* Small atmospheric moon, positioned away from the title */
.start-moon {
  position: absolute;
  left: clamp(-70px, 4vw, 70px);
  top: clamp(90px, 13vh, 150px);
  width: clamp(130px, 16vw, 230px);
  aspect-ratio: 1;
  border-radius: 50%;

  background:
    radial-gradient(circle at 37% 31%, rgba(255,250,221,.82) 0 8%, transparent 9%),
    radial-gradient(circle at 62% 67%, rgba(83,69,81,.20) 0 12%, transparent 13%),
    radial-gradient(circle at 36% 67%, rgba(83,69,81,.16) 0 8%, transparent 9%),
    radial-gradient(circle at 42% 37%, #f7e7c6, #cfad99 64%, #866e7c 100%);

  opacity: .48;
  box-shadow: 0 0 65px rgba(247,220,183,.07);
}

/* Low skyline only — no runner, no story text */
.start-skyline {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 0;
  height: 25vh;
  opacity: .46;

  background:
    linear-gradient(90deg,
      #070810 0 8%, transparent 8% 10%,
      #090a13 10% 19%, transparent 19% 22%,
      #06070e 22% 31%, transparent 31% 34%,
      #0a0912 34% 45%, transparent 45% 48%,
      #070810 48% 58%, transparent 58% 61%,
      #0a0912 61% 73%, transparent 73% 76%,
      #07080f 76% 87%, transparent 87% 90%,
      #090a13 90% 100%);
}

.start-skyline::after {
  content: "";
  position: absolute;
  inset: 24% 0 8%;
  opacity: .22;
  background-image:
    radial-gradient(circle, rgba(242,192,120,.85) 0 1px, transparent 1.6px);
  background-size: 42px 32px;
}

/* Intro content */
.start-panel {
  position: relative;
  z-index: 3;
  width: min(600px, 100%);
  text-align: center;
  padding: 34px 24px;
}

.start-kicker {
  display: block;
  margin-bottom: 21px;

  color: rgba(242,192,120,.78);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .42em;
}

.start-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 8.2vw, 112px);
  font-weight: 400;
  line-height: .78;
  letter-spacing: -.045em;
  color: #fbf3e2;
  text-shadow: 0 18px 55px rgba(0,0,0,.40);
}

.start-panel h2 span {
  display: block;
  margin-bottom: 14px;

  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: .18em;
  font-weight: 800;
  letter-spacing: .46em;
  color: rgba(255,255,255,.50);
}

.start-rule {
  width: 64px;
  height: 1px;
  margin: 30px auto 24px;
  background: rgba(242,192,120,.72);
}

.start-panel p {
  max-width: 430px;
  margin: 0 auto 30px;

  color: rgba(255,255,255,.58);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(16px, 1.4vw, 20px);
  font-style: italic;
  line-height: 1.65;
}

.start-panel button {
  appearance: none;
  min-width: 190px;

  border: 1px solid rgba(242,192,120,.68);
  background: rgba(242,192,120,.09);
  color: #f7d79f;

  border-radius: 999px;
  padding: 15px 24px;

  font-size: 10px;
  font-weight: 800;
  letter-spacing: .20em;

  cursor: pointer;

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.025),
    0 12px 35px rgba(0,0,0,.20);

  transition:
    transform .2s ease,
    background .2s ease,
    border-color .2s ease;
}

.start-panel button:hover,
.start-panel button:focus-visible {
  transform: translateY(-2px);
  background: rgba(242,192,120,.16);
  border-color: rgba(242,192,120,.92);
  outline: none;
}

.start-panel small {
  display: block;
  margin-top: 18px;

  color: rgba(255,255,255,.28);
  font-size: 10px;
  letter-spacing: .04em;
}

@media (max-width: 820px) {
  .moon { left: -35px; top: 12vh; }
  .runner-wrap { left: 50%; bottom: 7vh; transform: translateX(-50%) scale(.78); transform-origin: center bottom; opacity: .94; }
  .story { padding: 14vh 22px 21vh 34vw; place-items: center end; }
  .story h1 { font-size: clamp(48px, 13vw, 78px); }
  .subtitle { font-size: 18px; }
  .city-far { height: 38vh; }
  .city-mid { height: 31vh; }
  .city-near { height: 24vh; }
}

@media (max-width: 520px) {
  .hud { align-items: flex-start; }
  .brand { max-width: 110px; line-height: 1.5; }
  .hud-btn { padding: 8px 9px; font-size: 9px; }
  .runner-wrap { left: 50%; transform: translateX(-50%) scale(.68); transform-origin: center bottom; opacity: .90; }
  .story { padding: 18vh 18px 22vh 26vw; }
  .chapter { letter-spacing: .27em; }
  .story h1 { font-size: clamp(44px, 15vw, 68px); }
  .subtitle { margin-top: 18px; font-size: 16px; }
}


@media (max-width: 520px) {
  .start-screen {
    padding: 20px;
  }

  .start-panel {
    padding: 20px 8px 72px;
  }

  .start-kicker {
    margin-bottom: 18px;
    font-size: 9px;
    letter-spacing: .31em;
  }

  .start-panel h2 {
    font-size: clamp(58px, 18vw, 82px);
    line-height: .82;
  }

  .start-panel h2 span {
    font-size: .17em;
    letter-spacing: .35em;
    margin-bottom: 12px;
  }

  .start-rule {
    margin: 25px auto 20px;
  }

  .start-panel p {
    max-width: 320px;
    margin-bottom: 26px;
    font-size: 16px;
  }

  .start-moon {
    left: -70px;
    top: 96px;
    width: 175px;
    opacity: .30;
  }

  .start-skyline {
    height: 22vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .city, .road-lines, .runner, .runner-shadow, .stars-b { animation-play-state: paused !important; }
  .story-card { transition: none; }
}
