:root {
  --bg: #0b0e0d;
  --fg: #f2ede4;
  --fg-muted: rgba(242, 237, 228, 0.72);
  --fg-dim: rgba(242, 237, 228, 0.45);
  --gold: #d6a96c;
  --rosehip: #c45642;
  --glass: rgba(12, 16, 15, 0.48);
  --glass-border: rgba(242, 237, 228, 0.14);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html,
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input,
select {
  font-family: inherit;
  color: inherit;
}

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

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #090c0b;
  display: grid;
  place-items: center;
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.9s;
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  width: min(380px, 84vw);
  text-align: center;
}

.preloader-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin-bottom: 12px;
}

.preloader-title {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 400;
  font-style: italic;
  margin-bottom: 26px;
}

.preloader-bar-wrap {
  height: 2px;
  background: rgba(242, 237, 228, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.preloader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), #f3d7a8);
  transition: width 0.25s ease-out;
}

.preloader-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-dim);
}

/* ---------- Cinema Stage ---------- */
.cinema-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}

#cinema-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.cinema-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 38%, rgba(7, 9, 8, 0.72) 100%),
    linear-gradient(180deg, rgba(8, 10, 9, 0.52) 0%, transparent 22%, transparent 72%, rgba(8, 10, 9, 0.72) 100%);
}

.cinema-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(8, 11, 10, 0.24);
  transition: background 0.6s ease;
}

.cinema-grain {
  position: absolute;
  inset: -40%;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 6s steps(8) infinite;
}

@keyframes grainShift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 2%); }
  50% { transform: translate(2%, -1%); }
  75% { transform: translate(-1%, -2%); }
}

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 48px);
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--fg);
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(214, 169, 108, 0.8);
}

.chapter-pill {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  color: var(--fg-muted);
}

.cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(242, 237, 228, 0.1);
  border: 1px solid rgba(242, 237, 228, 0.24);
  backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.28s ease;
}

.cta-pill:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* ---------- Left HUD Rail ---------- */
.hud-rail {
  position: fixed;
  left: clamp(16px, 2.8vw, 38px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  pointer-events: none;
}

.hud-alt {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
}

.hud-value {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.hud-track {
  position: relative;
  height: 180px;
  width: 2px;
  margin-left: 5px;
  background: rgba(242, 237, 228, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
}

.hud-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--gold);
}

.hud-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(242, 237, 228, 0.5);
  background: #0b0e0d;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.hud-dot.is-active {
  background: var(--gold);
  border-color: var(--gold);
  transform: scale(1.25);
  box-shadow: 0 0 12px rgba(214, 169, 108, 0.75);
}

.hud-dot::after {
  content: attr(data-tip);
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hud-dot:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.hud-coords {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
}

/* ---------- Scroll World & Acts ---------- */
.scroll-world {
  position: relative;
  z-index: 10;
}

.act {
  position: relative;
  min-height: 220vh;
}

.act-finale {
  min-height: 150vh;
}

.act-sticky {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 112px clamp(24px, 6vw, 112px) 64px max(172px, 13vw);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin-bottom: 18px;
}

.display-title {
  font-family: var(--serif);
  font-size: clamp(46px, 7.6vw, 106px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-shadow: 0 12px 44px rgba(0, 0, 0, 0.45);
}

.display-title em,
.section-title em {
  font-style: italic;
  color: #f4d8ae;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(36px, 5.2vw, 68px);
  font-weight: 400;
  line-height: 1.04;
  text-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
}

/* ---------- Hero ---------- */
.hero-content {
  max-width: 780px;
}

.hero-lead {
  margin-top: 24px;
  max-width: 540px;
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.68;
  color: var(--fg-muted);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn-primary {
  background: var(--gold);
  color: #101311;
  border: 1px solid var(--gold);
}

.btn-primary:hover {
  background: #e6be84;
  transform: translateY(-2px);
}

.btn-ghost {
  background: var(--glass);
  color: var(--fg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
}

.btn-ghost:hover {
  border-color: rgba(242, 237, 228, 0.45);
  background: rgba(20, 25, 23, 0.65);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 15px;
}

.btn-full {
  width: 100%;
}

.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: clamp(24px, 11vw, 156px);
  display: flex;
  align-items: center;
  gap: 14px;
}

.scroll-cue-text {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--fg-dim);
}

.scroll-cue-line {
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  animation: pulseLine 2.4s ease-in-out infinite;
}

@keyframes pulseLine {
  0%, 100% { opacity: 0.35; transform: scaleX(0.7); transform-origin: left; }
  50% { opacity: 1; transform: scaleX(1.1); transform-origin: left; }
}

/* ---------- Act II: Philosophy ---------- */
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.body-text {
  margin-top: 22px;
  max-width: 520px;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.72;
  color: var(--fg-muted);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.metrics-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metric-card {
  padding: 22px 26px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-num {
  font-family: var(--serif);
  font-size: clamp(30px, 3.2vw, 42px);
  font-style: italic;
  color: var(--gold);
  line-height: 1;
}

.metric-caption {
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-muted);
}

/* ---------- Act III: Routes ---------- */
.routes-wrap {
  width: 100%;
  max-width: 1180px;
}

.routes-head {
  margin-bottom: 34px;
}

.routes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.route-card {
  padding: 26px;
  border-radius: 22px;
  background: rgba(11, 15, 14, 0.56);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, background 0.3s ease;
}

.route-card:hover {
  transform: translateY(-6px);
  border-color: rgba(214, 169, 108, 0.5);
  background: rgba(13, 18, 16, 0.72);
}

.route-card.is-featured {
  border-color: rgba(214, 169, 108, 0.38);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.route-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-family: var(--mono);
  font-size: 11px;
}

.route-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(214, 169, 108, 0.14);
  color: var(--gold);
  white-space: nowrap;
}

.route-meta {
  color: var(--fg-dim);
  white-space: nowrap;
}

.route-name {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.12;
}

.route-desc {
  font-size: 14px;
  line-height: 1.62;
  color: var(--fg-muted);
  flex: 1;
}

.route-foot {
  padding-top: 14px;
  border-top: 1px solid rgba(242, 237, 228, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.route-season {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-dim);
}

.route-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  transition: transform 0.2s ease;
}

.route-btn:hover {
  transform: translateX(4px);
}

/* ---------- Act IV: Finale ---------- */
.finale-card {
  max-width: 720px;
  padding: clamp(28px, 4vw, 52px);
  border-radius: 28px;
  background: rgba(10, 14, 15, 0.56);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px);
}

.finale-title {
  font-size: clamp(40px, 6vw, 78px);
}

.finale-lead {
  margin-top: 20px;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.65;
  color: var(--fg-muted);
}

.finale-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.finale-foot {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(242, 237, 228, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-dim);
}

.mode-badge {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(214, 169, 108, 0.3);
  color: var(--gold);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 6, 0.72);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(460px, 92vw);
  padding: 34px 30px;
  border-radius: 24px;
  background: #101514;
  border: 1px solid rgba(242, 237, 228, 0.16);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(242, 237, 228, 0.16);
  background: transparent;
  cursor: pointer;
  color: var(--fg-muted);
}

.modal-close:hover {
  background: rgba(242, 237, 228, 0.1);
  color: var(--fg);
}

.modal-title {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  margin-bottom: 8px;
}

.modal-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin-bottom: 22px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--fg-muted);
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(242, 237, 228, 0.16);
  font-size: 14px;
  outline: none;
}

.field select option {
  background: #101514;
  color: var(--fg);
}

.field input:focus,
.field select:focus {
  border-color: var(--gold);
}

.modal-success {
  text-align: center;
  padding: 16px 0 4px;
}

.success-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(214, 169, 108, 0.16);
  color: var(--gold);
  font-size: 22px;
}

.modal-success h4 {
  font-family: var(--serif);
  font-size: 28px;
  margin-bottom: 8px;
}

.modal-success p {
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: 20px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hud-rail,
  .topbar-center {
    display: none;
  }

  .act-sticky {
    padding: 88px 22px 48px;
  }

  .split-layout,
  .routes-grid {
    grid-template-columns: 1fr;
  }

  .scroll-cue {
    left: 22px;
  }
}
