/* Homepage map only. Other homepage sections keep their existing styles. */
.map-marker{cursor:pointer;outline:none}.marker-core{fill:var(--bg);stroke:var(--ink);stroke-width:calc(1.3px * var(--marker-scale,1));transition:fill .22s,stroke-width .22s}.marker-halo{fill:rgba(11,51,82,.06);stroke:rgba(11,51,82,.17);stroke-width:calc(.6px * var(--marker-scale,1))}.map-marker.is-visited .marker-core{fill:var(--ink)}.map-marker.is-hovered .marker-halo,.map-marker:focus .marker-halo{fill:rgba(11,51,82,.16);stroke:var(--ink)}.map-marker.is-selected .marker-core{fill:var(--ink);stroke-width:calc(2px * var(--marker-scale,1))}.map-marker.is-selected .marker-halo{stroke:var(--ink);stroke-width:calc(1px * var(--marker-scale,1));fill:rgba(11,51,82,.12)}.marker-label{font:500 11px var(--font);fill:var(--ink);paint-order:stroke;stroke:var(--bg);stroke-width:4px;stroke-linejoin:round;pointer-events:none}.map-tooltip{position:absolute;z-index:4;padding:9px 13px;background:var(--ink);color:var(--bg);border-radius:7px;font-size:12px;pointer-events:none;box-shadow:0 5px 20px rgba(11,51,82,.12);max-width:230px}
.trail-hero{--muted:#617580;--line:rgba(11,51,82,.16)}
.trail-hero{position:relative;isolation:isolate;height:min(calc(140px + 44vw),826px,calc(100dvh - 136px));padding:0!important;overflow:hidden}
/* JS refines the loading fallback from the actual Equal Earth land bounds. */
.trail-hero + main #latest{padding-top:26.4px}
.trail-hero:not(.is-fullscreen) .journey-bar{bottom:40px;z-index:4}
.trail-hero:not(.is-fullscreen) .map-caption{bottom:8px}
#trail-viewport{position:absolute;inset:0;background:var(--bg);overflow:hidden;transform-origin:0 0}
.trail-hero:not(.is-fullscreen) #trail-viewport{max-width:1560px;margin-inline:auto}
.trail-hero:not(.is-fullscreen) .journey-bar{left:var(--home-map-left,30px);max-width:min(680px,var(--home-map-width,calc(100% - 60px)))}
.trail-hero.is-fullscreen{isolation:auto;overflow:visible}
.trail-hero.is-fullscreen #trail-viewport{position:fixed;inset:0;z-index:100;height:100vh;height:100dvh}
/* Fixed, native-size surfaces crossfade; neither viewport height nor scaleY is animated. */
.trail-hero.is-transitioning{isolation:auto;overflow:visible}
.trail-hero.is-transitioning #trail-viewport{z-index:101;pointer-events:none}
.trail-hero.is-transitioning .map-stage,.trail-hero.is-transitioning .hero-heading h1{transform:none;will-change:auto}
.trail-hero.is-transitioning .hero-heading{transition:none}
.trail-transition-snapshot{position:fixed;z-index:100;overflow:hidden;background:var(--bg);pointer-events:none;contain:layout paint}
.hero-heading.trail-transition-heading{z-index:102;pointer-events:none;transition:none}
.map-stage{position:absolute;inset:0;z-index:0}
/* Fullscreen geometry must never depend on the compact home height. */
.trail-hero.is-fullscreen .map-stage{width:100%;height:100%}
.map-stage canvas,.map-stage>svg{position:absolute;inset:0;width:100%;height:100%;display:block}
#map-interaction{touch-action:pan-y pinch-zoom;cursor:pointer;outline-offset:-6px}
.is-immersive #map-interaction{touch-action:none;cursor:grab}
.is-immersive #map-interaction:active{cursor:grabbing}
.hero-heading{position:absolute;top:48px;left:50%;transform:translateX(-50%);text-align:center;z-index:10;pointer-events:none;width:max-content;max-width:100%}
.hero-heading h1{font-size:min(11.8vw,164px);font-weight:800;letter-spacing:.8em;padding-left:.8em;line-height:1;margin:0;text-shadow:0 0 25px var(--bg),0 0 60px var(--bg),0 10px 24px rgba(11,51,82,.09)}
.hero-heading h1.is-title-pending{visibility:hidden;opacity:0}
.hero-heading h1.is-title-ready{visibility:visible;opacity:1;transition:opacity .3s ease}
/* Depth transforms belong to the two visual layers; the viewport keeps its fullscreen geometry. */
.trail-hero.is-depth-active:not(.is-fullscreen) .map-stage{transform:translate3d(var(--depth-far-x,0px),var(--depth-far-y,0px),0) scale(1.02);will-change:transform}
.trail-hero.is-depth-active:not(.is-fullscreen) .hero-heading h1{transform:translate3d(var(--depth-near-x,0px),var(--depth-near-y,0px),0);will-change:transform}
.trail-hero.is-fullscreen .map-stage,.trail-hero.is-fullscreen .hero-heading h1{transform:none;will-change:auto}
.is-immersive .hero-heading{opacity:0;transform:translate(-50%,-120px)}
.trail-hero .map-note{position:absolute;top:34px;left:48px;color:var(--muted);font-size:11px;letter-spacing:.14em;pointer-events:none}
.trail-hero .journey-bar{position:absolute;bottom:40px;left:max(48px,calc((100% - 1000px)/2));display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:24px 32px;width:max-content;max-width:min(680px,calc(100% - 96px));height:56px;padding:0;background:none;border:0;border-radius:0;pointer-events:auto;opacity:1;transform:translateY(0);transition:opacity .18s ease,transform .18s ease}
.journey-open{grid-column:1;grid-row:1 / 3;display:grid;grid-template-rows:24px 32px;min-width:0;height:56px;text-align:left;color:var(--ink);border-radius:3px}
.journey-heading{display:flex;align-items:baseline;gap:7px;min-width:0;line-height:24px;white-space:nowrap}.journey-heading>span{font-size:11px;color:var(--muted);letter-spacing:.045em;flex:none}.journey-heading strong{min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:17px;font-weight:600;letter-spacing:.02em}
.journey-line{display:flex;align-items:center;gap:9px;min-width:0;line-height:22px;font-size:13px;color:var(--ink2);white-space:nowrap}.journey-line #journey-quote{min-width:0;overflow:hidden;text-overflow:ellipsis}.journey-line #journey-episode{flex:none;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}.journey-line #journey-episode:empty{display:none}
.journey-play{grid-column:2;grid-row:2;align-self:center;display:grid;place-items:center;width:44px;height:44px;font-size:11px;line-height:1;color:var(--ink);border-radius:50%;transition:color .18s ease,opacity .18s ease}.journey-play:disabled{opacity:.35;cursor:default}.journey-open:disabled{cursor:default}.journey-open:hover:not(:disabled) .journey-line{color:var(--ink)}.journey-play:hover:not(:disabled){color:var(--soft)}.journey-play[aria-pressed="true"]{color:var(--soft)}
.trail-hero .journey-bar.is-changing{opacity:0;transform:translateY(-5px)}
.trail-hero.is-immersive .journey-bar{opacity:0;visibility:hidden;pointer-events:none}
.trail-hero .map-tools{position:absolute;right:calc(30px + env(safe-area-inset-right));bottom:calc(30px + env(safe-area-inset-bottom));display:flex;flex-direction:column;align-items:center;gap:3px;padding:5px;border-radius:12px;background:rgba(255,253,244,.92);border:1px solid var(--line);opacity:0;visibility:hidden;transition:opacity .2s}
.is-immersive .map-tools{opacity:1;visibility:visible}.map-tools button{display:grid;place-items:center;width:44px;height:44px;border-radius:7px}.map-tools button:disabled{opacity:.3;cursor:default}.map-tools button:hover:not(:disabled){background:rgba(11,51,82,.08)}.map-tools button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.tool-divider{width:22px;height:1px;background:var(--line);margin:3px 0}
#trail-exit{position:absolute;top:calc(18px + env(safe-area-inset-top));left:calc(18px + env(safe-area-inset-left));display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;min-width:90px;padding:0 16px;border:1px solid var(--line);border-radius:25px;background:var(--paper);z-index:6;font-size:13px;box-shadow:0 4px 16px rgba(11,51,82,.05)}#trail-exit span[aria-hidden]{font-size:24px;line-height:1}
.is-immersive .map-note{opacity:0;pointer-events:none;visibility:hidden}
.trail-hero .map-caption{position:absolute;bottom:26px;left:48px;font-size:10px;color:var(--muted);pointer-events:none}.is-immersive .map-caption{display:none}
.trail-hero .map-error{position:absolute;top:16px;left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);width:max-content;font-size:12px;padding:9px 15px;border:1px solid var(--line);border-radius:8px;background:var(--paper);z-index:5}.is-immersive .map-error{top:80px}
.trail-hero .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.trail-panel-open .map-tools{right:calc(min(420px,34vw) + 20px + env(safe-area-inset-right))}
.trail-hero button:focus-visible,.trail-hero a:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
@media(max-width:760px){.trail-hero + main #latest{padding-top:19.2px}}
@media(max-width:599px){
  .trail-hero{height:min(calc(230px + 44vw),calc(100dvh - 136px))}
  .trail-hero:not(.is-fullscreen) .journey-bar{bottom:12px}
  .hero-heading{top:40px}.hero-heading h1{letter-spacing:.5em;padding-left:.5em}
  .trail-hero .map-note{top:20px;left:22px;font-size:9px}.trail-hero .journey-bar{left:22px;max-width:calc(100% - 44px)}.trail-hero .map-caption{display:none}
  .journey-heading strong{font-size:16px}.journey-heading>span{font-size:10px}.journey-line{gap:6px;font-size:12px}.journey-line #journey-episode{font-size:10px}
}
@media(prefers-reduced-motion:reduce){.trail-hero *{animation:none!important;transition:none!important;scroll-behavior:auto!important}.trail-hero .journey-bar.is-changing{transform:none}.trail-hero .map-stage,.trail-hero .hero-heading h1{transform:none!important;will-change:auto!important}}
@media(prefers-reduced-motion:reduce){.is-immersive .hero-heading{transform:translateX(-50%)}.trail-transition-heading h1{transform:none!important}}

/* The SVG remains the sole camera/marker input surface over both basemaps. */
#city-map{position:absolute;inset:0;z-index:1;pointer-events:none;opacity:0;background:transparent;transition:opacity .42s ease;-webkit-mask-composite:source-in;mask-composite:intersect;mask-repeat:no-repeat}
#city-map .maplibregl-canvas{background:transparent}
#land-canvas{z-index:0;pointer-events:none}
#trail-canvas{z-index:2;pointer-events:none}
#map-interaction{z-index:3}
.is-city-map #city-map{opacity:1}
#city-attribution{position:absolute;right:calc(12px + env(safe-area-inset-right));bottom:calc(3px + env(safe-area-inset-bottom));z-index:5;padding:2px 6px;border-radius:3px;background:rgba(255,249,228,.88);font-size:10px;color:var(--muted)}
#city-attribution a{text-decoration:underline;text-underline-offset:2px}
.trail-panel-open #city-attribution{right:calc(min(420px,34vw) + 12px + env(safe-area-inset-right))}
/* Share the actual sheet height with controls, including short landscapes. */
body.trail-immersive{--trail-sheet-height:clamp(240px,52dvh,calc(100dvh - 90px - env(safe-area-inset-top)))}
@media(max-width:959px){
  .trail-hero .map-tools{right:calc(16px + env(safe-area-inset-right));bottom:calc(20px + env(safe-area-inset-bottom))}
  .trail-panel-open .map-tools{bottom:calc(var(--trail-sheet-height) + 12px);flex-direction:row;right:calc(16px + env(safe-area-inset-right))}
  .trail-panel-open .tool-divider{width:1px;height:20px}
  .trail-panel-open #city-attribution{right:calc(12px + env(safe-area-inset-right));bottom:calc(var(--trail-sheet-height) + 70px)}
}
/* Loading fallback also permits vertical scrolling in a short viewport. */
@media(max-height:519px){.trail-hero{height:calc(190px + 44vw)}}
/* The loading placeholder follows the same width-only rule as the mobile map. */
@media(any-pointer:coarse) and (max-width:767px){.trail-hero{height:calc(140px + 44vw)}}
@media(any-pointer:coarse) and (max-width:599px){.trail-hero{height:calc(230px + 44vw)}}
