:root {
  --red: #E30613;
  --red-dim: rgba(227,6,19,0.12);
  --bg: #0a0806;
  --text: #f5f0e8;
  --muted: rgba(245,240,232,0.55);
  --muted2: rgba(245,240,232,0.25);
  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.13);
  --gold: #C8A96A;
  --green: #4fa870;
  --green-dim: rgba(79,168,112,0.14);
  --amber: #d4a040;
  --amber-dim: rgba(212,160,64,0.12);
  --max-w: 680px;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}

body {
  font-family:'DM Sans',sans-serif;
  background:var(--bg);
  color:var(--text);
  font-size:15px;
  line-height:1.7;
  overflow-x:hidden;
}

/* ═══ LAYER 1: FULL-PAGE FIXED BACKGROUND ═══ */
.scene-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('../../assets/bernina-express-bg.png') center 35% / cover no-repeat;
  filter: brightness(0.42) saturate(1.15);
}

/* Gradient to darken bottom third where track + content live */
.scene-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      to bottom,
      rgba(10,8,6,0.15) 0%,
      rgba(10,8,6,0.0) 35%,
      rgba(10,8,6,0.55) 65%,
      rgba(10,8,6,0.88) 85%,
      rgba(10,8,6,0.97) 100%
    );
  pointer-events: none;
}

/* ═══ LAYER 2: FIXED TRAIN TRACK ═══ */
.track-layer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 160px; /* taller — gives more breathing room above content */
  z-index: 20;
  pointer-events: none;
}

/* Rail progress (red line) */
.rail-progress {
  position: absolute;
  bottom: 62px; left: 0;
  height: 3px;
  width: 0%;
  background: var(--red);
  z-index: 3;
  box-shadow: 0 0 8px rgba(227,6,19,0.5);
}

/* Rails */
.rail {
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, #666, #aaa 20%, #aaa 80%, #666);
  box-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.rail-top { bottom: 64px; }
.rail-bottom { bottom: 54px; }

/* Sleepers */
.sleepers { position: absolute; bottom: 50px; left: 0; right: 0; height: 24px; }
.sleeper {
  position: absolute;
  width: 14px; height: 24px;
  background: #3d2610;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Station markers */
.station {
  position: absolute;
  bottom: 100px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.12; /* very faded — barely there */
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.station.active { opacity: 0.35; /* slightly more visible, still subtle */ }

.sm-sign {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: rgba(245,240,232,0.5);
  background: transparent;
  border: none;
  padding: 2px 4px;
  white-space: nowrap;
  margin-bottom: 4px;
  transition: color 0.4s;
}
.station.active .sm-sign {
  color: rgba(245,240,232,0.65);
}

.sm-pole {
  width: 1px; height: 10px;
  background: rgba(255,255,255,0.15);
}
.station.active .sm-pole { background: rgba(255,255,255,0.25); }

.sm-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
}
.station.active .sm-dot {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.3);
  box-shadow: none;
}

/* Train element */
.train-el {
  position: absolute;
  bottom: 52px;
  width: 420px;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.7));
  will-change: transform;
  z-index: 10;
  pointer-events: none;
}
.train-el svg { width: 100%; display: block; }

/* Steam / condensation puffs */
.puff-wrap {
  position: absolute;
  bottom: 102px;
  z-index: 11;
  pointer-events: none;
  will-change: transform;
}

@keyframes steam {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.6); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(var(--ds)); }
}

.puff {
  position: absolute;
  border-radius: 50%;
  /* Soft radial gradient: dense white centre fading to transparent */
  background: radial-gradient(circle, rgba(240,245,255,0.85) 0%, rgba(255,255,255,0.3) 45%, transparent 75%);
  filter: blur(3px);
  animation: steam var(--dur) ease-out infinite var(--delay);
}
/* Each puff has unique size, position, drift, and timing */
.p1 { --dx:-28px; --dy:-44px; --ds:3.2; --dur:2.0s; --delay:0.0s; width:16px; height:16px; left:0px; top:0px; }
.p2 { --dx:-18px; --dy:-38px; --ds:2.8; --dur:2.2s; --delay:0.5s; width:11px; height:11px; left:5px; top:-5px; }
.p3 { --dx:-36px; --dy:-52px; --ds:2.5; --dur:1.8s; --delay:1.0s; width:13px; height:13px; left:-5px; top:3px; }
.p4 { --dx:-12px; --dy:-46px; --ds:3.5; --dur:2.4s; --delay:0.25s; width:9px;  height:9px;  left:3px; top:-9px; }
.p5 { --dx:-42px; --dy:-34px; --ds:2.2; --dur:1.6s; --delay:0.8s; width:8px;  height:8px;  left:-7px; top:6px; }

/* ═══ SCROLL PROGRESS ═══ */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; background: var(--red);
  z-index: 1000; width: 0%;
}

/* ═══ LAYER 4: PAGE CONTENT ═══ */
.page-content {
  position: relative;
  z-index: 10;
}

/* HERO */
.hero-section {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 28px 200px; /* generous clearance above fixed track */
}
.hero-inner { max-width: var(--max-w); }

.back-link {
  display: inline-block;
  font-size: 12px; color: var(--muted);
  text-decoration: none; letter-spacing: 0.04em;
  margin-bottom: 16px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text); }

.hero-route {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 0.1em;
  color: rgba(245,240,232,0.35);
  margin-bottom: 12px;
}

.hero-section h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(34px, 7vw, 60px);
  font-weight: 400;
  line-height: 1.1;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
  margin-bottom: 12px;
}
.hero-section h1 em { font-style: italic; color: var(--red); }
.hero-section p { font-size: 15px; color: var(--muted); text-shadow: 0 1px 8px rgba(0,0,0,0.5); }

.hero-scroll-hint {
  position: absolute;
  bottom: 148px; right: 28px;
  font-family: 'DM Mono', monospace;
  font-size: 11px; letter-spacing: 0.08em;
  color: rgba(245,240,232,0.3);
  animation: bobY 2s ease-in-out infinite;
}
@keyframes bobY { 0%,100%{transform:translateY(0)} 50%{transform:translateY(6px)} }

/* CONTENT SECTIONS */
.content-section {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Large bottom padding = content never overlaps fixed train track */
  padding: 48px 20px 200px;
}

/* GLASS CARD */
.glass-card {
  width: 100%;
  max-width: var(--max-w);
  background: rgba(8,6,4,0.82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 30px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,255,255,0.05);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.glass-card.visible { opacity: 1; transform: translateY(0); }
.wide-card { max-width: 760px; }
@media(max-width:600px) { .glass-card { padding: 20px 16px; } }

.card-label { display:flex;align-items:center;gap:10px;font-size:10px;letter-spacing:0.1em;text-transform:uppercase;color:var(--muted2);margin-bottom:10px; }
.card-num { font-family:'DM Mono',monospace;color:var(--red);font-size:11px; }
.glass-card h2 { font-family:'Playfair Display',serif;font-size:clamp(21px,4vw,30px);font-weight:400;margin-bottom:20px;line-height:1.2; }
.card-intro { color:var(--muted);font-size:14px;margin-bottom:18px; }
.card-tip { margin-top:16px;padding:11px 15px;background:rgba(200,169,106,0.07);border-left:3px solid var(--gold);border-radius:0 7px 7px 0;font-size:13.5px;color:var(--muted);line-height:1.65; }
.card-tip a { color:var(--text); }

/* Two col */
.two-col { display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:4px; }
@media(max-width:480px) { .two-col { grid-template-columns:1fr; } }
.verdict-head { font-size:11px;font-weight:600;letter-spacing:0.05em;text-transform:uppercase;margin-bottom:10px; }
.yes-head { color:var(--green); }
.skip-head { color:var(--amber); }
.vlist { list-style:none;display:flex;flex-direction:column;gap:7px; }
.vlist li { font-size:13.5px;color:var(--muted);padding-left:12px;position:relative; }
.vlist li::before { content:'—';position:absolute;left:0;color:var(--muted2);font-size:10px; }

/* Passes */
.passes-list { display:flex;flex-direction:column;gap:10px; }
.pass-item { padding:16px;background:rgba(255,255,255,0.025);border:1px solid var(--border);border-radius:9px;transition:border-color 0.2s; }
.pass-item:hover { border-color:var(--border2); }
.featured-pass { border-color:rgba(227,6,19,0.22);background:rgba(227,6,19,0.04); }
.saver-pass { border-color:rgba(79,168,112,0.18);background:rgba(79,168,112,0.03); }
.pi-top { display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px; }
@media(max-width:480px) { .pi-top { flex-direction:column; } }
.pi-top h3 { font-family:'Playfair Display',serif;font-size:16px;font-weight:400;margin-bottom:3px; }
.pi-top p { font-size:12.5px;color:var(--muted);max-width:340px; }
.pi-badge { display:inline-block;font-size:9px;letter-spacing:0.06em;text-transform:uppercase;padding:2px 8px;border-radius:20px;background:var(--red);color:white;margin-bottom:5px; }
.saver-badge { background:var(--green-dim);color:var(--green);border:1px solid rgba(79,168,112,0.3); }
.pi-stats { display:flex;gap:14px;flex-shrink:0; }
.pis { display:flex;flex-direction:column;align-items:flex-end; }
.pis-n { font-family:'DM Mono',monospace;font-size:14px;color:var(--text);line-height:1; }
.pis-l { font-size:10px;color:var(--muted2); }
.pi-tags { display:flex;flex-wrap:wrap;gap:5px;margin-bottom:9px; }
.pt-yes,.pt-part,.pt-no { font-size:11.5px;padding:2px 9px;border-radius:20px;border:1px solid; }
.pt-yes { border-color:rgba(79,168,112,0.3);color:var(--green);background:var(--green-dim); }
.pt-part { border-color:rgba(212,160,64,0.3);color:var(--amber);background:var(--amber-dim); }
.pt-no { border-color:var(--border);color:var(--muted2); }
.pi-verdict { font-size:12px;padding:5px 11px;border-radius:5px;display:inline-block; }
.good-v { background:var(--green-dim);color:var(--green); }
.neutral-v { background:rgba(200,169,106,0.1);color:var(--gold); }
.skip-v { background:var(--red-dim);color:var(--red); }

/* Mountain grid */
.mountain-grid { border:1px solid var(--border);border-radius:8px;overflow:hidden;margin-bottom:14px; }
.mg-row { display:grid;grid-template-columns:1.6fr 1.4fr;padding:11px 16px;border-top:1px solid var(--border);font-size:13.5px;gap:8px;align-items:center; }
.mg-row:first-child { border-top:none; }
.mg-head { background:rgba(255,255,255,0.03);font-size:10px;letter-spacing:0.07em;text-transform:uppercase;color:var(--muted2);font-family:'DM Mono',monospace; }
.mg-yes { color:var(--green);font-weight:500; }
.mg-part { color:var(--amber);font-size:12.5px; }

/* Selector */
.sel-prog-bar { height:2px;background:rgba(255,255,255,0.1);border-radius:2px;margin-bottom:22px;overflow:hidden; }
.sel-prog-fill { height:100%;background:var(--red);width:0%;transition:width 0.4s ease; }
.sel-q { display:none; }
.sel-q.active { display:block; }
.sq-l { font-family:'DM Mono',monospace;font-size:10px;letter-spacing:0.08em;text-transform:uppercase;color:var(--muted2);margin-bottom:10px; }
.sel-q h3,.sel-result h3 { font-family:'Playfair Display',serif;font-size:19px;font-weight:400;margin-bottom:14px;line-height:1.3; }
.sq-opts { display:flex;flex-direction:column;gap:7px; }
.sopt { padding:11px 16px;background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.1);border-radius:7px;color:var(--text);font-family:'DM Sans',sans-serif;font-size:14px;text-align:left;cursor:pointer;transition:border-color 0.18s,background 0.18s,padding-left 0.18s; }
.sopt:hover { border-color:var(--red);background:var(--red-dim);padding-left:22px; }
.sel-result { display:none; }
.sel-result.active { display:block; }
.sel-result>p { font-size:14px;color:var(--muted);line-height:1.7;margin-bottom:14px; }
.r-tags { display:flex;flex-wrap:wrap;gap:6px;margin-bottom:16px; }
.r-tag { font-size:11.5px;font-family:'DM Mono',monospace;padding:3px 10px;border-radius:20px;border:1px solid var(--border2);color:var(--muted); }
.r-reset { background:none;border:none;color:var(--muted);font-family:'DM Sans',sans-serif;font-size:13px;cursor:pointer;padding:0;transition:color 0.2s; }
.r-reset:hover { color:var(--red); }

/* Route viz */
.route-viz { display:flex;align-items:center;flex-wrap:wrap;gap:0;margin-bottom:16px; }
.rv-stop { font-family:'DM Mono',monospace;font-size:10px;color:var(--muted);padding:5px 10px;border:1px solid var(--border);border-radius:4px;white-space:nowrap;background:rgba(255,255,255,0.03); }
.rv-accent { border-color:rgba(212,160,64,0.4);color:var(--amber); }
.rv-line { flex:1;min-width:14px;height:1px;background:rgba(227,6,19,0.35); }
.pick-chips { display:flex;flex-wrap:wrap;gap:6px;margin:12px 0; }
.pick-chips span { font-size:11px;font-family:'DM Mono',monospace;padding:3px 9px;border-radius:4px;background:var(--red-dim);color:rgba(227,6,19,0.9);border:1px solid rgba(227,6,19,0.2); }

/* Comparison table */
.ct-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 14px; }
.ct-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.ct-table th {
  font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted2); font-weight: 400;
  padding: 8px 12px; text-align: left;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}
.ct-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  vertical-align: top;
  line-height: 1.4;
}
.ct-table th:first-child, .ct-table td:first-child { color: var(--text); font-size: 13px; }
.ct-table tr:last-child td { border-bottom: none; }
.ct-table tr:hover td { background: rgba(255,255,255,0.02); }
.ct-yes { color: var(--green) !important; }
.ct-part { color: var(--amber) !important; }
.ct-no { color: var(--muted2) !important; }
.ct-warn { color: var(--amber) !important; font-size: 12px; }
.ct-sub { display: block; font-size: 10px; color: var(--muted2); letter-spacing: 0.03em; margin-top: 1px; }
.ct-note { font-size: 12px; color: var(--muted2); line-height: 1.6; border-top: 1px solid var(--border); padding-top: 10px; }

/* Tips grid */
.tips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
@media (max-width: 500px) { .tips-grid { grid-template-columns: 1fr; } }
.tip-item {
  padding: 18px 14px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.tip-item:nth-child(even) { border-right: none; }
.tip-item:nth-last-child(-n+2) { border-bottom: none; }
@media (max-width: 500px) {
  .tip-item { border-right: none; }
  .tip-item:last-child { border-bottom: none; }
}
.tip-n {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--muted2);
  margin-bottom: 6px;
}
.tip-item h4 {
  font-family: 'Playfair Display', serif;
  font-size: 14px; font-weight: 400;
  margin-bottom: 6px; line-height: 1.3;
}
.tip-item p { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* Footer */
.guide-footer { position:relative;z-index:30;text-align:center;padding:28px 24px;background:rgba(8,6,4,0.97);backdrop-filter:blur(10px);display:flex;flex-direction:column;gap:7px; }
.footer-home { color:var(--muted);text-decoration:none;font-size:13px;transition:color 0.2s; }
.footer-home:hover { color:var(--red); }
.guide-footer p { font-size:12px;color:var(--muted2); }
.guide-footer a { color:var(--muted); }
