/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --ink: #14110F;
  --parchment: #EDE6D8;
  --linen: #F6F3EC;
  --bronze: #B0894F;
  --patina: #4A5A4F;
  --signal: #8C2F22;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --mono: 'IBM Plex Mono', monospace;
  --ease-slow: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

/* ── Film grain ─────────────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ── Compass nav ────────────────────────────────────────── */
.compass {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  gap: 6px;
  align-items: center;
}

.compass-mark {
  width: 8px;
  height: 8px;
  background: var(--patina);
  opacity: 0.3;
  transform: rotate(45deg);
  transition: all 0.6s var(--ease-slow);
}

.compass-mark.active {
  background: var(--bronze);
  opacity: 1;
  transform: rotate(45deg) scale(1.4);
}

.compass-mark.done {
  opacity: 0.6;
  background: var(--bronze);
}

/* ── Scenes ─────────────────────────────────────────────── */
.scene {
  position: fixed;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s var(--ease-slow), visibility 1.2s;
  overflow: hidden;
}

.scene.active {
  opacity: 1;
  visibility: visible;
}

/* ── SCENE 0: Atelier ─────────────────────────────────── */
#scene-atelier {
  background: var(--ink) url('assets/atelier.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

#scene-atelier::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 35% 45%, rgba(20,17,15,0.45) 0%, rgba(20,17,15,0.82) 70%, rgba(20,17,15,0.95) 100%);
  z-index: 1;
}

.lamp-glow {
  position: absolute;
  top: -25%;
  left: 58%;
  transform: translateX(-50%);
  width: 50vw;
  height: 60vh;
  z-index: 1;
  background: radial-gradient(ellipse at center, rgba(176,137,79,0.22) 0%, transparent 70%);
  animation: lampFade 3s var(--ease-out) forwards;
  opacity: 0;
  mix-blend-mode: screen;
}

.atelier-window,
.atelier-floor { display: none; }

@keyframes lampFade {
  to { opacity: 1; }
}

.atelier-window {
  position: absolute;
  top: 8%;
  right: 12%;
  width: 120px;
  height: 160px;
  border: 1px solid rgba(176,137,79,0.15);
  background: linear-gradient(180deg, rgba(74,90,79,0.2) 0%, rgba(20,17,15,0.8) 100%);
  opacity: 0;
  animation: lampFade 4s 1s var(--ease-out) forwards;
}

.atelier-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(176,137,79,0.05));
}

.atelier-content {
  text-align: center;
  z-index: 2;
  padding: 2rem;
}

.brand-mark {
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--bronze);
  opacity: 0;
  animation: fadeUp 1s 0.5s var(--ease-out) forwards;
  margin-bottom: 2rem;
}

.hero-line {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.4;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  min-height: 2.8em;
}

.hero-sub {
  font-size: 1.1rem;
  color: rgba(237,230,216,0.5);
  margin-bottom: 3rem;
  opacity: 0;
}

.fade-in-delayed {
  animation: fadeUp 1s 2s var(--ease-out) forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.cta-ghost {
  background: none;
  border: 1px solid rgba(176,137,79,0.4);
  color: var(--bronze);
  font-family: var(--serif);
  font-size: 1rem;
  padding: 0.75rem 2rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.4s var(--ease-slow);
  opacity: 0;
}

.cta-ghost:not(:disabled) {
  opacity: 1;
  animation: fadeUp 0.8s var(--ease-out) forwards;
}

.cta-ghost:hover {
  background: rgba(176,137,79,0.1);
  border-color: var(--bronze);
}

.cta-ghost .arrow {
  display: inline-block;
  transition: transform 0.3s;
}

.cta-ghost:hover .arrow {
  transform: translateX(4px);
}

/* ── SCENE 1: Vijfhoek ────────────────────────────────── */
#scene-vijfhoek {
  background: #1a1612 url('assets/vijfhoek.jpg') center/cover no-repeat;
}

#scene-vijfhoek::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20,17,15,0.88) 0%, rgba(20,17,15,0.55) 35%, rgba(20,17,15,0.2) 70%, rgba(20,17,15,0.4) 100%);
  z-index: 1;
}

.street-scene { display: none; }

.street-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-size: cover;
  background-position: center bottom;
}

.layer-back {
  height: 55%;
  background: linear-gradient(180deg, #1a1612 0%, #2a2218 40%, #3d3228 100%);
  transform: translateZ(-200px) scale(1.3);
}

.layer-mid {
  height: 40%;
  background: linear-gradient(180deg, transparent, rgba(74,90,79,0.15));
  animation: streetDrift 12s linear infinite;
}

.layer-front {
  height: 25%;
  background: linear-gradient(180deg, transparent, #14110F);
}

.street-fog {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 80%, rgba(176,137,79,0.06) 0%, transparent 60%);
  animation: fogPulse 8s ease-in-out infinite alternate;
}

@keyframes streetDrift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-20px); }
}

@keyframes fogPulse {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

.vijfhoek-copy {
  position: absolute;
  left: 8%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  max-width: 420px;
}

.float-line {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 1s var(--ease-out);
}

.float-line.visible {
  opacity: 1;
  transform: translateX(0);
}

#btn-to-atlas {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

/* ── SCENE 2: Atlas ───────────────────────────────────── */
#scene-atlas {
  background: var(--parchment);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  padding: 2rem 3rem;
}

.atlas-header {
  text-align: center;
  margin-bottom: 1rem;
}

.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 0.5rem;
}

.atlas-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.atlas-hint {
  font-size: 0.95rem;
  color: var(--patina);
  font-style: italic;
}

.atlas-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

#world-map {
  width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 2px 20px rgba(20,17,15,0.08));
}

.route-line {
  stroke-dasharray: 8 6;
  animation: routePulse 4s linear infinite;
}

@keyframes routePulse {
  to { stroke-dashoffset: -28; }
}

.city-node {
  cursor: pointer;
}

.city-dot {
  fill: var(--bronze);
  stroke: #14110F;
  stroke-width: 1;
  transition: r 0.3s var(--ease-out);
  filter: drop-shadow(0 1px 2px rgba(20,17,15,0.6));
}

.city-glow {
  fill: url(#nodeGlow);
  opacity: 0;
  transition: opacity 0.4s;
}

.city-node:hover .city-glow,
.city-node.hovered .city-glow {
  opacity: 1;
}

.city-node:hover .city-dot,
.city-node.hovered .city-dot {
  r: 6;
}

.city-node.visited .city-dot {
  fill: var(--patina);
}

.city-label {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  fill: #14110F;
  paint-order: stroke;
  stroke: rgba(246,243,236,0.9);
  stroke-width: 3px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.city-node:hover .city-label,
.city-node.hovered .city-label {
  opacity: 0.7;
}

.whisper-panel {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  background: rgba(246,243,236,0.92);
  border: 1px solid rgba(176,137,79,0.2);
  padding: 1.2rem 2rem;
  max-width: 480px;
  backdrop-filter: blur(8px);
  animation: fadeUp 0.5s var(--ease-out);
}

.whisper-city {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 0.4rem;
}

.whisper-text {
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.4;
}

.whisper-signal {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--patina);
  margin-top: 0.6rem;
}

.atlas-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--patina);
  padding-top: 0.5rem;
}

/* ── SCENE 3: Zaal ────────────────────────────────────── */
#scene-zaal {
  background: var(--linen) url('assets/gallery.jpg') center/cover no-repeat;
  color: var(--ink);
}

#scene-zaal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(246,243,236,0.25) 0%, rgba(246,243,236,0.05) 40%, rgba(246,243,236,0.65) 100%);
  z-index: 0;
}

.back-btn {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 10;
  background: none;
  border: none;
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--patina);
  cursor: pointer;
  transition: color 0.3s;
}

.back-btn:hover { color: var(--bronze); }

.gallery-room {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  z-index: 1;
}

.gallery-wall,
.gallery-floor,
.gallery-ceiling { display: none; }

.gallery-wall {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20%;
  background: linear-gradient(90deg, #e8e2d6, var(--linen));
}

.gallery-wall.left { left: 0; }
.gallery-wall.right {
  right: 0;
  background: linear-gradient(270deg, #e8e2d6, var(--linen));
}

.gallery-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 15%;
  background: linear-gradient(180deg, var(--linen), #ddd6c8);
}

.gallery-ceiling {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8%;
  background: linear-gradient(180deg, #fff, var(--linen));
}

.artwork-frame {
  position: relative;
  z-index: 2;
  text-align: center;
  animation: walkIn 1.5s var(--ease-out);
}

@keyframes walkIn {
  from {
    opacity: 0;
    transform: translateZ(-200px) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translateZ(0) scale(1);
  }
}

.artwork-canvas {
  width: clamp(280px, 45vw, 520px);
  height: clamp(200px, 32vw, 360px);
  margin: 0 auto;
  background-size: cover;
  background-position: center;
  border: 12px solid #f8f6f0;
  outline: 1px solid rgba(20,17,15,0.15);
  box-shadow: 0 18px 50px rgba(20,17,15,0.28), 0 2px 6px rgba(20,17,15,0.2);
  transition: background-image 0.8s var(--ease-slow);
}

.artwork-plaque { position: relative; z-index: 2; }
.curator-note { z-index: 2; }

.artwork-plaque {
  margin-top: 1.5rem;
}

.plaque-segment {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 0.3rem;
}

.plaque-title {
  font-size: 1.3rem;
  font-weight: 500;
}

.curator-note {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 520px;
  text-align: center;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--patina);
  line-height: 1.5;
  padding: 0 2rem;
  animation: fadeUp 1s 0.8s var(--ease-out) both;
}

.loep-btn {
  position: absolute;
  bottom: 6%;
  right: 6%;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(246,243,236,0.9);
  border: 1px solid rgba(176,137,79,0.3);
  color: var(--bronze);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  padding: 0.8rem 1.4rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.4s var(--ease-slow);
  animation: loepPulse 3s ease-in-out infinite;
}

@keyframes loepPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(176,137,79,0.2); }
  50% { box-shadow: 0 0 20px 4px rgba(176,137,79,0.15); }
}

.loep-btn:hover {
  background: var(--bronze);
  color: var(--linen);
  animation: none;
}

/* ── SCENE 4: Loep ────────────────────────────────────── */
#scene-loep {
  background: var(--ink);
  color: var(--parchment);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.loep-stage {
  position: relative;
  width: clamp(300px, 60vw, 640px);
  height: clamp(220px, 40vw, 420px);
  margin-bottom: 2rem;
  border: 1px solid rgba(176,137,79,0.15);
  overflow: hidden;
}

.loep-art-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 0.6s var(--ease-slow);
}

.loep-data-layer {
  position: absolute;
  inset: 0;
  background: rgba(20,17,15,0.95);
  opacity: 0;
  transition: opacity 0.6s var(--ease-slow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 3rem;
  margin-bottom: 1.5rem;
}

.data-cell {
  text-align: center;
}

.data-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--patina);
  margin-bottom: 0.3rem;
}

.data-value {
  display: block;
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--parchment);
}

.data-trend {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--bronze);
  margin-top: 0.2rem;
}

.data-verdict {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--bronze);
  text-align: center;
  max-width: 400px;
  line-height: 1.5;
}

.loep-lens {
  position: absolute;
  width: 120px;
  height: 120px;
  border: 2px solid var(--bronze);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 30px rgba(176,137,79,0.2), inset 0 0 20px rgba(176,137,79,0.1);
  transition: opacity 0.3s;
}

.loep-copy {
  text-align: center;
  max-width: 500px;
}

.loep-intro {
  font-size: 1.1rem;
  font-style: italic;
  margin-bottom: 1.5rem;
  opacity: 0.7;
}

.loep-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

#loep-slider {
  width: 280px;
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  background: var(--patina);
  outline: none;
  cursor: pointer;
}

#loep-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bronze);
  border: 2px solid var(--parchment);
  cursor: grab;
}

.loep-slider-label {
  font-size: 0.8rem;
  color: var(--patina);
  font-style: italic;
}

.finale-tease {
  margin-top: 2rem;
  text-align: center;
  animation: fadeUp 1s var(--ease-out);
}

.finale-tease p {
  font-size: 1rem;
  color: rgba(237,230,216,0.5);
}

.finale-hammer {
  margin-top: 0.5rem;
  font-size: 1.2rem !important;
  color: var(--bronze) !important;
}

.finale-hammer em {
  font-style: normal;
  border-bottom: 1px solid var(--bronze);
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  #scene-atlas { padding: 1.5rem; }
  .vijfhoek-copy { left: 5%; max-width: 85%; }
  .data-grid { grid-template-columns: 1fr; gap: 1rem; }
  .loep-btn span { display: none; }
}
