/* ── Tokens ──────────────────────────────────────── */
:root {
  --bg: #0a0a0a;
  --card: rgba(10,10,10,0.88);
  --card-border: rgba(255,255,255,0.06);
  --text: #e8e4dc;
  --text2: #a09888;
  --text3: #685e50;
  --gold: #c9a84c;
  --blue: #7ba3c9;
  --land: #c9a84c;
  --people: #7ba3c9;
  --source: #8a7a60;
  --radius: 16px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Map (fixed background) ─────────────────────── */
#map {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
}

/* ── Progress bar ────────────────────────────────── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--gold);
  z-index: 100;
  width: 0;
  transition: width 0.3s ease;
}

/* ── Story container ─────────────────────────────── */
#story {
  position: relative;
  z-index: 5;
  pointer-events: none;
}

#story * {
  pointer-events: auto;
}

/* ── Header ──────────────────────────────────────── */
#header {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  position: relative;
}

#header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  max-width: 700px;
}

#header p {
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  color: var(--text2);
  margin-top: 0.75rem;
  max-width: 500px;
}

.lang-toggle {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 200;
  display: flex; gap: 4px;
}

.lang-btn {
  font-family: var(--font);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 5px 12px;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: var(--card);
  color: var(--text3);
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.2s;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.lang-btn.active {
  color: var(--gold);
  border-color: var(--gold);
}
.lang-btn:hover { color: var(--text); }

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  font-size: 1.5rem;
  color: var(--text3);
  animation: bounce 2s infinite;
  transition: opacity 0.5s;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ── Chapters ────────────────────────────────────── */
#chapters {
  padding: 30vh 0 40vh;
}

.step {
  padding-bottom: 55vh;
  opacity: 0.15;
  transition: opacity 0.6s ease;
  max-width: 420px;
  margin-left: 5vw;
}

.step.active {
  opacity: 1;
}

.step-inner {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 30px 24px;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

/* Perspective tags */
.persp-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.persp-land {
  color: var(--land);
  border: 1px solid rgba(201,168,76,0.3);
  background: rgba(201,168,76,0.08);
}

.persp-people {
  color: var(--people);
  border: 1px solid rgba(123,163,201,0.3);
  background: rgba(123,163,201,0.08);
}

.step-year {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.step-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 12px;
}

.step-desc {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text2);
}

.step-desc .source {
  display: block;
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--source);
  line-height: 1.5;
}

/* ── Footer ──────────────────────────────────────── */
#footer {
  text-align: center;
  padding: 4rem 2rem 3rem;
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

#footer-text {
  font-size: 0.75rem;
  color: var(--text3);
  line-height: 1.7;
  max-width: 500px;
}

#footer-text a {
  color: var(--gold);
  text-decoration: none;
}

.back-link {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text3);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}
.back-link:hover { color: var(--gold); }

/* ── MapLibre tweaks ─────────────────────────────── */
.maplibregl-ctrl-attrib { font-size: 9px !important; }
.maplibregl-marker svg path[fill] { transition: fill 0.5s ease; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .step {
    max-width: 85vw;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 45vh;
  }

  .step-inner {
    padding: 20px 22px 18px;
  }

  .step-title {
    font-size: 1.1rem;
  }

  .step-desc {
    font-size: 0.8rem;
  }

  #header h1 {
    font-size: 1.8rem;
  }
}
