/* ============ Tokens ============ */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem);
  --text-hero: clamp(2.75rem, 0.8rem + 6vw, 6.5rem);

  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.25rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem; --space-16: 4rem;
  --space-20: 5rem; --space-24: 6rem; --space-32: 8rem;

  --radius-sm: 8px; --radius-md: 14px; --radius-lg: 22px; --radius-xl: 30px; --radius-full: 999px;

  --font-display: 'Cabinet Grotesk', 'Satoshi', system-ui, sans-serif;
  --font-body: 'Satoshi', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.4, 0, 0.2, 1);
  --t: 180ms var(--ease-out);

  --content: 1240px;
}

/* Dark — Atlantic night */
[data-theme='dark'] {
  color-scheme: dark;
  --bg: oklch(0.165 0.022 235);
  --bg-2: oklch(0.195 0.024 232);
  --text: oklch(0.955 0.01 85);
  --muted: oklch(0.74 0.02 230);
  --faint: oklch(0.55 0.02 230);
  --line: oklch(1 0 0 / 0.10);
  --accent: oklch(0.82 0.145 72);
  --accent-hover: oklch(0.86 0.13 75);
  --accent-ink: oklch(0.22 0.04 60);
  --accent-text: oklch(0.84 0.14 72);
  --ok: oklch(0.80 0.15 158);
  --busy: oklch(0.74 0.15 35);
  --off: oklch(0.62 0.02 230);
  --glass-bg: oklch(0.24 0.025 232 / 0.48);
  --glass-strong-bg: oklch(0.20 0.025 232 / 0.62);
  --glass-border: oklch(1 0 0 / 0.13);
  --glass-hi: oklch(1 0 0 / 0.16);
  --shadow: 0 24px 60px -24px oklch(0.05 0.03 240 / 0.7), 0 2px 6px oklch(0.05 0.03 240 / 0.35);
  --map-land: oklch(0.27 0.025 230);
  --map-dot: oklch(1 0 0 / 0.10);
  --ambient-1: oklch(0.35 0.06 225 / 0.45);
  --ambient-2: oklch(0.45 0.09 65 / 0.18);
}

/* Light — Limestone day */
[data-theme='light'] {
  color-scheme: light;
  --bg: oklch(0.965 0.008 85);
  --bg-2: oklch(0.935 0.012 80);
  --text: oklch(0.22 0.025 235);
  --muted: oklch(0.45 0.025 235);
  --faint: oklch(0.6 0.02 235);
  --line: oklch(0.22 0.03 235 / 0.10);
  --accent: oklch(0.80 0.15 72);
  --accent-hover: oklch(0.76 0.15 68);
  --accent-ink: oklch(0.22 0.04 60);
  --accent-text: oklch(0.52 0.13 58);
  --ok: oklch(0.56 0.14 158);
  --busy: oklch(0.58 0.17 35);
  --off: oklch(0.55 0.02 235);
  --glass-bg: oklch(1 0 0 / 0.55);
  --glass-strong-bg: oklch(1 0 0 / 0.72);
  --glass-border: oklch(0.22 0.03 235 / 0.10);
  --glass-hi: oklch(1 0 0 / 0.85);
  --shadow: 0 24px 60px -28px oklch(0.3 0.05 235 / 0.35), 0 2px 6px oklch(0.3 0.05 235 / 0.10);
  --map-land: oklch(0.90 0.015 85);
  --map-dot: oklch(0.22 0.03 235 / 0.12);
  --ambient-1: oklch(0.85 0.05 220 / 0.55);
  --ambient-2: oklch(0.88 0.09 75 / 0.45);
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 400ms var(--ease-io), color 400ms var(--ease-io);
}
/* Soft ambient light behind glass surfaces */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 85% 20%, var(--ambient-2), transparent 70%),
    radial-gradient(70% 60% at 10% 80%, var(--ambient-1), transparent 70%);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.02; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--radius-sm); }
.skip:focus { top: 12px; }
.mono { font-family: var(--font-mono); font-feature-settings: 'zero' 1; letter-spacing: -0.01em; }
.small { font-size: var(--text-xs); }
.muted { color: var(--muted); }
.accent-text { color: var(--accent-text); }
.container { width: min(100% - 2 * clamp(1.25rem, 4vw, 3rem), var(--content)); margin-inline: auto; }
.section { padding-block: clamp(var(--space-20), 10vw, var(--space-32)); }

/* ============ Glass ============ */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
  transition: background-color 400ms var(--ease-io), border-color 400ms var(--ease-io);
}
.glass-strong { background: var(--glass-strong-bg); }
/* Hero glass always reads against the dark photo */
.hero .glass {
  --glass-bg: oklch(0.22 0.025 232 / 0.42);
  --glass-strong-bg: oklch(0.18 0.025 232 / 0.55);
  --glass-border: oklch(1 0 0 / 0.16);
  --glass-hi: oklch(1 0 0 / 0.18);
  color: oklch(0.96 0.01 85);
}

/* ============ Typography bits ============ */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: var(--space-4);
}
.section-title { font-size: var(--text-xl); max-width: 18ch; }
.section-sub { color: var(--muted); max-width: 44ch; }
.label { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 0 var(--space-6);
  border-radius: var(--radius-full); border: 1px solid transparent;
  font-size: var(--text-sm); font-weight: 700;
  transition: background-color var(--t), transform 120ms var(--ease-out), border-color var(--t), box-shadow var(--t);
}
.btn svg { width: 18px; height: 18px; transition: transform var(--t); }
.btn:active { transform: scale(0.97); }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -10px oklch(0.75 0.15 70 / 0.7); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-accent:hover svg { transform: translateX(3px); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-ghost[aria-pressed='true'] { color: var(--accent-text); border-color: var(--accent-text); }
.btn-ghost[aria-pressed='true'] svg path { fill: currentColor; }
.btn-sm { min-height: 40px; padding: 0 var(--space-4); }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius-full); border: 1px solid oklch(1 0 0 / 0.2); background: oklch(0.15 0.02 235 / 0.5); color: white; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.icon-btn svg { width: 20px; height: 20px; }

/* ============ Nav ============ */
.nav-wrap { position: fixed; top: var(--space-4); left: 0; right: 0; z-index: 50; pointer-events: none; }
.nav {
  pointer-events: auto;
  width: min(100% - 2rem, 1100px); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  transition: transform 400ms var(--ease-out), background-color 400ms var(--ease-io);
}
.nav-wrap.on-hero .nav { --glass-bg: oklch(0.2 0.025 232 / 0.35); --glass-border: oklch(1 0 0 / 0.16); --glass-hi: oklch(1 0 0 / 0.18); color: oklch(0.96 0.01 85); }
.nav-wrap.hidden .nav { transform: translateY(calc(-100% - 2rem)); }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; letter-spacing: -0.03em; }
.wm-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px oklch(0.82 0.145 72 / 0.22); }
.nav-links { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.nav-links a { display: block; padding: var(--space-2) var(--space-4); border-radius: var(--radius-full); font-size: var(--text-sm); font-weight: 500; opacity: 0.82; transition: opacity var(--t), background-color var(--t); }
.nav-links a:hover { opacity: 1; background: oklch(0.5 0.02 230 / 0.14); }
.nav-actions { display: flex; align-items: center; gap: var(--space-2); }

/* Theme toggle */
.theme-toggle { width: 64px; height: 40px; padding: 0; border: 0; background: transparent; border-radius: var(--radius-full); display: grid; place-items: center; }
.tt-track { position: relative; width: 60px; height: 34px; border-radius: var(--radius-full); background: oklch(0.5 0.02 230 / 0.22); border: 1px solid var(--glass-border); transition: background-color 400ms var(--ease-io); }
.tt-thumb { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: oklch(0.96 0.01 85); color: oklch(0.25 0.03 235); display: grid; place-items: center; transition: transform 500ms cubic-bezier(0.34, 1.4, 0.5, 1); box-shadow: 0 2px 8px oklch(0 0 0 / 0.3); }
.tt-thumb svg { width: 15px; height: 15px; position: absolute; transition: opacity 300ms var(--ease-out), transform 500ms var(--ease-out); }
[data-theme='dark'] .tt-thumb { transform: translateX(26px); }
[data-theme='dark'] .tt-sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
[data-theme='light'] .tt-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme='light'] .tt-thumb { background: var(--accent); color: var(--accent-ink); }

/* View transition for theme */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ============ Hero ============ */
.hero { position: relative; min-height: max(100svh, 720px); display: grid; align-items: end; color: oklch(0.96 0.01 85); overflow: clip; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 115%; object-fit: cover; object-position: 60% 50%; transform: translate3d(0, var(--py, 0px), 0) scale(1.04); will-change: transform; animation: heroIn 1.8s var(--ease-out) both; }
@keyframes heroIn { from { opacity: 0; filter: blur(12px); transform: scale(1.12); } }
.hero-scrim { position: absolute; inset: 0; z-index: -1; background:
  linear-gradient(180deg, oklch(0.14 0.03 240 / 0.55) 0%, transparent 30%),
  linear-gradient(90deg, oklch(0.14 0.03 240 / 0.72) 0%, oklch(0.14 0.03 240 / 0.25) 55%, transparent 80%),
  linear-gradient(0deg, oklch(0.14 0.03 240 / 0.85) 0%, transparent 45%); }
.hero-grid { display: grid; grid-template-columns: 1.35fr minmax(320px, 400px); gap: clamp(var(--space-8), 5vw, var(--space-20)); align-items: end; padding-block: 140px clamp(var(--space-12), 7vw, var(--space-24)); }
.hero-title { font-size: var(--text-hero); line-height: 0.94; letter-spacing: -0.035em; margin-bottom: var(--space-6); }
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero-title .line > span { display: inline-block; animation: lineUp 1.1s var(--ease-out) both; }
.hero-title .line:nth-child(2) > span { animation-delay: 120ms; }
.hero-title .line:nth-child(3) > span { animation-delay: 240ms; }
@keyframes lineUp { from { transform: translateY(105%); } }
.accent-word { color: oklch(0.85 0.14 74); }
.hero-lede { max-width: 50ch; color: oklch(0.9 0.015 85 / 0.88); }
.hero .eyebrow { color: oklch(0.88 0.12 75); }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; position: relative; display: inline-block; flex: none; }
.live-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: ping 2s var(--ease-out) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3); opacity: 0; } }
.hero .eyebrow .live-dot { color: oklch(0.82 0.15 158); }

/* Planner */
.planner { border-radius: var(--radius-xl); padding: var(--space-6); display: grid; gap: var(--space-5); }
.planner-head { display: flex; justify-content: space-between; align-items: center; }
.chip-mini { font-size: var(--text-xs); padding: 4px 10px; border-radius: var(--radius-full); background: oklch(1 0 0 / 0.08); border: 1px solid oklch(1 0 0 / 0.12); }
.planner-fields { position: relative; display: grid; gap: var(--space-2); }
.field label { display: block; font-size: var(--text-xs); color: oklch(0.85 0.015 85 / 0.7); margin-bottom: 4px; padding-left: 4px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap svg { position: absolute; left: 14px; width: 18px; height: 18px; color: oklch(0.85 0.14 74); pointer-events: none; }
.input-wrap input, .input-wrap select {
  width: 100%; min-height: 50px; padding: 0 var(--space-4) 0 44px;
  background: oklch(1 0 0 / 0.07); border: 1px solid oklch(1 0 0 / 0.12); border-radius: var(--radius-md);
  font-weight: 500; appearance: none; transition: border-color var(--t), background-color var(--t);
}
.input-wrap select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23e8e4dc' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; cursor: pointer; }
.input-wrap select option { color: #111; }
.input-wrap input:hover, .input-wrap select:hover { border-color: oklch(1 0 0 / 0.28); }
.field-connector { position: absolute; left: 22px; top: 62px; height: 34px; border-left: 2px dotted oklch(1 0 0 / 0.3); z-index: 1; }
.planner-soc label { display: flex; justify-content: space-between; font-size: var(--text-xs); color: oklch(0.85 0.015 85 / 0.75); margin-bottom: var(--space-2); }
.planner-soc output { color: oklch(0.96 0.01 85); }
.planner-summary { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid oklch(1 0 0 / 0.12); padding-top: var(--space-4); }
.planner-summary > div { display: grid; }
.planner-summary .k, .map-stats .k, .calc-out .k { font-size: var(--text-lg); font-weight: 500; line-height: 1.2; }
.planner-summary .u, .map-stats .u, .calc-out .u { font-size: var(--text-xs); opacity: 0.7; }

/* Range */
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; --p: 50%; }
input[type='range']::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--accent) var(--p), oklch(0.6 0.02 230 / 0.3) var(--p)); }
input[type='range']::-moz-range-track { height: 6px; border-radius: 6px; background: oklch(0.6 0.02 230 / 0.3); }
input[type='range']::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--accent); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: oklch(0.98 0.005 85); border: 0; box-shadow: 0 0 0 5px oklch(0.82 0.145 72 / 0.28), 0 2px 6px oklch(0 0 0 / 0.3); transition: box-shadow var(--t); }
input[type='range']::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: oklch(0.98 0.005 85); border: 0; box-shadow: 0 0 0 5px oklch(0.82 0.145 72 / 0.28); }
input[type='range']:hover::-webkit-slider-thumb { box-shadow: 0 0 0 8px oklch(0.82 0.145 72 / 0.28), 0 2px 6px oklch(0 0 0 / 0.3); }

/* Floating card */
.planner-col { position: relative; }
.hero-float { position: absolute; bottom: calc(100% + var(--space-5)); left: -22%; width: 260px; z-index: 2; padding: var(--space-4); border-radius: var(--radius-lg); animation: floaty 7s ease-in-out infinite; }
@keyframes floaty { 50% { translate: 0 -10px; } }
.hf-top { display: flex; justify-content: space-between; align-items: center; font-size: var(--text-xs); }
.hf-dist { opacity: 0.7; }
.hf-name { font-weight: 700; margin: var(--space-2) 0 var(--space-1); }
.hf-meta { display: flex; gap: var(--space-3); font-size: var(--text-xs); opacity: 0.85; flex-wrap: wrap; }

.scroll-cue { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; width: 26px; height: 42px; border-radius: 14px; border: 1.5px solid oklch(1 0 0 / 0.4); display: grid; justify-items: center; padding-top: 7px; }
.scroll-cue span { width: 3px; height: 8px; border-radius: 2px; background: white; animation: cue 1.8s var(--ease-io) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* Status pills */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 700; padding: 4px 10px; border-radius: var(--radius-full); white-space: nowrap; }
.status.ok { color: var(--ok); background: color-mix(in oklch, var(--ok) 16%, transparent); }
.status.busy { color: var(--busy); background: color-mix(in oklch, var(--busy) 16%, transparent); }
.status.off { color: var(--off); background: color-mix(in oklch, var(--off) 16%, transparent); }
.hero .status.ok { color: oklch(0.82 0.15 158); }

/* ============ Reveal ============ */
.reveal { opacity: 0; filter: blur(6px); clip-path: inset(0 0 12% 0); transition: opacity 900ms var(--ease-out), filter 900ms var(--ease-out), clip-path 900ms var(--ease-out); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; filter: none; clip-path: inset(-80px -80px -120px -80px); }
.no-js .reveal { opacity: 1; filter: none; clip-path: none; }

/* ============ Stations ============ */
.section-head.split { display: flex; justify-content: space-between; align-items: end; gap: var(--space-8); margin-bottom: var(--space-10); flex-wrap: wrap; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }
.chips { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-full); border: 1px solid var(--line); background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: var(--text-sm); font-weight: 500; color: var(--muted); transition: all var(--t); }
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.sort select { min-height: 40px; padding: 0 36px 0 var(--space-4); border-radius: var(--radius-full); border: 1px solid var(--line); background: var(--glass-bg); appearance: none; font-size: var(--text-sm); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }

.station-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--space-5); }
.station { grid-column: span var(--span, 4); }

.station {
  position: relative; perspective: 1000px; border: 0; padding: 0; background: none; text-align: left; color: white;
  animation: cardIn 700ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
.station-inner {
  position: relative; height: clamp(340px, 34vw, 420px); border-radius: var(--radius-xl); overflow: hidden;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d; transition: transform 500ms var(--ease-out), box-shadow 400ms var(--ease-out);
  box-shadow: var(--shadow); isolation: isolate;
}
.station.tilting .station-inner { transition: transform 80ms linear, box-shadow 400ms var(--ease-out); }
.station:hover .station-inner { box-shadow: 0 40px 80px -30px oklch(0.05 0.03 240 / 0.7); }
.station img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 900ms var(--ease-out); }
.station:hover img { transform: scale(1.06); }
.station-inner::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, oklch(0.12 0.03 240 / 0.35) 0%, transparent 30%, transparent 45%, oklch(0.12 0.03 240 / 0.75) 100%); }
.glare { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 400ms; background: radial-gradient(400px circle at var(--gx, 50%) var(--gy, 50%), oklch(1 0 0 / 0.22), transparent 45%); mix-blend-mode: soft-light; z-index: 3; }
.station:hover .glare { opacity: 1; }

.st-top { position: absolute; top: var(--space-4); left: var(--space-4); right: var(--space-4); display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.st-top .status { background: oklch(0.15 0.02 235 / 0.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid oklch(1 0 0 / 0.14); }
.st-top .status.ok { color: oklch(0.84 0.15 158); }
.st-top .status.busy { color: oklch(0.80 0.14 40); }
.st-top .status.off { color: oklch(0.8 0.02 230); }
.st-dist { font-size: var(--text-xs); padding: 4px 10px; border-radius: var(--radius-full); background: oklch(0.15 0.02 235 / 0.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid oklch(1 0 0 / 0.14); }
.st-panel {
  position: absolute; left: var(--space-3); right: var(--space-3); bottom: var(--space-3);
  padding: var(--space-4) var(--space-5); border-radius: calc(var(--radius-xl) - 10px);
  background: oklch(0.18 0.025 232 / 0.45); border: 1px solid oklch(1 0 0 / 0.16);
  backdrop-filter: blur(20px) saturate(170%); -webkit-backdrop-filter: blur(20px) saturate(170%);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.18);
  transform: translateZ(40px);
  transition: transform 500ms var(--ease-out);
}
.st-area { font-size: var(--text-xs); opacity: 0.75; }
.st-name { font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; letter-spacing: -0.015em; line-height: 1.15; margin: 2px 0 var(--space-3); }
.st-row { display: flex; justify-content: space-between; align-items: end; gap: var(--space-3); flex-wrap: wrap; }
.st-specs { display: flex; gap: var(--space-4); }
.st-specs div { display: grid; }
.st-specs .k { font-family: var(--font-mono); font-size: 1rem; font-weight: 500; }
.st-specs .u { font-size: 0.75rem; opacity: 0.7; }
.st-conns { display: flex; gap: 6px; }
.conn-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-family: var(--font-mono); padding: 3px 8px; border-radius: var(--radius-full); background: oklch(1 0 0 / 0.08); border: 1px solid oklch(1 0 0 / 0.12); }
.conn-dot i { width: 6px; height: 6px; border-radius: 50%; background: oklch(0.84 0.15 158); }
.conn-dot.busy i { background: oklch(0.80 0.14 40); }
.conn-dot.off i { background: oklch(0.7 0.02 230); }
.st-bar { margin-top: var(--space-3); height: 4px; border-radius: 4px; background: oklch(1 0 0 / 0.14); overflow: hidden; }
.st-bar span { display: block; height: 100%; background: oklch(0.84 0.15 158); border-radius: 4px; transition: width 700ms var(--ease-out); }
.st-open { position: absolute; top: 50%; left: 50%; translate: -50% -50%; opacity: 0; scale: 0.9; transition: opacity 300ms var(--ease-out), scale 300ms var(--ease-out); font-size: var(--text-sm); font-weight: 700; padding: 10px 16px; border-radius: var(--radius-full); background: oklch(1 0 0 / 0.18); border: 1px solid oklch(1 0 0 / 0.3); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transform: translateZ(60px); }
.station:hover .st-open, .station:focus-visible .st-open { opacity: 1; scale: 1; }
.station.flash .st-top .status { animation: flash 900ms var(--ease-out); }
@keyframes flash { 30% { box-shadow: 0 0 0 6px oklch(1 0 0 / 0.25); } }
.empty-state { padding: var(--space-12); text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-lg); }

/* ============ Costs ============ */
.costs { background: linear-gradient(180deg, transparent, var(--bg-2) 30%, var(--bg-2) 70%, transparent); }
.costs-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(var(--space-8), 6vw, var(--space-20)); align-items: center; }
.costs-copy > p:not(.eyebrow) { color: var(--muted); max-width: 46ch; margin-top: var(--space-5); }
.kwh-control { margin-top: var(--space-8); padding: var(--space-5); border-radius: var(--radius-lg); max-width: 440px; }
.kwh-control label { display: flex; justify-content: space-between; font-size: var(--text-sm); font-weight: 500; margin-bottom: var(--space-2); }
.kwh-control .hint { font-size: var(--text-xs); color: var(--muted); margin-top: var(--space-2); }
.cost-board { padding: clamp(var(--space-5), 3vw, var(--space-8)); border-radius: var(--radius-xl); }
.cb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-6); gap: var(--space-3); flex-wrap: wrap; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.bar-row { display: grid; grid-template-columns: 150px 1fr 80px; align-items: center; gap: var(--space-4); }
.bar-name { font-size: var(--text-sm); font-weight: 500; line-height: 1.25; }
.bar-name small { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.bar-track { display: block; height: 14px; border-radius: 8px; background: oklch(0.6 0.02 230 / 0.14); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 8px; background: var(--faint); transition: width 900ms var(--ease-out); }
.bar-row.best .bar-fill { background: var(--accent); }
.bar-row.home .bar-fill { background: repeating-linear-gradient(45deg, var(--faint) 0 6px, transparent 6px 10px); opacity: .7; }
.bar-val { text-align: right; font-family: var(--font-mono); font-size: var(--text-sm); }
.bar-row.best .bar-val { color: var(--accent-text); font-weight: 500; }
.cb-foot { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--line); }

/* ============ Trip ============ */
.trip { position: relative; height: 260vh; }
.trip-sticky { position: sticky; top: 0; min-height: 100svh; display: grid; align-items: center; padding-block: 100px var(--space-12); }
.trip-grid { display: grid; grid-template-columns: 1fr minmax(320px, 460px); gap: clamp(var(--space-8), 6vw, var(--space-24)); align-items: center; }
.trip-copy > p:not(.eyebrow) { color: var(--muted); max-width: 44ch; margin-top: var(--space-5); }
.seg { position: relative; display: inline-flex; padding: 4px; margin-top: var(--space-8); border-radius: var(--radius-full); background: var(--glass-bg); border: 1px solid var(--glass-border); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.seg-btn { position: relative; z-index: 1; min-height: 40px; padding: 0 var(--space-5); border: 0; background: none; border-radius: var(--radius-full); font-size: var(--text-sm); font-weight: 700; color: var(--muted); transition: color 300ms var(--ease-out); }
.seg-btn.is-active { color: var(--accent-ink); }
.seg-pill { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: var(--radius-full); background: var(--accent); transition: transform 450ms var(--ease-io), width 450ms var(--ease-io); }

.itinerary { list-style: none; margin: var(--space-8) 0 0; padding: 0; display: grid; gap: 0; max-width: 460px; }
.itinerary li { position: relative; display: grid; grid-template-columns: 28px 1fr auto; gap: var(--space-3); align-items: start; padding-bottom: var(--space-5); opacity: 0.35; transition: opacity 500ms var(--ease-out); }
.itinerary li.on { opacity: 1; }
.itinerary li::before { content: ''; position: absolute; left: 13px; top: 22px; bottom: -2px; width: 2px; background: var(--line); }
.itinerary li:last-child::before { display: none; }
.it-node { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--faint); background: var(--bg); transition: all 400ms var(--ease-out); }
.it-node svg { width: 14px; height: 14px; }
.itinerary li.on .it-node { border-color: var(--accent); }
.itinerary li.charge.on .it-node { background: var(--accent); color: var(--accent-ink); }
.it-title { font-weight: 700; line-height: 1.3; }
.it-sub { font-size: var(--text-xs); color: var(--muted); }
.it-meta { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); text-align: right; white-space: nowrap; }
.itinerary li.charge .it-meta { color: var(--accent-text); }

.map-card { position: relative; border-radius: var(--radius-xl); padding: var(--space-4); aspect-ratio: 400 / 640; max-height: calc(100svh - 160px); justify-self: end; width: 100%; max-width: 460px; }
.pt-map { width: 100%; height: 100%; display: block; overflow: visible; }
.pt-shape { fill: var(--map-land); stroke: var(--line); stroke-width: 1.5; transition: fill 400ms var(--ease-io); }
.map-dot { fill: var(--map-dot); }
.route-ghost { fill: none; stroke: var(--faint); stroke-opacity: .35; stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; }
.route-line { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px oklch(0.82 0.145 72 / 0.6)); }
.city-label { font-family: var(--font-body); font-size: 13px; font-weight: 700; fill: var(--text); paint-order: stroke; stroke: var(--map-land); stroke-width: 4px; }
.city-label.dim { fill: var(--muted); font-weight: 500; font-size: 11.5px; }
.node-ring { fill: var(--bg); stroke: var(--faint); stroke-width: 2; transition: all 400ms var(--ease-out); }
.node-ring.on { stroke: var(--accent); }
.node-charge { fill: var(--accent); transform-box: fill-box; transform-origin: center; scale: 0; transition: scale 500ms cubic-bezier(0.34, 1.5, 0.5, 1); }
.node-charge.on { scale: 1; }
.car { fill: var(--text); stroke: var(--accent); stroke-width: 3; }
.map-stats { position: absolute; left: var(--space-4); right: var(--space-4); top: var(--space-4); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); }
.map-stats > div { display: grid; }

/* ============ Band ============ */
.band { padding-block: var(--space-8) var(--space-12); overflow: hidden; }
.band-track { display: flex; gap: var(--space-5); width: max-content; padding-inline: 4vw; transform: translate3d(var(--bx, 0px), 0, 0); will-change: transform; }
.band figure { position: relative; margin: 0; width: clamp(300px, 42vw, 620px); aspect-ratio: 3 / 2; border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow); }
.band img { width: 100%; height: 100%; object-fit: cover; }
.band figcaption { position: absolute; left: var(--space-4); bottom: var(--space-4); padding: 6px 14px; border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 700; --glass-bg: oklch(0.18 0.025 232 / 0.45); --glass-border: oklch(1 0 0 / 0.16); --glass-hi: oklch(1 0 0 / 0.18); color: white; }

/* ============ App ============ */
.app-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(var(--space-8), 5vw, var(--space-16)); align-items: center; }
.app-card { padding: clamp(var(--space-8), 5vw, var(--space-16)); border-radius: var(--radius-xl); position: relative; overflow: hidden; }
.app-card > p:not(.eyebrow):not(.form-msg) { color: var(--muted); max-width: 48ch; margin-top: var(--space-5); }
.beta-form { display: flex; gap: var(--space-2); margin-top: var(--space-8); max-width: 520px; padding: 6px; border-radius: var(--radius-full); background: oklch(0.5 0.02 230 / 0.10); border: 1px solid var(--line); }
.beta-form input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 var(--space-4); min-height: 48px; outline: none; }
.beta-form input::placeholder { color: var(--faint); }
.beta-form:focus-within { border-color: var(--accent); }
.form-msg { min-height: 1.6em; margin-top: var(--space-3); font-size: var(--text-sm); }
.form-msg.err { color: var(--busy); }
.form-msg.ok { color: var(--ok); }
.app-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.app-facts li { padding: var(--space-5) 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.app-facts li:first-child { border-top: 1px solid var(--line); }
.app-facts .mono { display: block; color: var(--text); font-size: var(--text-sm); font-weight: 500; margin-bottom: 2px; }

/* ============ Footer ============ */
.footer { padding-block: var(--space-12); border-top: 1px solid var(--line); }
.footer-grid { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; }

/* ============ Dialog ============ */
.sheet { width: min(560px, calc(100% - 2rem)); max-height: calc(100svh - 2rem); padding: 0; border-radius: var(--radius-xl); color: var(--text); overflow: auto; }
.sheet::backdrop { background: oklch(0.1 0.02 240 / 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet[open] { animation: sheetIn 420ms var(--ease-out); }
.sheet[open]::backdrop { animation: fadeIn 300ms var(--ease-out); }
.sheet.closing { animation: sheetOut 200ms cubic-bezier(0.4, 0, 1, 1) forwards; }
.sheet.closing::backdrop { animation: fadeOut 200ms cubic-bezier(0.4, 0, 1, 1) forwards; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px) scale(0.97); } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet-media { position: relative; height: 200px; }
.sheet-media img { width: 100%; height: 100%; object-fit: cover; }
.sheet-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, var(--glass-strong-bg)); }
.sheet-close { position: absolute; top: var(--space-3); right: var(--space-3); z-index: 2; }
.sheet-body { padding: var(--space-6); display: grid; gap: var(--space-6); }
.sheet-head { display: flex; justify-content: space-between; align-items: start; gap: var(--space-4); }
.sheet-head h3 { font-size: 1.75rem; line-height: 1.1; }
.connectors { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-2); }
.conn-opt { display: grid; gap: 2px; text-align: left; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--line); background: oklch(0.5 0.02 230 / 0.06); transition: border-color var(--t), background-color var(--t); }
.conn-opt:hover:not(:disabled) { border-color: var(--faint); }
.conn-opt[aria-checked='true'] { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 12%, transparent); }
.conn-opt:disabled { opacity: .45; cursor: not-allowed; }
.conn-opt b { font-size: var(--text-sm); }
.conn-opt span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.calc { display: grid; gap: var(--space-5); padding: var(--space-5); border-radius: var(--radius-lg); background: oklch(0.5 0.02 230 / 0.07); border: 1px solid var(--line); }
.calc-row label { display: block; font-size: var(--text-sm); font-weight: 500; margin-bottom: var(--space-2); }
.dual { position: relative; height: 28px; }
.dual input[type='range'] { position: absolute; inset: 0; pointer-events: none; }
.dual input[type='range']::-webkit-slider-runnable-track { background: transparent; }
.dual input[type='range']::-moz-range-track { background: transparent; }
.dual input[type='range']::-moz-range-progress { background: transparent; }
.dual input[type='range']::-webkit-slider-thumb { pointer-events: auto; position: relative; z-index: 2; }
.dual input[type='range']::-moz-range-thumb { pointer-events: auto; }
.dual::before { content: ''; position: absolute; left: 0; right: 0; top: 11px; height: 6px; border-radius: 6px; background: oklch(0.6 0.02 230 / 0.3); }
.dual-fill { position: absolute; top: 11px; height: 6px; border-radius: 6px; background: var(--accent); }
.calc-out { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.calc-out > div { display: grid; }
.sheet-actions { display: flex; gap: var(--space-3); justify-content: flex-end; }
.sheet-actions .btn-accent { flex: 1; }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-float { display: none; }
  .planner { max-width: 520px; }
  .station { grid-column: span var(--span-t, 6); }
  .costs-grid, .app-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 860px) {
  .trip { height: auto; }
  .trip-sticky { position: relative; min-height: 0; padding-block: var(--space-20); }
  .trip-grid { grid-template-columns: 1fr; }
  .map-card { justify-self: center; max-height: none; }
}
@media (max-width: 640px) {
  .station { grid-column: 1 / -1; }
  .hero-grid { padding-top: 120px; }
  .hero-media img { object-position: 74% 50%; }
  .bar-row { grid-template-columns: 1fr 64px; gap: var(--space-2) var(--space-3); }
  .bar-name { grid-column: 1 / -1; }
  .bar-track { grid-column: 1; }
  .nav-cta { display: none; }
  .beta-form { flex-direction: column; border-radius: var(--radius-lg); }
  .sheet-actions { flex-direction: column-reverse; }
  .toolbar { align-items: stretch; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * clamp(1.25rem, 4vw, 3rem)); padding-inline: clamp(1.25rem, 4vw, 3rem); scrollbar-width: none; }
  .chip { flex: none; }
  .band figure { width: 80vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; filter: none; clip-path: none; }
}
.costs { padding-top: clamp(var(--space-12), 6vw, var(--space-20)); }

.app.section { padding-top: clamp(var(--space-12), 6vw, var(--space-20)); }

/* Official Elequi brand mark */
.wordmark .elequi-brand-logo { display:block; width:auto; height:44px; max-width:160px; object-fit:contain; }
@media(max-width:640px){.wordmark .elequi-brand-logo{height:36px;max-width:135px}}

 .stations .station-grid { max-height: 680px; overflow-y:auto; overscroll-behavior:contain; padding-bottom:16px; scrollbar-width:thin; } @media(max-width:700px){.stations .station-grid{max-height:520px}} 

/* Compact homepage station preview */
#stations .station-grid { max-width: 1160px; margin-inline: auto; }
#stations .station-grid > * { max-height: 350px; overflow: hidden; }


/* Elequi identity and legible map */
.wordmark .elequi-brand-logo {height:56px;max-width:200px;min-width:72px}
@media(max-width:640px){.wordmark .elequi-brand-logo{height:44px;max-width:150px}}
.map-card{min-height:490px}
.pt-map{min-height:430px}
[data-theme='light'] .pt-shape{fill:#d2e6de;stroke:#568f7a;stroke-width:2.5}
[data-theme='dark'] .pt-shape{fill:#254e49;stroke:#80c4a5;stroke-width:2.5}
.map-card .map-stats{z-index:3}

/* Real-data station cards: compact, readable, no nested scroll trap */
#stations .station-grid { max-height:none; overflow:visible; }
#stations .station-grid > * { max-height:none; overflow:visible; }
#stations .station-inner { height:clamp(310px,30vw,380px); }
#stations .station-inner::before { z-index:0; background:linear-gradient(180deg,rgba(7,20,27,.42),rgba(7,20,27,.05) 35%,rgba(7,20,27,.92) 100%); }
#stations .station-inner > :not(img) { position:relative; z-index:1; }
#stations .station-inner > img { z-index:0; }
#stations .st-top { display:flex; gap:8px; flex-wrap:wrap; }
#stations .st-dist { white-space:normal; }
#stations .station .st-name { overflow-wrap:anywhere; }
#stationCity { appearance:auto; padding:11px 14px; border-radius:99px; border:1px solid var(--glass-border); background:var(--glass-bg); color:var(--text); font:inherit; }
@media(max-width:700px){#stations .station-grid{max-height:none;overflow:visible}}

.lang-toggle{border:1px solid var(--glass-border);border-radius:100px;background:var(--glass-bg);color:var(--text);font-weight:700;font-size:12px;min-width:44px;min-height:38px;cursor:pointer}

/* Mobile release corrections */
@media(max-width:720px){
 .nav-wrap{top:12px}
 .nav{min-height:62px;padding:8px 14px}
 .nav-actions{gap:8px}
 .chips{flex-wrap:wrap;overflow:visible;margin-inline:0;padding-inline:0}
 .chip{max-width:100%;white-space:normal;text-align:center}
 .map-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:12px}
 .map-stats .k{font-size:clamp(12px,3.1vw,18px);overflow-wrap:anywhere;line-height:1.25}
 .map-stats .u{font-size:11px;overflow-wrap:anywhere}
 .map-card{min-width:0}
 .nav-wrap:not(.on-hero) .nav{box-shadow:0 8px 26px rgba(0,0,0,.12)}
}
/* Accessible, compact navigation on both hero and light sections */
.nav-wrap.on-hero .nav{--glass-bg:rgba(249,247,241,.96);--glass-border:rgba(25,42,50,.13);--glass-hi:rgba(255,255,255,.85);color:#122a33;background:rgba(249,247,241,.96);box-shadow:0 8px 32px rgba(0,0,0,.18)}
.nav-wrap.on-hero .lang-toggle{background:#fff;color:#122a33;border-color:#d8dcda}
.nav-wrap.on-hero .tt-track{background:#e4e7e3;border-color:#b9c1c0}
.nav-wrap.on-hero .wordmark{color:#122a33}
@media(max-width:720px){
 .nav-wrap{top:8px}
 .nav{width:calc(100% - 24px);padding:6px 12px 6px 14px;min-height:56px;gap:8px}
 .nav .elequi-brand-logo{height:42px;max-width:108px;object-fit:contain}
 .nav-actions{gap:6px}
 .lang-toggle{min-width:40px;min-height:36px}
 .theme-toggle{width:56px;height:38px}
}
