/* ==========================================================================
   Quanta Diplomacy · pages.css
   The Atlas (Home + Locations), next-chapter links, page-specific details.
   ========================================================================== */

/* ---------- Section heads ---------- */
.sec-head { row-gap: 28px; margin-bottom: clamp(48px, 6vw, 104px); align-items: end; }
.sec-head__title { grid-column: 1 / span 8; }
.sec-head__text { grid-column: 9 / span 4; color: var(--muted); }
.sec-head__text .arrow-link { margin-top: 22px; color: var(--ink); }
.theme-dark .sec-head__text .arrow-link, .theme-deep .sec-head__text .arrow-link { color: #fff; }
@media (max-width: 900px) { .sec-head__title, .sec-head__text { grid-column: 1 / -1; } }

/* ==========================================================================
   ATLAS
   ========================================================================== */
.atlas { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.atlas__index { grid-column: 1 / span 6; }
.atlas__stage { grid-column: 7 / span 6; position: sticky; top: calc(var(--nav-h) + 20px); align-self: start; }

/* tabs */
.atlas__tabs { display: flex; gap: clamp(18px, 2.4vw, 40px); border-bottom: 1px solid var(--line); }
.atlas__tab {
  position: relative; padding: 0 0 16px; text-align: left;
  font-family: var(--font-head); font-weight: 700; font-size: 14px; letter-spacing: 0.01em; color: var(--muted);
  transition: color var(--dur-1) var(--ease-soft);
}
.atlas__tab sup { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; margin-left: 6px; color: var(--accent); vertical-align: 0.6em; }
.atlas__tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink);
  transform: scaleX(0); transform-origin: right; transition: transform 0.6s var(--ease-precise);
}
.atlas__tab[aria-selected="true"] { color: var(--ink); }
.atlas__tab[aria-selected="true"]::after { transform: scaleX(1); transform-origin: left; }
.atlas__tab:hover { color: var(--ink); }
.atlas__note { margin: 18px 0 8px; color: var(--muted); font-size: 15.5px; }

/* rows */
.atlas__list { counter-reset: none; }
.atlas__list[hidden] { display: none; }
.atlas__row {
  position: relative; display: grid; grid-template-columns: clamp(44px, 4.4vw, 72px) 1fr auto; column-gap: 12px; align-items: baseline;
  padding: clamp(12px, 1.4vw, 20px) 0; border-bottom: 1px solid var(--line);
  color: rgba(10, 22, 48, 0.34);
  transition: color 0.35s var(--ease-soft);
}
.atlas__row::before {
  content: ""; position: absolute; left: -14px; top: 50%; width: 5px; height: 5px; background: var(--gold);
  transform: translateY(-50%) rotate(45deg) scale(0); transition: transform 0.4s var(--ease-out);
}
.atlas__row.is-active { color: var(--ink); }
.atlas__row.is-active::before { transform: translateY(-50%) rotate(45deg) scale(1); }
.atlas__row:hover { color: var(--ink); }
div.atlas__row { cursor: default; outline-offset: 4px; }
.atlas__num { font-family: var(--font-head); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--accent); align-self: center; }
.atlas__name {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 0.9rem + 2.9vw, 4.4rem);
  letter-spacing: -0.045em; line-height: 0.95; transition: transform 0.5s var(--ease-out);
}
.atlas__row:hover .atlas__name, .atlas__row.is-active .atlas__name { transform: translateX(10px); }
.atlas__meta {
  grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px;
  font-family: var(--font-head); font-size: 12.5px; font-weight: 600; letter-spacing: 0.03em; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.atlas__meta span + span::before { content: "·"; margin-right: 18px; color: var(--accent); }
.atlas__time { min-width: 7ch; }

/* stage */
.atlas__frame {
  position: relative; overflow: hidden; background: var(--navy-900);
  height: min(calc(100vh - var(--nav-h) - 60px), 860px); min-height: 460px;
  --px: 0; --py: 0;
}
.atlas__slide { position: absolute; inset: 0; margin: 0; clip-path: inset(0 0 0 100%); z-index: 1; transition: clip-path 0.72s cubic-bezier(0.3, 0.7, 0.15, 1); }
.atlas__slide.is-prev { clip-path: inset(0 0 0 0); z-index: 2; transition: none; }
.atlas__slide.is-active { clip-path: inset(0 0 0 0); z-index: 3; }
.atlas__slide img {
  position: absolute; inset: -4%; width: 108%; height: 108%; max-width: none; object-fit: cover;
  transform: translate3d(calc(var(--px) * -14px), calc(var(--py) * -10px), 0) scale(1.06);
  transition: transform 1.4s var(--ease-out);
}
.atlas__slide.is-active img { animation: atlasZoom 1.6s var(--ease-out) both; }
@keyframes atlasZoom { from { scale: 1.12; } to { scale: 1; } }
.atlas__slide::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 11, 26, 0.32) 0%, rgba(5, 11, 26, 0) 28%, rgba(5, 11, 26, 0) 50%, rgba(5, 11, 26, 0.78) 100%);
}
.atlas__cap { display: block; padding: 0; position: absolute; left: clamp(20px, 2.6vw, 44px); right: clamp(20px, 2.6vw, 44px); bottom: clamp(22px, 2.6vw, 44px); z-index: 2; color: #fff; }
.atlas__cap-line { display: block; overflow: hidden; }
.atlas__cap-line > span { display: block; transform: translateY(105%); transition: transform 0.9s var(--ease-out); }
.atlas__slide.is-active .atlas__cap-line > span { transform: none; transition-delay: 0.14s; }
.atlas__slide.is-active .atlas__cap-line:nth-child(2) > span { transition-delay: 0.22s; }
.atlas__slide.is-active .atlas__cap-line:nth-child(3) > span { transition-delay: 0.3s; }
.atlas__cap-kicker { font-family: var(--font-head); font-weight: 700; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-300); }
.atlas__cap-name { font-family: var(--font-display); font-weight: 900; font-size: clamp(2.8rem, 1rem + 4.6vw, 7.6rem); letter-spacing: -0.05em; line-height: 0.9; margin: 10px 0 14px; }
.atlas__cap-meta { font-family: var(--font-head); font-weight: 600; font-size: 13px; letter-spacing: 0.03em; color: #d9e0ea; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.atlas__cap-meta span + span::before { content: "·"; margin-right: 16px; color: var(--gold-300); }

.atlas__hud { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.atlas__hud-top { position: absolute; top: clamp(18px, 2vw, 32px); left: clamp(20px, 2.6vw, 44px); right: clamp(20px, 2.6vw, 44px); display: flex; justify-content: space-between; color: #e8ecf2; }
.atlas__count { font-variant-numeric: tabular-nums; }
.atlas__cross {
  position: absolute; left: 62%; top: 40%; display: flex; align-items: center; gap: 10px; color: var(--gold-300);
  transform: translate3d(calc(var(--px) * 16px), calc(var(--py) * 12px), 0);
  transition: transform 1.2s var(--ease-out), left 1s var(--ease-precise), top 1s var(--ease-precise);
}
.atlas__cross svg { width: 34px; height: 34px; overflow: visible; }
.atlas__cross svg circle.pulse { transform-origin: 17px 17px; animation: crossPulse 2.6s var(--ease-out) infinite; }
@keyframes crossPulse { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(2.2); opacity: 0; } }
.atlas__cross span { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 1px 8px rgba(5, 11, 26, 0.6); }
.atlas__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, 0.14); z-index: 6; }
.atlas__progress i { position: absolute; inset: 0; background: var(--gold); transform: scaleX(0); transform-origin: left; }
.atlas__foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 14px; color: var(--muted); }

/* mobile carousel */
.atlas__mobile { display: none; }
@media (max-width: 860px) {
  .atlas__index, .atlas__stage { display: none; }
  .atlas__mobile { display: block; grid-column: 1 / -1; }
  .atlas__chips {
    display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
    margin-inline: calc(-1 * var(--margin)); padding: 2px max(var(--margin), 28px) 14px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
    overscroll-behavior-x: contain;
  }
  .atlas__chips::-webkit-scrollbar { display: none; }
  .atlas__chip {
    flex: none; min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; border: 1px solid var(--line);
    font-family: var(--font-head); font-weight: 700; font-size: 13.5px; letter-spacing: 0.01em; color: var(--ink-soft); white-space: nowrap;
    background: transparent;
    transition: background-color 0.35s var(--ease-soft), color 0.35s var(--ease-soft), border-color 0.35s var(--ease-soft);
  }
  .atlas__chip.is-active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
  .atlas__chip-sep { flex: none; align-self: center; width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
  .atlas__mbar { display: flex; align-items: center; gap: 16px; margin-top: 16px; color: var(--muted); }
  .atlas__mcount { font-variant-numeric: tabular-nums; min-width: 7ch; }
  .atlas__mprog { position: relative; flex: 1; height: 1px; background: var(--line); overflow: hidden; }
  .atlas__mprog i { position: absolute; inset: 0; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease-precise); }
  .atlas__carousel {
    display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: calc(-1 * var(--margin)); padding-inline: var(--margin); scroll-padding-inline: var(--margin);
    overscroll-behavior-x: contain;
  }
  .atlas__carousel::-webkit-scrollbar { display: none; }
  .atlas__card { position: relative; flex: 0 0 86vw; aspect-ratio: 4 / 5; overflow: hidden; scroll-snap-align: start; background: var(--navy-900); color: #fff; }
  .atlas__card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .atlas__card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,11,26,0) 40%, rgba(5,11,26,0.82) 100%); }
  .atlas__card .atlas__cap { z-index: 2; }
  .atlas__card .atlas__cap-line > span { transform: none; }
  .atlas__card .atlas__cap-name { font-size: clamp(2.4rem, 1rem + 7vw, 4rem); }
}

/* ---------- Locations: dossiers use the horizontal scroller from components.css ---------- */
.city__name { font-weight: 900; }
.city__coords { font-variant-numeric: tabular-nums; }

/* ---------- Next chapter ---------- */
.next-chapter { padding-block: clamp(32px, 4vw, 64px) clamp(72px, 9vw, 160px); }
.next {
  display: grid; grid-template-columns: 1fr auto; align-items: end; row-gap: 14px;
  padding-top: clamp(28px, 3vw, 44px); border-top: 1px solid var(--line);
}
.next__label { grid-column: 1 / -1; color: var(--accent); }
.next__title {
  font-family: var(--font-display); font-weight: 900; font-size: var(--fs-h1); letter-spacing: -0.05em; line-height: 0.88;
  transition: transform 0.9s var(--ease-out), color var(--dur-1);
}
.next__arrow { display: grid; place-items: center; width: clamp(56px, 6vw, 96px); aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; transition: background-color 0.5s var(--ease-precise), color 0.5s var(--ease-precise), transform 0.7s var(--ease-out); }
.next__arrow svg { width: 40%; height: 40%; }
.next:hover .next__title { transform: translateX(clamp(8px, 1.4vw, 24px)); color: var(--royal); }
.next:hover .next__arrow { background: var(--navy-900); color: #fff; transform: rotate(-45deg); }

/* ---------- Home specifics ---------- */
.home-figure-cap { display: flex; justify-content: space-between; gap: 16px; padding-top: 14px; }

/* ---------- Statement band (dark feature) ---------- */
.statement { row-gap: 36px; }
.statement__title { grid-column: 1 / span 7; }
.statement__body { grid-column: 9 / span 4; align-self: end; color: #d9e0ea; }
@media (max-width: 900px) { .statement__title, .statement__body { grid-column: 1 / -1; } }

/* ---------- Podcast band ---------- */
.listen { row-gap: 32px; align-items: center; }
.listen__plate { grid-column: 1 / span 4; }
.listen__body { grid-column: 6 / span 7; }
@media (max-width: 900px) { .listen__plate { grid-column: 1 / span 8; } .listen__body { grid-column: 1 / -1; } }

/* display-type emphasis is colour, never italic */
em { font-style: normal; }
.cta-band .t-h1 em, .cta-band .t-h2 em { color: var(--gold-300); }
