/* ARMADILLO EXPRESS - THE TUNNEL (index.html only)
   Default (no JS / reduced motion): stages render as stacked static sections.
   With JS + motion allowed: html.tunnel-on turns it into a sticky canvas ride. */

.tunnel { position: relative; background: var(--asphalt); color: var(--foam); }

/* ---------- Static default ---------- */
.tunnel-sticky { position: relative; }
#tunnel-canvas { display: none; }
.tunnel-vignette, .tunnel-rail, .tunnel-cue { display: none; }

.tunnel-hero {
  min-height: 92svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(120px, 16vh, 180px) 0 60px;
  position: relative;
  background:
    radial-gradient(900px 480px at 50% 110%, rgba(255, 61, 138, 0.22), transparent 65%),
    radial-gradient(700px 420px at 50% -10%, rgba(55, 216, 240, 0.10), transparent 60%),
    var(--asphalt);
}
.tunnel-hero .wrap { position: relative; z-index: 2; }
.tunnel-hero h1 {
  font-size: var(--t-hero);
  letter-spacing: -0.02em;
  margin: 18px 0 20px;
  max-width: 900px;
  text-shadow: 0 4px 44px rgba(4, 6, 11, 0.85), 0 1px 3px rgba(4, 6, 11, 0.6);
}
.tunnel-hero h1 .glow-m { color: var(--magenta); text-shadow: 0 0 34px rgba(255, 61, 138, 0.55); }
.tunnel-hero h1 .glow-c { color: var(--cyan); text-shadow: 0 0 34px rgba(55, 216, 240, 0.5); }
.tunnel-hero .lede {
  max-width: 560px;
  color: #C7D1E0;
  text-shadow: 0 2px 18px rgba(4, 6, 11, 0.9), 0 1px 2px rgba(4, 6, 11, 0.7);
}
.tunnel-hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.gate-chip { margin-bottom: 8px; }

/* Stage blocks: static = stacked sections */
.tstage {
  padding: clamp(80px, 12vh, 140px) 0;
  border-top: 1px solid var(--line-dark);
  position: relative;
}
.tstage .wrap { max-width: 860px; }
.tstage-eyebrow {
  font-family: var(--font-mono); font-size: var(--t-mono); font-weight: 700;
  letter-spacing: 0.26em; text-transform: uppercase; margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
}
.tstage-eyebrow::before { content: ""; width: 34px; height: 2px; background: currentColor; }
.tstage h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); max-width: 780px; }
.tstage p { color: var(--foam-dim); max-width: 560px; font-size: clamp(1rem, 1.3vw, 1.15rem); }
.tstage-soak  { background: linear-gradient(180deg, var(--asphalt), #0B1B26 70%, var(--asphalt)); }
.tstage-soak .tstage-eyebrow { color: var(--cyan); }
.tstage-foam  { background: linear-gradient(180deg, var(--asphalt), #1E0B1B 70%, var(--asphalt)); }
.tstage-foam .tstage-eyebrow { color: var(--magenta); }
.tstage-seal  { background: linear-gradient(180deg, var(--asphalt), #1F1608 70%, var(--asphalt)); }
.tstage-seal .tstage-eyebrow { color: var(--chamois); }
.tstage-dry   { background: linear-gradient(180deg, var(--asphalt), #101A2A 70%, var(--asphalt)); }
.tstage-dry .tstage-eyebrow { color: var(--foam); }

/* ---------- JS ride mode ---------- */
html.tunnel-on .tunnel { height: 560vh; }
html.tunnel-on .tunnel-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  overflow: hidden;
}
html.tunnel-on #tunnel-canvas {
  display: block; position: absolute; inset: 0; width: 100%; height: 100%;
}
html.tunnel-on .tunnel-vignette {
  display: block; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(4, 6, 11, 0.75) 100%);
}
html.tunnel-on .tunnel-hero {
  position: absolute; inset: 0; z-index: 4; min-height: 0;
  display: flex; justify-content: center;
  background: none; padding: 0;
  transition: opacity 0.3s linear;
}
html.tunnel-on .tstage {
  position: absolute; inset: 0; z-index: 4;
  display: flex; align-items: center;
  padding: 0; border: 0; background: none;
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease, transform 0.45s ease;
  transform: translateY(18px);
  pointer-events: none;
}
html.tunnel-on .tstage.live {
  opacity: 1; visibility: visible; transform: none;
}
html.tunnel-on .tstage .wrap { width: 100%; }
html.tunnel-on .tstage h2 { text-shadow: 0 4px 40px rgba(4, 6, 11, 0.8); }
html.tunnel-on .tstage p { text-shadow: 0 2px 20px rgba(4, 6, 11, 0.9); }

/* progress rail */
html.tunnel-on .tunnel-rail {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  position: absolute; right: clamp(14px, 3vw, 44px); top: 50%;
  transform: translateY(-50%); z-index: 5; height: min(44vh, 380px);
}
.tunnel-rail-track { width: 2px; flex: 1; background: var(--line-dark); position: relative; border-radius: 2px; }
.tunnel-rail-fill { position: absolute; top: 0; left: 0; width: 100%; height: 0%; background: linear-gradient(180deg, var(--cyan), var(--magenta)); border-radius: 2px; }
.tunnel-rail-label {
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.2em; color: var(--foam-dim); writing-mode: vertical-rl;
  margin-bottom: 12px;
}
.tunnel-rail-pct { font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700; color: var(--cyan); margin-top: 12px; }

/* scroll cue */
html.tunnel-on .tunnel-cue {
  display: flex; align-items: center; gap: 10px;
  position: absolute; left: 50%; bottom: clamp(18px, 4vh, 40px);
  transform: translateX(-50%); z-index: 5;
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--foam-dim);
  transition: opacity 0.3s linear;
}
.tunnel-cue .cue-arrow { animation: cue-drop 1.6s ease-in-out infinite; }
@keyframes cue-drop { 0%, 100% { transform: translateY(0); opacity: 1; } 55% { transform: translateY(7px); opacity: 0.4; } }

/* gate arm (hero, ride mode only) */
.gate-wrap { display: none; }
html.tunnel-on .gate-wrap {
  display: block; position: absolute; left: 0; right: 0; bottom: 7vh; z-index: 3;
  pointer-events: none;
}
.gate-arm {
  width: min(52vw, 560px); height: 10px; border-radius: 6px;
  margin: 0 auto;
  background: repeating-linear-gradient(45deg, var(--chamois) 0 26px, var(--asphalt) 26px 52px);
  box-shadow: 0 0 24px rgba(255, 214, 92, 0.35);
  transform-origin: left center;
  transition: transform 0.2s linear;
}

/* daylight exit sections (shared with rest of page) */
.daylight { background: var(--day); color: var(--ink); position: relative; }
.daylight .eyebrow { color: var(--magenta); }
.daylight .final-cta .eyebrow { color: var(--cyan); }
.daylight-burst {
  height: 130px;
  background: linear-gradient(180deg, var(--asphalt) 0%, #7FB4D6 34%, #D8E9F4 62%, var(--day) 100%);
}
html.tunnel-on .daylight-burst {
  background: linear-gradient(180deg, #E8F4FB 0%, var(--day) 100%);
  height: 90px;
}

@media (max-width: 700px) {
  html.tunnel-on .tunnel { height: 480vh; }
  html.tunnel-on .tunnel-rail { display: none; }
  .gate-arm { width: 74vw; }
}
