/* Night atlas: the map-led pages (world, country, district). Loaded after the shared sheets. */
:root {
  --night: #06131e;
  --night-2: #0e2c40;
  --night-line: #b6d7ed38;
  --sun: #e9be82;
  --mist: #cfe0e8;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* Moving between map pages on one host feels like diving one level deeper. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: dive-out .45s cubic-bezier(.5, 0, .75, 0) both; }
::view-transition-new(root) { animation: dive-in .7s var(--ease-out) both; }
@keyframes dive-out { to { opacity: 0; scale: 1.25; } }
@keyframes dive-in { from { opacity: 0; scale: .92; } }

/* Header floats over the night stage instead of sitting on paper. */
.atlas-page .header {
  position: absolute;
  inset: 0 0 auto;
  background: none;
  border: 0;
  color: #fff;
  --logo-road: var(--night);
  --logo-cross: var(--sun);
}
.atlas-page .header nav a:hover { color: var(--sun); }
.atlas-page .header .nav-social, .atlas-page .lang-select, .atlas-page .header-back { border-color: #ffffff4d; color: #fff; }
.atlas-page .header-back:hover { background: #ffffff1f; }
.atlas-page .lang-select select { color: #fff; }
.atlas-page .lang-select option { color: var(--ink); }
.atlas-page ::selection { background: var(--sun); color: var(--night); }

/* ---------- Stage: one full-viewport map with the copy laid over it ---------- */
.stage {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: max(660px, 100svh);
  overflow: clip;
  background: var(--night);
  color: #fff;
}
/* The sky is its own layer: it drifts, twinkles and shifts with the pointer without repainting the map. */
.stage-sky {
  position: absolute;
  inset: -5%;
  z-index: -2;
  background:
    radial-gradient(circle at 7% 22%, #ffffffb3 0 1px, transparent 1.6px),
    radial-gradient(circle at 19% 71%, #ffffff80 0 1px, transparent 1.6px),
    radial-gradient(circle at 44% 86%, #ffffff66 0 1px, transparent 1.5px),
    radial-gradient(circle at 53% 14%, #ffffff8c 0 1px, transparent 1.5px),
    radial-gradient(circle at 78% 6%, #ffffffa6 0 1px, transparent 1.6px),
    radial-gradient(circle at 96% 78%, #ffffff80 0 1px, transparent 1.5px),
    radial-gradient(circle at 37% 47%, #ffffff40 0 1px, transparent 1.4px),
    radial-gradient(ellipse 75% 85% at 66% 50%, var(--night-2), var(--night) 72%);
  transition: translate .9s var(--ease-out);
  animation: sky-drift 80s ease-in-out infinite alternate;
}
.stage-sky::before, .stage-sky::after { content: ''; position: absolute; inset: 0; animation: sky-twinkle 3.7s ease-in-out infinite alternate; }
.stage-sky::before {
  background:
    radial-gradient(circle at 31% 9%, #f1cd9bcc 0 1.2px, transparent 1.9px),
    radial-gradient(circle at 66% 93%, #c1e4ecb3 0 1px, transparent 1.6px),
    radial-gradient(circle at 91% 31%, #f1cd9bb3 0 1.2px, transparent 1.9px),
    radial-gradient(circle at 13% 52%, #ffffffb3 0 1px, transparent 1.6px),
    radial-gradient(circle at 59% 36%, #ffffff99 0 1px, transparent 1.6px);
}
.stage-sky::after {
  background:
    radial-gradient(circle at 24% 33%, #ffffffcc 0 1.2px, transparent 1.9px),
    radial-gradient(circle at 71% 19%, #c1e4eccc 0 1px, transparent 1.6px),
    radial-gradient(circle at 84% 62%, #ffffffb3 0 1px, transparent 1.6px),
    radial-gradient(circle at 47% 67%, #f1cd9b99 0 1px, transparent 1.6px),
    radial-gradient(circle at 4% 88%, #ffffffa6 0 1px, transparent 1.6px);
  animation-duration: 5.3s;
  animation-delay: -2s;
}
@keyframes sky-drift { to { transform: scale(1.07) rotate(1.4deg); } }
@keyframes sky-twinkle { from { opacity: .12; } }
.stage-comet {
  position: absolute;
  inset: 16% auto auto 62%;
  width: 150px;
  height: 1px;
  background: linear-gradient(90deg, #fff, #ffffff00);
  rotate: -24deg;
  opacity: 0;
  animation: sky-comet 14s linear 5s infinite;
}
@keyframes sky-comet {
  0% { opacity: 0; transform: translateX(0); }
  1% { opacity: 1; }
  6%, 100% { opacity: 0; transform: translateX(-460px); }
}

.stage-map { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.stage-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, #06131ef2 0, #06131ea6 27%, #06131e00 56%),
    linear-gradient(0deg, #06131ed9 0, #06131e00 24%);
}
/* The copy never blocks the map: only its links and controls take the pointer. */
.stage-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 132px 128px;
  pointer-events: none;
}
.stage-inner :is(a, button, select) { pointer-events: auto; }
.stage-copy { max-width: 34rem; }
/* Arrival: heading, its accent word, lead, actions and the bar surface one after another. */
.stage-copy > *, .stage h1 em, .stage-bar { animation: stage-rise 1.1s var(--ease-out) backwards; }
.stage h1 em { display: inline-block; animation-delay: .2s; }
.stage-copy > :nth-child(2) { animation-delay: .34s; }
.stage-copy > :nth-child(n+3) { animation-delay: .48s; }
.stage-bar { animation-delay: .7s; }
@keyframes stage-rise { from { opacity: 0; transform: translateY(22px); filter: blur(8px); } }
.stage h1 { font-size: clamp(3.25rem, 6.6vw, 6rem); line-height: 1.02; letter-spacing: -.03em; }
.stage h1 em { color: #f1cd9b; }
.stage-lead { max-width: 31rem; margin-top: 26px; font-size: clamp(1.05rem, 1.35vw, 1.25rem); line-height: 1.6; color: var(--mist); }
.stage-lead strong { color: #fff; font-weight: 600; }
.stage-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 30px; margin-top: 32px; }
.stage .button { margin: 0; min-height: 50px; gap: 22px; border-radius: 7px; font-size: 14px; }
.stage .button .icon { transition: transform .35s var(--ease-out); }
.stage .button:hover .icon { transform: translateX(5px); }
.stage-link { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; font-size: 14px; font-weight: 500; text-decoration: underline; text-decoration-color: #ffffff59; }
.stage-link:hover { color: var(--sun); text-decoration-color: currentColor; }
.stage a:focus-visible, .stage :is(button, select):focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

.stage-bar {
  position: absolute;
  inset: auto 0 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  color: var(--mist);
  font-size: 13px;
  pointer-events: none;
}
.stage-bar > * { pointer-events: auto; }
.stage-bar :is(select, button) {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #9fc0d066;
  border-radius: 7px;
  background: #0a2233;
  color: #fff;
  font: 500 14px/1.2 inherit;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.stage-bar select { max-width: min(100%, 250px); }
.stage-bar :is(select, button):enabled:hover { background: #17405a; border-color: #cfe0e8; }
.stage-bar :is(select, button):disabled { opacity: .55; cursor: default; }
.stage-bar .button { min-height: 46px; padding: 0 18px; gap: 14px; }
.stage-note { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.stage-note[hidden], .stage-tools[hidden], .atlas-map-tooltip[hidden], .atlas-pin[hidden], .sk-map-fallback[hidden] { display: none; }
.stage-note .icon { width: 15px; height: 15px; color: var(--sun); }
.stage-tools { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.stage-tools a { margin-inline-end: 10px; color: var(--mist); font-size: 12px; }
.stage-tools button { display: grid; place-items: center; width: 46px; padding: 0; }
.stage-tools .icon { width: 18px; height: 18px; }

/* Leaving for a country: the copy clears while the globe dives in. */
.stage :is(.stage-inner, .stage-bar, .stage-shade, .atlas-pin) { transition: opacity .35s; }
.stage.is-leaving :is(.stage-inner, .stage-bar, .stage-shade, .atlas-pin) { opacity: 0; }

/* ---------- Globe ---------- */
canvas.stage-map { cursor: grab; touch-action: pan-y; opacity: 0; transition: opacity 1.4s; }
[data-ready] canvas.stage-map { opacity: 1; }
canvas.stage-map:active { cursor: grabbing; }
canvas.stage-map.over-country:not(:active) { cursor: pointer; }
canvas.stage-map:focus-visible { outline: 2px solid var(--sun); outline-offset: -6px; }
/* Atmosphere: world.js places and scales it, the breathing stays on the compositor. */
.atlas-halo {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: -1;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  box-shadow: 0 0 24px 5px #7fc4e44d;
  pointer-events: none;
  animation: atlas-breathe 6s ease-in-out infinite alternate;
}
@keyframes atlas-breathe { from { opacity: .35; } }
.atlas-map-tooltip {
  position: absolute;
  inset: 0 auto auto 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 5px 10px;
  border: 1px solid var(--night-line);
  border-radius: 6px;
  background: var(--night);
  font-size: 13px;
}
/* Label and ring on the published country; world.js only moves it. */
.atlas-pin {
  position: absolute;
  inset: 0 auto auto 0;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline-start: 26px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.atlas-pin span { padding: 4px 10px; border-radius: 6px; background: #06131ed9; transition: background .2s, color .2s; }
.atlas-pin:hover span { background: var(--sun); color: var(--night); }
.atlas-pin::before, .atlas-pin::after, .sk-map .sk-beacon::before, .sk-map .sk-beacon::after, .sk-map .sk-marker::after {
  content: '';
  position: absolute;
  border: 2px solid var(--sun);
  border-radius: 50%;
  animation: atlas-pulse 2.6s ease-out infinite;
}
.atlas-pin::before, .atlas-pin::after { inset: 50% auto auto 0; width: 18px; height: 18px; margin-top: -9px; }
.atlas-pin::after, .sk-map .sk-beacon::after { animation-delay: 1.3s; }
@keyframes atlas-pulse {
  from { transform: scale(.8); opacity: .9; }
  to { transform: scale(3); opacity: 0; }
}

/* ---------- Country and district maps (Leaflet) ---------- */
.sk-map { isolation: isolate; background: none; color: #fff; font: inherit; }
.sk-map path.leaflet-interactive { transition: fill-opacity .2s, fill .3s; }
.sk-map .sk-district { animation: district-in .8s var(--ease-out) backwards; }
@keyframes district-in { from { fill-opacity: 0; stroke-opacity: 0; } }
.sk-map .sk-detail { animation: stage-fade 1.2s ease-out backwards; }
@keyframes stage-fade { from { opacity: 0; } }
.sk-map .leaflet-bottom { bottom: 22px; }
.sk-map .leaflet-right { right: max(18px, calc((100% - 1160px) / 2 - 10px)); }
.sk-map .leaflet-control-attribution { margin-top: 8px; border-radius: 5px; background: #06131ed9; color: var(--mist); }
.sk-map .leaflet-control-attribution a { color: var(--sun); }
.sk-map .leaflet-control-zoom.leaflet-bar { border: 0; box-shadow: none; }
/* !important only to outrank the shared zoom-control rule in professional.css. */
.sk-map .leaflet-control-zoom.leaflet-bar a { width: 46px !important; height: 46px !important; line-height: 44px !important; border: 1px solid #9fc0d066; background: #0a2233; color: #fff !important; }
.sk-map .leaflet-control-zoom.leaflet-bar a:first-child { border-radius: 7px 7px 0 0; }
.sk-map .leaflet-control-zoom.leaflet-bar a:last-child { border-radius: 0 0 7px 7px; border-top: 0; }
.sk-map .leaflet-control-zoom.leaflet-bar a:hover { background: #17405a; }
.sk-map .leaflet-control-zoom.leaflet-bar a.leaflet-disabled { opacity: .5; }
.sk-map .leaflet-tooltip { border: 1px solid var(--night-line); border-radius: 6px; background: var(--night); color: #fff; font: 500 13px/1.3 'DM Sans', sans-serif; box-shadow: none; }
.sk-map .leaflet-tooltip::before { display: none; }
.sk-map .sk-town-label { border: 0; background: none; color: var(--mist); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; pointer-events: none; }
.sk-map .sk-pin-label { padding: 6px 11px; font-weight: 600; cursor: pointer; transition: background .2s, color .2s; animation: stage-fade .6s ease-out .35s backwards; }
.sk-map .sk-pin-label:hover { background: var(--sun); color: var(--night); }
.sk-map .sk-marker {
  border: 2px solid #fff1cb;
  border-radius: 50%;
  background: #c28741 radial-gradient(circle, #fff1cb 0 2px, transparent 3px);
  box-shadow: 0 2px 8px #03101b;
  animation: atlas-pin-in .6s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
.sk-map .sk-marker::after { inset: -2px; border-color: #fff1cb; }
@keyframes atlas-pin-in { from { opacity: 0; translate: 0 -28px; } }
.sk-map .sk-marker:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.sk-map .sk-beacon { pointer-events: none; }
.sk-map .sk-beacon::before, .sk-map .sk-beacon::after { inset: 0; }
.sk-map .sk-active-district:focus { outline: 2px solid var(--sun); }
.sk-map-fallback { margin: 0; padding: 46svh 24px 24px; color: var(--mist); text-align: center; }
/* On a map stage the copy keeps to the top corner so the map owns the screen. */
.stage-geo .stage-inner { justify-content: flex-start; padding-top: 124px; }
.stage-geo h1 { font-size: clamp(2.5rem, 4.6vw, 4.25rem); }
.stage-geo .stage-lead { max-width: 23rem; margin-top: 16px; font-size: 1rem; }
.stage-geo .stage-shade {
  background:
    radial-gradient(ellipse 56% 62% at 0 0, #06131ef0 0, #06131e99 45%, #06131e00 74%),
    linear-gradient(0deg, #06131ed9 0, #06131e00 22%);
}

/* ---------- Sections under the stage ---------- */
.atlas-about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.atlas-about > p { max-width: 36ch; font-size: clamp(1.15rem, 1.7vw, 1.45rem); line-height: 1.55; }
.atlas-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 40px; margin: 72px 0 0; padding: 0; list-style: none; }
.atlas-steps li { padding-top: 22px; border-top: 1px solid var(--ink); }
.section-night .atlas-steps li { border-color: var(--night-line); }
.atlas-steps h3 { font-size: 20px; }
.atlas-steps p { max-width: 34ch; margin-top: 8px; color: var(--muted); font-size: 15px; }
.section-night .atlas-steps p, .section-night .atlas-about > p { color: var(--mist); }

.section-night { background: var(--night); color: #fff; }
.section-night h2 em { color: #f1cd9b; }
.section-night .section-heading > p { color: var(--mist); }
.atlas-rows { border-top: 1px solid var(--line); }
.atlas-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) auto;
  align-items: center;
  gap: 10px 32px;
  padding-block: 30px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.section-night :is(.atlas-rows, .atlas-row) { border-color: var(--night-line); }
.atlas-row h3 { font: 500 clamp(2rem, 4.2vw, 3.4rem)/1.08 'Playfair Display', Georgia, serif; letter-spacing: -.03em; transition: color .2s; }
.atlas-row p { color: var(--muted); font-size: 15px; }
.section-night .atlas-row p { color: var(--mist); }
.atlas-row-go { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.atlas-row-go .icon { width: 18px; height: 18px; transition: transform .3s var(--ease-out); }
a.atlas-row:hover h3 { color: var(--gold); }
.section-night a.atlas-row:hover h3 { color: var(--sun); }
a.atlas-row:hover .atlas-row-go .icon { transform: translateX(6px); }
.atlas-row-soon h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); color: var(--muted); }
.section-night .atlas-row-soon h3 { color: #9fb6c2; }
.atlas-places { display: flex; flex-wrap: wrap; gap: 4px 30px; margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); list-style: none; font-weight: 500; }
.atlas-places a { display: inline-flex; align-items: center; min-height: 44px; }
.atlas-places a:hover { color: var(--gold); }

@media (max-width: 900px) {
  .stage { min-height: max(720px, 100svh); }
  .stage-inner { justify-content: flex-start; padding-block: 124px 0; }
  .stage-shade, .stage-geo .stage-shade { background: linear-gradient(180deg, #06131ef2 0, #06131ea6 36%, #06131e00 60%), linear-gradient(0deg, #06131ee6 0, #06131e00 22%); }
  .stage-geo .stage-shade { background: linear-gradient(180deg, #06131ef2 0, #06131e00 44%), linear-gradient(0deg, #06131ee6 0, #06131e00 26%); }
  .stage-bar { inset-block-end: 30px; }
  .stage-tools a, .sk-map .leaflet-control-zoom { display: none; }
  .stage-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sk-map .leaflet-bottom { bottom: 0; }
  .atlas-about, .atlas-steps { grid-template-columns: 1fr; }
  .atlas-steps { margin-top: 44px; }
  .atlas-row { grid-template-columns: 1fr; padding-block: 24px; }
}
@media (max-width: 420px) {
  .stage-inner { padding-top: 138px; }
  .stage h1 { font-size: 3rem; }
  .stage-geo h1 { font-size: 2.5rem; }
  .stage-bar select { flex: 1 1 130px; }
  .stage-bar [data-location-label] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .atlas-pin::after, .sk-map .sk-beacon::after, .sk-map .sk-marker::after, .stage-comet { display: none; }
  .atlas-pin::before, .sk-map .sk-beacon::before { opacity: .6; }
}
