/* ==========================================================================
   Reroute NJ — Styles
   A civic transit tool. Design inspired by transit signage, editorial layouts,
   and information-dense news applications. Not a template.
   ========================================================================== */

/* --- Design tokens --- */
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --navy: #0c1f3f;
  --navy-mid: #162d54;
  --navy-light: #1e3a6a;
  --blue: #2c6fba;
  --blue-light: #4a8fd4;
  --orange: #e87722;
  --orange-warm: #f09030;
  --orange-deep: #c45e10;
  --bg: #f5f6f8;
  --bg-warm: #fafafa;
  --card: #ffffff;
  --text: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --green: #059669;
  --green-bg: #ecfdf5;
  --yellow: #b45309;
  --yellow-bg: #fffbeb;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-xl: 0 16px 50px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Dark mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e17;
    --bg-warm: #0f1420;
    --card: #151c2c;
    --text: #e8ecf2;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border: #1e293b;
    --border-light: #1a2234;
    --green-bg: #052e1c;
    --yellow-bg: #2a1f06;
    --red-bg: #2d0a0a;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.35);
    --shadow-xl: 0 16px 50px rgba(0,0,0,0.4);
  }
}

/* --- Reset & base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(232, 119, 34, 0.2);
  color: inherit;
}

@media (prefers-color-scheme: dark) {
  ::selection { background: rgba(232, 119, 34, 0.35); }
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-tertiary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: 3px;
}

a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}
a:hover { color: var(--orange); }

@media (prefers-color-scheme: dark) {
  a { color: var(--blue-light); }
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.hidden { display: none !important; }

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   HEADER
   Deep navy. Big type. Feels like a transit authority announcement.
   ========================================================================== */
.header {
  background: var(--navy);
  color: #fff;
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle diagonal stripe texture */
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 40px,
    rgba(255,255,255,0.015) 40px,
    rgba(255,255,255,0.015) 80px
  );
  pointer-events: none;
}

.header-inner {
  max-width: 920px;
  margin: 0 auto;
  position: relative;
}

.brand {
  font-size: 2.75rem;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  user-select: none;
}

.brand-accent {
  color: var(--orange);
  position: relative;
}

/* Glow on the NJ */
.brand-accent::after {
  content: "";
  position: absolute;
  inset: -4px -6px;
  background: radial-gradient(ellipse, rgba(232, 119, 34, 0.15) 0%, transparent 70%);
  border-radius: 8px;
  pointer-events: none;
}

.brand-link {
  text-decoration: none;
  color: inherit;
}
.brand-link:hover { color: inherit; }

.tagline {
  font-size: 1.05rem;
  font-weight: 400;
  opacity: 0.75;
  margin-top: 0.35rem;
  letter-spacing: -0.01em;
}

.countdown {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 100px;
  padding: 0.55rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  animation: fadeIn 0.6s var(--ease);
}

.countdown .num {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--orange-warm);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   ALERT BANNER
   Orange bar. Urgent. Dense info. Scannable.
   ========================================================================== */
.alert-banner {
  background: var(--orange);
  color: #fff;
  padding: 0.65rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
  letter-spacing: -0.01em;
  position: relative;
}

.alert-banner strong {
  font-weight: 800;
  letter-spacing: 0;
}

/* ==========================================================================
   TOOL NAVIGATION
   Dark sub-nav. Tabs for switching between tools.
   ========================================================================== */
.tool-nav {
  background: var(--navy-mid);
  padding: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.tool-nav .container {
  display: flex;
  gap: 0;
}

.tool-nav-link {
  display: block;
  padding: 0.65rem 1.25rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.2s ease, border-color 0.2s ease;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tool-nav-link:hover { color: rgba(255,255,255,0.85); }

.tool-nav-link.active {
  color: #fff;
  border-bottom-color: var(--orange);
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */
main.container {
  padding-top: 1.75rem;
  padding-bottom: 3rem;
}

/* ==========================================================================
   LINE HEADER & NAV
   Pill buttons for each transit line. Color-coded.
   ========================================================================== */
.line-header {
  margin-bottom: 1.75rem;
  animation: fadeUp 0.4s var(--ease);
}

.line-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  margin-bottom: 0.75rem;
  transition: all 0.3s var(--ease);
}

/* Line-specific badge colors */
.line-badge.montclair-boonton { background: #7b2d8e; color: #fff; }
.line-badge.morris-essex { background: #00a651; color: #fff; }
.line-badge.northeast-corridor { background: #ee3a43; color: #fff; }
.line-badge.north-jersey-coast { background: #0082c8; color: #fff; }
.line-badge.raritan-valley { background: #faa634; color: #fff; }

.line-nav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.line-btn {
  padding: 0.5rem 1.05rem;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--card);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.line-btn:hover:not(.disabled) {
  border-color: var(--navy-light);
  background: var(--bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.line-btn.active {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

@media (prefers-color-scheme: dark) {
  .line-btn { background: var(--bg-warm); border-color: var(--border); }
  .line-btn:hover:not(.disabled) { background: var(--navy-mid); border-color: var(--navy-light); }
  .line-btn.active { background: var(--navy-light); border-color: var(--blue); }
}

.line-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ==========================================================================
   STATION PICKER
   Clean select. Feels native but custom.
   ========================================================================== */
.station-picker {
  margin-bottom: 1.75rem;
  animation: fadeUp 0.5s var(--ease);
}

.station-picker label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.station-picker select {
  width: 100%;
  max-width: 420px;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  appearance: none;
  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 fill='%239ca3af' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.station-picker select:hover {
  border-color: var(--text-tertiary);
}

.station-picker select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(44, 111, 186, 0.12);
}

@media (prefers-color-scheme: dark) {
  .station-picker select {
    background-color: var(--bg-warm);
    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 fill='%2364748b' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  }
  .station-picker select:focus {
    box-shadow: 0 0 0 3px rgba(74, 143, 212, 0.2);
  }
}

/* ==========================================================================
   TOOL TABS
   Underscore tabs. Minimal chrome. High signal.
   ========================================================================== */
.tool-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 1.75rem;
  animation: fadeUp 0.5s var(--ease) 0.05s both;
}

.tab {
  padding: 0.7rem 1.25rem;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  transition: all 0.2s ease;
  letter-spacing: -0.01em;
}

.tab:hover { color: var(--text-secondary); }

.tab.active {
  color: var(--navy);
  border-bottom-color: var(--orange);
}

@media (prefers-color-scheme: dark) {
  .tab.active { color: var(--text); }
}

/* ==========================================================================
   TOOL PANELS
   ========================================================================== */
.tool-panel { display: none; }
.tool-panel.active { display: block; animation: fadeIn 0.25s ease; }

.panel-intro {
  margin-bottom: 1.5rem;
}

.panel-intro h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

.panel-intro p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--text-tertiary);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  filter: grayscale(0.3);
}

/* ==========================================================================
   IMPACT CARD
   The main result card. Shows before/after, key changes.
   ========================================================================== */
.impact-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fadeUp 0.35s var(--ease);
}

.impact-card.severe .impact-header { background: var(--red); }
.impact-card.moderate .impact-header { background: var(--yellow); }

.impact-header {
  padding: 1rem 1.25rem;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.impact-level {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.2);
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
}

.impact-station {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.impact-body {
  padding: 1.5rem;
}

/* --- Before / After --- */
.before-after {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.before, .after {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.1rem;
  border: 1px solid var(--border-light);
}

@media (prefers-color-scheme: dark) {
  .before, .after { background: var(--bg-warm); }
}

.before h4, .after h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.route-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.station-tag {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
  transition: transform 0.2s var(--ease);
}

.station-tag.highlight { background: var(--navy); border-color: var(--navy); color: #fff; }
.station-tag.accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.station-tag.warning { background: var(--yellow); border-color: var(--yellow); color: #fff; }

.arrow { color: var(--text-tertiary); font-weight: bold; font-size: 0.85rem; }

.route-note {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Key changes --- */
.key-changes {
  margin-bottom: 1.25rem;
}

.key-changes h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.key-changes ul { list-style: none; }

.key-changes li {
  padding: 0.45rem 0 0.45rem 1.5rem;
  position: relative;
  font-size: 0.9rem;
  line-height: 1.55;
  border-bottom: 1px solid var(--border-light);
}

.key-changes li:last-child { border-bottom: none; }

.key-changes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
}

/* --- Weekend note / savings callout --- */
.weekend-note {
  background: var(--green-bg);
  border-left: 3px solid var(--green);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem;
  line-height: 1.55;
}

.savings-callout {
  background: var(--green-bg);
  border-left: 3px solid var(--green);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 1rem;
  font-size: 0.88rem;
  line-height: 1.55;
}

.fare-disclaimer {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* ==========================================================================
   ROUTE CARDS
   Each alternative commute option as a card.
   ========================================================================== */
.route-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s var(--ease);
  border: 1px solid var(--border-light);
}

.route-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.route-card.other {
  border: 1.5px dashed var(--border);
  box-shadow: none;
  background: var(--bg-warm);
}
.route-card.other:hover {
  box-shadow: none;
  transform: none;
}

.route-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.mode-icon {
  font-size: 1.6rem;
  line-height: 1;
  filter: grayscale(0);
}

.route-card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
}

.badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-secondary);
}

.badge.recommended {
  background: var(--green-bg);
  color: var(--green);
}

.route-card-body { padding: 1.25rem; }

.route-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.detail { display: flex; flex-direction: column; }

.detail-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 0.15rem;
}

.detail-value {
  font-size: 0.9rem;
  font-weight: 500;
}

.route-tips p {
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

.route-tips .pro { color: var(--green); }
.route-tips .con { color: var(--red); }

.route-tips .tip {
  background: var(--yellow-bg);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  border: 1px solid transparent;
}

@media (prefers-color-scheme: dark) {
  .route-tips .tip { border-color: var(--border); }
}

/* ==========================================================================
   TICKET SCENARIOS
   ========================================================================== */
.ticket-scenarios {
  display: grid;
  gap: 1rem;
}

.scenario-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: box-shadow 0.2s ease;
}

.scenario-card:hover { box-shadow: var(--shadow); }

.scenario-card h3 {
  padding: 1rem 1.25rem;
  font-size: 0.98rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
  letter-spacing: -0.01em;
}

@media (prefers-color-scheme: dark) {
  .scenario-card h3 { background: var(--bg-warm); }
}

.scenario-body { padding: 1.25rem; }

.step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.step:last-child { margin-bottom: 0; }

.step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.step p {
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ==========================================================================
   INFO SECTIONS
   Below-the-fold content blocks.
   ========================================================================== */
.info-section {
  margin-top: 2.5rem;
  padding-top: 2.25rem;
  border-top: 1.5px solid var(--border);
}

.info-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.section-intro {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

/* --- Hoboken Terminal map --- */
.terminal-map {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: grid;
  gap: 0.5rem;
  border: 1px solid var(--border-light);
}

.map-label {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  padding: 0.3rem;
}

.map-label-river { color: #0082c8; }

.map-zone {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s ease;
}

.map-zone-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.map-zone-detail {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.map-ferry { background: #e3f2fd; border-color: #0082c8; }
.map-terminal { background: var(--bg); border-color: var(--navy-light); }
.map-bus { background: #fff3e0; border-color: var(--orange); }

@media (prefers-color-scheme: dark) {
  .map-ferry { background: #0a2540; border-color: #0082c8; }
  .map-terminal { background: var(--bg-warm); border-color: var(--navy-light); }
  .map-bus { background: #2a1f06; border-color: var(--orange); }
}

.map-inner-zones {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.map-subzone {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  flex: 1;
}

.map-arrow {
  font-size: 1.1rem;
  color: var(--text-tertiary);
  font-weight: bold;
  flex-shrink: 0;
}

.map-platforms { border-color: var(--navy); }

.map-path-entrance {
  background: #ecfdf5;
  border: 1px solid #059669;
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  margin-top: 0.5rem;
}

@media (prefers-color-scheme: dark) {
  .map-path-entrance { background: var(--green-bg); }
}

/* --- Transfer cards (Hoboken guide) --- */
.transfer-cards {
  display: grid;
  gap: 1rem;
}

.transfer-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: box-shadow 0.2s ease, transform 0.2s var(--ease);
}

.transfer-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.transfer-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.transfer-icon { font-size: 1.4rem; }

.transfer-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.transfer-time {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--orange);
}

.path-card .transfer-header { border-left: 4px solid #059669; }
.ferry-card .transfer-header { border-left: 4px solid #0082c8; }
.bus-card .transfer-header { border-left: 4px solid var(--orange); }

.transfer-steps {
  padding: 1rem 1.25rem 0.5rem 2.5rem;
  margin: 0;
}

.transfer-steps li {
  font-size: 0.88rem;
  padding: 0.3rem 0;
  line-height: 1.55;
}

.transfer-tip {
  padding: 0.75rem 1.25rem 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* --- Callout card --- */
.callout-card {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.callout-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 40px,
    rgba(255,255,255,0.02) 40px,
    rgba(255,255,255,0.02) 80px
  );
  pointer-events: none;
}

.callout-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  position: relative;
}

.callout-card p {
  opacity: 0.8;
  max-width: 480px;
  margin: 0 auto 1.25rem;
  font-size: 0.92rem;
  line-height: 1.6;
  position: relative;
}

.callout-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--orange);
  color: #fff;
  text-decoration: none;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  transition: all 0.2s var(--ease);
  position: relative;
}

.callout-btn:hover {
  background: var(--orange-deep);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(232, 119, 34, 0.3);
}

/* --- Secaucus grid --- */
.secaucus-grid {
  display: grid;
  gap: 1rem;
}

.secaucus-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  transition: box-shadow 0.2s ease;
}

.secaucus-card:hover { box-shadow: var(--shadow); }

.secaucus-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--navy);
  letter-spacing: -0.01em;
}

@media (prefers-color-scheme: dark) {
  .secaucus-card h4 { color: var(--blue-light); }
}

.secaucus-card ul { list-style: none; }

.secaucus-card li {
  padding: 0.45rem 0;
  font-size: 0.88rem;
  line-height: 1.55;
  border-bottom: 1px solid var(--border-light);
}

.secaucus-card li:last-child { border-bottom: none; }

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin-top: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.35rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--card);
  border: 2.5px solid var(--border);
  z-index: 1;
  transition: all 0.3s ease;
}

.timeline-item.past .timeline-marker {
  background: var(--green);
  border-color: var(--green);
}

.timeline-item.active .timeline-marker {
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: 0 0 0 5px rgba(232, 119, 34, 0.15);
  animation: pulse 2s ease-in-out infinite;
}

.timeline-content {
  background: var(--card);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-light);
}

.timeline-date {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0.15rem 0 0.25rem;
  letter-spacing: -0.01em;
}

.timeline-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* --- Resources --- */
.resources-grid {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.resource-link {
  display: block;
  background: var(--card);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition: all 0.2s var(--ease);
  border: 1px solid var(--border-light);
}

.resource-link:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
  color: var(--text);
  transform: translateY(-1px);
}

.resource-link strong {
  display: block;
  font-size: 0.92rem;
  color: var(--navy);
  margin-bottom: 0.1rem;
  letter-spacing: -0.01em;
}

@media (prefers-color-scheme: dark) {
  .resource-link strong { color: var(--blue-light); }
}

.resource-link span {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   COMMUTE COMPARISON TOOL
   ========================================================================== */
.compare-hero {
  padding: 1.5rem 0 0.5rem;
  animation: fadeUp 0.4s var(--ease);
}

.compare-hero h1 {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

.compare-hero p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* --- Input steps --- */
.input-step {
  margin-bottom: 1.5rem;
  animation: fadeUp 0.45s var(--ease);
}

.input-step:nth-child(2) { animation-delay: 0.05s; }
.input-step:nth-child(3) { animation-delay: 0.1s; }

.step-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}

.input-step select {
  width: 100%;
  max-width: 420px;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  appearance: none;
  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 fill='%239ca3af' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.input-step select:hover { border-color: var(--text-tertiary); }

.input-step select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(44, 111, 186, 0.12);
}

@media (prefers-color-scheme: dark) {
  .input-step select {
    background-color: var(--bg-warm);
    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 fill='%2364748b' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  }
}

/* --- Destination grid --- */
.dest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
}

.dest-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.75rem 0.5rem;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-align: center;
  font-family: var(--font);
  color: var(--text);
}

.dest-card:hover {
  border-color: var(--navy-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.dest-card.active {
  border-color: var(--navy);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(12, 31, 63, 0.1);
}

@media (prefers-color-scheme: dark) {
  .dest-card { background: var(--bg-warm); }
  .dest-card.active { background: var(--navy-mid); border-color: var(--blue); box-shadow: 0 0 0 3px rgba(74, 143, 212, 0.15); }
}

.dest-icon { font-size: 1.4rem; }
.dest-name { font-weight: 700; font-size: 0.82rem; }
.dest-area { font-size: 0.68rem; color: var(--text-tertiary); }

/* --- Results --- */
.compare-results {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1.5px solid var(--border);
  animation: fadeUp 0.35s var(--ease);
}

.results-header h2 {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.results-subtitle {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Normal commute reference */
.normal-ref {
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.normal-ref-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.normal-ref-time {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.normal-ref-route {
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-basis: 100%;
}

/* Result cards */
.result-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.85rem;
  display: flex;
  overflow: hidden;
  border: 1.5px solid transparent;
  transition: all 0.2s var(--ease);
}

.result-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.result-card.recommended {
  border-color: var(--green);
}

.result-rank {
  width: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text-tertiary);
  background: var(--bg);
}

.result-card.recommended .result-rank {
  background: var(--green);
  color: #fff;
}

.result-info {
  flex: 1;
  padding: 1rem 1.25rem;
  min-width: 0;
}

.result-info h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
  letter-spacing: -0.01em;
}

.rec-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--green-bg);
  color: var(--green);
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  vertical-align: middle;
}

.result-summary {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

/* Timeline bars */
.time-bar {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  height: 34px;
  margin-bottom: 0.75rem;
  background: var(--bg);
}

.bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  min-width: 0;
  overflow: hidden;
  position: relative;
  transition: flex 0.3s var(--ease);
}

.bar-label {
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0 4px;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Result meta */
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

.result-total {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.result-delta {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 100px;
}

.delta-good { background: var(--green-bg); color: var(--green); }
.delta-ok { background: var(--yellow-bg); color: var(--yellow); }
.delta-bad { background: var(--red-bg); color: var(--red); }

.result-cost {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.result-note {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Share */
.results-share {
  margin-top: 1.5rem;
  text-align: center;
}

.share-btn {
  padding: 0.7rem 1.75rem;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  letter-spacing: -0.01em;
}

.share-btn:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.share-confirm {
  display: inline-block;
  margin-left: 0.75rem;
  font-weight: 700;
  color: var(--green);
  animation: fadeIn 0.2s ease;
}

/* ==========================================================================
   FOOTER
   Dark, understated. Credits and disclaimers.
   ========================================================================== */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 2.25rem 1.25rem;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.65;
}

.footer a {
  color: var(--orange-warm);
  transition: color 0.15s ease;
}

.footer a:hover { color: #fff; }

.disclaimer {
  max-width: 580px;
  margin: 0 auto 0.75rem;
}

.credit {
  font-size: 0.75rem;
  opacity: 0.5;
}

/* ==========================================================================
   RESPONSIVE
   Mobile-first progressive enhancement.
   ========================================================================== */
@media (min-width: 600px) {
  .before-after { grid-template-columns: 1fr 1fr; }

  .secaucus-grid { grid-template-columns: 1fr 1fr; }
  .secaucus-card:last-child { grid-column: 1 / -1; }

  .resources-grid { grid-template-columns: 1fr 1fr; }

  .transfer-cards { grid-template-columns: 1fr 1fr; }
  .transfer-cards .bus-card { grid-column: 1 / -1; }

  .dest-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
  .header { padding: 3.25rem 1.25rem 2.75rem; }
  .brand { font-size: 3.5rem; }

  .route-details { grid-template-columns: 1fr 1fr 1fr; }

  .secaucus-grid { grid-template-columns: 1fr 1fr 1fr; }
  .secaucus-card:last-child { grid-column: auto; }

  .transfer-cards { grid-template-columns: 1fr 1fr 1fr; }
  .transfer-cards .bus-card { grid-column: auto; }
}

@media (max-width: 480px) {
  .brand { font-size: 2.25rem; letter-spacing: -1.5px; }

  .tool-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .tab {
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .route-details { grid-template-columns: 1fr; }

  .route-flow { font-size: 0.85rem; }

  .station-tag {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
  }

  .impact-header { flex-direction: column; align-items: flex-start; }

  .result-card { flex-direction: column; }

  .result-rank {
    width: 100%;
    height: 34px;
  }

  .map-inner-zones { flex-direction: column; }
  .map-arrow { transform: rotate(90deg); }

  .dest-grid { grid-template-columns: repeat(2, 1fr); }

  .normal-ref-time { font-size: 1.1rem; }

  .time-bar { height: 26px; }
  .bar-label { font-size: 0.55rem; }

  .line-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }

  .line-btn {
    flex-shrink: 0;
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
  }

  .compare-hero h1 { font-size: 1.4rem; }
}

/* ==========================================================================
   PRINT
   Clean printable version. No interactive chrome.
   ========================================================================== */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .header { background: #000; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .alert-banner, .tool-nav, .tool-tabs, .callout-card, .share-btn,
  .results-share, .empty-state { display: none; }
  .tool-panel { display: block !important; }
  .container { max-width: 100%; padding: 0; }
  .route-card, .scenario-card, .secaucus-card, .transfer-card,
  .timeline-content, .resource-link, .result-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
  .footer { background: #fff; color: #666; border-top: 1px solid #ccc; }
}
