/* ============================================
   TREVIO — Memory Reconstruction System
   Color Theme: Deep Ocean Blue + Sunset Ember
   ============================================ */

:root {
  --primary: #0B1F3B;
  --secondary: #FF6A3D;
  --background: #F7F4EF;
  --text: #1C1C1C;
  --accent: #FFC857;
  --text-muted: rgba(28, 28, 28, 0.6);
  --text-light: rgba(247, 244, 239, 0.85);
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', 'Manrope', system-ui, sans-serif;
  --transition-cinematic: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-memory: cubic-bezier(0.22, 1, 0.36, 1);
  --section-padding: clamp(4rem, 10vw, 8rem);
  --dial-size: 64px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
  overflow-x: hidden;
}

body.scan-active {
  overflow: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: var(--text-light);
  border-radius: 0 0 4px 4px;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Section base */
.section {
  position: relative;
  padding: var(--section-padding) clamp(1.25rem, 5vw, 4rem);
  min-height: 100vh;
  min-height: 100dvh;
}

.section-header {
  margin-bottom: clamp(2rem, 5vw, 4rem);
  max-width: 600px;
}

.section-header--dark .section-title,
.section-header--dark .section-subtitle {
  color: var(--text-light);
}

.section-index {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-muted);
  font-weight: 300;
}

/* ============================================
   SECTION 1 — MEMORY SCAN
   ============================================ */
.section--scan {
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.scan-screen {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.scan-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 200, 87, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 200, 87, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.scan-beam {
  position: absolute;
  top: 0;
  left: -20%;
  width: 4px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--accent) 20%,
    var(--secondary) 50%,
    var(--accent) 80%,
    transparent
  );
  box-shadow:
    0 0 30px var(--accent),
    0 0 60px var(--secondary),
    -80px 0 120px rgba(255, 200, 87, 0.15),
    80px 0 120px rgba(255, 106, 61, 0.15);
  animation: scan-sweep 4s var(--transition-memory) infinite;
  z-index: 10;
}

@keyframes scan-sweep {
  0% { left: -5%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 105%; opacity: 0; }
}

.scan-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.scan-particles::before,
.scan-particles::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    10vw 20vh 0 0 rgba(255, 200, 87, 0.6),
    25vw 60vh 0 0 rgba(255, 106, 61, 0.4),
    40vw 30vh 0 0 rgba(255, 200, 87, 0.5),
    55vw 80vh 0 0 rgba(255, 200, 87, 0.3),
    70vw 15vh 0 0 rgba(255, 106, 61, 0.5),
    85vw 50vh 0 0 rgba(255, 200, 87, 0.4),
    15vw 75vh 0 0 rgba(255, 106, 61, 0.3),
    60vw 45vh 0 0 rgba(255, 200, 87, 0.6),
    90vw 70vh 0 0 rgba(255, 106, 61, 0.4),
    35vw 90vh 0 0 rgba(255, 200, 87, 0.5);
  animation: particles-rise 8s linear infinite;
}

.scan-particles::after {
  animation-delay: -4s;
  opacity: 0.6;
}

@keyframes particles-rise {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh); opacity: 0; }
}

.scan-waves {
  position: absolute;
  bottom: 25%;
  left: 0;
  right: 0;
  height: 120px;
  color: rgba(255, 200, 87, 0.3);
  opacity: 0;
  animation: waves-fade 4s ease-in-out infinite;
}

.wave-path {
  animation: wave-pulse 2s ease-in-out infinite;
}

.wave-path--2 {
  animation-delay: 0.5s;
  opacity: 0.5;
}

@keyframes wave-pulse {
  0%, 100% { d: path("M0,60 Q100,20 200,60 T400,60 T600,60 T800,60"); }
  50% { d: path("M0,60 Q100,80 200,60 T400,40 T600,60 T800,60"); }
}

@keyframes waves-fade {
  0%, 100% { opacity: 0; }
  30%, 70% { opacity: 1; }
}

.scan-fragments {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fragment {
  position: absolute;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: rgba(255, 200, 87, 0.5);
  opacity: 0;
  font-weight: 500;
  text-transform: uppercase;
  animation: fragment-appear 4s var(--transition-memory) infinite;
}

.fragment[data-fragment="kyoto"] { top: 20%; left: 15%; animation-delay: 0.5s; }
.fragment[data-fragment="sahara"] { top: 35%; right: 20%; animation-delay: 1.2s; }
.fragment[data-fragment="paris"] { bottom: 30%; left: 25%; animation-delay: 2s; }
.fragment[data-fragment="patagonia"] { bottom: 20%; right: 15%; animation-delay: 2.8s; }

@keyframes fragment-appear {
  0%, 15% { opacity: 0; transform: translateX(-10px); filter: blur(4px); }
  25%, 55% { opacity: 1; transform: translateX(0); filter: blur(0); }
  65%, 100% { opacity: 0; transform: translateX(10px); filter: blur(4px); }
}

.logo-reconstruct {
  position: relative;
  z-index: 5;
  text-align: center;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 12vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.3em;
  color: transparent;
  display: flex;
  gap: 0.05em;
  justify-content: center;
}

.logo-line {
  display: inline-block;
  color: var(--text-light);
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  animation: logo-reconstruct 4s var(--transition-memory) infinite;
  animation-delay: calc(var(--i) * 0.15s);
  text-shadow: 0 0 40px rgba(255, 200, 87, 0.3);
}

@keyframes logo-reconstruct {
  0%, 20% { opacity: 0; clip-path: inset(0 100% 0 0); }
  35% { opacity: 0.3; clip-path: inset(0 50% 0 0); }
  50%, 80% { opacity: 1; clip-path: inset(0 0 0 0); }
  95%, 100% { opacity: 0.7; clip-path: inset(0 0 0 0); }
}

.logo-tagline {
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(247, 244, 239, 0.4);
  margin-top: 1rem;
  opacity: 0;
  animation: tagline-fade 4s ease-in-out infinite;
  animation-delay: 1.5s;
}

@keyframes tagline-fade {
  0%, 30% { opacity: 0; }
  50%, 80% { opacity: 1; }
  100% { opacity: 0.5; }
}

.scan-enter-prompt {
  position: absolute;
  bottom: 3rem;
  z-index: 20;
  opacity: 0;
  animation: enter-prompt 4s ease-in-out infinite;
  animation-delay: 2s;
}

@keyframes enter-prompt {
  0%, 40% { opacity: 0; transform: translateY(10px); }
  60%, 90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0.7; transform: translateY(0); }
}

.scan-enter-btn {
  background: transparent;
  border: 1px solid rgba(255, 200, 87, 0.4);
  color: var(--accent);
  padding: 0.875rem 2rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  transition: all 0.4s var(--transition-memory);
}

.scan-enter-btn:hover,
.scan-enter-btn:focus-visible {
  border-color: var(--accent);
  background: rgba(255, 200, 87, 0.1);
  outline: none;
  box-shadow: 0 0 30px rgba(255, 200, 87, 0.2);
}

.scan-enter-line {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background: var(--secondary);
  transition: width 0.4s var(--transition-memory);
}

.scan-enter-btn:hover .scan-enter-line {
  width: 80%;
}

.section--scan.scan-complete {
  animation: scan-exit 1.2s var(--transition-memory) forwards;
}

@keyframes scan-exit {
  to {
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
  }
}

/* ============================================
   SECTION 2 — JOURNEY RECONSTRUCTION GRID
   ============================================ */
.section--grid {
  background: var(--background);
}

.reconstruction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.memory-frame {
  position: relative;
  aspect-ratio: 4/5;
  cursor: pointer;
  outline: none;
}

.frame-incomplete,
.frame-complete {
  position: absolute;
  inset: 0;
  transition: opacity 0.6s var(--transition-memory), transform 0.6s var(--transition-memory);
}

.frame-incomplete {
  background: var(--primary);
  opacity: 1;
  overflow: hidden;
}

.frame-complete {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.memory-frame:hover .frame-incomplete,
.memory-frame:focus-visible .frame-incomplete,
.memory-frame.frame-active .frame-incomplete {
  opacity: 0;
}

.memory-frame:hover .frame-complete,
.memory-frame:focus-visible .frame-complete,
.memory-frame.frame-active .frame-complete {
  opacity: 1;
  transform: scale(1);
}

.frame-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 200, 87, 0.4);
}

.frame-corner--tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.frame-corner--br { bottom: 12px; right: 12px; border-left: none; border-top: none; }

.frame-scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: frame-scan 3s linear infinite;
}

@keyframes frame-scan {
  0% { top: 0; opacity: 0.8; }
  100% { top: 100%; opacity: 0; }
}

.frame-visual {
  height: 75%;
  position: relative;
  overflow: hidden;
  background: hsl(var(--hue, 200), 30%, 25%);
}

.frame-landscape {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, hsla(var(--hue, 200), 40%, 15%, 0.9) 0%, transparent 60%),
    linear-gradient(135deg, hsl(var(--hue, 200), 25%, 35%) 0%, hsl(calc(var(--hue, 200) + 40), 30%, 20%) 100%);
}

.frame-landscape::after {
  content: '';
  position: absolute;
  bottom: 20%;
  left: 10%;
  right: 10%;
  height: 30%;
  background: hsla(var(--hue, 200), 20%, 50%, 0.3);
  border-radius: 50% 50% 0 0;
  filter: blur(20px);
}

.frame-soundscape {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
}

.sound-bar {
  flex: 1;
  height: var(--h, 50%);
  background: linear-gradient(to top, var(--secondary), var(--accent));
  border-radius: 2px 2px 0 0;
  opacity: 0.7;
  animation: sound-pulse 1.5s ease-in-out infinite;
}

.sound-bar:nth-child(odd) { animation-delay: 0.2s; }
.sound-bar:nth-child(even) { animation-delay: 0.5s; }

@keyframes sound-pulse {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.6); }
}

.frame-meta {
  padding: 1rem 1.25rem;
  background: var(--primary);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.frame-meta time {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.frame-location {
  font-size: 0.85rem;
  font-weight: 300;
  opacity: 0.8;
}

/* ============================================
   SECTION 3 — TIME RIVER
   ============================================ */
.section--river {
  background: var(--primary);
  overflow: hidden;
}

.river-container {
  position: relative;
  height: 60vh;
  min-height: 400px;
}

.river-flow {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.river-light {
  position: absolute;
  top: 50%;
  left: -10%;
  right: -10%;
  height: 3px;
  transform: translateY(-50%);
  background: linear-gradient(
    90deg,
    transparent,
    var(--secondary) 15%,
    var(--accent) 50%,
    var(--secondary) 85%,
    transparent
  );
  box-shadow: 0 0 40px var(--secondary), 0 0 80px rgba(255, 106, 61, 0.3);
  animation: river-flow 12s linear infinite;
}

@keyframes river-flow {
  0% { transform: translateY(-50%) translateX(-5%); }
  100% { transform: translateY(-50%) translateX(5%); }
}

.river-particles {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 200px 20px at 20% 50%, rgba(255, 200, 87, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 150px 15px at 50% 50%, rgba(255, 106, 61, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 180px 18px at 80% 50%, rgba(255, 200, 87, 0.12) 0%, transparent 70%);
  animation: river-shimmer 6s ease-in-out infinite;
}

@keyframes river-shimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.river-memories {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0 10vw;
  gap: clamp(3rem, 8vw, 8rem);
}

.river-memories::-webkit-scrollbar {
  display: none;
}

.river-event {
  flex-shrink: 0;
  scroll-snap-align: center;
  text-align: center;
  opacity: 0.3;
  transform: scale(0.85);
  transition: all 0.8s var(--transition-memory);
}

.river-event.river-active {
  opacity: 1;
  transform: scale(1);
}

.river-year {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.river-moment {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 300;
  max-width: 200px;
  opacity: 0.7;
}

.river-event.river-active .river-moment {
  opacity: 1;
}

/* ============================================
   SECTION 4 — DESTINATION ECHOES
   ============================================ */
.section--echoes {
  background: var(--background);
}

.echo-chamber {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
}

.echo {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3rem 1.5rem;
  text-align: center;
  width: 100%;
  transition: transform 0.5s var(--transition-memory);
}

.echo:hover,
.echo:focus-visible {
  transform: scale(1.05);
  outline: none;
}

.echo-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(11, 31, 59, 0.15);
  animation: echo-pulse 3s ease-in-out infinite;
}

.echo-ring--1 { width: 100px; height: 100px; }
.echo-ring--2 { width: 140px; height: 140px; animation-delay: 0.5s; opacity: 0.6; }
.echo-ring--3 { width: 180px; height: 180px; animation-delay: 1s; opacity: 0.3; }

@keyframes echo-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.8; }
}

.echo-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--primary);
  position: relative;
  z-index: 1;
}

.echo-frequency {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
}

.echo[aria-expanded="true"] .echo-ring {
  border-color: var(--secondary);
  animation-duration: 1.5s;
}

.echo-layers {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 0;
  animation: layers-expand 0.6s var(--transition-memory);
}

.echo-layers[hidden] {
  display: none;
}

@keyframes layers-expand {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.echo-layer {
  padding: 1.25rem 2rem;
  background: var(--primary);
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 300;
  border-left: 3px solid var(--secondary);
  transform: translateX(calc(var(--depth, 1) * 15px));
  opacity: calc(1 - (var(--depth, 1) * 0.1));
  transition: transform 0.4s var(--transition-memory);
}

.echo-layer:hover {
  transform: translateX(calc(var(--depth, 1) * 15px + 10px));
}

/* ============================================
   SECTION 5 — CINEMATIC ARCHIVE WALL
   ============================================ */
.section--archive {
  background: var(--primary);
  overflow: hidden;
}

.archive-wall {
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  overflow-x: auto;
  padding: 2rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--secondary) transparent;
}

.film-strip {
  flex-shrink: 0;
  width: clamp(80px, 12vw, 120px);
  background: #0a1628;
  border-radius: 4px;
  position: relative;
  animation: strip-drift 20s ease-in-out infinite;
  animation-delay: calc(var(--strip-hue, 200) * 0.01s);
}

.film-strip:nth-child(even) {
  animation-direction: reverse;
}

@keyframes strip-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.strip-perforations {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 8px,
    rgba(255, 200, 87, 0.15) 8px,
    rgba(255, 200, 87, 0.15) 12px
  );
}

.strip-frames {
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.strip-frame {
  aspect-ratio: 3/4;
  background: hsl(var(--strip-hue, 200), 35%, 30%);
  position: relative;
  overflow: hidden;
}

.strip-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    hsla(var(--strip-hue, 200), 50%, 50%, 0.3) 50%,
    transparent 100%
  );
  animation: frame-scroll 4s linear infinite;
}

@keyframes frame-scroll {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.strip-label {
  display: block;
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 244, 239, 0.5);
  padding: 0.5rem;
  writing-mode: vertical-rl;
  position: absolute;
  right: -1.5rem;
  top: 50%;
  transform: translateY(-50%);
}

/* ============================================
   SECTION 6 — SOUND OF JOURNEYS
   ============================================ */
.section--sound {
  background: var(--background);
}

.sound-space {
  position: relative;
  height: 50vh;
  min-height: 350px;
  background: var(--primary);
  border-radius: 4px;
  overflow: hidden;
}

#sound-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sound-labels {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  display: flex;
  gap: 1.5rem;
  z-index: 2;
}

.sound-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(247, 244, 239, 0.4);
  transition: color 0.4s;
}

.sound-label.active {
  color: var(--accent);
}

.sound-memories {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  right: 2rem;
  z-index: 2;
}

.sound-memory {
  position: absolute;
  bottom: 0;
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 300;
  opacity: 0;
  transition: opacity 0.6s var(--transition-memory);
  font-style: italic;
}

.sound-memory.active {
  opacity: 1;
}

/* ============================================
   SECTION 7 — LIGHT ROUTE MAP
   ============================================ */
.section--routes {
  background: var(--primary);
}

.route-map-container {
  position: relative;
}

.route-map {
  width: 100%;
  height: auto;
  border-radius: 4px;
  overflow: hidden;
}

.route-path {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  transition: stroke-dashoffset 2s var(--transition-memory);
}

.route-path.drawn {
  stroke-dashoffset: 0;
}

.route-node {
  fill: var(--accent);
  opacity: 0;
  transition: opacity 0.5s, r 0.3s;
  cursor: pointer;
}

.route-node.visible {
  opacity: 1;
}

.route-node:hover {
  r: 12;
  fill: var(--secondary);
}

.route-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.route-card {
  padding: 1.5rem;
  border: 1px solid rgba(255, 200, 87, 0.15);
  border-radius: 4px;
  opacity: 0.5;
  transition: all 0.5s var(--transition-memory);
}

.route-card.active {
  opacity: 1;
  border-color: var(--secondary);
  background: rgba(255, 106, 61, 0.05);
}

.route-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.route-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.route-meta div {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.route-meta dt {
  color: rgba(247, 244, 239, 0.5);
  font-weight: 400;
}

.route-meta dd {
  color: var(--text-light);
  font-weight: 300;
}

/* ============================================
   SECTION 8 — MEMORY VAULT
   ============================================ */
.section--vault {
  background: var(--background);
}

.vault-container {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  overflow: hidden;
}

.vault-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #0a1628 100%);
  z-index: 3;
  transition: transform 1.5s var(--transition-memory);
  border: 1px solid rgba(255, 200, 87, 0.1);
}

.vault-door--left {
  left: 0;
  transform-origin: left center;
  border-right: 2px solid rgba(255, 200, 87, 0.2);
}

.vault-door--right {
  right: 0;
  transform-origin: right center;
  border-left: 2px solid rgba(255, 200, 87, 0.2);
}

.vault-container.vault-open .vault-door--left {
  transform: rotateY(-85deg);
}

.vault-container.vault-open .vault-door--right {
  transform: rotateY(85deg);
}

.vault-glass-layers {
  position: absolute;
  inset: 10%;
  z-index: 2;
  pointer-events: none;
}

.glass-layer {
  position: absolute;
  inset: calc(var(--layer, 1) * 5%);
  background: rgba(255, 200, 87, 0.03);
  border: 1px solid rgba(255, 200, 87, 0.08);
  backdrop-filter: blur(2px);
  transition: opacity 1s;
  opacity: 1;
}

.vault-open .glass-layer {
  opacity: 0;
}

.vault-contents {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1000px;
  opacity: 0;
  transform: translateZ(-100px);
  transition: all 1.2s var(--transition-memory) 0.5s;
}

.vault-open .vault-contents {
  opacity: 1;
  transform: translateZ(0);
}

.vault-memory {
  position: relative;
  padding: 2rem;
  background: var(--primary);
  color: var(--text-light);
  border-radius: 4px;
  overflow: hidden;
}

.vault-memory-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 106, 61, 0.1) 0%, transparent 60%);
  animation: vault-glow 4s ease-in-out infinite;
}

@keyframes vault-glow {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10%, 10%); }
}

.vault-memory-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  position: relative;
}

.vault-memory-desc {
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.7;
  opacity: 0.85;
  margin-bottom: 1rem;
  position: relative;
}

.vault-memory-date {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--secondary);
  position: relative;
}

/* ============================================
   SECTION 9 — REFLECTION ROOM
   ============================================ */
.section--reflection {
  background: #060f1c;
}

.reflection-room {
  position: relative;
  height: 60vh;
  min-height: 450px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1.5rem;
  padding: 1rem;
}

.reflection-surface {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(11, 31, 59, 0.8) 0%,
    rgba(11, 31, 59, 0.4) 100%
  );
  border: 1px solid rgba(255, 200, 87, 0.1);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.3s var(--transition-memory);
  cursor: crosshair;
}

.reflection-surface::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    var(--reflect-angle, 180deg),
    rgba(255, 106, 61, 0.1) 0%,
    transparent 40%,
    rgba(255, 200, 87, 0.05) 100%
  );
  transition: --reflect-angle 0.3s;
}

.reflection-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transform: scaleY(-1);
  opacity: 0.7;
}

.reflection-place {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text-light);
}

.reflection-emotion {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--secondary);
}

.reflection-pool {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(to top, rgba(255, 200, 87, 0.05), transparent);
  pointer-events: none;
}

/* ============================================
   SECTION 10 — FINAL REPLAY HORIZON
   ============================================ */
.section--horizon {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  background: var(--primary);
}

.horizon-sky {
  position: absolute;
  inset: 0;
}

.horizon-blend {
  position: absolute;
  inset: 0;
  opacity: 0.6;
}

.horizon-blend--1 {
  background: linear-gradient(180deg, #0B1F3B 0%, #1a3a5c 40%, #FF6A3D33 70%, #FFC85744 100%);
  animation: horizon-shift 15s ease-in-out infinite;
}

.horizon-blend--2 {
  background: radial-gradient(ellipse at 30% 80%, rgba(255, 106, 61, 0.3) 0%, transparent 50%);
  animation: horizon-shift 20s ease-in-out infinite reverse;
}

.horizon-blend--3 {
  background: radial-gradient(ellipse at 70% 70%, rgba(255, 200, 87, 0.2) 0%, transparent 40%);
  animation: horizon-shift 18s ease-in-out infinite;
  animation-delay: -5s;
}

@keyframes horizon-shift {
  0%, 100% { transform: translateX(0) scale(1); }
  50% { transform: translateX(2%) scale(1.02); }
}

.horizon-particles {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 10% 60%, rgba(255, 200, 87, 0.4), transparent),
    radial-gradient(1px 1px at 30% 70%, rgba(255, 106, 61, 0.3), transparent),
    radial-gradient(1px 1px at 50% 65%, rgba(255, 200, 87, 0.5), transparent),
    radial-gradient(1px 1px at 70% 75%, rgba(255, 106, 61, 0.3), transparent),
    radial-gradient(1px 1px at 90% 60%, rgba(255, 200, 87, 0.4), transparent);
  animation: particles-rise 12s linear infinite;
}

.horizon-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
}

.horizon-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 400;
  color: var(--text-light);
  margin-bottom: 3rem;
  letter-spacing: 0.05em;
  line-height: 1.3;
}

.replay-control {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin: 0 auto;
  padding: 1rem;
  transition: transform 0.4s var(--transition-memory);
}

.replay-control:hover,
.replay-control:focus-visible {
  outline: none;
  transform: scale(1.05);
}

.replay-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(255, 200, 87, 0.3);
}

.replay-ring--outer {
  width: 100px;
  height: 100px;
  animation: replay-pulse 3s ease-in-out infinite;
}

.replay-ring--inner {
  width: 70px;
  height: 70px;
  border-color: rgba(255, 106, 61, 0.4);
  animation: replay-pulse 3s ease-in-out infinite reverse;
}

@keyframes replay-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.replay-icon {
  position: relative;
  z-index: 1;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: rgba(255, 200, 87, 0.1);
  border-radius: 50%;
  transition: all 0.4s;
}

.replay-control:hover .replay-icon {
  background: rgba(255, 106, 61, 0.2);
  color: var(--secondary);
  box-shadow: 0 0 40px rgba(255, 106, 61, 0.3);
}

.replay-text {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 3rem;
}

.replay-control.replaying .replay-ring {
  animation-duration: 0.5s;
  border-color: var(--secondary);
}

.replay-control.replaying .replay-icon {
  animation: replay-spin 1s linear;
}

@keyframes replay-spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.section--contact {
  background: var(--background);
  min-height: auto;
  padding-bottom: calc(var(--section-padding) + 6rem);
}

.contact-form {
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-field label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: transparent;
  border: 1px solid rgba(11, 31, 59, 0.2);
  border-radius: 2px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.1);
}

.contact-submit {
  align-self: flex-start;
  background: var(--primary);
  color: var(--text-light);
  border: none;
  padding: 1rem 2.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.4s var(--transition-memory);
}

.contact-submit:hover,
.contact-submit:focus-visible {
  background: var(--secondary);
  outline: none;
  box-shadow: 0 4px 20px rgba(255, 106, 61, 0.3);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--primary);
  padding: 2rem;
  text-align: center;
}

.footer-text {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(247, 244, 239, 0.4);
}

/* ============================================
   PLAYBACK DIAL NAVIGATION
   ============================================ */
.playback-dial {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.dial-trigger {
  position: relative;
  width: var(--dial-size);
  height: var(--dial-size);
  background: var(--primary);
  border: 1px solid rgba(255, 200, 87, 0.3);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--transition-memory);
  box-shadow: 0 4px 30px rgba(11, 31, 59, 0.5);
}

.dial-trigger:hover,
.dial-trigger:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 4px 40px rgba(255, 200, 87, 0.2);
  outline: none;
}

.dial-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 200, 87, 0.15);
  animation: dial-rotate 20s linear infinite;
}

.dial-ring--outer {
  inset: -8px;
}

.dial-ring--inner {
  inset: 4px;
  animation-direction: reverse;
  animation-duration: 15s;
}

@keyframes dial-rotate {
  to { transform: rotate(360deg); }
}

.dial-center {
  color: var(--accent);
  position: relative;
  z-index: 1;
}

.dial-menu {
  position: absolute;
  bottom: calc(var(--dial-size) + 1rem);
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 280px;
}

.dial-menu[hidden] {
  display: none;
}

.dial-menu:not([hidden]) {
  animation: dial-open 0.5s var(--transition-memory);
}

@keyframes dial-open {
  from { opacity: 0; transform: translateX(-50%) scale(0.8); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}

.dial-timeline {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 200, 87, 0.2);
}

.dial-item {
  position: absolute;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  background: var(--primary);
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 200, 87, 0.2);
  border-radius: 2px;
  white-space: nowrap;
  transition: all 0.3s var(--transition-memory);
  transform: translate(-50%, -50%);
}

.dial-item:hover,
.dial-item:focus-visible {
  color: var(--accent);
  border-color: var(--secondary);
  background: rgba(255, 106, 61, 0.15);
  outline: none;
}

.dial-item[data-angle="0"]   { top: 5%;  left: 50%; }
.dial-item[data-angle="60"]  { top: 22%; left: 85%; }
.dial-item[data-angle="120"] { top: 55%; left: 92%; }
.dial-item[data-angle="180"] { top: 88%; left: 50%; }
.dial-item[data-angle="240"] { top: 55%; left: 8%; }
.dial-item[data-angle="300"] { top: 22%; left: 15%; }

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--transition-memory), transform 0.8s var(--transition-memory);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .scan-beam,
  .river-light,
  .dial-ring {
    animation: none;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .reflection-room {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    height: auto;
    min-height: 600px;
  }

  .dial-menu {
    width: 240px;
    height: 240px;
  }

  .dial-item {
    font-size: 0.6rem;
    padding: 0.4rem 0.5rem;
  }

  .river-memories {
    padding: 0 5vw;
  }

  .vault-door {
    width: 50%;
  }

  .strip-label {
    display: none;
  }
}

@media (max-width: 480px) {
  :root {
    --dial-size: 52px;
  }

  .playback-dial {
    bottom: 1.25rem;
  }

  .reconstruction-grid {
    grid-template-columns: 1fr;
  }

  .echo-chamber {
    grid-template-columns: 1fr 1fr;
  }
}
