/* Source style section 3 */

/* ============ responsive hardening (shared across all pages) ============ */

/* never allow sideways scroll caused by a single wide child */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}
img {
  display: block;
}

/* long strings (emails, URLs, EPSG codes) must not push the layout */
p,
li,
dd,
td,
th,
a,
h1,
h2,
h3,
h4 {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* ---- container padding scales down on small screens ---- */
@media (max-width: 1020px) {
  .wrap {
    padding-inline: 32px;
  }
}
@media (max-width: 760px) {
  .wrap {
    padding-inline: 26px;
  }
}
@media (max-width: 420px) {
  .wrap {
    padding-inline: 22px;
  }
}

/* full-bleed panels must never eat into the gutter on small screens */
@media (max-width: 900px) {
  .ct {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .lk a {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* slim, unobtrusive scrollbars for the horizontal strips */
.ds-list::-webkit-scrollbar,
.mv-side::-webkit-scrollbar,
.dx-strip::-webkit-scrollbar,
.tbl-scroll::-webkit-scrollbar {
  height: 6px;
}
.ds-list::-webkit-scrollbar-track,
.mv-side::-webkit-scrollbar-track,
.dx-strip::-webkit-scrollbar-track,
.tbl-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.ds-list::-webkit-scrollbar-thumb,
.mv-side::-webkit-scrollbar-thumb,
.dx-strip::-webkit-scrollbar-thumb,
.tbl-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 99px;
}

/* ---- Navigation below ~900px (six links don't fit) ---- */
@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 12px;
    right: 12px;
    background: rgba(22, 12, 13, 0.96);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    border-radius: 11px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    z-index: 60;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 12px 14px;
  }
  .burger {
    display: block;
  }
  nav .nav-in {
    position: relative;
  }
}

/* ---- comfortable touch targets on finger-driven devices ---- */
@media (pointer: coarse) {
  .car-btn {
    width: 34px;
    height: 34px;
  }
  .chip,
  .pl-tab,
  .seg button,
  .mini-seg button {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .ds-item {
    padding: 14px;
  }
  .lk a {
    padding-top: 18px;
    padding-bottom: 18px;
  }
}

/* ---- tables scroll horizontally instead of breaking the page ---- */
.tbl-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 720px) {
  table.tbl {
    min-width: 560px;
  }
}

/* ---- hero / headline scaling ---- */
@media (max-width: 640px) {
  .hero {
    padding-block: 38px 26px;
  }
  .hero h1 {
    font-size: clamp(28px, 8vw, 36px);
  }
  .hero p,
  .ah p,
  .sec p {
    font-size: 15px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}
@media (max-width: 380px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

/* ---- footer ---- */
@media (max-width: 760px) {
  .f-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .f-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: left;
  }
  .f-logos {
    flex-wrap: wrap;
  }
}

/* Source style section 4 */

/* ============ page-specific responsive rules ============ */

/* ---------- maps.html : layer viewer ---------- */
@media (max-width: 900px) {
  .mv {
    grid-template-columns: 1fr;
  }
  .mv-side {
    border-right: none;
    border-bottom: 0.5px solid var(--line);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
  }
  .mv-side h4 {
    display: none;
  }
  #lyList {
    display: flex;
    gap: 8px;
  }
  .ly {
    white-space: nowrap;
    flex: none;
    width: auto;
    margin-bottom: 0;
  }
}
@media (max-width: 640px) {
  .mv-canvas {
    padding: 14px 10px 4px;
    min-height: 240px;
  }
  .tl {
    padding: 12px 16px 16px;
  }
  .tl-top {
    gap: 10px;
  }
  .tl-date {
    font-size: 13.5px;
  }
  .badge {
    top: 12px;
    right: 14px;
    font-size: 10px;
    padding: 5px 10px;
  }
  .lgd {
    gap: 1px;
  }
  .lgd i {
    width: auto;
    flex: 1;
    min-width: 0;
  }
  .lgd b {
    width: 100%;
    margin-bottom: 6px;
  }
  .lgd em {
    width: 100%;
    margin: 6px 0 0;
  }
  .p-head,
  .p-foot {
    padding: 12px 16px;
  }
  .p-body {
    padding: 18px 16px;
  }
  .dx-strip {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .dx-tab {
    white-space: nowrap;
  }
}

/* ---------- archive.html : request form ---------- */
@media (max-width: 860px) {
  .grid2,
  .grid3 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .row {
    gap: 8px;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
  #fmt {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  #fmt .chip {
    text-align: center;
  }
}

/* ---------- impacts.html : country rows ---------- */
@media (max-width: 760px) {
  .ic-row {
    grid-template-columns: 26px 1fr 56px;
    gap: 10px;
    padding: 12px 10px;
  }
  .ic-bar,
  .ic-cat {
    display: none;
  }
  .ic-name {
    font-size: 13.5px;
  }
  .cat-bar {
    height: 30px;
  }
}
@media (max-width: 520px) {
  .cat-bar span {
    min-width: 4px;
  }
}

/* ---------- globe.html ---------- */
@media (max-width: 900px) {
  #globe {
    height: min(58vh, 520px);
  }
}
@media (max-width: 640px) {
  #globe {
    height: min(52vh, 420px);
    margin-top: 0;
  }
  .globe-head {
    padding-block: 40px 4px;
  }
  .lb-x {
    top: 14px;
    right: 16px;
    width: 38px;
    height: 38px;
  }
  #lbsvg {
    width: 86vw;
    height: 46vh;
  }
  .lb-name {
    font-size: 21px;
  }
}

/* ---------- about.html ---------- */
@media (max-width: 900px) {
  .ds {
    grid-template-columns: 1fr;
  }
  .ds-list {
    border-right: none;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.07);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ds-item {
    white-space: nowrap;
    flex: none;
    width: auto;
  }
  .ds-item + .ds-item {
    margin-top: 0;
  }
  .ds-meta {
    grid-template-columns: 1fr;
  }
  .ds-meta > div:nth-child(even) {
    padding-left: 0;
    border-left: none;
  }
  .ds-meta > div:nth-child(odd) {
    padding-right: 0;
  }
  .pt-card {
    grid-template-columns: 1fr;
  }
  .pt-logo {
    border-right: none;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.07);
    padding: 22px;
  }
  .pt-logo img {
    max-width: 130px;
  }
}
@media (max-width: 640px) {
  .ah {
    padding-block: 52px 30px;
  }
  .ds-body {
    padding: 22px 18px 24px;
  }
  .ds-body h3 {
    font-size: 18px;
  }
  .kv > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
  .kv dd {
    text-align: left;
    white-space: normal;
  }
  .sec {
    padding-block: 0 48px;
  }
  .steps li {
    padding: 16px 0 4px;
  }
  .ct {
    padding: 26px 22px 28px;
  }
  .ct-head {
    gap: 10px;
  }
  .ct h2 {
    font-size: 20px;
  }
  .ct-ico {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 14px;
  }
  .ct-head h2 {
    height: 36px;
  }
  .acc summary {
    padding: 14px 16px;
    font-size: 13.5px;
  }
  .acc-in {
    padding: 14px 16px 18px;
  }
  .lk a {
    padding: 14px 4px;
    font-size: 13.5px;
    gap: 10px;
  }
  .lk a span {
    font-size: 11.5px;
  }
}
@media (max-width: 420px) {
  .lk a {
    flex-wrap: wrap;
  }
  .lk a span {
    margin-left: 0;
    width: 100%;
    padding-left: 23px;
  }
}

/* ---------- index.html : dashboard ---------- */
@media (max-width: 640px) {
  .dash-strip {
    grid-template-columns: 1fr;
  }
  .rep-cell {
    border-left: none;
  }
  .strip-head,
  .dash-head,
  .dash-foot {
    padding-left: 18px;
    padding-right: 18px;
  }
  .dash-cell {
    padding: 22px 18px 26px;
  }
  .ibar {
    height: 30px;
  }
  /* Title on its own row, window note below it. */
  .strip-head {
    flex-wrap: wrap;
    row-gap: 5px;
  }
  .strip-head .hint {
    flex-basis: 100%;
    padding-left: 27px;
    line-height: 1.4;
  }
  /* the continent name gets the room, the bar gives it up */
  .crow {
    grid-template-columns: 14px minmax(0, 1fr) minmax(44px, 26%) 40px;
    gap: 9px;
  }
  .cont-head {
    display: none;
  }
  .dash-head {
    row-gap: 8px;
  }
  .dash-head .t {
    font-size: 10.5px;
  }
  .dash-head .t.upd .ud::after {
    inset: -3px;
  }
}
@media (max-width: 360px) {
  .crow .cname {
    font-size: 12.5px;
  }
  .crow {
    gap: 7px;
  }
}

/* Source style section 5 */

/* ================= reveal on load / scroll ================= */
/* Reveals: longer, softer curve with a shorter stagger. will-change only
   while pending. */
.rv {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition:
    opacity 0.85s cubic-bezier(0.22, 0.61, 0.28, 1),
    transform 0.85s cubic-bezier(0.22, 0.61, 0.28, 1);
  transition-delay: calc(var(--i, 0) * 52ms);
}
.rv.arm {
  will-change: opacity, transform;
}
.rv-l {
  transform: translate3d(-24px, 0, 0);
}
.rv-r {
  transform: translate3d(24px, 0, 0);
}
.rv-s {
  transform: scale(0.965);
}
/* Offset instead of animated blur (blur is rendered on the CPU). */
.rv-b {
  transform: translate3d(0, 26px, 0) scale(0.985);
}
.rv-d {
  transform: translate3d(0, -16px, 0);
}
.rv.in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* headline rises word by word */
.wsplit {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
}
.wsplit > i {
  display: inline-block;
  font-style: inherit;
  transform: translateY(110%);
  opacity: 0;
  transition:
    transform 0.8s cubic-bezier(0.2, 0.85, 0.2, 1),
    opacity 0.55s ease;
  transition-delay: calc(var(--w, 0) * 55ms);
}
h1.in .wsplit > i {
  transform: none;
  opacity: 1;
}

/* section rules draw out from the label */
.sec-head h2 {
  position: relative;
}
.sec-head.in h2::after {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .rv,
  .wsplit > i {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

/* ---- brand mark, footer and link colour ------------------------------ */
/* Nav logo is offset left so the T aligns with the page gutter; the footer
   logo does the same and is larger. */
.brand-logo {
  width: auto;
  height: 60px;
  max-width: none;
  display: block;
  margin-left: -5px;
}
footer .brand {
  margin-bottom: 14px;
}
footer .brand-logo {
  height: 62px;
  margin-left: -6px;
}

/* Links use the site accent instead of default blue. */
footer a.fl:hover {
  color: var(--orange);
}
.f-bottom a {
  color: inherit;
  transition: color 0.2s;
}
.f-bottom a:hover,
.f-bottom span a:hover {
  color: var(--orange);
}

/* Tablet footer: three columns don't fit, so the layout changes here. */
@media (max-width: 1020px) {
  .f-top {
    grid-template-columns: 1fr 1fr;
    gap: 34px;
  }
  .f-top > div:first-child {
    grid-column: 1 / -1;
  }
  footer p {
    max-width: 52ch;
  }
  .f-logos {
    flex-wrap: wrap;
    gap: 16px 22px;
  }
}
@media (max-width: 1000px) {
  .brand-logo {
    height: 52px;
  }
  footer .brand-logo {
    height: 54px;
  }
}
@media (max-width: 760px) {
  .f-top {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .f-top > div:first-child {
    grid-column: auto;
  }
  .f-bottom {
    flex-direction: column;
    gap: 10px;
  }
}
@media (max-width: 700px) {
  .brand-logo {
    height: 44px;
  }
  footer .brand-logo {
    height: 46px;
  }
}
@media (max-width: 430px) {
  .brand-logo {
    height: 36px;
  }
  footer .brand-logo {
    height: 40px;
  }
  .f-logos img {
    height: 24px;
  }
}

/* ---- Footer: shared responsive rules for all pages ----
   Fluid sizing, no breakpoint jumps. */
footer .brand {
  margin-bottom: 16px;
}
.f-top {
  padding-top: clamp(40px, 6vw, 64px);
  padding-bottom: clamp(28px, 4vw, 44px);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}
.f-top > div {
  min-width: 0;
}
footer p {
  max-width: 38ch;
}
.f-logos {
  gap: clamp(14px, 2vw, 24px);
  margin-top: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.f-logos img {
  height: clamp(30px, 3.4vw, 42px);
  width: auto;
  filter: none;
}
.f-logos span,
.f-logos a {
  display: flex;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.f-logos a:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}
.f-bottom {
  margin-top: 8px;
  padding-top: 22px;
  padding-bottom: clamp(26px, 3vw, 34px);
  align-items: center;
  row-gap: 10px;
}
@media (max-width: 1020px) {
  .f-top {
    grid-template-columns: 1fr 1fr;
  }
  .f-top > div:first-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .f-top {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  footer .brand {
    margin-bottom: 14px;
  }
  footer p {
    max-width: 46ch;
  }
  .f-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
  }
}

/* ---- Intro ----
   Mark assembles, moves aside for the wordmark, then breaks along its fracture
   lines. Once per session, skippable, ~2.3 s. */
#intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg);
  overflow: hidden;
  transition:
    opacity 0.34s ease,
    visibility 0.34s;
}
#intro.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#intro::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    60% 50% at 50% 50%,
    rgba(226, 59, 46, 0.13) 0%,
    rgba(226, 59, 46, 0.1248) 8.4%,
    rgba(226, 59, 46, 0.1097) 17.5%,
    rgba(226, 59, 46, 0.088) 26.6%,
    rgba(226, 59, 46, 0.065) 35%,
    rgba(226, 59, 46, 0.042) 43.4%,
    rgba(226, 59, 46, 0.0203) 52.5%,
    rgba(226, 59, 46, 0.0052) 61.6%,
    rgba(226, 59, 46, 0) 70%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
}
#intro.burst::after {
  opacity: 1;
}
#introFx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.intro-wm {
  contain: paint;
}
.intro-lock {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(12px, 3.2vw, 26px);
  will-change: transform, opacity;
  perspective: 520px;
  perspective-origin: 50% 50%;
  transform: translateX(calc(var(--shift) / 2)) scale(0.86);
  opacity: 0;
  transition:
    transform 1.05s cubic-bezier(0.22, 0.9, 0.26, 1),
    opacity 0.85s ease;
}
#intro.lit .intro-lock {
  opacity: 1;
  transform: translateX(calc(var(--shift) / 2)) scale(1);
}
#intro.slid .intro-lock {
  transform: translateX(0) scale(1);
}
/* Box uses the glyph's aspect ratio (children are absolutely
   positioned). */
.intro-t {
  position: relative;
  height: clamp(62px, 17vw, 146px);
  aspect-ratio: 2165/2395;
  flex: none;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
  animation: tIn 1.2s cubic-bezier(0.16, 0.9, 0.24, 1.04) both;
}
/* Mark flies in from behind the camera, overshoots, settles, then tilts
   into its final pose. */
/* No blur on the 3D stack; transform and opacity only. */
@keyframes tIn {
  from {
    transform: translateZ(-440px) rotateY(-88deg) rotateX(18deg);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
/* a hard punch on the letter itself the instant the first crack runs */
#intro.burst .intro-t {
  animation: tHit 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes tHit {
  0% {
    transform: scale(1.045) rotate(-0.6deg);
  }
  40% {
    transform: scale(0.992) rotate(0.25deg);
  }
  100% {
    transform: none;
  }
}
/* stacked copies behind the face give the letter real thickness while it turns */
.intro-t .ext {
  opacity: 1;
  pointer-events: none;
  backface-visibility: hidden;
  transition: opacity 0.25s ease;
}
.intro-t .ext svg path {
  fill: #7c2418;
}

.intro-t svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  will-change: opacity;
}
.intro-t .cracked {
  opacity: 0;
}
#intro.burst .intro-t .whole {
  opacity: 0;
}
#intro.burst .intro-t .cracked {
  opacity: 1;
}
.ish {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
  transition: transform 0.16s cubic-bezier(0.15, 1.05, 0.3, 1);
}
/* Wordmark: fixed-size window, only the contents translate. */
/* the window carries a little extra width so the light edge can ride ahead
   of the letters instead of touching them */
.intro-wm {
  position: relative;
  height: clamp(22px, 6.1vw, 51px);
  width: calc(var(--wm) + clamp(9px, 2.2vw, 18px));
  overflow: hidden;
}
/* Letters are revealed by a clip whose edge follows the same curve as the
   light edge. */
.intro-wmi {
  position: relative;
  height: 100%;
  width: 100%;
  clip-path: inset(0 100% 0 0);
  will-change: clip-path;
  transition: clip-path 1.05s cubic-bezier(0.22, 0.9, 0.26, 1);
}
#intro.slid .intro-wmi {
  clip-path: inset(0 0 0 0);
}
/* TERRA and DROUGHT are one artwork, split with a clip at the D; only the
   right half flickers. */
.intro-wm svg {
  position: absolute;
  inset: 0;
  height: 100%;
  width: var(--wm);
  display: block;
}
.intro-wm .wm-a {
  clip-path: inset(0 58.7% 0 0);
}
.intro-wm .wm-b {
  clip-path: inset(0 0 0 41.3%);
}
/* the word guts out at the exact moment the letter lets go */
#intro.burst .wm-b {
  animation: wmFlick 1.5s steps(1, end) both;
}
@keyframes wmFlick {
  0%,
  7% {
    opacity: 1;
  }
  9% {
    opacity: 0.28;
  }
  11% {
    opacity: 1;
  }
  13% {
    opacity: 0.42;
  }
  15%,
  26% {
    opacity: 1;
  }
  28% {
    opacity: 0.18;
  }
  30% {
    opacity: 1;
  }
  31% {
    opacity: 0.5;
  }
  33%,
  52% {
    opacity: 1;
  }
  54% {
    opacity: 0.34;
  }
  55.5% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
/* Light edge is a sibling of the clipped window so its falloff isn't cut.
   Two soft gradients: thin core + wide bloom. */
.intro-edge {
  position: absolute;
  right: 0;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  will-change: transform, opacity;
  opacity: 0;
  transform: translate3d(calc(-1 * (var(--wm) + clamp(9px, 2.2vw, 18px))), 0, 0);
  transition: transform 1.05s cubic-bezier(0.22, 0.9, 0.26, 1);
}
#intro.slid .intro-edge {
  transform: translate3d(0, 0, 0);
  animation: wmEdge 1.05s cubic-bezier(0.22, 0.9, 0.26, 1) both;
}
.intro-edge i {
  position: absolute;
  top: 50%;
  display: block;
}
.intro-edge .e-core {
  left: -1.5px;
  width: 3px;
  height: clamp(38px, 9.5vw, 80px);
  transform: translateY(-50%);
  border-radius: 99px;
  filter: blur(0.6px);
  background: linear-gradient(
    180deg,
    rgba(255, 246, 238, 0) 0%,
    rgba(255, 246, 238, 0.55) 26%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 246, 238, 0.55) 74%,
    rgba(255, 246, 238, 0) 100%
  );
}
.intro-edge .e-bloom {
  left: -46px;
  width: 92px;
  height: clamp(74px, 18vw, 148px);
  transform: translateY(-50%);
  filter: blur(7px);
  background: radial-gradient(
    closest-side,
    rgba(255, 196, 152, 0.55),
    rgba(245, 114, 46, 0.2) 46%,
    rgba(226, 59, 46, 0) 74%
  );
}
@keyframes wmEdge {
  0% {
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  72% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
  }
}
/* ---- Wordmark exit ----
   DROUGHT flickers out first, then TERRA is removed by the clip edge. The letter
   mark stays last. */
#intro.collapse .wm-b {
  animation: wmGutOut 0.72s steps(1, end) 0.16s forwards;
}
@keyframes wmGutOut {
  0% {
    opacity: 1;
  }
  9% {
    opacity: 0.16;
  }
  14% {
    opacity: 0.92;
  }
  23% {
    opacity: 0.08;
  }
  30% {
    opacity: 0.66;
  }
  42% {
    opacity: 0.04;
  }
  49% {
    opacity: 0.4;
  }
  62% {
    opacity: 0.02;
  }
  70% {
    opacity: 0.2;
  }
  82%,
  100% {
    opacity: 0;
  }
}
/* TERRA spans the first 41.3% of the artwork, so the clip stops there.
   No opacity fade; the clip edge does the removal. */
#intro.collapse .wm-a {
  animation: wmErode 0.5s cubic-bezier(0.42, 0, 0.72, 1) 0.62s forwards;
}
@keyframes wmErode {
  from {
    clip-path: inset(0 58.7% 0 0);
  }
  to {
    clip-path: inset(0 58.7% 0 41.3%);
  }
}
/* The light edge runs back along the same path to remove the letters. */
#intro.collapse .intro-edge {
  animation: wmEdgeBack 0.5s cubic-bezier(0.42, 0, 0.72, 1) 0.62s both;
}
@keyframes wmEdgeBack {
  0% {
    opacity: 0;
    transform: translate3d(calc(-1 * (var(--wm) + clamp(9px, 2.2vw, 18px))), 0, 0);
  }
  14% {
    opacity: 1;
  }
  86% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(-1 * (0.587 * var(--wm) + clamp(9px, 2.2vw, 18px))), 0, 0);
  }
}
#intro.collapse #introSkip {
  opacity: 0;
  transition: opacity 0.3s 0.3s;
}
#introSkip {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s 0.8s;
}
#intro.lit #introSkip {
  opacity: 0.7;
}
/* Subtitle positioned under the lockup outside its flow. Appears after the word,
   leaves at the start of the collapse. */
.intro-sub {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
  pointer-events: none;
  top: calc(50% + clamp(62px, 17vw, 146px) / 2 + clamp(18px, 3.6vw, 34px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(9px, 1.6vw, 13px);
  padding: 0 16px;
  text-align: center;
}
.intro-sub i {
  display: block;
  width: clamp(30px, 6vw, 52px);
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(226, 59, 46, 0),
    rgba(245, 114, 46, 0.9),
    rgba(226, 59, 46, 0)
  );
  transform: scaleX(0);
  opacity: 0;
  will-change: transform, opacity;
  transition:
    transform 0.9s cubic-bezier(0.22, 0.9, 0.26, 1),
    opacity 0.5s ease;
}
.intro-sub span {
  font-size: clamp(9.5px, 2.3vw, 12.5px);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: -0.34em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  will-change: transform, opacity;
  transition:
    opacity 0.8s ease,
    transform 0.9s cubic-bezier(0.22, 0.9, 0.26, 1);
}
#intro.slid .intro-sub i {
  transform: scaleX(1);
  opacity: 1;
  transition-delay: 1.05s;
}
#intro.slid .intro-sub span {
  opacity: 1;
  transform: none;
  transition-delay: 1.15s;
}
#intro.collapse .intro-sub i,
#intro.collapse .intro-sub span {
  opacity: 0;
  transition: opacity 0.4s ease 0.6s;
  transform: none;
}
#intro.collapse .intro-sub i {
  transform: scaleX(1);
}
@media (max-width: 640px) {
  .intro-sub span {
    letter-spacing: 0.2em;
    margin-right: -0.2em;
  }
}
body.intro-on {
  overflow: hidden;
}
@media (max-width: 640px) {
  .intro-lock {
    perspective: 340px;
  }
  #introSkip {
    bottom: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #intro {
    display: none;
  }
}
/* light version: a flat letter that scales in instead of tumbling through 3D,
   and no particle layer */
#intro.lite #introFx {
  display: none;
}
#intro.lite .intro-lock {
  perspective: none;
}
#intro.lite .intro-t {
  transform-style: flat;
  animation: tInLite 0.75s cubic-bezier(0.2, 0.9, 0.3, 1.06) both;
}
#intro.lite.burst .intro-t {
  animation: tHit 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes tInLite {
  from {
    transform: scale(0.78);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
#intro.lite .intro-edge .e-bloom,
#intro.lite .intro-edge .e-core {
  filter: none;
}

/* ---- Phones ----
   - mask-composite isn't supported on several mobile browsers, so the globe mask
   is simplified; - no forced square globe in fullscreen; - lighter reveal
   animations. */
@media (max-width: 760px) {
  .dash.expanded .globe-stage {
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  /* Explicit square size for the globe. */
  .globe-wrap {
    position: relative;
    display: block;
    width: 100%;
    height: min(62vw, 320px);
    max-width: none;
    min-height: 0;
    aspect-ratio: auto;
    margin: 14px 0 6px;
    overflow: visible;
    border-radius: 0;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  /* Soft edge via a mask on the stage's own layer, so the globe keeps full
     brightness up to the fade. */
  /* the hint fits a much narrower box here */
  .globe-hint {
    font-size: 9.5px;
    letter-spacing: 0.02em;
    padding: 0;
    bottom: 2px;
    max-width: calc(100% - 34px);
    text-align: center;
    line-height: 1.35;
    white-space: normal;
  }

  .globe-stage {
    -webkit-mask-image:
      linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%),
      linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%) !important;
    mask-image:
      linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%),
      linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%) !important;
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
  }

  .dash.in .globe-wrap {
    animation: none;
  }
  .globe-stage {
    position: absolute;
    inset: 0;
  }

  /* Fullscreen is desktop only; on phones the control is hidden. */
  .dash-full {
    display: none !important;
  }
  .dash.expanded {
    position: static;
    inset: auto;
    padding-right: 0;
    --gw: 0px;
  }
  .dash.expanded .dash-split {
    display: none;
  }

  /* reveals: opacity only, no stagger, short enough not to feel like lag */
  .rv {
    transform: none !important;
    transition: opacity 0.45s ease !important;
    transition-delay: 0ms !important;
  }
  .rv.in {
    opacity: 1;
  }
  .rv.arm {
    will-change: auto;
  }
}

/* ---- Back to top ----
   Shown only after scrolling past the first screen; doesn't overlap the map controls on phones. */
#toTop {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(26, 13, 13, 0.72);
  color: var(--muted);
  font-size: 14px;
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.94);
  transition:
    opacity 0.35s ease,
    transform 0.35s cubic-bezier(0.3, 0.9, 0.35, 1),
    visibility 0.35s,
    background 0.25s,
    color 0.25s,
    border-color 0.25s;
}
#toTop.on {
  opacity: 1;
  visibility: visible;
  transform: none;
}
#toTop:hover {
  color: var(--ink);
  background: rgba(226, 59, 46, 0.26);
  border-color: rgba(255, 255, 255, 0.2);
}
#toTop:active {
  transform: scale(0.94);
}
@media (max-width: 760px) {
  #toTop {
    right: 14px;
    bottom: 14px;
    width: 40px;
    height: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #toTop {
    transition: opacity 0.2s;
  }
}

/* ---- phones: cut what the GPU cannot afford --------------------------- */
@media (max-width: 760px) {
  nav,
  .dash,
  .dash-cell,
  .glass,
  .acc,
  #toTop,
  .clb,
  .dx,
  .exp {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .rv,
  .dash-cell,
  .rep-cell {
    box-shadow: none;
  }
}

/* ---- Sticky nav ----
   Own compositing layer so the backdrop blur doesn't flash while scrolling.
   Phones get a flat background instead of backdrop-filter. */
/* No contain:paint here: it clipped the mobile dropdown to the 64px nav
   box. The layer promotion stays. */
nav {
  transform: translateZ(0);
  will-change: transform;
}
.nav-links {
  z-index: 60;
}
footer {
  contain: layout paint;
}
@media (max-width: 760px) {
  nav {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: rgba(20, 11, 12, 0.96);
  }
}

/* ---- Browse all data layers: phones ----
   Single column, no preview, tabs as wrapping chips. */
@media (max-width: 760px) {
  .dx-thumb {
    display: none !important;
  }
  .dx-grid,
  .dx-body {
    grid-template-columns: 1fr !important;
  }
  .dx-side {
    border-left: none;
    border-top: 0.5px solid var(--line);
    padding-top: 18px;
  }
  .dx-tab {
    min-width: 0;
  }
  .dx-tab small {
    display: none;
  }
  .dx-tabs {
    scroll-snap-type: x mandatory;
  }
  .dx-tab {
    scroll-snap-align: center;
  }
  .dx-detail {
    padding: 22px 20px;
  }
  .dx-btn {
    padding-top: 26px;
    padding-bottom: 10px;
  }
}

/* ---- Phones: spacing above these two headings ----
   Smaller than the desktop 88px section padding. */
@media (max-width: 760px) {
  #highlights,
  #layers {
    padding-top: 38px;
  }
  #highlights .sec-head,
  #layers .sec-head {
    margin-bottom: 18px;
  }
}

/* ---- Phones: nav and page heading ----
   44px burger target and spacing below the bar. */
@media (max-width: 760px) {
  .burger {
    width: 44px;
    height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }
  .burger:active {
    background: var(--fill2);
  }
  .vw-head {
    padding-block: 34px 20px;
  }
}

/* ---- Phones: open menu ----
   Larger tap targets for the menu links. */
@media (max-width: 760px) {
  .nav-links.open {
    gap: 2px;
    padding: 8px;
  }
  .nav-links a {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 15px;
    text-align: left;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-links a::before {
    border-radius: 12px;
  }
  .nav-links a:active {
    background: rgba(255, 255, 255, 0.08);
  }
}
