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

/* ── Tokens ───────────────────────────────────────── */
:root {
  --w:          420px;
  --glass:      rgba(12, 14, 20, 0.78);
  --glass-hdr:  rgba(10, 12, 17, 0.92);
  --glass-in:   rgba(255, 255, 255, 0.045);
  --glass-in-h: rgba(255, 255, 255, 0.08);
  --border:     rgba(255, 255, 255, 0.08);
  --border-in:  rgba(255, 255, 255, 0.10);
  --t1:         rgba(255, 255, 255, 0.90);
  --t2:         rgba(255, 255, 255, 0.40);
  --t3:         rgba(255, 255, 255, 0.20);
  --blue:       #5B9CF6;
  --blue-dim:   rgba(91, 156, 246, 0.50);
  --red:        rgba(240, 96, 96, 0.80);
  --red-bright: rgba(240, 96, 96, 0.95);
  --dot:        rgba(255, 255, 255, 0.30);
  --dot-night:  rgba(91, 156, 246, 0.50);
  --dot-minor:  rgba(255, 255, 255, 0.14);
  --dot-final:  rgba(240, 96, 96, 0.65);
  --sep:        rgba(255, 255, 255, 0.06);
  --radius:     11px;
}

/* ── Base ─────────────────────────────────────────── */
html { font-size: 16px; }

body {
  font-family: 'Outfit', sans-serif;
  background: #141620;
  color: var(--t1);
  overflow: hidden;
  height: 100vh;
}

/* ── Map ──────────────────────────────────────────── */
#map {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.leaflet-control-attribution { display: none !important; }

/* Zoom control — minimal glass */
.leaflet-control-zoom {
  border: none !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.30) !important;
}

.leaflet-control-zoom a {
  background: rgba(10, 12, 18, 0.82) !important;
  backdrop-filter: blur(12px) !important;
  color: rgba(255,255,255,0.55) !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.07) !important;
  font-size: 16px !important;
  line-height: 28px !important;
  width: 28px !important;
  height: 28px !important;
  transition: background 0.2s ease, color 0.2s ease !important;
}

.leaflet-control-zoom a:last-child { border-bottom: none !important; }

.leaflet-control-zoom a:hover {
  background: rgba(91,156,246,0.15) !important;
  color: rgba(255,255,255,0.85) !important;
}

/* Drive time labels on map */
.drive-label {
  background: rgba(10, 12, 18, 0.80);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  padding: 3px 9px;
  font-family: 'Outfit', sans-serif;
  font-size: 9.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.52);
  letter-spacing: 0.8px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

/* ── Panel ────────────────────────────────────────── */
.panel {
  position: fixed;
  top: 0; left: 0;
  z-index: 10;
  width: var(--w);
  height: 100vh;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: none;
  background: var(--glass);
  backdrop-filter: blur(52px) saturate(160%) brightness(0.9);
  -webkit-backdrop-filter: blur(52px) saturate(160%) brightness(0.9);
  border-right: 1px solid var(--border);
  box-shadow:
    1px 0 0 0 rgba(255,255,255,0.04),
    4px 0 40px rgba(0,0,0,0.30);
}

.panel::-webkit-scrollbar { display: none; }

/* noise grain */
.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: 0.025;
}

.panel > * { position: relative; z-index: 1; }

/* ── Header ───────────────────────────────────────── */
.trip-header {
  position: sticky;
  top: 0; z-index: 20;
  padding: 52px 40px 30px;
  background: var(--glass-hdr);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-bottom: 1px solid var(--sep);
}

.eyebrow {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--blue);
  opacity: 0.75;
  margin-bottom: 11px;
}

.trip-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 33px;
  font-weight: 300;
  color: var(--t1);
  line-height: 1;
  letter-spacing: -0.3px;
}

.trip-header h1 i {
  font-style: italic;
  color: var(--blue);
  margin: 0 5px;
  opacity: 0.8;
}

.sub {
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 300;
  color: var(--t2);
  letter-spacing: 0.4px;
}

/* ── Timeline ─────────────────────────────────────── */
.timeline { padding: 0 40px 0 36px; }

/* ── Day row ──────────────────────────────────────── */
.day-row {
  margin: 44px 0 26px;
  padding-bottom: 11px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  color: var(--t3);
  border-bottom: 1px solid var(--sep);
  opacity: 0;
  animation: up 0.45s ease forwards;
}

/* ── Stop ─────────────────────────────────────────── */
.stop {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 4px 0;
  opacity: 0;
  animation: up 0.45s ease forwards;
  transition: opacity 0.4s ease;
}

.stop.dimmed { opacity: 0.22; }

/* ── Dot ──────────────────────────────────────────── */
.dot {
  flex-shrink: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-top: 7px;
  background: var(--dot);
  transition: transform 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}

.stop.active .dot {
  background: var(--blue);
  transform: scale(1.55);
  box-shadow: 0 0 0 3px rgba(91, 156, 246, 0.18);
}

.dot-night { background: var(--dot-night); }
.dot-minor { width: 6px; height: 6px; background: var(--dot-minor); margin-top: 9px; }
.dot-final { background: var(--dot-final); }

.stop.active .dot-night { background: var(--blue); }
.stop.active .dot-final {
  background: var(--red-bright);
  box-shadow: 0 0 0 3px rgba(240, 96, 96, 0.18);
}

/* ── Body ─────────────────────────────────────────── */
.body { flex: 1; }

.tag {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 4px;
}

.tag-final { color: rgba(240, 96, 96, 0.50); }

/* City — now an anchor */
.city {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.80);
  line-height: 1.05;
  letter-spacing: -0.2px;
  text-decoration: none;
  transition: color 0.25s ease;
  cursor: pointer;
}

.city:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(91,156,246,0.35);
}

.stop.active .city { color: #fff; }

.detail {
  font-size: 11px;
  font-weight: 300;
  color: var(--t2);
  margin-top: 5px;
  letter-spacing: 0.2px;
}

.note {
  margin-top: 9px;
  font-size: 10.5px;
  font-weight: 300;
  color: rgba(91, 156, 246, 0.55);
  letter-spacing: 0.3px;
  padding-top: 9px;
  border-top: 1px solid var(--sep);
}

.address {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 300;
  font-style: italic;
  color: var(--t3);
  letter-spacing: 0.2px;
}

/* ── Glass card (hotel link) ──────────────────────── */
.glass-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
  padding: 10px 13px;
  background: var(--glass-in);
  border: 1px solid var(--border-in);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.glass-card:hover {
  background: var(--glass-in-h);
  border-color: rgba(255, 255, 255, 0.18);
}

.card-name {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.2px;
}

.card-arrow {
  font-size: 12px;
  color: var(--t3);
  transition: color 0.2s ease;
}

.glass-card:hover .card-arrow { color: rgba(255, 255, 255, 0.45); }

/* ── Flight glass ─────────────────────────────────── */
.flight-glass {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(240, 96, 96, 0.05);
  border: 1px solid rgba(240, 96, 96, 0.14);
  border-radius: var(--radius);
}

.flight-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
}

.fkey {
  font-size: 10.5px;
  font-weight: 300;
  color: var(--t2);
  letter-spacing: 0.3px;
}

.fval {
  font-size: 13px;
  font-weight: 500;
  color: var(--red);
  letter-spacing: 0.5px;
}

.flight-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin: 7px 0;
}

/* ── Leg ──────────────────────────────────────────── */
.leg {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 1px 0 1px 4px;
  opacity: 0;
  animation: up 0.45s ease forwards;
}

.leg-line {
  width: 1px;
  height: 44px;
  flex-shrink: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.11) 30%,
    rgba(255, 255, 255, 0.11) 70%,
    transparent 100%
  );
}

/* drive time text — heavier weight now */
.leg-text {
  font-size: 10.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.8px;
}

/* ── Footer ───────────────────────────────────────── */
.trip-footer {
  margin-top: 14px;
  padding: 26px 40px 40px;
  border-top: 1px solid var(--sep);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--t3);
}

/* spacer so the last stop can scroll into the observer window */
.scroll-spacer { height: 45vh; }

/* ── Map edge fade ────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: var(--w);
  right: 0;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(
    to right,
    rgba(12, 14, 20, 0.28) 0%,
    transparent 22%
  );
  pointer-events: none;
}

/* ── Animation ────────────────────────────────────── */
@keyframes up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 860px) {
  :root { --w: 100vw; }
  body { overflow: hidden; }
  .panel {
    height: 60vh;
    top: auto; bottom: 0;
    border-right: none;
    border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
  }
  #map { height: 45vh; top: 0; bottom: auto; }
  body::after { display: none; }
  .trip-header { padding: 28px 28px 22px; }
  .timeline    { padding: 0 28px 0 24px; }
  .trip-footer { padding: 22px 28px 36px; }
  .scroll-spacer { height: 20vh; }
}
