:root {
  --ink: #10263d;
  --ink-soft: #44586e;
  --sea-deep: #052a42;
  --sea-mid: #0a4d70;
  --sea-light: #1385ad;
  --planned: #1d7fd6;
  --actual: #ff7a1a;
  --actual-alt: #e11d8f;
  --transfer: #8fa3b8;
  --sand: #f5f8fa;
  --card: #ffffff;
  --line: #dde6ee;
  --ok: #16a34a;
  --warn: #b45309;
  --radius: 14px;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--sand);
  line-height: 1.6;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; }
a { color: var(--sea-mid); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  color: #fff;
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(19, 133, 173, 0.55), transparent 60%),
    linear-gradient(160deg, var(--sea-deep) 0%, var(--sea-mid) 70%, var(--sea-light) 115%);
  padding: 4.5rem 1.5rem 5.5rem;
  text-align: center;
  overflow: hidden;
}

.hero-inner { max-width: 46rem; margin: 0 auto; position: relative; }

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.8rem;
  font-weight: 600;
  color: #9fd6ea;
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 800;
  margin: 0 0 1rem;
}

.hero h1 .arrow { color: var(--actual); font-weight: 600; }

.hero-sub {
  font-size: 1.1rem;
  color: #d8ecf4;
  max-width: 38rem;
  margin: 0 auto 2rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(1.2rem, 4vw, 3rem);
  flex-wrap: wrap;
  margin-bottom: 2.2rem;
}

.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
}
.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9fd6ea;
}

.hero-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

.btn {
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--actual); color: #fff; box-shadow: 0 6px 18px rgba(255, 122, 26, 0.35); }
.btn-ghost { color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.55); }

.hero-wave {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%; height: 60px;
  color: var(--sand);
  display: block;
}

/* ---------- sections ---------- */

.section { max-width: 46rem; margin: 0 auto; padding: 3rem 1.5rem 0.5rem; }
.section h2, .map-head h2 { font-size: 1.9rem; font-weight: 700; margin: 0 0 1rem; }
.section-sub { color: var(--ink-soft); margin-top: -0.5rem; }

/* ---------- map ---------- */

.map-block { max-width: 72rem; margin: 2.5rem auto 0; padding: 0 1.5rem; }

.map-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.map-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; }

.legend { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink-soft); }
.swatch { width: 22px; height: 0; border-top: 3px solid; border-radius: 2px; }
.swatch.planned { border-color: var(--planned); border-top-style: dashed; }
.swatch.actual { border-color: var(--actual); }
.swatch.actual-alt { border-color: var(--actual-alt); }
.swatch.transfer { border-color: var(--transfer); border-top-style: dotted; }

.status-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: #e7edf3;
  color: var(--ink-soft);
  white-space: nowrap;
}
.status-pill[data-state="live"] { background: #e3f6e9; color: var(--ok); }
.status-pill[data-state="live"]::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse 1.6s ease-out infinite;
}
.status-pill[data-state="warn"] { background: #fdf1e2; color: var(--warn); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  100% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
}

#map {
  height: min(68vh, 640px);
  min-height: 380px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(5, 42, 66, 0.12);
  background: #cfe4ee;
}

/* stop markers + popups */

.stop-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--planned);
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(5, 42, 66, 0.5);
}
.stop-dot.start { background: var(--ok); }
.stop-dot.end { background: #e11d48; }

.last-pos {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--actual);
  border: 3px solid #fff;
  box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.55);
  animation: pos-pulse 1.8s ease-out infinite;
}
@keyframes pos-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(255, 122, 26, 0); }
}
.last-pos.alt {
  background: var(--actual-alt);
  box-shadow: 0 0 0 0 rgba(225, 29, 143, 0.55);
  animation: pos-pulse-alt 1.8s ease-out infinite;
}
@keyframes pos-pulse-alt {
  0% { box-shadow: 0 0 0 0 rgba(225, 29, 143, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(225, 29, 143, 0); }
}

.leaflet-popup-content { margin: 0.65rem 0.85rem; font-family: var(--font-body); }
.leaflet-popup-content-wrapper { border-radius: 12px; }

.popup h3 { margin: 0 0 0.1rem; font-size: 1.05rem; }
.popup .popup-island { color: var(--ink-soft); font-size: 0.82rem; margin: 0 0 0.35rem; }
.popup .popup-roles { font-size: 0.8rem; font-weight: 600; color: var(--sea-mid); margin: 0 0 0.4rem; }

.popup .photo-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0.3rem 0 0.5rem;
  scrollbar-width: thin;
}
.popup .photo-strip img {
  height: 110px;
  border-radius: 8px;
  flex: 0 0 auto;
  max-width: 180px;
  object-fit: cover;
}

.popup .popup-links { font-size: 0.85rem; }
.popup details { margin-top: 0.4rem; font-size: 0.8rem; }
.popup details summary { cursor: pointer; font-weight: 600; color: var(--sea-mid); }
.popup details p { white-space: pre-line; margin: 0.3rem 0 0; color: var(--ink-soft); }

/* ---------- itinerary ---------- */

#itinerary { max-width: 72rem; }

.legs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.leg-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: left;
  font: inherit;
  color: inherit;
}
.leg-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(5, 42, 66, 0.12);
}

.leg-card .leg-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.leg-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--sea-mid);
  background: #e5f1f8;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}
.leg-dist { font-size: 0.82rem; color: var(--ink-soft); font-weight: 600; }

.leg-route { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }
.leg-route .arrow { color: var(--actual); }
.leg-islands { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.15rem; }

.leg-transfer {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dotted var(--line);
}

/* ---------- riders ---------- */

.riders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0 0;
}

.rider-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  text-align: center;
}

.rider-photo, .rider-initial {
  width: 110px; height: 110px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  object-fit: cover;
  display: block;
}
.rider-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(150deg, var(--sea-mid), var(--sea-light));
}

.rider-card h3 { margin: 0 0 0.15rem; font-size: 1.3rem; }
.rider-tagline { color: var(--sea-mid); font-size: 0.85rem; font-weight: 600; margin: 0 0 0.6rem; }
.rider-blurb { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }

/* ---------- footer ---------- */

.footer {
  margin-top: 4rem;
  padding: 2.2rem 1.5rem 2.6rem;
  background: var(--sea-deep);
  color: #b9d3e0;
  text-align: center;
  font-size: 0.85rem;
}
.footer a { color: #9fd6ea; }
.footer p { margin: 0.3rem 0; }

@media (max-width: 640px) {
  .hero { padding: 3rem 1.25rem 4.5rem; }
  .map-block { padding: 0 0.75rem; }
  #map { height: 62vh; border-radius: 10px; }
  .section { padding: 2.2rem 1.25rem 0.5rem; }
}
