:root {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #edf4ef;
  --text: #16201b;
  --muted: #5b6a62;
  --line: #d6e0d9;
  --accent: #18756c;
  --accent-2: #2c6fbb;
  --accent-3: #c4842c;
  --good: #177245;
  --warn: #a15d16;
  --shadow: 0 14px 38px rgba(26, 42, 35, 0.12);
}

body[data-theme="dark"] {
  --bg: #101513;
  --surface: #18201d;
  --surface-2: #202b27;
  --text: #f4fbf7;
  --muted: #b7c5bd;
  --line: #34423b;
  --accent: #5fd0bd;
  --accent-2: #75b9ff;
  --accent-3: #f0b15e;
  --good: #73d79d;
  --warn: #f0b15e;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 12px 0 8px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.brand .eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.brand strong {
  font-size: 1.15rem;
  white-space: nowrap;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
}

.weather-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 0 0 10px;
}

.weather-pill {
  flex: 0 0 auto;
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.78rem;
  color: var(--muted);
}

.weather-pill strong {
  display: block;
  color: var(--accent-2);
  font-size: 0.84rem;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 0 0 10px;
}

.tab-link {
  flex: 1 0 98px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.tab-link.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
}

main {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 64px;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 10px;
  font-size: 3.4rem;
  line-height: 1;
  letter-spacing: 0;
}
h2 {
  margin: 0 0 14px;
  font-size: 1.42rem;
  letter-spacing: 0;
}
h3 {
  margin: 0 0 7px;
  font-size: 1.08rem;
  letter-spacing: 0;
}
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  align-items: end;
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), color-mix(in srgb, var(--accent-2) 8%, var(--surface)));
  box-shadow: var(--shadow);
}

.compact-hero {
  align-items: center;
}

.hero-copy {
  max-width: 700px;
  padding: 18px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1px solid var(--line);
}

.visual-hero {
  position: relative;
  overflow: hidden;
  min-height: 380px;
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(7, 16, 22, 0.84), rgba(7, 16, 22, 0.36) 58%, rgba(7, 16, 22, 0.58)),
    var(--hero-image) center / cover no-repeat;
}

.visual-hero .hero-copy {
  padding: 0;
  border: 0;
  background: transparent;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}

.visual-hero .hero-copy p {
  max-width: 640px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
}

.visual-hero .kicker {
  color: #7fe4d3;
}

.visual-hero .stat {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(12, 20, 25, 0.58);
  backdrop-filter: blur(10px);
}

.visual-hero .stat span {
  color: rgba(255, 255, 255, 0.72);
}

.hub-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 14px;
}

.hub-intro h2 {
  margin-bottom: 0;
}

.hub-timeline {
  display: grid;
  gap: 14px;
}

.hub-day-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hub-day-card {
  box-shadow: none;
}

.hub-day-card .timeline-body {
  padding: 0;
}

.hub-day-card .timeline-body p {
  margin-bottom: 10px;
}

.action-strip {
  margin-bottom: 14px;
}

.timeline-card {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.timeline-media {
  min-height: 220px;
  background: var(--surface-2);
}

.timeline-media img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  display: block;
}

.timeline-body {
  padding: 18px;
}

.timeline-date {
  margin-bottom: 8px;
  color: var(--accent-3);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline-body h3 {
  font-size: 1.28rem;
}

.timeline-body p {
  margin-bottom: 12px;
  color: var(--muted);
}

.hub-events {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hub-events li {
  position: relative;
  padding-left: 18px;
  color: var(--text);
  font-weight: 720;
}

.hub-events li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}

.image-credit {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
}

.image-credit a {
  color: var(--muted);
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.person-card {
  display: grid;
  gap: 12px;
}

.person-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.person-header p {
  margin-bottom: 0;
}

.person-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.person-details div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.person-details dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.person-details dd {
  margin: 3px 0 0;
  font-weight: 850;
}

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card.compact {
  min-height: 160px;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 1.35rem;
}

.callout {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.12rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.btn.primary {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.timeline {
  display: grid;
  gap: 14px;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.day-anchor {
  margin: 0;
  color: var(--accent-2);
  font-weight: 800;
}

.item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.item:first-of-type { border-top: 0; }
.time {
  color: var(--accent-3);
  font-size: 0.9rem;
  font-weight: 900;
}
.event { font-weight: 850; }
.note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.94rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 32%, var(--line));
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 9%, var(--surface));
  font-size: 0.74rem;
  font-weight: 900;
}
.badge.good {
  color: var(--good);
  border-color: color-mix(in srgb, var(--good) 38%, var(--line));
  background: color-mix(in srgb, var(--good) 10%, var(--surface));
}
.badge.warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 42%, var(--line));
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
}
.badge.neutral {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface-2);
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.decision-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.decision-row:first-of-type { border-top: 0; }

.plain-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}
.plain-list li { margin: 8px 0; }

.map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-btn {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}
.filter-btn.active {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
}

.map-shell {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 14px;
}

#map {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #d8e0d7;
}

.location-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.location-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.pin,
.marker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 8px 20px rgba(0,0,0,0.16);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface);
  color: var(--text);
}

.route-grid,
.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.booking-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.weather-card {
  min-height: 160px;
}

.vehicle-card {
  display: flex;
  flex-direction: column;
}

.checklist-group {
  margin-bottom: 14px;
}

.progress-bar {
  height: 8px;
  margin: 10px 0 14px;
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.check-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.check-item input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.source {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .brand-row,
  .brand {
    align-items: flex-start;
  }
  .brand {
    flex-direction: column;
    gap: 2px;
  }
  .brand strong { white-space: normal; }
  .theme-toggle span { display: none; }
  h1 { font-size: 2.25rem; }
  .hero,
  .grid.two,
  .grid.four,
  .people-grid,
  .hub-day-grid,
  .timeline-card,
  .map-shell,
  .route-grid,
  .source-grid,
  .weather-grid,
  .stat-row {
    grid-template-columns: 1fr;
  }
  .hub-intro {
    align-items: flex-start;
    flex-direction: column;
  }
  .hero { min-height: 420px; padding: 16px; }
  .timeline-card,
  .timeline-media,
  .timeline-media img {
    min-height: 0;
  }
  .timeline-media img {
    aspect-ratio: 16 / 9;
  }
  #map { min-height: 380px; }
  .location-list { max-height: none; }
  .item { grid-template-columns: 76px 1fr; }
  .decision-row { grid-template-columns: 1fr; }
  .person-header {
    flex-direction: column;
  }
  .person-details {
    grid-template-columns: 1fr;
  }
}
