:root {
  --bg: #04060c;
  --ink: #eef2f8;
  --muted: #9aa8bd;
  --warm: #ffb454;
  --cool: #6fd3ff;
  --line: rgba(255, 255, 255, .1);
  --panel: rgba(6, 10, 20, .72);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- fixed layers ---------- */
#globe {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; z-index: 0;
  opacity: 0; transition: opacity 1.4s ease;
}
.ready #globe { opacity: 1; }

.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4, 6, 12, .78) 0%, rgba(4, 6, 12, .35) 38%, transparent 62%),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(4, 6, 12, .85) 100%);
}

#labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.label {
  position: absolute; left: 0; top: 0;
  font: 600 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); white-space: nowrap;
  opacity: 0; transition: opacity .5s ease;
  will-change: transform;
}
.label.on { opacity: 1; }
.label span {
  display: block; padding: 6px 9px; border-radius: 4px;
  background: rgba(4, 6, 12, .7); border: 1px solid var(--line);
  transform: translate(14px, -50%);
}

.styles {
  position: fixed; right: clamp(12px, 3vw, 32px); bottom: clamp(12px, 3vh, 28px); z-index: 6;
  display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: rgba(6, 10, 20, .8); border: 1px solid var(--line);
}
.styles[hidden] { display: none; }
.styles button {
  appearance: none; border: 0; background: none; cursor: pointer;
  padding: 8px 13px; border-radius: 999px;
  font: 600 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  transition: color .2s, background-color .2s;
}
.styles button:hover { color: var(--ink); }
.styles button[aria-pressed="true"] { color: #04060c; background: var(--warm); }

.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 6; }
.progress i {
  display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--warm), var(--cool));
}

.top {
  position: fixed; inset: 0 0 auto 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px clamp(20px, 5vw, 64px);
  background: linear-gradient(rgba(4, 6, 12, .7), transparent);
}
.top a { color: var(--ink); text-decoration: none; }
.brand { font: 600 20px/1 var(--serif); letter-spacing: .02em; }
.top nav { display: flex; gap: clamp(14px, 2.4vw, 34px); }
.top nav a {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); transition: color .25s;
}
.top nav a:hover, .top nav a:focus-visible { color: var(--ink); }

/* ---------- scroll steps ---------- */
main { position: relative; z-index: 3; counter-reset: step; }
.step {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 0 clamp(20px, 7vw, 110px);
}
.step.center { justify-content: center; text-align: center; }
.step.hero { min-height: 100vh; align-items: flex-end; padding-bottom: 9vh; }

.card {
  position: relative;
  width: min(470px, 100%);
  padding: 30px 32px 34px;
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(20, 29, 52, .93), rgba(7, 11, 22, .95) 70%);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .09);
  counter-increment: step;
}
/* accent hairline along the top edge */
.card::before {
  content: ""; position: absolute; top: -1px; left: 28px; right: 28px; height: 1px;
  background: linear-gradient(90deg, var(--warm), var(--cool) 55%, transparent);
}
/* chapter number */
.card::after {
  content: counter(step, decimal-leading-zero);
  position: absolute; top: 30px; right: 32px;
  font: 500 13px/1 var(--sans); letter-spacing: .1em; font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .28);
}
.card.bare { width: min(760px, 100%); background: none; border: 0; padding: 0; box-shadow: none; counter-increment: none; }
.card.bare::before, .card.bare::after, .card.quote::after { content: none; }
.card.quote { width: min(860px, 100%); padding: clamp(30px, 5vw, 60px); }
.card.quote::before { left: 25%; right: 25%; background: linear-gradient(90deg, transparent, var(--warm), var(--cool), transparent); }

/* staggered reveal: only opacity + transform, so it stays on the compositor */
.card > * {
  opacity: 0; transform: translate3d(0, 22px, 0);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.in .card > * { opacity: 1; transform: none; }
.in .card > :nth-child(2) { transition-delay: .08s; }
.in .card > :nth-child(3) { transition-delay: .16s; }
.in .card > :nth-child(4) { transition-delay: .24s; }
.in .card > :nth-child(5) { transition-delay: .32s; }

/* card header: logo plate + place / years */
.head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding-right: 34px; }
.plate {
  flex: none; display: grid; place-items: center;
  width: 52px; height: 52px; padding: 8px; border-radius: 13px;
  background: #fff; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .6);
}
.plate img { display: block; max-width: 100%; max-height: 100%; }
.plate.wide { width: 124px; padding: 0 13px; }
.plate.flag { padding: 0; overflow: hidden; background: none; }
.plate.flag img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.plate.icon { background: rgba(255, 180, 84, .1); box-shadow: inset 0 0 0 1px rgba(255, 180, 84, .35); }
.plate.icon svg { width: 26px; height: 26px; fill: none; stroke: var(--warm); stroke-width: 1.500; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; line-height: 1.3;
  color: var(--warm);
}
.eyebrow b {
  display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 6px; border-radius: 50%;
  font-size: 11px; letter-spacing: 0; color: #04060c; background: var(--warm); vertical-align: 1px;
}
.years { margin-top: 5px; font: 500 19px/1.1 var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.bare .eyebrow, .quote .eyebrow { margin-bottom: 16px; }

h1, h2, blockquote { font-family: var(--serif); font-weight: 500; text-wrap: balance; }
h1 { font-size: clamp(60px, 11vw, 136px); line-height: .92; letter-spacing: -.02em; text-shadow: 0 4px 40px rgba(4, 6, 12, .9); }
h2 { font-size: clamp(34px, 3.7vw, 46px); line-height: 1.06; letter-spacing: -.012em; margin-bottom: 12px; }
h3 {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 24px 0 6px;
}
h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
p { color: #b4c0d2; text-wrap: pretty; }
.lede { font-size: clamp(17px, 2vw, 22px); color: var(--ink); margin-top: 18px; text-shadow: 0 2px 20px rgba(4, 6, 12, 1); }
blockquote { font-size: clamp(22px, 2.8vw, 35px); line-height: 1.34; color: var(--ink); }

.hint {
  margin-top: 34px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 12px;
}
.hint span {
  width: 1px; height: 34px; background: linear-gradient(var(--warm), transparent);
  transform-origin: 50% 0; animation: drop 2.2s var(--ease) infinite;
}
@keyframes drop { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* stat tiles */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.stats > div {
  padding: 16px 16px 15px; border-radius: 14px;
  background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.stats b { display: block; font: 500 clamp(25px, 2.3vw, 30px)/1 var(--serif); color: var(--warm); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stats.two b { font-size: 42px; color: var(--ink); }
.stats span { display: block; margin-top: 9px; font-size: 13px; line-height: 1.4; color: var(--muted); }

/* country chips with flags */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips span {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 14px 6px 7px; border-radius: 999px; font-size: 14px; line-height: 1;
  box-shadow: inset 0 0 0 1px var(--line); color: var(--muted);
  opacity: .32; transform: scale(.94);
  transition: opacity .5s, transform .5s var(--ease), color .5s, box-shadow .5s, background-color .5s;
}
.chips img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; filter: grayscale(1); transition: filter .5s; }
.chips span.lit {
  opacity: 1; transform: none; color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(111, 211, 255, .5); background: rgba(111, 211, 255, .09);
}
.chips span.lit img { filter: none; }

/* numbered impact list */
.impact { list-style: none; padding: 0; counter-reset: imp; }
.impact li {
  counter-increment: imp;
  display: flex; align-items: baseline; gap: 14px;
  padding: 9px 0; color: var(--ink); font-size: 15.5px; line-height: 1.4;
}
.impact li + li { border-top: 1px solid rgba(255, 255, 255, .07); }
.impact li::before {
  content: counter(imp, decimal-leading-zero);
  font: 600 11px/1 var(--sans); letter-spacing: .08em; color: var(--warm); font-variant-numeric: tabular-nums;
}

.noscript { position: fixed; bottom: 12px; left: 12px; z-index: 9; }

:focus-visible { outline: 2px solid var(--cool); outline-offset: 4px; border-radius: 4px; }

/* touch devices: native snapping (wheel / keys are eased in main.js) */
@media (pointer: coarse) {
  html { scroll-snap-type: y mandatory; }
  .step { scroll-snap-align: center; scroll-snap-stop: always; }
}

/* ---------- narrow screens: globe on top, cards at the bottom ---------- */
@media (max-width: 820px) {
  body { font-size: 16px; }
  .vignette { background: linear-gradient(transparent 35%, rgba(4, 6, 12, .9) 78%); }
  .step { align-items: flex-end; padding: 0 16px 5vh; }
  .step.center:not(.hero) { align-items: center; }
  .card { padding: 22px 22px 24px; }
  .top nav a:not(:last-child):not(:first-child) { display: none; }
  .stats.two b { font-size: 34px; }
  .styles { left: 12px; right: 12px; top: 58px; bottom: auto; justify-content: space-between; }
  .styles button { padding: 8px 6px; letter-spacing: .06em; }
}

@media (prefers-reduced-motion: reduce) {
  .card > *, .chips span { transition: none; }
  .hint span { animation: none; }
}
