:root {
  --bg: #f3efe7;
  --paper: rgba(255, 255, 255, 0.78);
  --text: #172027;
  --muted: #5e6a72;
  --line: rgba(23, 32, 39, 0.08);
  --brand: #245a53;
  --brand-2: #d28b3d;
  --shadow: 0 30px 80px rgba(17, 30, 37, 0.12);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(210, 139, 61, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(36, 90, 83, 0.16), transparent 32%),
    linear-gradient(180deg, #f8f4ee 0%, var(--bg) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { border: 0; }

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 16px auto 32px;
}

.hero,
.controls,
.results-layout {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: var(--paper);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero { padding: 28px; overflow: hidden; }
.hero__nav,
.controls__top,
.results-head,
.trip-card__topline,
.hero__stats,
.trip-stop__header,
.detail-header__meta,
.map-legend__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hero__content {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin-top: 28px;
}

.eyebrow,
.kicker,
.trip-card__region,
.trip-stop__label,
.story-card__eyebrow,
.detail-pill__label,
.map-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 10px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.8rem, 6vw, 5.4rem); line-height: 0.95; margin-bottom: 12px; }
h2 { font-size: clamp(1.7rem, 2vw, 2.3rem); margin-bottom: 0; }
h3 { font-size: 1.18rem; margin-bottom: 10px; }
.lede,
.detail-summary,
.story-card__summary,
.trip-stop__description,
.detail-notes,
.trip-card__summary,
.results-subhead,
.map-view__copy,
.detail-glance {
  color: var(--muted);
  line-height: 1.62;
}

.ghost-button,
.view-toggle button,
.story-card__cta,
.detail-primary,
.detail-secondary,
.map-point,
.mood-card,
.map-card {
  cursor: pointer;
}

.ghost-button,
.view-toggle button,
.detail-secondary,
.detail-primary {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  padding: 12px 18px;
}

.detail-primary {
  background: var(--text);
  color: white;
}

.view-toggle {
  display: inline-flex;
  padding: 4px;
  background: rgba(255,255,255,0.72);
  border-radius: 999px;
  border: 1px solid var(--line);
}
.view-toggle button.is-active {
  background: var(--text);
  color: white;
}

.hero-card {
  border-radius: var(--radius);
  padding: 18px;
  background: linear-gradient(180deg, rgba(22, 32, 39, 0.92), rgba(17, 21, 26, 0.96));
  color: white;
}

.hero-card__grid,
.trip-grid,
.story-feed,
.trip-stop-list,
.detail-highlights,
.detail-facts,
.trip-card__chips,
.trip-card__meta,
.hero__stats,
.detail-quickfacts,
.map-legend,
.map-story-grid {
  display: grid;
  gap: 12px;
}

.hero-card__grid,
.trip-grid,
.story-feed,
.map-story-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mood-card,
.trip-card,
.story-card,
.detail-block,
.trip-stop,
.map-view,
.map-card {
  border-radius: var(--radius);
  overflow: hidden;
}

.mood-card {
  min-height: 150px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  background: linear-gradient(160deg, rgba(36, 90, 83, 0.85), rgba(210, 139, 61, 0.85));
  color: white;
}
.mood-card:nth-child(2n) { background: linear-gradient(160deg, rgba(41, 77, 124, 0.9), rgba(27, 36, 58, 0.92)); }
.mood-card:nth-child(3n) { background: linear-gradient(160deg, rgba(100, 65, 35, 0.9), rgba(210, 139, 61, 0.82)); }
.mood-card:nth-child(4n) { background: linear-gradient(160deg, rgba(60, 67, 44, 0.9), rgba(36, 90, 83, 0.85)); }
.mood-card p:last-child { margin: 0; color: rgba(255,255,255,0.82); }
.mood-card strong { font-size: 1.05rem; }

.controls { padding: 22px 28px; margin-top: 16px; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.filters label { font-size: 0.92rem; color: var(--muted); }
.filters input,
.filters select {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.88);
  padding: 12px 14px;
  color: var(--text);
}

.results-layout {
  margin-top: 16px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 430px;
  gap: 18px;
  align-items: start;
}
.results-subhead { margin: 4px 0 0; max-width: 36ch; }

.trip-card,
.story-card,
.detail-panel,
.detail-empty,
.detail-block,
.trip-stop,
.map-view,
.map-card {
  background: rgba(255,255,255,0.84);
  border: 1px solid var(--line);
}

.trip-card,
.map-card {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.trip-card:hover,
.trip-card.is-selected,
.map-card:hover,
.map-card.is-selected {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(17,30,37,0.12);
  border-color: rgba(36, 90, 83, 0.28);
}

.trip-card__media,
.story-card__media,
.detail-hero,
.map-card__media {
  min-height: 180px;
  background-size: cover;
  background-position: center;
}
.trip-card__body,
.story-card__body,
.detail-panel__body,
.map-card__body { padding: 18px; }
.trip-card__meta { grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: 0.92rem; color: var(--muted); }
.trip-card__chips,
.detail-highlights,
.detail-facts,
.detail-quickfacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.chip,
.fact,
.detail-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(23, 32, 39, 0.06);
  color: var(--text);
  font-size: 0.9rem;
}
.detail-pill {
  flex-direction: column;
  align-items: start;
  border-radius: 18px;
}
.detail-pill strong { font-size: 1rem; }
.detail-pill__label { margin: 0; }

.detail-panel { position: sticky; top: 16px; }
.detail-empty,
.detail-panel__body { padding: 20px; }
.detail-hero { border-radius: 22px; margin-bottom: 16px; }
.detail-stack { display: grid; gap: 12px; }
.detail-block { padding: 16px; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-glance { margin-bottom: 0; }
.trip-stop-list { margin-top: 6px; }
.trip-stop { padding: 16px; }
.trip-stop__image { width: 100%; height: 160px; border-radius: 18px; margin-bottom: 12px; background-size: cover; background-position: center; }
.trip-stop__meta { color: var(--muted); font-size: 0.9rem; }

.story-card__body { display: grid; gap: 12px; }
.story-card__cta {
  display: inline-flex;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--text);
  color: white;
}

.map-view { padding: 16px; display: grid; gap: 14px; }
.map-stage {
  position: relative;
  min-height: 360px;
  border-radius: 24px;
  border: 1px solid rgba(23,32,39,0.08);
  background:
    radial-gradient(circle at 52% 78%, rgba(36, 90, 83, 0.16), transparent 18%),
    linear-gradient(180deg, rgba(255,255,255,0.5), rgba(246,241,232,0.72)),
    linear-gradient(135deg, rgba(210,139,61,0.08), rgba(36,90,83,0.08));
  overflow: hidden;
}
.map-stage::before,
.map-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.map-stage::before {
  background-image:
    linear-gradient(rgba(23,32,39,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,32,39,0.05) 1px, transparent 1px);
  background-size: 56px 56px;
}
.map-stage::after {
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.8), transparent 30%);
}
.map-stage__origin {
  position: absolute;
  left: 46%;
  top: 78%;
  transform: translate(-50%, -50%);
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--text);
  color: white;
  font-size: 0.84rem;
  box-shadow: 0 8px 24px rgba(17,30,37,0.2);
}
.map-point {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--brand), var(--brand-2));
  border: 2px solid rgba(255,255,255,0.88);
  box-shadow: 0 10px 20px rgba(17,30,37,0.18);
  transform: translate(-50%, -50%);
}
.map-point.is-selected { width: 22px; height: 22px; }
.map-label {
  position: absolute;
  transform: translate(-10%, calc(-100% - 14px));
  max-width: 180px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(23,32,39,0.08);
  box-shadow: 0 14px 28px rgba(17,30,37,0.08);
}
.map-label strong { display: block; font-size: 0.9rem; }
.map-label span { color: var(--muted); font-size: 0.8rem; }
.map-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.map-legend__item {
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(23,32,39,0.08);
  background: rgba(255,255,255,0.64);
}
.map-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--brand), var(--brand-2));
}
.map-card__facts { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; }
.detail-tips { display: grid; gap: 10px; margin-top: 12px; }
.detail-tip {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(23,32,39,0.05);
  color: var(--muted);
}
.mobile-dock {
  position: sticky;
  bottom: 10px;
  z-index: 20;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 30px rgba(17,30,37,0.1);
}
.mobile-dock button {
  padding: 12px 10px;
  border-radius: 14px;
  background: rgba(23,32,39,0.06);
  color: var(--text);
}

.stat-pill {
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.68);
  border: 1px solid var(--line);
}
.stat-pill strong { display: block; font-size: 1.05rem; color: var(--text); }
.stat-pill span { color: var(--muted); font-size: 0.86rem; }
.hidden { display: none !important; }

@media (max-width: 1120px) {
  .hero__content,
  .results-layout { grid-template-columns: 1fr; }
  .detail-panel { position: static; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 16px, 100%); margin: 8px auto 18px; }
  .hero, .controls, .results-layout { padding: 16px; }
  .filters,
  .hero-card__grid,
  .trip-grid,
  .story-feed,
  .map-story-grid,
  .trip-card__meta,
  .trip-card__chips,
  .detail-highlights,
  .detail-facts,
  .detail-quickfacts,
  .map-legend,
  .detail-actions { grid-template-columns: 1fr; }
  h1 { font-size: 2.55rem; }
  .view-toggle { width: 100%; overflow: auto; }
  .view-toggle button { flex: 1 0 auto; }
  .trip-card__media,
  .story-card__media,
  .detail-hero,
  .map-card__media { min-height: 150px; }
  .map-stage { min-height: 300px; }
  .map-label { max-width: 140px; transform: translate(-5%, calc(-100% - 12px)); }
  .detail-panel__body { padding-bottom: 24px; }
  .mobile-dock { display: grid; }
}
