:root { --gold: #d8b25a; --gold2: #8a6a2f; --cream: #efe3c4; --tag: #e7cf9a; --ink: #241d12; --hud: #e9e2c4; --stage-h: 100vh; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #050505; color: var(--cream); font-family: Archivo, Helvetica, Arial, sans-serif; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* only the active theme is visible */
body[data-theme="city"] .deep-only, body[data-theme="deep"] .city-only { display: none !important; }

.stage { position: fixed; inset: 0; display: block; touch-action: none; }
#deep-canvas { width: 100vw; height: 100vh; image-rendering: pixelated; image-rendering: crisp-edges; cursor: grab; }
#deep-canvas:active { cursor: grabbing; }

/* post effects */
.fx { position: fixed; inset: 0; pointer-events: none; }
.grain { opacity: .12; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.vig { background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(0,0,0,.55) 85%, rgba(0,0,0,.85)); }
.scan { background: repeating-linear-gradient(to bottom, rgba(0,0,0,.18) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
.vig-deep { background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.75) 100%); }
.noise { opacity: .13; mix-blend-mode: screen; animation: jit .25s steps(3) infinite;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
@keyframes jit { 33% { background-position: 37px 91px; } 66% { background-position: 141px 13px; } }

/* theme switch */
.theme { position: fixed; z-index: 20; top: 16px; right: 18px; display: flex; border: 1px solid rgba(216,178,90,.6); border-radius: 30px; overflow: hidden; background: rgba(0,0,0,.55); }
.theme button { font: 600 11px Archivo, Helvetica, sans-serif; letter-spacing: .2em; color: #d8c79a; background: none; border: 0; padding: 8px 14px; cursor: pointer; }
.theme button[aria-pressed="true"] { background: #d8b25a; color: #120e08; }
.theme a.tower { font: 600 11px Archivo, Helvetica, sans-serif; letter-spacing: .2em; color: #120e08; background: linear-gradient(#f2d48a, #b98a35); text-decoration: none; padding: 8px 14px; }
.switch { position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: 0;
  background: #000 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .7  0 0 0 0 .75  0 0 0 0 .8  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.switch.run { animation: swap .8s steps(8) forwards, jit .12s steps(3) infinite; }
@keyframes swap { 0% { opacity: 0; } 30%, 55% { opacity: 1; } 100% { opacity: 0; } }

/* ================= CITY ================= */
.brand { position: fixed; top: 20px; left: 24px; z-index: 5; font-weight: 800; letter-spacing: .3em; font-size: 12px; opacity: .8; }
.brand span { display: block; font-weight: 400; letter-spacing: .12em; opacity: .65; margin-top: 3px; }
.dial { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 6; width: 300px; height: 106px; transition: opacity .5s; }
.dial svg { width: 100%; height: 100%; overflow: visible; }
.dial .lbl { font: 400 17px Limelight, serif; fill: #a08850; cursor: pointer; transition: fill .3s; outline: none; }
.dial .lbl.on { fill: #ffe7a8; filter: drop-shadow(0 0 6px rgba(255,210,120,.9)); }
.dial .lbl:hover, .dial .lbl:focus-visible { fill: #ffe7a8; }
#needle { transition: transform 1.6s cubic-bezier(.5,0,.3,1.2); transform-origin: 150px 86px; }

.plaque { position: fixed; z-index: 6; left: max(16px, 3vw); bottom: max(18px, 4vh); width: min(470px, calc(100vw - 32px));
  background: linear-gradient(160deg, rgba(14,12,9,.88), rgba(6,5,4,.92)); border: 1px solid var(--gold2); padding: 20px 22px 18px;
  box-shadow: 0 0 0 4px rgba(0,0,0,.6), 0 0 0 5px rgba(216,178,90,.35), 0 20px 50px rgba(0,0,0,.6);
  transition: opacity .6s, transform .8s cubic-bezier(.2,.9,.25,1); }
.plaque.out { opacity: 0; transform: translateY(16px); }
.plaque::before, .plaque::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid var(--gold); }
.plaque::before { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.plaque::after { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }
.plaque .k { font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.plaque h1 { font: 400 clamp(28px, 3.4vw, 40px)/1.05 Limelight, serif; color: #f6e7bd; margin: 8px 0 8px; text-shadow: 0 0 18px rgba(255,200,110,.25); }
.plaque p { font-size: 15px; line-height: 1.55; color: #cbbf9f; }

.go { position: fixed; z-index: 6; right: max(16px, 3vw); bottom: max(18px, 4vh); font: 400 18px Limelight, serif; letter-spacing: .06em;
  color: #120e08; background: linear-gradient(#f0cf7a, #b98a35); border: 0; padding: 14px 22px; cursor: pointer;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
  filter: drop-shadow(0 0 14px rgba(240,190,90,.45)); transition: transform .2s, opacity .4s; }
.go:hover { transform: translateY(-2px); }
.go[disabled] { opacity: 0; pointer-events: none; }
.hint { position: fixed; z-index: 6; right: max(16px, 3vw); bottom: calc(max(18px, 4vh) + 60px); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; opacity: .5; }

/* portrait phones: scene on top, caption below (city.js sets --stage-h) */
@media (max-aspect-ratio: 17/20) {
  .brand { top: 18px; left: 16px; }
  .dial { top: 60px; width: 180px; height: 64px; }
  .plaque { top: calc(var(--stage-h) - 28px); bottom: auto; left: 16px; padding: 16px 18px 14px; }
  .plaque h1 { font-size: 30px; }
  .plaque p { font-size: 14.5px; }
  .go { left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); text-align: center; }
  .hint { display: none; }
}
@media (max-aspect-ratio: 17/20) and (max-height: 700px) {
  .plaque p { font-size: 13px; line-height: 1.45; }
  .plaque h1 { font-size: 24px; margin: 4px 0; }
}

/* ================= DEEP ================= */
#deep-ui { font-family: VT323, monospace; color: var(--hud); }
.hud { position: fixed; z-index: 5; font-size: 22px; letter-spacing: .06em; text-shadow: 0 0 6px rgba(255,240,190,.45), 1px 1px 0 #000; }
.hud.tl { top: 16px; left: 20px; }
.hud .rec { color: #ff4a3a; animation: blink 1s steps(2) infinite; }
.hud small { display: block; font-size: 17px; opacity: .7; }
.hud.tr { top: 58px; right: 20px; text-align: right; }
.hud.bl { bottom: 16px; left: 20px; font-size: 17px; opacity: .7; max-width: 46vw; }
.hud .touch { display: none; }
@media (pointer: coarse) { .hud .kb { display: none; } .hud .touch { display: inline; } }
@keyframes blink { 50% { opacity: 0; } }
#mini { position: fixed; right: 18px; bottom: 18px; z-index: 5; width: 168px; height: 168px; image-rendering: pixelated; border: 2px solid rgba(233,226,196,.35); background: rgba(10,9,5,.6); }
.btn { background: rgba(0,0,0,.45); color: var(--hud); border: 1px solid rgba(233,226,196,.4); font: 17px VT323, monospace; padding: 2px 10px; cursor: pointer; margin-left: 6px; }
.btn.on { background: var(--hud); color: #111; }

/* manila relay tag */
.tag { position: fixed; z-index: 6; left: 50%; top: 50%; width: min(440px, calc(100vw - 32px)); background: var(--tag); color: var(--ink);
  font-family: 'Special Elite', 'Courier New', monospace; padding: 26px 26px 22px 64px;
  clip-path: polygon(38px 0, 100% 0, 100% 100%, 38px 100%, 0 calc(100% - 38px), 0 38px);
  transform: translate(-50%, -40%) rotate(4deg) scale(.9); opacity: 0; transition: opacity .35s, transform .6s cubic-bezier(.2,.9,.3,1.3); pointer-events: none;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.6)); }
.tag.show { opacity: 1; transform: translate(-50%, -50%) rotate(-2deg) scale(1); pointer-events: auto; }
.tag::before { content: ''; position: absolute; left: 20px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: #0d0b06; box-shadow: 0 0 0 5px #c9ad70; }
.tag::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 27px, rgba(80,60,20,.18) 27px 28px); pointer-events: none; }
.tag .no { font-size: 12px; letter-spacing: .2em; opacity: .7; display: flex; justify-content: space-between; }
.tag h2 { font-size: 30px; line-height: 1.05; margin: 10px 0 8px; font-weight: 400; }
.tag .line { display: inline-flex; align-items: center; gap: 8px; font-family: Archivo, sans-serif; font-weight: 800; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.tag .bullet { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; }
.tag p { font-size: 15.5px; line-height: 1.55; margin-top: 8px; }
.tag .stamp { position: absolute; right: 16px; bottom: 12px; border: 3px solid #b3261e; color: #b3261e; font-family: Archivo, sans-serif; font-weight: 800; font-size: 13px; letter-spacing: .12em; padding: 2px 8px; transform: rotate(-12deg); opacity: .8; }
.tag button { margin-top: 14px; font-size: 13px; background: var(--ink); color: var(--tag); border: 0; padding: 6px 12px; cursor: pointer; position: relative; z-index: 1; font-family: 'Special Elite', monospace; }

/* intro */
.intro { position: fixed; inset: 0; z-index: 10; background: #0d0b06; display: grid; place-items: center; text-align: center; transition: opacity 1.2s; padding: 24px; }
.intro[hidden] { display: none; }
.intro.gone { opacity: 0; pointer-events: none; }
.intro p, .intro h2, .intro .who, .intro button { opacity: 0; }
.intro.play p { font-size: clamp(20px, 3vw, 28px); animation: fade 1.2s forwards; color: #cfc6a4; }
.intro p { font-size: clamp(20px, 3vw, 28px); color: #cfc6a4; }
.intro.play p:nth-child(2) { animation-delay: 1s; } .intro.play p:nth-child(3) { animation-delay: 2s; }
.intro h2 { font-family: 'Special Elite', monospace; font-weight: 400; font-size: clamp(40px, 8vw, 92px); margin: 26px 0 6px; color: #efe3b8; text-shadow: 0 0 24px rgba(255,220,140,.35); }
.intro.play h2 { animation: fade 1.6s 3s forwards; }
.intro .who { font-family: Archivo, sans-serif; font-weight: 800; letter-spacing: .3em; font-size: 13px; }
.intro.play .who { animation: fade 1s 3.6s forwards; }
.intro button { margin-top: 34px; font: 24px VT323, monospace; letter-spacing: .1em; background: none; color: #efe3b8; border: 2px solid #efe3b8; padding: 8px 26px; cursor: pointer; }
.intro.play button { animation: fade 1s 4.2s forwards; }
.intro button:hover { background: #efe3b8; color: #111; }
@keyframes fade { to { opacity: 1; } }
@media (max-width: 640px) { .hud.bl { display: none; } #mini { width: 110px; height: 110px; } .hud { font-size: 18px; } .hud small { font-size: 14px; } }

/* motion-sensitive visitors: no flicker loops, instant intro */
@media (prefers-reduced-motion: reduce) {
  .noise, .switch.run { animation: none; }
  .switch.run { opacity: .9; }
  .intro.play p, .intro.play h2, .intro.play .who, .intro.play button { animation: none; opacity: 1; }
  .hud .rec { animation: none; }
}

.nojs { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; font: 400 22px Limelight, serif; }
