:root{
  --gold: #d9b877;
  --gold-bright: #ffe9b8;
  --ink: #0d0f14;
}

*{ box-sizing:border-box; margin:0; padding:0; }

html,body{
  width:100%; height:100%; overflow:hidden;
  background:var(--ink);
  font-family:'Georgia', 'Times New Roman', serif;
  cursor:none;
}

/* ========================================================
   STAGE — fixed full-viewport frame, always fully covered by
   the scene (cover-fit math in script.js), so no empty edges
   are ever possible regardless of parallax offset or resize.
   ======================================================== */
#stage{
  position:fixed; inset:0;
  overflow:hidden;
  background:var(--ink);
}

/* ==========================================================
   #scene is the ONE shared, continuously-animated transform
   target. It is sized in px by script.js to the exact
   "object-fit: cover" render size for the current viewport
   (plus a small bleed margin for subtle vertical travel), then
   centered with top:50%/left:50%/translate(-50%,-50%). Parallax
   only ADDS a translate3d() on top of that base centering — see
   script.js raf(). Both image layers and the hotspot layer are
   children of #scene, so they share this single transform and
   never need per-element position updates on animation frames.
   No CSS transition lives on this element's transform: it is
   driven purely by the JS lerp loop (a transition here would
   fight the manual damping).
   ========================================================== */
#scene{
  position:absolute;
  top:50%; left:50%;
  will-change:transform;
  z-index:1;
}
#scene img{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  display:block;
  pointer-events:none;
  filter: saturate(1.05) contrast(1.03);
}
/* Real crossfade between two actual renders — never a CSS
   filter grade. Both layers share #scene's transform above, so
   they stay pixel-aligned at every parallax position. */
#img-night{
  opacity:0;
  transition: opacity 900ms ease;
}
body.night #img-night{ opacity:1; }

/* hotspot layer occupies the exact same box as the images, so
   0-100% here is the same coordinate space as the artwork */
#hotspot-layer{
  position:absolute; inset:0;
  z-index:20;
}

/* vignette — frames the viewport itself, independent of #scene's pan */
#vignette{
  position:absolute; inset:0; pointer-events:none; z-index:5;
  background: radial-gradient(ellipse at 50% 40%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.5) 100%);
  mix-blend-mode:multiply;
}

/* subtle top/bottom darkening for a cinematic frame */
#letterbox-top, #letterbox-bottom{
  position:absolute; left:0; right:0; height:9%; pointer-events:none; z-index:6;
}
#letterbox-top{ top:0; background:linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0)); }
#letterbox-bottom{ bottom:0; background:linear-gradient(to top, rgba(0,0,0,0.4), rgba(0,0,0,0)); }

/* film grain */
#grain{
  position:fixed; inset:0; pointer-events:none;
  opacity:0.05; mix-blend-mode:overlay; z-index:40;
}

/* ---------- HEADER / INTRO TEXT ---------- */
#intro{
  position:fixed; top:6%; left:50%; transform:translateX(-50%);
  text-align:center; z-index:30; color:#fdf6e6;
  pointer-events:none;
  opacity:0; animation: fadeIn 1.4s ease forwards 0.6s;
}
#intro .eyebrow{
  font-family:'Helvetica Neue', Arial, sans-serif;
  font-size:11px; letter-spacing:0.45em; text-transform:uppercase;
  color:var(--gold); margin-bottom:10px; opacity:0.9;
}
#intro h1{
  font-size:26px; font-weight:400; letter-spacing:0.12em;
  text-transform:uppercase;
  text-shadow:0 2px 20px rgba(0,0,0,0.5);
}
#intro p{
  margin-top:10px; font-family:'Helvetica Neue', Arial, sans-serif;
  font-size:12px; letter-spacing:0.03em; color:rgba(253,246,230,0.75);
}
@keyframes fadeIn{ to{ opacity:1; } }

/* ---------- DAY / NIGHT TOGGLE ---------- */
#mode-toggle{
  position:fixed; top:6%; right:5%; z-index:30;
  display:flex; align-items:center; gap:10px;
  font-family:'Helvetica Neue', Arial, sans-serif;
  font-size:10px; letter-spacing:0.2em; text-transform:uppercase;
  color:rgba(253,246,230,0.8);
  opacity:0; animation: fadeIn 1.4s ease forwards 1s;
}
#mode-toggle button{
  all:unset; cursor:none;
  width:44px; height:22px; border-radius:20px;
  background:rgba(255,255,255,0.15);
  border:1px solid rgba(255,255,255,0.35);
  position:relative;
  transition: background 0.4s ease, opacity 0.3s ease;
}
#mode-toggle button::after{
  content:''; position:absolute; top:2px; left:2px;
  width:16px; height:16px; border-radius:50%;
  background:var(--gold-bright);
  transition: transform 0.4s cubic-bezier(.65,0,.35,1), background 0.4s ease;
  box-shadow:0 0 8px rgba(255,233,184,0.8);
}
body.night #mode-toggle button::after{
  transform:translateX(22px);
  background:#cfd8ff;
  box-shadow:0 0 8px rgba(207,216,255,0.8);
}
#mode-toggle button[disabled]{
  opacity:0.4; cursor:not-allowed;
}
#mode-toggle button:focus-visible{
  outline:2px solid var(--gold-bright); outline-offset:3px;
}

/* ---------- HOTSPOTS ---------- */
.hotspot{
  position:absolute;
  border:none; background:transparent;
  cursor:none;
}
.hotspot:focus-visible{
  outline:2px solid var(--gold-bright);
  outline-offset:4px;
  border-radius:14px;
}
.hotspot .ring{
  position:absolute; inset:0;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0);
  box-shadow: 0 0 0 rgba(217,184,119,0);
  transition: box-shadow 0.5s ease, border-color 0.5s ease, background 0.5s ease, transform 0.5s cubic-bezier(.2,.9,.3,1);
  background:rgba(0,0,0,0);
}
.hotspot:hover .ring,
.hotspot:focus-visible .ring{
  border-color: rgba(255,233,184,0.55);
  background:rgba(255,233,184,0.06);
  box-shadow: 0 0 40px 6px rgba(255,214,140,0.35), inset 0 0 25px rgba(255,214,140,0.15);
  transform: scale(1.03);
}
.hotspot .label{
  position:absolute; left:50%; bottom:calc(100% + 14px);
  transform:translate(-50%, 8px);
  white-space:nowrap;
  padding:9px 18px;
  font-family:'Helvetica Neue', Arial, sans-serif;
  font-size:10.5px; letter-spacing:0.18em; text-transform:uppercase;
  color:#fdf6e6;
  background:rgba(15,14,10,0.35);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  border:1px solid rgba(255,233,184,0.25);
  border-radius:100px;
  opacity:0; pointer-events:none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.hotspot:hover .label,
.hotspot:focus-visible .label{
  opacity:1; transform:translate(-50%, 0);
}
.hotspot .pulse{
  position:absolute; left:50%; top:32%;
  width:8px; height:8px; margin:-4px 0 0 -4px;
  border-radius:50%; background:var(--gold-bright);
  box-shadow:0 0 10px 3px rgba(255,233,184,0.7);
  animation: pulse 2.4s ease-in-out infinite;
}
.hotspot:hover .pulse,
.hotspot:focus-visible .pulse{ opacity:0; }
@keyframes pulse{
  0%,100%{ opacity:0.9; transform:translate(-50%,-50%) scale(1); }
  50%{ opacity:0.15; transform:translate(-50%,-50%) scale(1.6); }
}

/* ---------- DEBUG MODE (toggle with the "D" key) ----------
   Shows every hotspot's true boundary plus its id, building
   name, and left/top/width/height percentages — the same
   numbers script.js used to place it (single source of truth:
   the HOTSPOTS array in script.js). */
body.debug .hotspot .ring{
  border-color: rgba(255,60,60,0.9) !important;
  background: rgba(255,60,60,0.12) !important;
}
.hotspot .debug-info{
  display:none;
  position:absolute; left:0; top:0;
  transform:translateY(-100%);
  background:rgba(10,8,6,0.85);
  color:#ff9a8c;
  font-family:'Courier New', monospace;
  font-size:10px; line-height:1.4;
  white-space:nowrap;
  padding:4px 7px;
  border:1px solid rgba(255,60,60,0.6);
  pointer-events:none;
  z-index:25;
}
body.debug .hotspot .debug-info{ display:block; }

/* ---------- CUSTOM CURSOR (fine-pointer devices only) ---------- */
#cursor{
  position:fixed; top:0; left:0; z-index:60;
  width:10px; height:10px; border-radius:50%;
  background:var(--gold-bright);
  pointer-events:none;
  transform:translate(-50%,-50%);
  transition: width 0.25s cubic-bezier(.2,.9,.3,1), height 0.25s cubic-bezier(.2,.9,.3,1), background 0.25s ease, box-shadow 0.25s ease;
  box-shadow:0 0 12px 2px rgba(255,233,184,0.6);
}
#cursor.hover{
  width:64px; height:64px;
  background:rgba(255,233,184,0.08);
  border:1px solid rgba(255,233,184,0.8);
  box-shadow:0 0 30px 6px rgba(255,233,184,0.35);
}
#cursor-ring{
  position:fixed; top:0; left:0; z-index:59;
  width:34px; height:34px; border-radius:50%;
  border:1px solid rgba(255,233,184,0.35);
  pointer-events:none;
  transform:translate(-50%,-50%);
  transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease, transform 0.05s linear;
}
#cursor.hover ~ #cursor-ring{ opacity:0; }

/* ---------- HINT ---------- */
#hint{
  position:fixed; bottom:6%; left:50%; transform:translateX(-50%);
  z-index:30; text-align:center;
  font-family:'Helvetica Neue', Arial, sans-serif;
  font-size:11px; letter-spacing:0.15em; text-transform:uppercase;
  color:rgba(253,246,230,0.7);
  opacity:0; animation: fadeIn 1.4s ease forwards 1.4s;
}
#hint span{ color:var(--gold-bright); }

/* ---------- SECTION MODAL ---------- */
#modal-overlay{
  position:fixed; inset:0; z-index:80;
  display:flex; align-items:center; justify-content:center;
  background:rgba(8,7,5,0.45);
  backdrop-filter: blur(9px) saturate(1.1);
  -webkit-backdrop-filter: blur(9px) saturate(1.1);
  opacity:0; visibility:hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
#modal-overlay.active{
  opacity:1; visibility:visible;
  transition: opacity 0.45s ease, visibility 0s linear 0s;
}
#modal-card{
  width:min(480px, 86vw);
  background:#1a1610;
  border:1px solid rgba(217,184,119,0.6);
  padding:44px 40px 36px;
  text-align:center;
  transform: translateY(14px) scale(0.97);
  opacity:0;
  transition: transform 0.5s cubic-bezier(.2,.8,.3,1) 0.08s, opacity 0.5s ease 0.08s;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
#modal-overlay.active #modal-card{
  transform: translateY(0) scale(1);
  opacity:1;
}
#modal-card h2{
  font-family:'Georgia', 'Times New Roman', serif;
  font-weight:400; font-size:24px;
  color: var(--gold-bright);
  letter-spacing:0.02em;
  margin-bottom:14px;
}
#modal-card p{
  font-family:'Helvetica Neue', Arial, sans-serif;
  font-size:13px; line-height:1.6;
  color:rgba(253,246,230,0.72);
  letter-spacing:0.01em;
  margin-bottom:30px;
}
#modal-card button{
  all:unset; cursor:none;
  font-family:'Helvetica Neue', Arial, sans-serif;
  font-size:11px; letter-spacing:0.22em; text-transform:uppercase;
  color:var(--gold-bright);
  border:1px solid rgba(217,184,119,0.6);
  padding:11px 30px;
  transition: background 0.3s ease, color 0.3s ease;
}
#modal-card button:hover{
  background: rgba(217,184,119,0.12);
}
#modal-card button:focus-visible{
  outline:2px solid var(--gold-bright); outline-offset:3px;
}

/* ---------- TOUCH / COARSE-POINTER DEVICES ----------
   No mouse parallax, no custom cursor, no dependence on hover:
   hotspots fall back to a normal pointer cursor and are always
   visible/tappable via their static ring + pulse. */
@media (hover:none), (pointer:coarse){
  html,body{ cursor:auto; }
  #cursor,#cursor-ring{ display:none; }
  .hotspot{ cursor:pointer; }
}

@media (max-width:760px){
  #intro h1{ font-size:18px; }
  #mode-toggle{ top:4%; right:4%; }
}

/* ---------- REDUCED MOTION ----------
   Parallax is disabled entirely in script.js when this is set
   (the scene is simply held centered). The day/night crossfade
   and hotspot pulse are deliberately left alone here — the
   crossfade is required to keep working, and a slow opacity
   pulse is mild enough to leave running; only the faster ring
   hover animation curve is untouched since it's user-triggered. */
@media (prefers-reduced-motion: reduce){
  .hotspot .pulse{ animation:none; opacity:0.6; }
}
