:root {
  color-scheme: light;
  --ink: #0a2942;
  --muted: #5c6972;
  --paper: #f5f2eb;
  --panel: rgba(250, 248, 242, 0.9);
  --line: rgba(10, 41, 66, 0.15);
  --forest: #0a2942;
  --gold: #b67738;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; overflow-x: clip; overflow-y: visible; }
body { background: #ddd7ca; color: var(--ink); }
button, input { font: inherit; }
a { color: inherit; }

.project-site-nav { min-height:42px; padding:9px 18px; display:flex; align-items:center; gap:9px; color:rgba(255,255,255,.78); background:#071b2c; font-size:.7rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.project-site-nav a { color:#fff; text-decoration:none; }
.project-site-nav a:hover { color:#f7c47c; }
.project-site-nav strong { color:#f7c47c; }

.app-shell { display: grid; grid-template-columns: minmax(0, 1fr) 330px; width: 100%; height: 34vh; min-height: 270px; max-height: 390px; }
.map-stage { position: relative; min-width: 0; min-height: 0; height: 100%; max-height: 100%; overflow: hidden; }
#map { position: absolute; inset: 0; background: #d8d4c8; }
.history-sheet { position: absolute; z-index: 1; display: block; max-width: none; pointer-events: none; transform-origin: 0 0; mix-blend-mode: multiply; }
.trip-overlay { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.trip-overlay .route-casing { fill: none; stroke: rgba(255,255,255,.96); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.trip-overlay .route-line { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: stroke; cursor: pointer; }
.trip-overlay .point-halo { fill: rgba(255,255,255,.96); pointer-events: none; }
.trip-overlay .trip-point { stroke: #fff; stroke-width: 1.5; cursor: pointer; pointer-events: all; }
.glass-panel { background: rgba(249, 247, 240, 0.78); border: 1px solid rgba(255,255,255,.62); box-shadow: 0 8px 24px rgba(10, 41, 66, .14); backdrop-filter: blur(9px) saturate(.86); }

.title-card { position: absolute; z-index: 4; top: 12px; left: 12px; width: min(290px, calc(100% - 24px)); padding: 7px 10px 8px; border-radius: 11px; }
.title-card .eyebrow { margin-bottom: 2px; font-size: .49rem; letter-spacing: .11em; }
.eyebrow { margin: 0 0 7px; color: #8f6330; font-size: .69rem; font-weight: 800; letter-spacing: .14em; }
.eyebrow.dark { color: #6c746f; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.02rem; line-height: 1.05; font-weight: 600; }
.subtitle { display: none; }
.map-brand-signature { margin: 4px 0 0; color: #4e5e69; font-size: .5rem; font-weight: 800; letter-spacing: .045em; }

.map-actions { position: absolute; z-index: 4; top: 12px; right: 12px; display: flex; gap: 7px; }
.map-diagnostic { position: absolute; z-index: 10; top: 90px; right: 24px; max-width: 360px; padding: 10px 12px; border-radius: 10px; background: #7f1d1d; color: #fff; font-size: .72rem; line-height: 1.35; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.75); border-radius: 11px; background: rgba(248,245,236,.91); color: var(--forest); box-shadow: 0 8px 20px rgba(24,34,30,.16); cursor: pointer; font-size: .67rem; font-weight: 900; }
.icon-button:hover { transform: translateY(-1px); }
.icon-button.accent { background: var(--forest); color: white; border-color: var(--forest); }

.map-key { position: absolute; z-index: 4; left: 12px; bottom: 12px; display: flex; gap: 10px; flex-wrap: wrap; padding: 7px 10px; border-radius: 11px; font-size: .63rem; font-weight: 700; }
.map-key span { display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.map-key i { display: block; width: 18px; height: 4px; border-radius: 9px; background: var(--swatch); box-shadow: 0 0 0 1px rgba(255,255,255,.8); }
.history-controls { position: absolute; z-index: 5; right: 12px; bottom: 12px; width: 225px; padding: 9px 11px 8px; border-radius: 12px; }
.history-controls-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.history-controls h2 { font-size: .9rem; }
.history-controls .eyebrow { margin-bottom: 2px; font-size: .5rem; }
.history-controls .slider-label { margin-top: 6px; font-size: .62rem; }
.history-controls input[type="range"] { margin: 3px 0 0; }
.history-quality { margin: 2px 0 0; color: #69736d; font-size: .55rem; line-height: 1.25; }

.story-panel { position: relative; z-index: 5; min-width: 0; min-height: 0; height: 100%; max-height: 100%; overflow: hidden; background: var(--paper); border-left: 1px solid rgba(24,34,30,.1); box-shadow: -12px 0 35px rgba(34,35,27,.09); }
.panel-scroll { height: 100%; overflow: auto; padding: 14px 17px 20px; }
.panel-handle { display: none; }
.status-card { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 21px; border-bottom: 1px solid var(--line); }
.status-value { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; line-height: 1; }
.status-value small { display: block; margin-top: 4px; color: var(--muted); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.current-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 999px; background: #e0eee7; color: #245341; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.current-chip span { width: 7px; height: 7px; border-radius: 50%; background: #0f8a60; box-shadow: 0 0 0 4px rgba(15,138,96,.13); }
.movement-note { margin: 11px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }

.control-card, .downloads-card { margin: 13px 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.46); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.section-heading.compact { margin: 25px 0 13px; }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.18rem; font-weight: 600; }
.switch { position: relative; width: 44px; height: 25px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch span[aria-hidden] { display: block; width: 100%; height: 100%; border-radius: 999px; background: #c6cbc7; cursor: pointer; transition: .2s ease; }
.switch span[aria-hidden]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: white; box-shadow: 0 1px 5px rgba(0,0,0,.25); transition: .2s ease; }
.switch input:checked + span { background: var(--forest); }
.switch input:checked + span::after { transform: translateX(19px); }
.slider-label { display: flex; justify-content: space-between; margin-top: 16px; color: var(--muted); font-size: .74rem; font-weight: 700; }
input[type="range"] { width: 100%; margin: 8px 0 3px; accent-color: var(--forest); }
.fine-print { margin: 8px 0 0; color: #737a75; font-size: .71rem; line-height: 1.45; }
.text-button { border: 0; background: transparent; color: #326a56; font-size: .75rem; font-weight: 800; cursor: pointer; }

.leg-list { display: grid; gap: 10px; }
.leg-card { position: relative; display: grid; grid-template-columns: 8px minmax(0,1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 13px 12px 13px 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.55); color: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.leg-card:hover, .leg-card:focus-visible { border-color: color-mix(in srgb, var(--leg-color), white 45%); background: white; outline: none; }
.leg-bar { align-self: stretch; width: 8px; background: var(--leg-color); }
.leg-copy strong { display: block; font-size: .84rem; line-height: 1.3; }
.leg-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; }
.leg-mileage { color: var(--forest); font-size: .75rem; font-weight: 800; white-space: nowrap; }

.downloads-card h2 { margin-bottom: 12px; }
.download-grid { display: grid; gap: 8px; }
.download-grid a { display: flex; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: 11px; background: #efe9db; text-decoration: none; }
.download-grid a:hover { background: #e7ddca; }
.download-grid strong { font-size: .78rem; }
.download-grid span { color: var(--muted); font-size: .7rem; text-align: right; }
footer { color: #737a75; font-size: .68rem; line-height: 1.5; }
footer a { color: #345f50; font-weight: 700; }

.journey { background: #eee7da; border-top: 1px solid rgba(19,35,30,.18); }
.journey-intro { max-width: 1180px; margin: 0 auto; padding: 24px 28px 17px; }
.journey-intro h2 { max-width: 760px; font-size: clamp(1.6rem, 3.5vw, 3rem); line-height: 1; }
.journey-intro > p:not(.eyebrow) { max-width: 780px; margin: 9px 0 0; color: #53615a; font-size: .86rem; line-height: 1.45; }
.day-nav { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.day-nav button { padding: 8px 12px; border: 1px solid rgba(23,63,52,.2); border-radius: 999px; background: rgba(255,255,255,.48); color: #294b3f; font-size: .72rem; font-weight: 800; cursor: pointer; }
.day-nav button:hover { background: #fff; }
.day-nav button[aria-selected="true"] { border-color: var(--forest); background: var(--forest); color: white; box-shadow: 0 6px 18px rgba(23,63,52,.2); }

.journal-layout { display: block; max-width: none; margin: 0; padding: 0 0 54px; }
.journal-map-column { position: sticky; z-index: 8; top: 0; height: 34vh; min-height: 230px; max-height: 380px; }
.journal-map-frame { position: relative; height: 100%; overflow: hidden; border-block: 1px solid rgba(19,35,30,.15); background: #233d34; box-shadow: 0 14px 35px rgba(30,37,31,.18); }
#story-map { position: absolute; inset: 0; }
.story-map-header { position: absolute; z-index: 3; top: 18px; left: 18px; max-width: min(380px, calc(100% - 36px)); padding: 14px 16px; border-radius: 15px; pointer-events: none; }
.story-map-header h3 { margin: 0; font: 600 clamp(1.25rem, 2vw, 1.7rem)/1.08 Georgia, serif; }
.story-map-header p:last-child { margin: 7px 0 0; color: #5d6963; font-size: .74rem; line-height: 1.35; }
.story-history-controls { position: absolute; z-index: 4; left: 18px; bottom: 18px; width: min(270px, calc(100% - 88px)); padding: 10px 12px 9px; border-radius: 14px; }
.story-history-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: #173f34; }
.story-history-title strong { font: 700 .76rem/1.1 Georgia, serif; }
.story-history-title output { color: #5d6963; font-size: .61rem; font-weight: 800; white-space: nowrap; }
#story-history-opacity { width: 100%; margin: 7px 0 1px; accent-color: #b16c31; cursor: ew-resize; }
.story-history-scale { display: flex; justify-content: space-between; color: #68736d; font-size: .56rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.story-marker-key { display: flex; align-items: center; gap: 7px; margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(23,63,52,.14); color: #34453e; font-size: .62rem; font-weight: 800; }
.story-marker-key span { width: 8px; height: 8px; border-radius: 50%; background: #ff9e32; box-shadow: 0 0 0 4px rgba(255,158,50,.18); }

.story-feed { min-width: 0; max-width: 920px; margin: 0 auto; padding: 0 24px; }
.day-chapter { scroll-margin-top: 34vh; padding: 0 0 7vh; }
.day-chapter[hidden] { display: none; }
.day-heading { min-height: 30vh; display: flex; flex-direction: column; justify-content: flex-end; padding: 28px 6px 20px; border-bottom: 1px solid rgba(19,35,30,.15); }
.day-heading h3 { margin: 0; font: 600 clamp(1.8rem, 4vw, 3.5rem)/.98 Georgia, serif; }
.day-heading .day-summary { max-width: 42ch; margin: 17px 0 0; color: #55625c; line-height: 1.55; }
.day-badge { display: inline-flex; align-items: center; width: fit-content; margin-top: 18px; padding: 7px 10px; border-radius: 999px; background: #d9e7df; color: #28513f; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }

.media-step { min-height: 66vh; display: flex; align-items: center; padding: 4vh 0; opacity: .46; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease; scroll-margin-top: 34vh; }
.media-step.is-active { opacity: 1; transform: none; }
.media-card { width: 100%; overflow: hidden; border: 1px solid rgba(19,35,30,.13); border-radius: 20px; background: rgba(250,248,242,.96); box-shadow: 0 14px 45px rgba(31,40,34,.12); }
.media-card img { display: block; width: 100%; max-height: 48vh; object-fit: contain; background: #d9d4c9; }
.media-copy { padding: 16px 18px 18px; }
.media-meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 9px; color: #717b75; font-size: .68rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.media-copy h4 { margin: 0; font: 600 1.22rem/1.2 Georgia, serif; }
.media-copy p { margin: 8px 0 0; color: #53605a; font-size: .84rem; line-height: 1.55; }
.location-evidence { display: inline-block; margin-top: 11px; padding: 5px 8px; border-radius: 8px; background: #ece6d9; color: #66716b; font-size: .63rem; font-weight: 750; }
.video-poster { position: relative; display: block; color: inherit; text-decoration: none; }
.video-poster::after { content: "▶"; position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: rgba(19,35,30,.88); color: white; font-size: 1.35rem; transform: translate(-50%,-50%); box-shadow: 0 9px 30px rgba(0,0,0,.3); }
.video-link { display: inline-flex; margin-top: 13px; color: #2b5e4c; font-size: .75rem; font-weight: 850; }
.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #081e2d; }
.video-embed iframe,
.video-embed video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }
.video-embed video { object-fit: contain; background: #081e2d; }
.journal-footer { max-width: 1180px; margin: 0 auto; padding: 0 36px 70px; color: #68736d; font-size: .75rem; line-height: 1.55; }
.journal-footer a { color: #2f6250; font-weight: 800; }
.story-photo-marker { z-index: 2; width: 22px; height: 22px; border: 4px solid white; border-radius: 50%; background: #f97316; box-shadow: 0 4px 16px rgba(0,0,0,.42); }
.story-photo-marker.video { background: #7c3aed; }
.story-photo-marker.travel { background: #0891b2; }
.story-camp-marker { z-index: 5; position: relative; display: grid; place-items: center; width: 34px; height: 34px; border: 3px solid white; border-radius: 50% 50% 50% 8px; background: #0b2940; color: white; box-shadow: 0 5px 16px rgba(0,0,0,.38); transform: rotate(-45deg); }
.story-camp-marker::after { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(224,185,99,.72); border-radius: inherit; }
.story-camp-marker svg { position: relative; z-index: 1; width: 22px; height: 22px; fill: rgba(224,185,99,.16); stroke: #e0b963; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transform: rotate(45deg); }

.maplibregl-popup { max-width: min(320px, calc(100vw - 38px)) !important; }
.maplibregl-popup-content { max-height: min(310px, calc(100vh - 100px)); overflow: auto; padding: 16px 38px 16px 16px; border-radius: 14px; box-shadow: 0 14px 35px rgba(25,35,30,.24); font-family: inherit; }
.maplibregl-popup-close-button { top: 7px; right: 8px; width: 28px; height: 28px; border-radius: 50%; font-size: 1.25rem; }
.popup-eyebrow { margin: 0 0 5px; color: #6a736e; font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.popup-title { margin: 0; font: 600 1.04rem/1.2 Georgia, serif; }
.popup-body { margin: 8px 0 0; color: #52605a; font-size: .78rem; line-height: 1.45; }
.popup-stat { display: inline-block; margin-top: 10px; padding: 5px 8px; border-radius: 8px; background: #edf1ec; color: #29483c; font-size: .7rem; font-weight: 800; }
.maplibregl-ctrl-bottom-right { bottom: 8px; right: 8px; }
.maplibregl-ctrl-attrib { max-width: 70vw; font-size: 10px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 880px) {
  .app-shell { display: block; height: auto; min-height: 0; max-height: none; }
  .map-stage { height: 34vh; min-height: 250px; }
  .story-panel { height: 32vh; min-height: 230px; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 30px rgba(32,37,31,.13); }
  .panel-handle { display: block; position: absolute; top: 7px; left: 50%; z-index: 2; width: 42px; height: 4px; border-radius: 4px; background: #b8b9b0; transform: translateX(-50%); }
  .panel-scroll { padding: 25px 18px 30px; }
  .title-card { top: 8px; left: 8px; width: min(245px, calc(100% - 140px)); padding: 6px 9px; border-radius: 10px; }
  .title-card .subtitle { display: none; }
  .map-actions { top: 8px; right: 8px; }
  .map-key { left: 8px; right: auto; bottom: 8px; max-width: calc(100% - 220px); gap: 7px; padding: 6px 8px; font-size: .58rem; }
  .history-controls { right: 8px; bottom: 8px; width: 200px; padding: 7px 9px 6px; }
  .status-card { padding-bottom: 15px; }
  .journey-intro { padding: 22px 18px 15px; }
  .journal-layout { display: block; padding: 0 0 48px; }
  .journal-map-column { z-index: 8; top: 0; height: 34vh; min-height: 220px; margin: 0; }
  .journal-map-frame { border-left: 0; border-right: 0; }
  .story-feed { padding: 0 14px; }
  .day-chapter { padding-bottom: 7vh; }
  .day-heading { min-height: 28vh; padding: 25px 7px 18px; }
  .media-step { min-height: 66vh; padding: 4vh 0; scroll-margin-top: 34vh; }
  .media-card img { max-height: 48vh; }
  .journal-footer { padding: 0 20px 55px; }
}

@media (max-width: 520px) {
  .map-stage { height: 34vh; }
  .story-panel { height: 32vh; }
  h1 { font-size: .92rem; }
  .status-card { align-items: flex-start; flex-direction: column; }
  .map-key { display: none; }
  .history-controls { width: 190px; }
  .story-map-header { top: 10px; left: 10px; max-width: calc(100% - 20px); padding: 10px 12px; }
  .story-map-header p:last-child { margin-top: 4px; }
  .story-history-controls { left: 10px; bottom: 10px; width: min(236px, calc(100% - 76px)); padding: 8px 10px 7px; }
  .story-marker-key { margin-top: 5px; padding-top: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
