/* Explore from space — opt-in globe page (V05 / V06 / V12).
   Builds on the hub's /styles.css (fonts, .btn, .lang-*, .lang-toggle) and the brief's draft space tokens (§4). */
:root {
  --ex-bg: #050B16;
  --ex-panel: #101D2B;
  --ex-text: #F3F6F8;
  --ex-muted: #BAC8D3;
  --ex-light: #F1C879;
  --ex-atm: #67C9F0;
  --ex-line: rgba(103, 201, 240, .22);
  --ex-radius: 22px;
}
html { background: var(--ex-bg); }
.ex-body {
  background:
    radial-gradient(1200px 520px at 78% -8%, rgba(103, 201, 240, .08), transparent 70%),
    var(--ex-bg);
  color: var(--ex-text);
}
[hidden] { display: none !important; }
.ex-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ex-body :where(a, button, input, [tabindex]):focus-visible { outline: 2px solid var(--ex-light); outline-offset: 3px; }
.ex-body .skip:focus { background: var(--ex-panel); color: var(--ex-text); padding: .6rem 1rem; }

/* ---- top bar ---- */
.ex-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1360px; margin: 0 auto; padding: 14px clamp(16px, 4vw, 40px); }
.ex-top__home { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .01em; }
.ex-top__home img { border-radius: 9px; display: block; }
.ex-top__right { display: flex; align-items: center; gap: 14px; }
.ex-top__link { color: var(--ex-muted); font-size: .9rem; font-weight: 600; }
.ex-top__link:hover { color: var(--ex-light); }
@media (max-width: 520px) { .ex-top__link { display: none; } }

/* ---- hero layout ---- */
.ex-hero { max-width: 1360px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 36px; display: grid; grid-template-columns: minmax(0, 470px) minmax(0, 1fr); gap: clamp(24px, 4.5vw, 72px); align-items: center; }
.ex-hero.is-live { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.ex-copy { min-width: 0; }
.ex-eyebrow { margin: 0 0 14px; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ex-atm); }
.ex-copy h1 { margin: 0 0 18px; font-family: var(--font-serif); font-weight: 600; font-size: clamp(2.6rem, 5.4vw, 4.4rem); line-height: 1.02; letter-spacing: -.01em; color: var(--ex-text); }
.ex-lede { margin: 0 0 26px; font-size: 1.08rem; line-height: 1.6; color: var(--ex-muted); max-width: 46ch; }
.ex-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.ex-btn-start { padding: .95rem 1.7rem; font-size: 1rem; background: var(--ex-light); color: #1a1305; box-shadow: 0 10px 34px -12px rgba(241, 200, 121, .55); }
.ex-btn-start:hover { background: #f6d58f; }
.ex-textlink { font-size: .92rem; font-weight: 600; color: var(--ex-muted); border-bottom: 1px solid rgba(186, 200, 211, .35); }
.ex-textlink:hover { color: var(--ex-light); border-color: var(--ex-light); }
.ex-hint { margin: 20px 0 0; font-size: .88rem; line-height: 1.55; color: #9db0bf; max-width: 52ch; }

/* While live/loading the copy collapses to a compact heading line */
.ex-hero.is-live .ex-lede, .ex-hero.is-live .ex-actions, .ex-hero.is-live .ex-hint { display: none; }
.ex-hero.is-live .ex-copy { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.ex-hero.is-live .ex-eyebrow { margin: 0; }
.ex-hero.is-live .ex-copy h1 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); }

@media (max-width: 899px) {
  .ex-hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .ex-copy h1 { font-size: clamp(2.3rem, 11vw, 3.2rem); }
}

/* ---- stage ---- */
.ex-figure { margin: 0; min-width: 0; }
.ex-stage {
  position: relative; width: 100%; aspect-ratio: 5 / 4; max-height: 720px; overflow: hidden;
  border-radius: var(--ex-radius); border: 1px solid var(--ex-line);
  background:
    radial-gradient(1.2px 1.2px at 8% 14%, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(1px 1px at 22% 78%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1.3px 1.3px at 37% 9%, rgba(255,255,255,.65), transparent 60%),
    radial-gradient(1px 1px at 52% 91%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.2px 1.2px at 66% 22%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1px 1px at 81% 66%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1.3px 1.3px at 93% 12%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1px 1px at 14% 44%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1px 1px at 88% 88%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.1px 1.1px at 46% 36%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(ellipse at 50% 110%, #0a1a2d 0%, var(--ex-bg) 68%);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .9), 0 0 90px -34px rgba(103, 201, 240, .28);
}
.ex-stage:focus { outline: none; }
.ex-stage:focus-visible { outline: 2px solid var(--ex-light); outline-offset: 3px; }
.ex-hero.is-live .ex-stage { aspect-ratio: auto; height: clamp(520px, 80vh, 800px); max-height: none; }
@supports (height: 1svh) { .ex-hero.is-live .ex-stage { height: clamp(520px, 80svh, 800px); } }

.ex-poster { position: absolute; inset: 0; }
.ex-poster picture, .ex-poster img { display: block; width: 100%; height: 100%; }
.ex-poster img { object-fit: cover; }
.ex-poster::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, transparent 52%, rgba(5, 11, 22, .72) 100%); box-shadow: inset 0 0 70px rgba(103, 201, 240, .14); }

.ex-stage .ex-map { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.ex-halo { position: absolute; inset: 0; display: none; pointer-events: none; opacity: var(--ho, 1);
  background: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%),
    transparent calc(var(--hr, 0px) - 6px),
    rgba(150, 220, 246, .72) calc(var(--hr, 0px) - 1px),
    rgba(103, 201, 240, .34) calc(var(--hr, 0px) + 5px),
    rgba(103, 201, 240, .15) calc(var(--hr, 0px) + 28px),
    rgba(103, 201, 240, .05) calc(var(--hr, 0px) + 70px),
    transparent calc(var(--hr, 0px) + 130px)); }
.ex-figure[data-state="live"] .ex-halo { display: block; }
.ex-map .maplibregl-canvas-container, .ex-map canvas { outline: none; }
.ex-map .maplibregl-canvas-container:focus-visible { outline: 2px solid var(--ex-light); outline-offset: -2px; }
.ex-figure[data-state="loading"] .ex-stage .ex-map { display: block; visibility: hidden; }
.ex-figure[data-state="live"] .ex-stage .ex-map { display: block; }
.ex-figure[data-state="live"] .ex-poster { display: none; }
.ex-map .maplibregl-cooperative-gesture-screen { font-family: var(--font-sans); }

/* ---- loading + error overlays ---- */
.ex-overlay { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: rgba(5, 11, 22, .78); }
.ex-figure[data-state="loading"] .ex-overlay--loading, .ex-figure[data-state="error"] .ex-overlay--error { display: flex; }
.ex-overlay__title { margin: 0; font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2rem); color: var(--ex-text); }
.ex-overlay__text { margin: 0; max-width: 46ch; color: var(--ex-muted); font-size: .98rem; line-height: 1.55; }
.ex-overlay__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.ex-err { display: none; }
.ex-overlay--error[data-kind="webgl"] .ex-err--webgl, .ex-overlay--error[data-kind="script"] .ex-err--script,
.ex-overlay--error[data-kind="tiles"] .ex-err--tiles, .ex-overlay--error[data-kind="context"] .ex-err--context { display: inline; }
.ex-bar { display: block; width: min(240px, 60%); height: 3px; border-radius: 3px; background: rgba(103, 201, 240, .18); overflow: hidden; }
.ex-bar i { display: block; width: 40%; height: 100%; background: var(--ex-atm); border-radius: 3px; animation: ex-bar 1.5s ease-in-out infinite; }
@keyframes ex-bar { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }

/* ---- live UI ---- */
.ex-ui { position: absolute; inset: 0; display: none; pointer-events: none; }
.ex-figure[data-state="live"] .ex-ui { display: block; }
.ex-ui > * { pointer-events: auto; }
.ex-ui__top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; pointer-events: none; }
.ex-ui__top > * { pointer-events: auto; }
.ex-ui__top-right { display: flex; gap: 8px; }
.ex-ui__bottom { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; pointer-events: none; }
.ex-ui__bottom > * { pointer-events: auto; }
.ex-zoom { display: inline-flex; gap: 8px; margin-left: auto; }
.ex-stage.is-presenting .ex-ui__bottom { display: none; }
.ex-ui .btn { white-space: nowrap; }
.ex-solid { background: rgba(16, 29, 43, .94); color: var(--ex-text); border-color: rgba(103, 201, 240, .3); }
.ex-solid:hover { background: #17283a; color: var(--ex-light); border-color: var(--ex-light); }
.ex-solid[aria-pressed="true"] { border-color: var(--ex-light); color: var(--ex-light); }

.ex-ibtn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid rgba(103, 201, 240, .3); background: rgba(16, 29, 43, .94); color: var(--ex-text); cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.ex-ibtn:hover { border-color: var(--ex-light); color: var(--ex-light); background: #17283a; }
.ex-ibtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ex-ibtn--sm { width: 40px; height: 40px; }
.ex-ibtn[aria-expanded="false"] svg { transform: rotate(-90deg); }
#ex-info-btn[aria-expanded="false"] svg, #ex-info-btn[aria-expanded="true"] svg { transform: none; }

/* day / night: a labelled 2-option switch (V06) */
.ex-switch { display: inline-flex; margin: 0; padding: 3px; border: 1px solid rgba(103, 201, 240, .3); border-radius: 999px; background: rgba(16, 29, 43, .94); min-width: 0; }
.ex-switch__opt { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.ex-switch__opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ex-switch__face { display: inline-flex; align-items: center; min-height: 38px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: .92rem; color: var(--ex-muted); transition: background .2s, color .2s; }
.ex-switch__opt input:checked + .ex-switch__face { background: var(--ex-light); color: #1a1305; }
.ex-switch__opt input:focus-visible + .ex-switch__face { outline: 2px solid var(--ex-text); outline-offset: 2px; }

/* panels */
.ex-panel { position: absolute; background: rgba(16, 29, 43, .96); border: 1px solid rgba(103, 201, 240, .28); border-radius: 18px; padding: 16px; color: var(--ex-text); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .8); overflow: auto; }
.ex-panel h2 { margin: 0; font-family: var(--font-serif); font-weight: 600; font-size: 1.5rem; line-height: 1.1; }
.ex-info { top: 66px; left: 12px; width: min(430px, calc(100% - 24px)); max-height: calc(100% - 140px); z-index: 3; }
.ex-info h2 { margin-bottom: 10px; }
.ex-info ul { margin: 0 0 14px; padding-left: 1.1rem; font-size: .9rem; line-height: 1.5; color: var(--ex-muted); }
.ex-info li { margin-bottom: 8px; }
.ex-info code { font-size: .82em; color: var(--ex-light); }
.ex-info a, .ex-sources a { color: var(--ex-atm); text-decoration: underline; text-underline-offset: 3px; }
.ex-check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; font-size: .9rem; color: var(--ex-text); cursor: pointer; }
.ex-check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--ex-light); }

.ex-atlaspanel { top: 66px; right: 12px; bottom: 70px; width: 360px; padding: 14px; }
.ex-atlaspanel.is-collapsed { bottom: auto; }
.ex-atlaspanel__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ex-atlaspanel.is-collapsed .ex-atlaspanel__head { margin-bottom: 0; }
@media (max-width: 899px) {
  .ex-atlaspanel { top: auto; left: 12px; right: 12px; bottom: 122px; width: auto; max-height: 48%; }
  .ex-info { max-height: calc(100% - 128px); }
  .ex-atlaspanel { max-height: calc(100% - 240px); }
}

/* presentation card (V12) */
.ex-tour { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(780px, calc(100% - 24px)); padding: 22px 26px 18px; background: rgba(16, 29, 43, .96); border: 1px solid rgba(241, 200, 121, .38); border-radius: 20px; box-shadow: 0 30px 70px -26px rgba(0, 0, 0, .9); color: var(--ex-text); max-height: 62%; overflow: auto; }
.ex-tour__count { margin: 0 0 6px; font-size: .86rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ex-light); }
.ex-tour__count b { font-size: 1.05rem; }
.ex-tour__title { margin: 0 0 8px; font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.05; }
.ex-tour__text { margin: 0 0 16px; font-size: clamp(1rem, 1.5vw, 1.2rem); line-height: 1.55; color: #dbe5ec; }
.ex-tour__nav { display: flex; flex-wrap: wrap; gap: 10px; }
.ex-tour__nav [aria-disabled="true"] { opacity: .42; cursor: default; pointer-events: none; }
.ex-tour__donetxt { display: none; }
.ex-tour.is-last .ex-tour__donetxt { display: inline; }
.ex-tour.is-last .ex-tour__nexttxt { display: none; }
.ex-tour__keys { margin: 12px 0 0; font-size: .8rem; color: #9db0bf; }
@media (max-width: 899px) { .ex-tour { padding: 16px 16px 14px; } .ex-tour__keys { display: none; } }

/* caption under the stage — solid background, never over imagery */
.ex-caption { margin: 12px 2px 0; font-size: .85rem; line-height: 1.55; color: var(--ex-muted); }
.ex-caption a { color: var(--ex-atm); text-decoration: underline; text-underline-offset: 3px; }
.ex-cap { display: none; }
.ex-figure[data-state="static"] .ex-cap--poster, .ex-figure[data-state="loading"] .ex-cap--poster, .ex-figure[data-state="error"] .ex-cap--poster { display: block; }
.ex-figure[data-state="live"][data-layer="night"] .ex-cap--night { display: block; }
.ex-figure[data-state="live"][data-layer="day"] .ex-cap--day { display: block; }

/* ---- lower sections ---- */
.ex-section { max-width: 1360px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 12px; }
.ex-section__head { margin-bottom: 18px; }
.ex-section h2 { margin: 0; font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.3rem); }
.ex-section__lede { margin: 6px 0 0; color: var(--ex-muted); }
.ex-atlases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.ex-atlas { --ac: var(--ex-atm); display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 6px; align-items: start; height: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--ex-line); background: rgba(16, 29, 43, .7); color: var(--ex-text); transition: border-color .2s, background .2s, transform .2s; }
.ex-atlas:hover { border-color: var(--ac); background: rgba(16, 29, 43, .95); transform: translateY(-1px); }
.ex-atlas__dot { width: 10px; height: 10px; margin-top: .5em; border-radius: 50%; background: var(--ac); box-shadow: 0 0 12px var(--ac); }
.ex-atlas__name { font-weight: 800; font-size: 1.02rem; }
.ex-atlas__badge { font-style: normal; font-weight: 700; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ex-muted); border: 1px solid rgba(186, 200, 211, .35); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: .12em; }
.ex-atlas__desc { display: block; margin-top: 3px; font-size: .88rem; line-height: 1.45; color: var(--ex-muted); }
.ex-atlas__url { grid-column: 2; font-size: .8rem; font-weight: 700; color: var(--ac); }
.ex-atlas__body { min-width: 0; }
.ex-atlases--panel { grid-template-columns: 1fr; gap: 8px; }
.ex-atlases--panel .ex-atlas { padding: 11px 13px; }
.ex-atlases--panel .ex-atlas__desc { font-size: .8rem; }
.ex-atlas[data-accent="air"] { --ac: #4ea8de; } .ex-atlas[data-accent="water"] { --ac: #2dd4bf; }
.ex-atlas[data-accent="forest"] { --ac: #4ade80; } .ex-atlas[data-accent="cost"] { --ac: #f59e0b; }
.ex-atlas[data-accent="motor"] { --ac: #a78bfa; } .ex-atlas[data-accent="road"] { --ac: #f87171; }
.ex-atlas[data-accent="church"] { --ac: #fbbf24; } .ex-atlas[data-accent="fauna"] { --ac: #34d399; }
.ex-atlas[data-accent="flora"] { --ac: #84cc16; } .ex-atlas[data-accent="soil"] { --ac: #c2854f; }
.ex-atlas[data-accent="rail"] { --ac: #818cf8; }

.ex-sources__body { color: var(--ex-muted); font-size: .95rem; line-height: 1.6; max-width: 80ch; }
.ex-sources__body ul { margin: 0; padding-left: 1.2rem; }
.ex-sources__body li { margin-bottom: 8px; }
.ex-sources code { color: var(--ex-light); font-size: .85em; }
.ex-foot { max-width: 1360px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 48px; font-size: .85rem; color: #9db0bf; }

/* ---- motion preferences ---- */
@media (prefers-reduced-motion: reduce) {
  .ex-bar i { animation: none; width: 100%; opacity: .6; }
  .ex-atlas, .ex-ibtn, .ex-switch__face { transition: none; }
  .ex-atlas:hover { transform: none; }
}
