/* ============================================
   The Museum of the First Connected Age — 2126
   A beautiful exploratory museum experience
   ============================================ */

:root {
  --bg-deep: #08080a;
  --bg-surface: #0f0f12;
  --bg-elevated: #18181c;
  --bg-card: #1e1e24;
  --text-primary: #ece8e3;
  --text-secondary: #a09a94;
  --text-muted: #6b6560;
  --accent-gold: #c9a96e;
  --accent-gold-bright: #e0c88a;
  --accent-gold-dim: #8a7350;
  --accent-warm: #b8956a;
  --border-subtle: #2a2a30;
  --border-gold: #3d3422;
  --shadow-gold: rgba(201, 169, 110, 0.08);
  --font-serif: 'Crimson Text', 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-serif);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   NAVIGATION
   ============================================ */

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(8, 8, 10, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-sans);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--accent-gold);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
}

.nav-brand .nav-icon {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--accent-gold-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.nav-current {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-current .room-name {
  color: var(--accent-gold);
  margin-left: 0.5rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.nav-btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* ============================================
   LOBBY / ENTRANCE HALL
   ============================================ */

.lobby {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.lobby-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.lobby-hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(201,169,110,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.lobby-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-gold-dim);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-gold);
  padding: 0.5rem 1.2rem;
  border-radius: 2px;
}

.lobby-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.lobby-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--text-secondary);
  font-style: italic;
  max-width: 600px;
  margin-bottom: 3rem;
}

.lobby-divider {
  width: 60px;
  height: 1px;
  background: var(--accent-gold);
  margin: 0 auto 3rem;
}

.lobby-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--accent-gold);
  color: var(--bg-deep);
  padding: 1rem 2.5rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  font-weight: 500;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.lobby-cta:hover {
  background: var(--accent-gold-bright);
  transform: translateY(-2px);
}

.lobby-hero-image {
  margin-top: 3rem;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  overflow: hidden;
  position: relative;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobby-hero-image .placeholder-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
}

/* Floor Plan / Map */

.floor-plan {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.floor-plan-header {
  text-align: center;
  margin-bottom: 3rem;
}

.floor-plan-title {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.floor-plan-subtitle {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

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

.map-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.4s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.map-card:hover {
  border-color: var(--accent-gold-dim);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow-gold);
}

.map-card-image {
  height: 160px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.map-card-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, var(--bg-card), transparent);
}

.map-card-image .placeholder-text {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0 1rem;
  z-index: 1;
}

.map-card-content {
  padding: 1.25rem;
}

.map-card-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-gold-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.map-card-title {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  font-weight: 400;
}

.map-card-period {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.map-card-teaser {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   ROOM PAGES
   ============================================ */

.room-page {
  padding-top: 64px;
}

.room-hero {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
}

.room-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center top, rgba(201,169,110,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.room-num-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 1rem;
  border: 1px solid var(--border-gold);
  padding: 0.4rem 1rem;
  border-radius: 2px;
}

.room-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.room-period-badge {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
}

/* Breadcrumbs */

.breadcrumbs {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 2rem 0;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: var(--accent-gold);
}

.breadcrumbs .sep {
  margin: 0 0.5rem;
  color: var(--border-subtle);
}

.breadcrumbs .current {
  color: var(--accent-gold-dim);
}

/* Room Content */

.room-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* Image Gallery */

.image-gallery {
  margin-bottom: 3rem;
}

.gallery-grid {
  display: grid;
  gap: 1rem;
}

.gallery-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-grid.cols-4 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 640px) {
  .gallery-grid.cols-2,
  .gallery-grid.cols-3,
  .gallery-grid.cols-4 {
    grid-template-columns: 1fr;
  }
}

.gallery-item {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  transition: all 0.3s ease;
}

.gallery-item:hover {
  border-color: var(--accent-gold-dim);
}

.gallery-item.featured {
  grid-column: 1 / -1;
}

.gallery-placeholder {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gallery-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(90deg, transparent 49%, var(--border-subtle) 49%, var(--border-subtle) 51%, transparent 51%),
    linear-gradient(0deg, transparent 49%, var(--border-subtle) 49%, var(--border-subtle) 51%, transparent 51%);
  opacity: 0.3;
}

.gallery-placeholder .placeholder-icon {
  font-size: 2rem;
  color: var(--accent-gold-dim);
  margin-bottom: 0.75rem;
  z-index: 1;
  opacity: 0.5;
}

.gallery-placeholder .placeholder-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-gold-dim);
  margin-bottom: 0.5rem;
  z-index: 1;
}

.gallery-placeholder .placeholder-caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  z-index: 1;
  max-width: 80%;
}

.gallery-item .gallery-caption {
  padding: 0.875rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.gallery-item .gallery-caption .ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent-gold-dim);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.gallery-item .gallery-caption .caption-text {
  display: block;
  color: var(--text-secondary);
}

/* Description */

.room-description {
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border-subtle);
}

.room-description p + p {
  margin-top: 1.25rem;
}

/* Voice Guide */

.voice-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2.5rem;
  position: relative;
  margin-bottom: 3rem;
}

.voice-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--accent-gold), transparent 80%);
}

.voice-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.voice-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.voice-meta {
  flex: 1;
}

.voice-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 0.25rem;
}

.voice-status {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.voice-progress {
  width: 120px;
  height: 3px;
  background: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.voice-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--accent-gold);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.voice-quote {
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--text-primary);
  margin-bottom: 1.75rem;
  padding-left: 1.5rem;
  position: relative;
}

.voice-quote::before {
  content: '"';
  position: absolute;
  left: 0;
  top: -0.5rem;
  font-size: 2.5rem;
  color: var(--accent-gold-dim);
  line-height: 1;
  font-family: var(--font-serif);
  opacity: 0.6;
}

.voice-quote:last-child {
  margin-bottom: 0;
}

/* Room Navigation */

.room-nav {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.room-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.room-nav-item {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  background: var(--bg-surface);
}

.room-nav-item:hover {
  border-color: var(--accent-gold-dim);
  background: var(--bg-card);
}

.room-nav-item.next {
  text-align: right;
  align-items: flex-end;
}

.room-nav-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.room-nav-name {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.room-nav-period {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.room-nav-arrow {
  font-size: 1.25rem;
  color: var(--accent-gold-dim);
  margin-top: 0.75rem;
}

.room-nav-item:only-child {
  grid-column: 2;
}

/* ============================================
   MUSEUM MAP OVERLAY
   ============================================ */

.map-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 8, 10, 0.92);
  backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  overflow-y: auto;
  padding: 4rem 2rem;
}

.map-overlay.active {
  display: flex;
}

.map-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto 3rem;
}

.map-overlay-title {
  font-size: 1.5rem;
  font-weight: 400;
}

.map-overlay-close {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.3s ease;
}

.map-overlay-close:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.map-overlay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.map-overlay-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  background: var(--bg-surface);
}

.map-overlay-item:hover,
.map-overlay-item.current {
  border-color: var(--accent-gold-dim);
  background: var(--bg-card);
}

.map-overlay-item.current {
  border-color: var(--accent-gold);
}

.map-overlay-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-gold-dim);
  width: 50px;
  flex-shrink: 0;
  text-align: center;
  border-right: 1px solid var(--border-subtle);
  padding-right: 1rem;
}

.map-overlay-info {
  flex: 1;
}

.map-overlay-room {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.map-overlay-period {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  html { font-size: 15px; }
  .top-nav { padding: 0 1rem; }
  .nav-current { display: none; }
  .room-hero { min-height: 40vh; padding: 3rem 1.5rem; }
  .room-content { padding: 2rem 1.5rem; }
  .voice-section { padding: 1.75rem; }
  .room-nav-grid { grid-template-columns: 1fr; }
  .room-nav-item.next { text-align: left; align-items: flex-start; }
  .floor-plan { padding: 3rem 1.5rem; }
  .map-grid { grid-template-columns: 1fr; }
  .lobby-hero { padding: 6rem 1.5rem 3rem; }
  .lobby-hero-image { width: 200px; height: 200px; }
}

/* Selection */
::selection {
  background: rgba(201, 169, 110, 0.25);
  color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-gold-dim); }
