:root {
  --chrome: #D9E1E8;
  --asphalt: #111318;
  --blue: #6FC7FF;
  --magenta: #FF2F7D;
  --lime: #B8FF2C;
  --violet: #6D4CFF;
  --receipt: #F7F3E8;
  --border: 5px solid var(--asphalt);
  --shadow-hard: 12px 12px 0 var(--asphalt);
  --shadow-rebel: 13px 13px 0 var(--magenta), 24px 24px 0 var(--asphalt);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--asphalt);
  color: var(--asphalt);
  font-family: "Commissioner", Inter, system-ui, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  z-index: 20;
  background:
    radial-gradient(circle at 25% 18%, rgba(255,255,255,.9) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 62%, rgba(255,47,125,.75) 0 1px, transparent 2px),
    repeating-linear-gradient(100deg, transparent 0 12px, rgba(17,19,24,.18) 13px 14px);
  background-size: 34px 34px, 48px 48px, 100% 100%;
  mix-blend-mode: multiply;
}

.route-spine {
  position: fixed;
  left: 0;
  top: 0;
  width: 70px;
  height: 100vh;
  z-index: 30;
  border-right: 5px solid var(--asphalt);
  background: linear-gradient(90deg, var(--chrome), var(--receipt) 42%, var(--blue) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  box-shadow: 9px 0 0 var(--magenta);
}

.route-thread {
  position: absolute;
  top: 0;
  width: 9px;
  height: 8%;
  background: var(--magenta);
  border-left: 3px solid var(--asphalt);
  border-right: 3px solid var(--asphalt);
  transform-origin: top;
  transition: height .25s linear;
}

.route-stamp {
  width: 44px;
  height: 44px;
  border: 4px solid var(--asphalt);
  background: var(--receipt);
  font-family: "Noto Serif JP", serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--asphalt);
  box-shadow: 5px 5px 0 var(--asphalt);
  z-index: 2;
  cursor: pointer;
  transform: rotate(-5deg);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.route-stamp.is-active,
.route-stamp.is-complete {
  background: var(--lime);
  transform: rotate(6deg) scale(1.08);
  box-shadow: 5px 5px 0 var(--magenta);
}

.quest-stack { margin-left: 70px; }

.quest-block {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  border-bottom: 7px solid var(--asphalt);
  padding: clamp(32px, 5vw, 72px);
  isolation: isolate;
  background:
    linear-gradient(135deg, rgba(217,225,232,.88), rgba(247,243,232,.9) 28%, rgba(111,199,255,.58) 43%, rgba(217,225,232,.95) 60%, rgba(109,76,255,.32)),
    repeating-linear-gradient(0deg, rgba(17,19,24,.08) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(17,19,24,.08) 0 1px, transparent 1px 32px);
}

.quest-block::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(-18deg, transparent 0 16px, rgba(255,47,125,.15) 17px 23px, transparent 24px 44px);
  clip-path: polygon(0 82%, 100% 63%, 100% 100%, 0 100%);
}

.chrome-panel {
  border: var(--border);
  background:
    linear-gradient(112deg, #F7F3E8 0%, #D9E1E8 18%, #6FC7FF 28%, #F7F3E8 39%, #D9E1E8 55%, #6D4CFF 73%, #D9E1E8 100%);
  box-shadow: var(--shadow-hard);
  position: relative;
}

.chrome-panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed rgba(17,19,24,.42);
  pointer-events: none;
}

.seam-label, .sticker, .destination-sign, .route-plate span, .route-plate em {
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.seam-label {
  position: absolute;
  top: 12px;
  left: 18px;
  padding: 9px 16px;
  border: 4px solid var(--asphalt);
  background: var(--lime);
  transform: rotate(-2deg);
  z-index: 3;
}

.sticker {
  position: absolute;
  right: 9vw;
  top: 9vh;
  padding: 12px 18px;
  border: 4px solid var(--asphalt);
  background: var(--magenta);
  color: var(--receipt);
  box-shadow: 8px 8px 0 var(--asphalt);
  transform: rotate(9deg);
  z-index: 5;
}

.title-plate {
  width: min(980px, 86vw);
  padding: clamp(28px, 5vw, 62px);
  margin-top: 28px;
  transform: translateX(-18px) rotate(-1deg);
  box-shadow: var(--shadow-rebel);
}

.kicker {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(16px, 2vw, 26px);
  margin: 0 0 10px;
  color: var(--violet);
  font-weight: 700;
}

h1, h2 {
  font-family: "Bebas Neue", Impact, sans-serif;
  line-height: .82;
  margin: 0;
  letter-spacing: .01em;
  text-transform: uppercase;
}

h1 { font-size: clamp(82px, 19vw, 250px); text-shadow: 6px 6px 0 var(--lime), 11px 11px 0 var(--asphalt); }
h2 { font-size: clamp(58px, 10vw, 148px); text-shadow: 5px 5px 0 var(--blue); }

.chapter-copy {
  max-width: 760px;
  font-size: clamp(18px, 2vw, 27px);
  line-height: 1.12;
  font-weight: 700;
  margin: 24px 0 0;
}

.iso-stage {
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.19,1,.22,1), opacity .5s ease;
}

.gate-tile {
  position: absolute;
  width: clamp(330px, 43vw, 650px);
  height: clamp(250px, 35vw, 470px);
  right: 5vw;
  bottom: 7vh;
  transform: rotateX(58deg) rotateZ(-32deg) translateY(90px);
  opacity: .86;
}

.quest-block.is-active .gate-tile,
.quest-block.is-active .station-scene,
.quest-block.is-active .duel-icons,
.quest-block.is-active .water-tank,
.quest-block.is-active .popup-city { opacity: 1; }

.city-base, .platform, .fold {
  position: absolute;
  inset: 18%;
  border: var(--border);
  background: var(--receipt);
  box-shadow: 18px 18px 0 var(--asphalt), 28px 28px 0 var(--magenta);
}

.tower { position: absolute; width: 92px; border: var(--border); background: var(--chrome); box-shadow: 10px 10px 0 var(--asphalt); }
.tower span { display: block; width: 28px; height: 18px; border: 3px solid var(--asphalt); background: var(--blue); margin: 10px; float: left; }
.tower-a { height: 185px; left: 25%; top: 2%; transform: translateZ(60px); }
.tower-b { height: 135px; right: 22%; top: 20%; transform: translateZ(45px); background: var(--violet); }
.manhole-ring { position: absolute; width: 92px; height: 92px; border: 13px solid var(--asphalt); border-radius: 50%; background: var(--chrome); left: 45%; bottom: 24%; box-shadow: inset 0 0 0 8px var(--magenta); }
.heart-dish { position: absolute; right: 28%; top: 0; width: 54px; height: 48px; background: var(--magenta); clip-path: polygon(50% 100%, 0 38%, 15% 5%, 50% 22%, 85% 5%, 100% 38%); border: 4px solid var(--asphalt); }
.rail-beam { position: absolute; left: 4%; right: 0; top: 58%; height: 33px; background: var(--asphalt); border: 4px solid var(--lime); transform: rotate(5deg); }

.magenta-cable { position: absolute; height: 22px; background: var(--magenta); border: 5px solid var(--asphalt); box-shadow: 8px 8px 0 var(--lime); z-index: 4; transform-origin: left center; }
.cable-a { width: 55vw; left: 2vw; bottom: -8px; transform: rotate(-4deg); }
.cable-b { width: 72vw; left: 16vw; top: -12px; transform: rotate(3deg); }
.cable-c { width: 80vw; left: 5vw; bottom: 17vh; transform: rotate(-2deg); }

.destination-sign {
  display: inline-block;
  padding: 14px 22px;
  background: var(--lime);
  border: 5px solid var(--asphalt);
  box-shadow: 9px 9px 0 var(--asphalt);
  font-size: clamp(16px, 2vw, 27px);
}
.chrome-gate .destination-sign { position: absolute; right: 8vw; top: 53vh; transform: rotate(2deg); }

.route-plate {
  width: min(650px, 84vw);
  padding: 18px 22px;
  display: grid;
  gap: 4px;
  transform: rotate(-1deg) translateX(-18px);
}
.route-plate strong { font-family: "Bebas Neue"; font-size: clamp(38px, 6vw, 72px); line-height: .9; }
.route-plate em { font-style: normal; font-size: 13px; }

.section-number {
  position: absolute;
  right: 4vw;
  top: 1vh;
  font-family: "Bebas Neue";
  font-size: clamp(170px, 30vw, 420px);
  color: var(--magenta);
  -webkit-text-stroke: 5px var(--asphalt);
  opacity: .95;
  line-height: .8;
}

.scene-text { position: relative; z-index: 2; width: min(850px, 75vw); margin-top: 9vh; }
.right-slam { margin-left: auto; background: rgba(247,243,232,.82); border: var(--border); padding: 26px; box-shadow: -12px 12px 0 var(--asphalt); transform: rotate(1deg); }

.station-scene {
  position: absolute;
  right: 4vw;
  bottom: 8vh;
  width: min(680px, 55vw);
  height: 360px;
  transform: rotateX(58deg) rotateZ(-25deg) translateY(95px);
  opacity: .45;
}
.platform { inset: 28% 4% 12% 2%; background: repeating-linear-gradient(90deg, var(--chrome) 0 34px, var(--receipt) 35px 68px); }
.ticket { position: absolute; width: 150px; height: 96px; padding: 14px; border: 5px solid var(--asphalt); background: var(--receipt); font-weight: 800; box-shadow: 8px 8px 0 var(--magenta); }
.ticket-left { left: 20%; top: 18%; transform: rotate(-8deg); }
.ticket-right { right: 18%; top: 4%; transform: rotate(11deg); background: var(--lime); }
.signpost { position: absolute; left: 38%; bottom: 18%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 4px solid var(--asphalt); background: var(--blue); font-weight: 800; }
.signpost b { font-size: 44px; }
.train-window { position: absolute; width: 70px; height: 44px; border: 4px solid var(--asphalt); background: var(--blue); top: 4%; animation: flicker 1.7s infinite steps(2); }
.window-one { left: 5%; } .window-two { left: 17%; animation-delay: .4s; } .window-three { left: 29%; animation-delay: .9s; }
.arrow-row { position: absolute; left: 9vw; bottom: 8vh; display: flex; gap: 18px; }
.arrow-row span { width: 70px; height: 44px; background: var(--lime); border: 4px solid var(--asphalt); clip-path: polygon(0 20%, 58% 20%, 58% 0, 100% 50%, 58% 100%, 58% 80%, 0 80%); opacity: .25; transition: opacity .25s ease, transform .25s ease; }
.quest-block.is-active .arrow-row span { opacity: 1; transform: translateX(8px); }
.quest-block.is-active .arrow-row span:nth-child(2) { transition-delay: .12s; } .quest-block.is-active .arrow-row span:nth-child(3) { transition-delay: .24s; } .quest-block.is-active .arrow-row span:nth-child(4) { transition-delay: .36s; } .quest-block.is-active .arrow-row span:nth-child(5) { transition-delay: .48s; }

.vow-fragment { position: absolute; left: 8vw; bottom: 4vh; padding: 16px 20px; border: 4px solid var(--asphalt); background: var(--receipt); font-family: "Noto Serif JP", serif; font-weight: 700; font-size: clamp(18px, 2.2vw, 31px); box-shadow: 8px 8px 0 var(--violet); transform: rotate(-2deg); z-index: 3; }

.crosswalk-duel { background-color: var(--chrome); }
.crosswalk-stripes { position: absolute; inset: 0; display: grid; align-content: center; gap: 18px; transform: rotate(-12deg) scale(1.2); opacity: .8; }
.crosswalk-stripes i { height: 52px; background: var(--receipt); border-top: 5px solid var(--asphalt); border-bottom: 5px solid var(--asphalt); box-shadow: 0 10px 0 var(--blue); }
.duel-icons { position: absolute; left: 8vw; bottom: 10vh; width: min(560px, 46vw); height: 330px; transform: rotateX(55deg) rotateZ(-31deg); opacity: .5; }
.barricade { position: absolute; inset: 40% 4% 36%; border: var(--border); background: repeating-linear-gradient(45deg, var(--magenta) 0 24px, var(--receipt) 25px 48px); box-shadow: 12px 12px 0 var(--asphalt); }
.traffic-light { position: absolute; left: 10%; top: 2%; width: 70px; padding: 8px; border: 5px solid var(--asphalt); background: var(--asphalt); box-shadow: 9px 9px 0 var(--violet); }
.traffic-light span { display: block; width: 44px; height: 44px; margin: 8px auto; border-radius: 50%; border: 3px solid var(--receipt); background: var(--magenta); }
.traffic-light span:nth-child(2) { background: var(--blue); } .traffic-light span:nth-child(3) { background: var(--lime); animation: flicker 1s infinite steps(2); }
.shoe { position: absolute; width: 98px; height: 45px; border: 5px solid var(--asphalt); background: var(--receipt); border-radius: 45px 14px 12px 12px; box-shadow: 8px 8px 0 var(--asphalt); }
.shoe-a { left: 48%; top: 16%; transform: rotate(18deg); } .shoe-b { left: 62%; top: 45%; transform: rotate(-14deg); background: var(--lime); }
.sticker-tear { position: absolute; right: 4%; top: 10%; padding: 14px; border: 4px solid var(--asphalt); background: var(--magenta); color: var(--receipt); font-weight: 800; transform: rotate(12deg); }

.rooftop-inventory { background: linear-gradient(145deg, var(--violet), var(--chrome) 35%, var(--receipt) 62%, var(--blue)); }
.inventory-orbit { position: absolute; inset: 18vh 5vw 8vh 44vw; }
.token { position: absolute; width: 145px; min-height: 132px; border: var(--border); background: var(--receipt); box-shadow: 9px 9px 0 var(--asphalt); padding: 12px; font-weight: 800; text-transform: uppercase; transition: transform .6s cubic-bezier(.19,1,.22,1); }
.token span { display: block; height: 72px; border: 4px solid var(--asphalt); background: var(--chrome); margin-bottom: 10px; }
.token-ring { left: 4%; top: 8%; transform: rotate(-8deg); } .token-ring span { border-radius: 50%; box-shadow: inset 0 0 0 18px var(--receipt), inset 0 0 0 27px var(--magenta); }
.token-receipt { right: 12%; top: 0; transform: rotate(7deg); } .token-receipt span { background: radial-gradient(circle at 65% 35%, var(--lime) 0 24px, var(--receipt) 25px 38px, var(--asphalt) 39px 43px, transparent 44px), var(--blue); }
.token-key { left: 0; bottom: 16%; transform: rotate(10deg); } .token-key span { clip-path: polygon(0 35%, 55% 35%, 55% 18%, 78% 18%, 78% 35%, 100% 35%, 100% 60%, 38% 60%, 38% 82%, 0 82%); background: var(--lime); }
.token-bouquet { right: 5%; bottom: 8%; transform: rotate(-11deg); } .token-bouquet span { clip-path: polygon(50% 0, 100% 80%, 50% 100%, 0 80%); background: repeating-linear-gradient(45deg, var(--receipt) 0 10px, var(--magenta) 11px 20px); }
.token-charm { left: 34%; top: 38%; transform: rotate(3deg); } .token-charm span { border-radius: 14px; background: linear-gradient(var(--blue), var(--violet)); }
.quest-block.is-active .token { transform: translateY(-14px) rotate(var(--r, 0deg)); }
.water-tank { position: absolute; left: 30%; top: 18%; width: 220px; height: 220px; border: var(--border); border-radius: 50% 50% 18px 18px; background: var(--chrome); box-shadow: 16px 16px 0 var(--asphalt); opacity: .75; }
.water-tank i { position: absolute; left: 42%; bottom: -58px; width: 36px; height: 58px; background: var(--asphalt); }

.dawn-block { background: linear-gradient(160deg, var(--asphalt) 0 18%, var(--violet) 18% 33%, var(--blue) 34% 57%, var(--receipt) 58% 100%); color: var(--receipt); }
.dawn-block .route-plate, .dawn-block .final-plate { color: var(--asphalt); }
.popup-city { position: absolute; inset: 12vh 6vw 8vh 42vw; transform: rotateX(58deg) rotateZ(-29deg); opacity: .6; }
.fold-left, .fold-right { inset: auto; width: 280px; height: 300px; bottom: 9%; background: var(--receipt); }
.fold-left { left: 0; transform: skewY(-8deg); } .fold-right { right: 6%; transform: skewY(8deg); background: var(--chrome); }
.courthouse { position: absolute; left: 26%; top: 12%; width: 250px; height: 190px; border: var(--border); background: var(--lime); box-shadow: 14px 14px 0 var(--asphalt); }
.courthouse::before { content: ""; position: absolute; left: -15px; right: -15px; top: -48px; height: 48px; background: var(--magenta); border: var(--border); clip-path: polygon(50% 0,100% 100%,0 100%); }
.courthouse span { float: left; width: 38px; height: 112px; margin: 42px 20px 0; background: var(--receipt); border: 4px solid var(--asphalt); }
.vending-machine { position: absolute; right: 4%; top: 28%; width: 115px; height: 185px; border: var(--border); background: var(--magenta); color: var(--receipt); font-family: "Bebas Neue"; font-size: 42px; writing-mode: vertical-rl; text-align: center; box-shadow: 10px 10px 0 var(--asphalt); }
.dawn-sun { position: absolute; right: 17%; top: 4%; width: 120px; height: 120px; border: var(--border); border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 18px var(--blue), 12px 12px 0 var(--asphalt); }
.final-plate { width: min(760px, 82vw); padding: clamp(28px, 5vw, 56px); margin-top: 24vh; box-shadow: 12px 12px 0 var(--lime), 24px 24px 0 var(--asphalt); }
.destination-sign.final { margin-top: 28px; position: static; transform: rotate(-1deg); color: var(--asphalt); }

.quest-block:not(.is-active) .chrome-panel,
.quest-block:not(.is-active) .scene-text,
.quest-block:not(.is-active) .section-number { transform: translateY(52px) rotate(-1deg); opacity: .7; }
.quest-block .chrome-panel,
.quest-block .scene-text,
.quest-block .section-number { transition: transform .6s cubic-bezier(.22,1.2,.36,1), opacity .5s ease; }

@keyframes flicker { 0%, 48% { opacity: 1; } 50%, 56% { opacity: .25; } 58%, 100% { opacity: 1; } }

@media (max-width: 820px) {
  .route-spine { width: 48px; }
  .route-stamp { width: 34px; height: 34px; font-size: 13px; }
  .quest-stack { margin-left: 48px; }
  .quest-block { padding: 54px 22px; }
  .gate-tile, .station-scene, .duel-icons, .inventory-orbit, .popup-city { position: relative; inset: auto; width: 88vw; height: 300px; margin-top: 42px; transform: rotateX(55deg) rotateZ(-28deg); }
  .scene-text, .right-slam { width: 100%; margin: 44px 0 0; }
  .section-number { top: 4vh; right: -4vw; opacity: .45; }
  .inventory-orbit { height: 680px; }
  .token { transform: scale(.82); }
  .final-plate { margin-top: 8vh; }
  .vow-fragment { position: relative; left: auto; bottom: auto; margin-top: 34px; }
}
