:root {
  /* Font hierarchy: Inter in 400/600 weights for crisp Frutiger-clean readability and compact UI notes. Space Grotesk in 600/700 weights. */
  --asphalt: #17152B;
  --cream: #FFF2C7;
  --orange: #FF6B2C;
  --cyan: #22D3D6;
  --violet: #7657FF;
  --yellow: #FFD400;
  --ink: #070707;
  --display: 'Atkinson Hyperlegible', 'Arial Black', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --accent: 'Space Grotesk', 'Trebuchet MS', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--asphalt);
  color: var(--ink);
  font-family: var(--body);
  overflow-x: hidden;
}

.city-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background:
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(255,242,199,.12) 18px 20px),
    repeating-linear-gradient(90deg, transparent 0 24px, rgba(34,211,214,.10) 24px 26px),
    radial-gradient(circle at 20% 10%, rgba(118,87,255,.28), transparent 24%),
    radial-gradient(circle at 86% 45%, rgba(34,211,214,.22), transparent 20%);
  mix-blend-mode: screen;
}

.top-transfer {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--yellow);
  border: 4px solid var(--ink);
  box-shadow: 7px 7px 0 var(--ink);
  font-family: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.route-map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 520vh;
  z-index: 1;
  pointer-events: none;
}

#mainRoute {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 13;
  stroke-linecap: square;
  stroke-dasharray: 34 24;
  filter: drop-shadow(6px 6px 0 var(--ink));
}

.district {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 110px clamp(18px, 5vw, 70px) 60px;
  display: grid;
  align-items: center;
}

.hero-district { grid-template-columns: 1fr; }

.directory-panel {
  position: relative;
  width: min(1020px, 94vw);
  min-height: 650px;
  margin: auto;
  padding: clamp(28px, 5vw, 62px);
  background: var(--cream);
  border: 5px solid var(--ink);
  box-shadow: 16px 16px 0 var(--ink);
  isolation: isolate;
}

.animated-border::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 4px solid var(--cyan);
  pointer-events: none;
  clip-path: polygon(0 0, var(--trace, 20%) 0, var(--trace, 20%) 12px, 12px 12px, 12px var(--trace2, 70%), 0 var(--trace2, 70%));
  transition: clip-path .28s steps(3), border-color .2s steps(2);
}

.animated-border.is-hot::before { border-color: var(--orange); }

.shadow-slab {
  position: absolute;
  border: 5px solid var(--ink);
  z-index: -1;
}

.shadow-slab.cyan { width: 46%; height: 36%; right: -28px; top: 38px; background: var(--cyan); }
.shadow-slab.violet { width: 32%; height: 50%; left: -32px; bottom: -34px; background: var(--violet); }

.kiosk-label, .ticket-number, .route-warning, .maybe-sticker, .floating-sign, .cordless-stamp {
  font-family: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.kiosk-label {
  display: inline-block;
  background: var(--cyan);
  border: 4px solid var(--ink);
  padding: 9px 13px;
  box-shadow: 6px 6px 0 var(--ink);
}

h1, h2 {
  font-family: var(--display);
  font-weight: 800;
  line-height: .88;
  margin: 24px 0;
}

h1 { font-size: clamp(4.3rem, 12vw, 11.5rem); letter-spacing: -.08em; max-width: 780px; }
h1 span { color: var(--orange); }
h2 { font-size: clamp(2.5rem, 7vw, 6.8rem); letter-spacing: -.055em; }
p { font-size: clamp(1rem, 1.5vw, 1.28rem); line-height: 1.45; max-width: 680px; }

.hero-copy { background: var(--yellow); border: 4px solid var(--ink); padding: 16px; max-width: 600px; }

.map-block {
  position: absolute;
  right: 48px;
  bottom: 60px;
  width: 300px;
  height: 230px;
  border: 5px solid var(--ink);
  box-shadow: 10px 10px 0 var(--violet);
}

.orange-block { background: var(--orange); }

.ghost-void, .under-ghost, .small-ghost {
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 48% 48% 16% 16%;
  position: absolute;
}

.ghost-void { width: 92px; height: 122px; left: 88px; top: 50px; }
.ghost-void::before, .under-ghost::before, .small-ghost::before { content: ""; position: absolute; width: 12px; height: 12px; background: var(--ink); border-radius: 50%; left: 24px; top: 38px; box-shadow: 30px 0 0 var(--ink); }
.ghost-void::after, .under-ghost::after, .small-ghost::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 28px; background: radial-gradient(circle at 16px 0, transparent 17px, var(--cream) 18px); }

.mini-grid { position: absolute; inset: 14px; background: repeating-linear-gradient(90deg, transparent 0 45px, var(--ink) 45px 49px), repeating-linear-gradient(0deg, transparent 0 38px, var(--ink) 38px 42px); opacity: .35; }
.arrow-sign { position: absolute; right: 15px; top: 0; font-size: 6rem; font-weight: 800; }

.maybe-sticker { position: absolute; right: 250px; top: 128px; transform: rotate(-7deg); background: var(--yellow); border: 4px solid var(--ink); padding: 13px; box-shadow: 6px 6px 0 var(--ink); animation: drift 1.2s steps(2) infinite alternate; }

.transfer-key, .objects button, .floor-grid button {
  border: 4px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
}

.transfer-key { padding: 16px 20px; margin-top: 18px; background: var(--orange); font-size: 1rem; }
.transfer-key:hover, .objects button:hover, .floor-grid button:hover { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }

.floating-sign { position: absolute; border: 4px solid var(--ink); padding: 12px; box-shadow: 7px 7px 0 var(--ink); }
.sign-a { left: 8vw; bottom: 13vh; background: var(--cyan); transform: rotate(8deg); }
.sign-b { right: 7vw; top: 21vh; background: var(--violet); color: var(--cream); transform: rotate(-6deg); }

.clue-scene { grid-template-columns: repeat(12, 1fr); gap: 24px; }
.blob-panel, .elevator-panel, .underpass-arch, .signal-box, .inventory-ribbon {
  position: relative;
  background: var(--cream);
  border: 5px solid var(--ink);
  box-shadow: 14px 14px 0 var(--ink);
  padding: clamp(22px, 4vw, 42px);
}

.blob-panel { grid-column: 2 / 7; border-radius: 28px 80px 34px 54px; background: var(--yellow); }
.payphone { grid-column: 8 / 12; justify-self: center; width: 270px; height: 470px; background: var(--cyan); border: 5px solid var(--ink); box-shadow: 14px 14px 0 var(--violet); position: relative; padding: 22px; transform: rotate(3deg); }
.phone-top { background: var(--yellow); border: 4px solid var(--ink); padding: 14px; text-align: center; font-family: var(--accent); font-weight: 700; }
.receiver { height: 52px; margin: 28px 12px; border: 5px solid var(--ink); border-radius: 28px; background: var(--orange); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad span { aspect-ratio: 1; background: var(--cream); border: 3px solid var(--ink); }
.cordless-stamp { position: absolute; bottom: 28px; left: -20px; background: var(--orange); border: 4px solid var(--ink); padding: 10px; transform: rotate(-12deg); }

.crosswalk { position: absolute; left: 8%; bottom: 9%; width: 420px; height: 110px; transform: rotate(-14deg); }
.crosswalk span { display: inline-block; width: 52px; height: 100%; margin-right: 20px; background: var(--cream); border: 4px solid var(--ink); }
.crosswalk span:nth-child(even) { transform: translateY(34px); }

.elevator-panel { grid-column: 2 / 8; background: var(--violet); color: var(--cream); }
.floor-grid { display: grid; grid-template-columns: repeat(3, minmax(80px, 1fr)); gap: 15px; margin-top: 24px; }
.floor-grid button { background: var(--cream); padding: 20px; font-size: 1.4rem; }
.floor-grid button:nth-child(4) { background: var(--orange); animation: flicker .8s steps(2) infinite; }
.route-warning { grid-column: 8 / 12; align-self: start; background: var(--yellow); border: 5px solid var(--ink); padding: 22px; box-shadow: 11px 11px 0 var(--ink); font-size: clamp(1.5rem, 4vw, 3.6rem); line-height: .95; transform: rotate(5deg); }
.small-ghost { right: 12%; bottom: 15%; width: 70px; height: 90px; animation: popGhost 1.8s steps(2) infinite; }

.underpass-arch { grid-column: 4 / 11; min-height: 520px; background: var(--orange); border-radius: 220px 220px 26px 26px; overflow: hidden; }
.under-ghost { width: 110px; height: 145px; right: 20%; bottom: 70px; animation: popGhost 2.4s steps(3) infinite; }
.chevron-road { grid-column: 1 / 5; display: flex; gap: 18px; transform: rotate(-12deg); }
.chevron-road span { width: 70px; height: 170px; background: var(--yellow); border: 5px solid var(--ink); clip-path: polygon(0 0, 65% 0, 100% 50%, 65% 100%, 0 100%, 35% 50%); }

.antenna-scene { grid-column: 2 / 12; display: grid; grid-template-columns: 1fr 1.3fr; align-items: end; gap: 30px; }
.antenna { height: 520px; border-left: 12px solid var(--ink); position: relative; margin-left: 35%; }
.antenna::before { content: ""; position: absolute; left: -120px; top: 90px; width: 240px; height: 160px; border: 8px solid var(--cyan); border-bottom: 0; border-radius: 50% 50% 0 0; animation: signalPulse 1.1s steps(3) infinite; }
.antenna::after { content: ""; position: absolute; left: -80px; top: 12px; width: 160px; height: 110px; border: 8px solid var(--violet); border-bottom: 0; border-radius: 50% 50% 0 0; animation: signalPulse .9s steps(2) infinite reverse; }
.signal-box { background: var(--cyan); }
.boo-signal { display: flex; gap: 12px; }
.boo-signal span { display: grid; place-items: center; width: 96px; height: 96px; background: var(--yellow); border: 5px solid var(--ink); box-shadow: 7px 7px 0 var(--ink); font: 800 3.2rem var(--display); animation: flicker 1s steps(2) infinite; }
.boo-signal span:nth-child(2) { animation-delay: .18s; }
.boo-signal span:nth-child(3) { animation-delay: .36s; }
.skyline { position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: end; gap: 10px; padding: 0 40px; z-index: -1; }
.skyline i { flex: 1; height: var(--h, 190px); background: var(--ink); border: 4px solid var(--cream); }
.skyline i:nth-child(2) { --h: 280px; } .skyline i:nth-child(3) { --h: 150px; } .skyline i:nth-child(4) { --h: 330px; } .skyline i:nth-child(5) { --h: 220px; }

.inventory-district { min-height: 85vh; }
.inventory-ribbon { width: min(1100px, 94vw); margin: auto; background: var(--cream); }
.objects { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0; }
.objects button { padding: 15px 18px; background: var(--yellow); }
.objects button:nth-child(even) { background: var(--cyan); }
#inventoryNote { background: var(--orange); border: 4px solid var(--ink); padding: 16px; font-family: var(--accent); font-weight: 700; }

.clue-toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; background: var(--cyan); border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); padding: 15px 18px; font-family: var(--accent); font-weight: 700; text-transform: uppercase; transform: translateY(150%); transition: transform .25s steps(3); }
.clue-toast.show { transform: translateY(0); }

.clue-object { transition: transform .22s steps(3), filter .22s steps(2); }
.clue-object.is-active { transform: rotate(-2deg) translate(8px, -8px); filter: saturate(1.35); }

@keyframes drift { from { translate: 0 0; } to { translate: 10px -6px; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 50% { opacity: .62; } }
@keyframes popGhost { 0%, 100% { transform: translate(0, 0); } 40% { transform: translate(16px, -18px); } 65% { transform: translate(-12px, 8px); } }
@keyframes signalPulse { from { transform: scale(.88); opacity: .55; } to { transform: scale(1.08); opacity: 1; } }

@media (max-width: 820px) {
  .top-transfer { font-size: .68rem; }
  .directory-panel { min-height: 760px; }
  .map-block { position: relative; right: auto; bottom: auto; margin-top: 26px; width: 250px; }
  .maybe-sticker { right: 25px; top: 92px; }
  .clue-scene, .antenna-scene { display: block; }
  .blob-panel, .payphone, .elevator-panel, .route-warning, .underpass-arch, .signal-box { margin: 24px 0; width: 100%; }
  .antenna { height: 310px; margin-left: 48%; }
  .crosswalk, .chevron-road { display: none; }
}
