/* =========================================================================
   RAD · Raquel Aycart Díaz
   Layout: a terminal you walk through gate by gate (A–G). White editorial
   spreads; the only "objects" are travel documents: the boarding pass, the
   departures board, the passport and the map. Dots and routes everywhere.
   ========================================================================= */

/* Archivo (SIL Open Font License, see assets/fonts/OFL.txt), self-hosted: one variable file
   covers weights 100–900 and widths 62–125%. */
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin.woff2") format("woff2-variations"), url("../fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2-variations"), url("../fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* colour */
  --paper: #ffffff;
  --ink: #000000;
  --ink-2: #474d63;          /* secondary text, biased toward cobalt */
  --ink-3: #868ca3;          /* captions, field labels */
  --cobalt: #1340d8;
  --cobalt-ink: #0b2a9c;     /* passport cover, pressed states */
  --cobalt-wash: #eef1fc;
  --signal: #ffd100;         /* wayfinding yellow: "you are here" only */
  --rule: #dde1ec;
  --board: #000000;
  --board-tile: #1c1d22;
  --board-line: #2a2c33;
  --board-text: #f4f5f8;
  --board-dim: #8d92a2;
  --page: #f5f7fd;           /* passport paper */

  /* type */
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; /* MRZ only */
  --t-cap: 0.75rem;     /* 12 */
  --t-sm: 0.875rem;     /* 14 */
  --t-body: 1.0625rem;  /* 17 */
  --t-md: 1.3125rem;    /* 21 */
  --t-lg: clamp(1.5rem, 1.1rem + 1.2vw, 2rem);
  --t-xl: clamp(2.125rem, 1.4rem + 2.6vw, 3.5rem);
  --t-title: clamp(2.75rem, 1.2rem + 5.6vw, 6.5rem);

  /* layout */
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1440px;
  --bar-h: 60px;
  --ease: cubic-bezier(.2, .8, .16, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.6;
  font-stretch: 100%;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--cobalt); }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
dl, dd { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
blockquote { margin: 0; }
::selection { background: var(--signal); color: var(--ink); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 2px; }

html[lang="en"] [data-lang="es"],
html[lang="es"] [data-lang="en"] { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--signal); color: var(--ink); padding: 10px 14px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.code { font-stretch: 125%; font-weight: 800; letter-spacing: .01em; }

/* ---------- top bar: airport wayfinding ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 24px;
  padding-inline: var(--gutter);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.topbar.is-scrolled { border-bottom-color: var(--rule); }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; white-space: nowrap; }
.brand-code { font-stretch: 125%; font-weight: 900; font-size: 1.25rem; letter-spacing: -.01em; }
.brand-name { font-size: var(--t-sm); color: var(--ink-2); }
.brand:hover { color: var(--ink); }

.gates { margin-left: auto; }
.gates ol { display: flex; gap: 4px; }
.gates a {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 4px;
  font-size: .8125rem; font-weight: 500; text-decoration: none; white-space: nowrap; color: var(--ink-2);
}
.gates a:hover { color: var(--ink); background: var(--cobalt-wash); }
.gate-tile {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; flex: none;
  border: 1.5px solid var(--ink); border-radius: 3px;
  font-size: .6875rem; font-weight: 800; line-height: 1; color: var(--ink);
}
.gates a.is-active { color: var(--ink); font-weight: 650; }
.gates a.is-active .gate-tile { background: var(--signal); border-color: var(--signal); }

.topbar-tools { display: flex; align-items: center; gap: 16px; }
.clock { font-size: var(--t-sm); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.clock-code { font-stretch: 125%; font-weight: 800; color: var(--ink); margin-right: 2px; }
.lang-switch { display: flex; border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; }
.lang-switch button {
  border: 0; background: transparent; padding: 4px 9px; cursor: pointer;
  font-size: .75rem; font-weight: 750; letter-spacing: .04em;
}
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.menu-toggle {
  display: none; border: 1.5px solid var(--ink); background: transparent; border-radius: 4px;
  padding: 4px 10px; font-size: .75rem; font-weight: 750; cursor: pointer;
}

@media (max-width: 1260px) {
  .brand-name { display: none; }
  .clock { display: none; }
}
@media (max-width: 1060px) {
  .gates a > span:not(.gate-tile) { display: none; }
  .gates a { padding: 6px 4px; }
  .gates a.is-active > span[data-lang] { display: inline; }
  html[lang="en"] .gates a.is-active > span[data-lang="es"],
  html[lang="es"] .gates a.is-active > span[data-lang="en"] { display: none; }
}
@media (max-width: 720px) {
  .menu-toggle { display: inline-block; }
  .gates {
    position: fixed; inset: var(--bar-h) 0 auto 0; margin: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 8px var(--gutter) 20px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .25s, transform .25s, visibility 0s .25s;
  }
  .gates.is-open { transform: none; opacity: 1; visibility: visible; transition: opacity .25s, transform .25s; }
  .gates ol { flex-direction: column; gap: 0; }
  .gates a { padding: 12px 0; font-size: 1.125rem; border-bottom: 1px solid var(--rule); border-radius: 0; gap: 14px; }
  .gates a > span:not(.gate-tile) { display: inline; }
  .gate-tile { width: 26px; height: 26px; font-size: .8125rem; }
}

/* ---------- shared section scaffolding ---------- */
.section, .hero { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(80px, 9vw, 136px) 0; }
.section-head { display: grid; gap: 20px; margin-bottom: clamp(36px, 5vw, 64px); max-width: 980px; }
.section-title {
  display: flex; align-items: baseline; gap: .28em;
  font-size: var(--t-title); font-weight: 800; font-stretch: 112%;
  letter-spacing: -.035em; line-height: .95;
}
.section-title .gate-tile {
  font-size: .42em; width: 1.5em; height: 1.5em; letter-spacing: 0;
  border: 0; border-radius: .08em; background: var(--signal); font-stretch: 100%;
}
.section-lede { font-size: var(--t-md); line-height: 1.45; color: var(--ink-2); max-width: 46ch; }

.text-button {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-weight: 650; text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px;
}
.text-button:hover { color: var(--cobalt); }
.pill-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1.5px solid var(--ink); border-radius: 999px;
  font-size: var(--t-sm); font-weight: 650; text-decoration: none; background: var(--paper);
}
.pill-link::after {
  content: ""; width: 9px; height: 9px; flex: none;
  border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg) translate(-1px, 1px);
}
.pill-link:hover { background: var(--ink); color: var(--paper); }
.link-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- split-flap ---------- */
.flap { white-space: nowrap; }
.flap--tiles .ft {
  position: relative; display: inline-block;
  min-width: .7em; padding: .02em .05em 0; margin-right: .07em;
  background: var(--ink); color: var(--board-text); border-radius: .09em;
  text-align: center; font-weight: 700; font-stretch: 100%; line-height: 1.12;
  transform-origin: 50% 50%;
}
.flap--tiles .ft::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: rgba(255, 255, 255, .16);
}
.flap--tiles .ft.is-flip { animation: flap .07s linear; }
.hero-thesis .flap--tiles .ft.is-blank { background: #e4e8f3; }
.flap--tiles .ft.is-blank::after { background: rgba(255, 255, 255, .5); }
@keyframes flap { 0% { transform: scaleY(1); } 50% { transform: scaleY(.2); } 100% { transform: scaleY(1); } }

/* ========================= A · BOARDING ========================= */
.hero { padding-top: clamp(12px, 1.4vw, 20px); }
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr) 210px;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
}
.hero-main {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: clamp(16px, 1.8vw, 26px);
  padding: clamp(18px, 2vw, 28px) clamp(16px, 2vw, 32px) clamp(20px, 2.4vw, 32px) 0;
  pointer-events: none;
}
.hero-main a, .hero-main button { pointer-events: auto; }
.pass-label, .field dt, .stub-fields dt, .case-meta dt, .pp-fields dt, .nb-label, .ci-label {
  font-size: .6875rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3);
}
.hero-name {
  font-size: clamp(3.5rem, .6rem + 8.6vw, 9.25rem);
  font-weight: 800; font-stretch: 125%;
  line-height: .84; letter-spacing: -.045em;
  margin-top: clamp(0px, 1vw, 12px);
}
.hero-name span { display: block; }
.hero-thesis { font-size: clamp(1.375rem, 1rem + 1.15vw, 2.125rem); font-weight: 600; line-height: 1.25; letter-spacing: -.01em; pointer-events: auto; }
.hero-thesis .flap { font-size: .94em; vertical-align: .04em; }
.hero-bio { max-width: 52ch; color: var(--ink-2); font-size: var(--t-body); pointer-events: auto; }
.pass-fields {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
  margin-top: auto; padding-top: 20px; border-top: 1px solid var(--rule); pointer-events: auto;
}
.field { display: grid; gap: 4px; align-content: start; }
.field dd { font-size: var(--t-sm); line-height: 1.35; }
.field dd .code { display: block; font-size: 1.75rem; line-height: 1; margin-bottom: 4px; }

.portrait { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding-top: 24px; }
.portrait-stage {
  position: relative; width: min(116%, calc((100svh - var(--bar-h) - 130px) * .751)); margin-left: auto;
  aspect-ratio: 591 / 787; max-width: none;
  touch-action: pan-y;
}
.portrait-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.portrait-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  clip-path: circle(0px at var(--lx, 50%) var(--ly, 40%));
  transition: clip-path .45s var(--ease);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 98%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 98%);
}
.portrait.is-lens .portrait-photo { clip-path: circle(var(--lr, 92px) at var(--lx, 50%) var(--ly, 40%)); transition: clip-path .25s var(--ease); }
.portrait.is-revealed .portrait-photo { clip-path: circle(140% at 50% 45%); transition: clip-path .9s var(--ease-io); }
.portrait-caption {
  position: relative; z-index: 3;
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; justify-content: flex-end;
  padding: 12px 0 18px; font-size: var(--t-cap); color: var(--ink-3); text-align: right;
}
.portrait-caption .text-button { font-size: var(--t-cap); color: var(--ink); }

.stub {
  position: relative;
  display: flex; flex-direction: column; gap: 22px;
  padding: clamp(20px, 2.4vw, 32px) 0 24px 24px;
  border-left: 2px dotted var(--ink);
}
.stub::before, .stub::after {
  content: ""; position: absolute; left: -11px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--ink);
}
.stub::before { top: -11px; clip-path: inset(50% 0 0 0); }
.stub::after { bottom: -11px; clip-path: inset(0 0 50% 0); }
.stub-code { font-size: 3.5rem; font-weight: 900; font-stretch: 125%; line-height: .85; letter-spacing: -.03em; color: var(--cobalt); }
.stub-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.stub-fields > div { grid-column: span 2; display: grid; gap: 2px; }
.stub-fields > div.half { grid-column: span 1; }
.stub-fields dd { font-size: .9375rem; font-weight: 700; line-height: 1.25; }
.stub-fields .tba { color: var(--cobalt); }
.stub-qr {
  margin-top: auto; display: grid; gap: 10px; text-decoration: none;
  font-size: var(--t-cap); line-height: 1.35; color: var(--ink-2);
}
.stub-qr .qr { display: block; width: 116px; aspect-ratio: 1; padding: 8px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 4px; }
.stub-qr .qr svg { display: block; width: 100%; height: 100%; fill: var(--ink); }
.stub-qr:hover .qr { border-color: var(--cobalt); }
.stub-qr:hover .qr svg { fill: var(--cobalt); }

@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); }
  .stub {
    grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px 32px;
    border-left: 0; border-top: 2px dotted var(--ink); padding: 22px 0 22px;
  }
  .stub::before { left: -11px; top: -11px; clip-path: inset(0 0 0 50%); }
  .stub::after { left: auto; right: -11px; top: -11px; bottom: auto; clip-path: inset(0 50% 0 0); }
  .stub-fields { grid-template-columns: repeat(5, auto); gap: 8px 24px; }
  .stub-fields > div, .stub-fields > div.half { grid-column: auto; }
  .stub-qr { margin: 0 0 0 auto; grid-template-columns: 76px auto; align-items: center; max-width: 220px; }
  .stub-qr .qr { width: 76px; padding: 5px; }
  .pass-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .portrait { order: -1; padding-top: 0; }
  .pass-label { display: none; }
  .portrait-stage { width: 100%; margin-left: 0; max-width: 460px; margin-inline: auto; }
  .portrait-caption { justify-content: flex-start; text-align: left; padding-bottom: 0; }
  .hero-main { padding-right: 0; }
  .hero-name { margin-top: 0; font-size: clamp(3.25rem, 17vw, 6rem); }
  .stub { flex-direction: column; align-items: stretch; }
  .stub-code { font-size: 2.5rem; }
  .stub-fields { grid-template-columns: 1fr 1fr; }
  .stub-fields > div { grid-column: span 2; }
  .stub-fields > div.half { grid-column: span 1; }
  .stub-qr { margin: 0; grid-template-columns: 76px 1fr; max-width: none; }
}

/* ========================= B · SELECTED WORK ========================= */
.board {
  background: var(--board); color: var(--board-text);
  border-radius: 8px; padding: clamp(14px, 2.2vw, 30px) clamp(12px, 2.2vw, 30px) clamp(10px, 1.4vw, 18px);
}
.board-top { display: flex; justify-content: space-between; align-items: center; padding: 0 12px 18px; }
.board-title { display: flex; align-items: center; gap: 12px; font-size: var(--t-lg); font-weight: 750; font-stretch: 112%; letter-spacing: -.01em; }
.board-title svg { width: 1.2em; height: 1.2em; fill: var(--signal); }
.board-clock { font-size: var(--t-lg); font-weight: 600; font-variant-numeric: tabular-nums; font-stretch: 87%; color: var(--signal); }
.board-head, .board-row {
  display: grid; align-items: center; column-gap: 20px;
  grid-template-columns: 6.25rem 5.75rem minmax(0, 1fr) 8.5rem 12.5rem 2rem;
}
.board-head {
  padding: 10px 12px; border-top: 1px solid var(--board-line); border-bottom: 1px solid var(--board-line);
  font-size: .6875rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--board-dim);
}
.board-row {
  width: 100%; padding: 18px 12px; border: 0; border-bottom: 1px solid var(--board-line);
  background: transparent; color: inherit; text-align: left; cursor: pointer; border-radius: 0;
  transition: background-color .18s, color .18s;
}
.board-rows li:last-child .board-row { border-bottom: 0; }
.board-row:hover, .board-row:focus-visible { background: var(--cobalt); color: #fff; outline: none; }
.board-row:focus-visible { box-shadow: inset 0 0 0 3px var(--signal); }
.c-time, .c-flight, .c-gate, .c-status {
  font-size: 1.0625rem; font-weight: 650; font-stretch: 87%; letter-spacing: .03em; text-transform: uppercase;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.c-flight { color: var(--signal); }
.board-row:hover .c-flight, .board-row:focus-visible .c-flight { color: #fff; }
.c-dest { font-size: clamp(1.125rem, .9rem + .8vw, 1.5rem); font-weight: 650; letter-spacing: -.005em; line-height: 1.2; }
.c-status b { font-weight: 800; margin-left: 6px; }
.c-status.is-boarding { color: var(--signal); }
.board-row:hover .c-status.is-boarding { color: #fff; }
.blink { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: .08em; animation: blink 1.4s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.c-go svg { width: 22px; height: 22px; fill: currentColor; opacity: .55; transition: transform .2s var(--ease), opacity .2s; }
.board-row:hover .c-go svg { opacity: 1; transform: translateX(3px); }
.board-legend { margin-top: 14px; font-size: var(--t-cap); color: var(--ink-3); }

@media (max-width: 860px) {
  .board-head { display: none; }
  .board-row {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "flight time . go" "dest dest dest go" "gate status status go";
    row-gap: 6px; padding: 16px 8px;
  }
  .c-flight { grid-area: flight; } .c-time { grid-area: time; color: var(--board-dim); }
  .c-dest { grid-area: dest; } .c-gate { grid-area: gate; color: var(--board-dim); }
  .c-status { grid-area: status; justify-self: end; } .c-go { grid-area: go; }
  .board-top { padding: 0 8px 14px; }
}

/* ---------- case study dialogs ---------- */
dialog.case {
  padding: 0; border: 0; margin: 0 0 0 auto;
  width: min(960px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  background: var(--paper); color: var(--ink);
  overflow: hidden;
}
dialog.case::backdrop { background: rgba(5, 18, 70, .5); }
dialog.case[open] { animation: sheet-in .55s var(--ease); }
dialog.case[open]::backdrop { animation: fade-in .4s ease; }
@keyframes sheet-in { from { transform: translateX(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } }
.case-sheet { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.case-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px clamp(20px, 5vw, 64px); background: var(--ink); color: var(--board-text);
}
.case-flight { display: flex; gap: 14px; align-items: baseline; font-stretch: 87%; text-transform: uppercase; letter-spacing: .04em; font-weight: 650; }
.case-flight b { color: var(--signal); font-size: 1.125rem; }
.case-flight span { color: var(--board-dim); font-size: var(--t-sm); }
.case-close {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1.5px solid var(--board-dim); background: transparent; color: var(--board-text);
  border-radius: 999px; padding: 6px 10px 6px 14px; font-size: var(--t-sm); font-weight: 650;
}
.case-close svg { width: 18px; height: 18px; fill: currentColor; }
.case-close:hover { background: var(--signal); border-color: var(--signal); color: var(--ink); }
.case-close:focus-visible { outline-color: var(--signal); }
.case-body { display: grid; gap: clamp(36px, 5vw, 56px); padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 64px) clamp(64px, 8vw, 96px); }
.case-title { font-size: var(--t-xl); font-weight: 800; font-stretch: 110%; letter-spacing: -.03em; line-height: 1; max-width: 18ch; }
.case-subtitle { margin-top: -28px; color: var(--ink-2); font-size: var(--t-md); }
.case-subtitle cite { font-style: normal; font-weight: 650; color: var(--ink); }
.case-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px 28px;
  padding-top: 18px; border-top: 1.5px solid var(--ink);
}
.case-meta > div { display: grid; gap: 4px; align-content: start; }
.case-meta dd { font-weight: 600; line-height: 1.35; }
.case-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.stat { display: grid; gap: 10px; align-content: start; }
.stat b { white-space: nowrap; font-size: clamp(2.75rem, 1.6rem + 3.4vw, 5rem); font-weight: 800; font-stretch: 125%; letter-spacing: -.045em; line-height: .9; color: var(--cobalt); font-variant-numeric: tabular-nums; }
.stat span { max-width: 32ch; color: var(--ink-2); line-height: 1.45; }
.case-block { display: grid; gap: 14px; max-width: 66ch; }
.case-block h3 { font-size: var(--t-md); font-weight: 750; letter-spacing: -.01em; }
.case-block p { color: var(--ink); }
.pull { font-size: var(--t-lg); font-weight: 650; line-height: 1.25; letter-spacing: -.015em; color: var(--cobalt) !important; margin-top: 8px; max-width: 28ch; }
.steps { counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; align-items: start; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 26px; height: 26px; margin-top: 1px;
  background: var(--ink); color: var(--paper); border-radius: 3px; font-size: .75rem; font-weight: 800;
}
.quote { display: grid; gap: 10px; }
.quote p { font-size: var(--t-md); line-height: 1.45; font-weight: 500; }
.quote footer { font-size: var(--t-sm); color: var(--ink-3); }
.quote--big { position: relative; padding-left: 1.1em; }
.quote--big::before { content: "“"; position: absolute; left: -.05em; top: -.18em; font-size: 3.2em; line-height: 1; color: var(--cobalt); font-weight: 800; }
.quote--big p { font-size: var(--t-lg); line-height: 1.3; font-weight: 550; letter-spacing: -.015em; }
.case-photo { display: grid; gap: 10px; }
.case-photo img { width: 100%; border-radius: 4px; }
.case-photo figcaption, .case-viz figcaption, .case-gallery figcaption, .stop-photo figcaption { font-size: var(--t-sm); color: var(--ink-3); max-width: 70ch; line-height: 1.45; }
.case-photo--portrait img { max-width: 420px; }
.case-photo--logo img { max-width: 280px; }
.case-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.case-gallery figure { display: grid; gap: 8px; }
.case-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tags li { padding: 5px 12px; border: 1px solid var(--rule); border-radius: 999px; font-size: var(--t-sm); color: var(--ink-2); }

.case-viz { display: grid; gap: 12px; }
.screen { position: relative; background: var(--board); border-radius: 10px; padding: 10px; aspect-ratio: 16 / 8; min-height: 260px; }
.screen canvas { width: 100%; height: 100%; display: block; border-radius: 4px; }
.screen-labels { position: absolute; left: 10px; right: 10px; bottom: 14px; display: grid; grid-template-columns: 1fr 1fr; pointer-events: none; }
.screen-labels p { padding-left: 18px; color: var(--board-dim); font-size: var(--t-sm); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-stretch: 87%; }
.screen-labels b { display: block; font-size: clamp(1.75rem, 1rem + 2.4vw, 2.75rem); color: var(--board-text); font-stretch: 125%; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.screen-labels p:last-child b { color: var(--signal); }

.bars { display: grid; gap: 10px; max-width: 640px; }
.bars-title { font-size: var(--t-sm); font-weight: 650; }
.bar { display: grid; grid-template-columns: 60px minmax(0, 1fr) 44px; gap: 12px; align-items: center; font-size: var(--t-sm); }
.bar-label { font-weight: 650; }
.bar-track { height: 14px; background: var(--cobalt-wash); border-radius: 2px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: var(--w); background: var(--cobalt); transform-origin: left; }
.bar-fill--grey { background: #9aa0b5; }
.bar-val { font-variant-numeric: tabular-nums; text-align: right; color: var(--ink-2); }
dialog[open] .bar-fill { animation: grow 1.1s var(--ease) .3s backwards; }
@keyframes grow { from { transform: scaleX(0); } }

.lean { display: grid; gap: 16px; max-width: 66ch; padding: 24px; background: var(--cobalt-wash); border-radius: 6px; }
.lean-title { font-weight: 750; }
.lean-list { display: flex; flex-wrap: wrap; gap: 8px; }
.lean-list li { padding: 6px 12px; background: var(--paper); border-radius: 3px; font-weight: 650; font-size: var(--t-sm); }

.course-board { display: grid; gap: 1px; background: var(--board-line); border-radius: 6px; overflow: hidden; }
.course-board li { background: var(--board); color: var(--board-text); padding: 14px 18px; font-size: var(--t-md); font-weight: 650; font-stretch: 100%; }
.course-board li::before { content: "TUM"; display: inline-block; width: 3.4em; color: var(--signal); font-size: .75em; font-stretch: 87%; letter-spacing: .06em; }
.lenses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: lens; }
.lenses li { counter-increment: lens; display: grid; gap: 8px; align-content: start; padding: 18px; border: 1.5px solid var(--ink); border-radius: 6px; }
.lenses li:last-child { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }
.lenses b { font-size: var(--t-md); font-weight: 800; font-stretch: 112%; }
.lenses b::before { content: counter(lens) "  "; color: var(--ink-3); font-stretch: 100%; }
.lenses li:last-child b::before { color: rgba(255, 255, 255, .6); }
.lenses small { font-size: var(--t-cap); color: var(--ink-3); }
.lenses li:last-child small { color: rgba(255, 255, 255, .75); }
@media (max-width: 640px) { .lenses { grid-template-columns: 1fr; } .case-gallery { grid-template-columns: 1fr; } }

/* phase diagram */
.phase-wrap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr); gap: 24px; align-items: center; padding: 20px; border: 1.5px solid var(--ink); border-radius: 8px; }
.phase-svg { width: 100%; height: auto; touch-action: none; user-select: none; }
.phase-svg .axis { stroke: var(--ink); stroke-width: 1.2; fill: none; }
.phase-svg .tick text, .phase-svg .lbl { font: 600 11px var(--font); fill: var(--ink-3); }
.phase-svg .curve { stroke: var(--ink); stroke-width: 2; fill: none; }
.phase-svg .curve-dash { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }
.phase-svg .region-sc { fill: var(--cobalt-wash); }
.phase-svg .region-name { font: 700 13px var(--font); fill: var(--ink-2); letter-spacing: .02em; }
.phase-svg .region-name.sc { fill: var(--cobalt); }
.phase-svg .pt { fill: var(--ink); }
.phase-svg .pt-label { font: 650 11px var(--font); fill: var(--ink); }
.phase-svg .handle { fill: var(--signal); stroke: var(--ink); stroke-width: 2; cursor: grab; }
.phase-svg .handle-halo { fill: var(--signal); opacity: .35; }
.phase-svg .guide { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.phase-state { font-size: clamp(1.625rem, 1rem + 1.3vw, 2.375rem); font-weight: 800; font-stretch: 105%; letter-spacing: -.025em; line-height: 1.05; overflow-wrap: anywhere; }
.phase-state.is-sc { color: var(--cobalt); }
.phase-desc { margin-top: 10px; color: var(--ink-2); font-size: var(--t-sm); min-height: 4.5em; }
.phase-inputs { display: grid; gap: 6px; margin-top: 18px; }
.phase-inputs label { display: flex; justify-content: space-between; font-size: var(--t-sm); font-weight: 650; }
.phase-inputs output { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.phase-inputs input[type="range"] { width: 100%; accent-color: var(--cobalt); margin: 0 0 8px; }
@media (max-width: 720px) { .phase-wrap { grid-template-columns: 1fr; padding: 12px; } }

/* health levels */
.levels-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.levels-svg { width: 100%; max-width: 420px; height: auto; }
.levels-svg .ring { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; cursor: pointer; transition: fill .3s, stroke .3s; }
.levels-svg .ring.is-on { fill: var(--cobalt-wash); stroke: var(--cobalt); stroke-width: 2.5; }
.levels-svg .ring-label { font: 800 13px var(--font); letter-spacing: .08em; text-transform: uppercase; fill: var(--ink); pointer-events: none; }
.levels-svg .ring-label.is-on { fill: var(--cobalt); }
.levels-svg .node { fill: var(--ink); transition: fill .3s, r .3s; }
.levels-svg .node.is-on { fill: var(--cobalt); }
.levels-svg .node-label { font: 600 10.5px var(--font); fill: var(--ink-2); pointer-events: none; }
.levels-svg .pulse { fill: none; stroke: var(--cobalt); stroke-width: 1.5; opacity: 0; }
.levels-panel { display: grid; gap: 18px; }
.levels-text h4 { font-size: var(--t-lg); font-weight: 800; font-stretch: 112%; letter-spacing: -.02em; margin-bottom: 8px; }
.levels-text p { color: var(--ink-2); }
.levels-text ul { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.levels-text li { padding: 4px 10px; border-radius: 3px; background: var(--cobalt-wash); font-size: var(--t-sm); font-weight: 600; color: var(--cobalt-ink); }
@media (max-width: 720px) { .levels-wrap { grid-template-columns: 1fr; } .levels-svg { margin-inline: auto; } }

.h2-svg { width: 100%; height: auto; border: 1.5px solid var(--ink); border-radius: 8px; }
.h2-svg .orbit { fill: none; stroke: var(--rule); stroke-width: 1.5; stroke-dasharray: 2 6; stroke-linecap: round; }
.h2-svg .core { fill: var(--cobalt); }
.h2-svg .core-t { font: 800 30px var(--font); font-stretch: 125%; fill: #fff; }
.h2-svg .sat { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.h2-svg .sat-t { font: 650 12.5px var(--font); fill: var(--ink); }
.h2-svg .link { stroke: var(--cobalt); stroke-width: 1.5; opacity: .5; }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; }
.seg button {
  border: 0; border-right: 1.5px solid var(--ink); background: var(--paper); cursor: pointer;
  padding: 7px 14px; font-size: var(--t-sm); font-weight: 650;
}
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.seg button:hover:not([aria-pressed="true"]):not([aria-selected="true"]) { background: var(--cobalt-wash); }
.seg--dark { border-color: var(--board-line); }
.seg--dark button { background: transparent; color: var(--board-text); border-right-color: var(--board-line); }
.seg--dark button[aria-pressed="true"] { background: var(--signal); color: var(--ink); }
.seg--dark button:hover:not([aria-pressed="true"]) { background: var(--board-tile); }

/* ========================= C · THE JOURNEY ========================= */
.journey-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); }
.journey-aside { position: sticky; top: calc(var(--bar-h) + 32px); align-self: start; display: grid; gap: 20px; }
.journey-aside .section-title { margin-bottom: 4px; }
.now-at { margin-top: clamp(16px, 4vw, 56px); display: grid; gap: 10px; }
.now-label { font-size: .6875rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.flap--big { font-size: clamp(3rem, 1rem + 4.6vw, 6rem); line-height: 1; }
.flap--big .ft { font-stretch: 125%; font-weight: 800; width: 1.04em; min-width: 0; padding: .04em .06em 0; margin-right: .06em; border-radius: .06em; }
.now-place { font-size: var(--t-md); font-weight: 600; }

.route { position: relative; }
.route-svg { position: absolute; left: 0; top: 0; width: 64px; height: 100%; overflow: visible; pointer-events: none; }
.route-plan { fill: none; stroke: #b9bfd2; stroke-width: 2; stroke-dasharray: 0 7; stroke-linecap: round; }
.route-flown { fill: none; stroke: var(--cobalt); stroke-width: 2.5; stroke-linecap: round; }
.route-head { fill: var(--signal); stroke: var(--ink); stroke-width: 2; }
.stops { display: grid; }
.stop {
  position: relative; display: grid; grid-template-columns: 88px minmax(0, 1fr); column-gap: 24px;
  padding: 0 0 clamp(36px, 4vw, 52px) 64px;
}
.stop-dot {
  position: absolute; left: 25px; top: 9px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink); z-index: 1;
  transition: background-color .3s, border-color .3s, transform .3s var(--ease);
}
.stop.is-passed .stop-dot { background: var(--cobalt); border-color: var(--cobalt); }
.stop.is-current .stop-dot { background: var(--signal); border-color: var(--ink); transform: scale(1.25); }
.stop-when { padding-top: 4px; font-size: var(--t-sm); font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.stop.is-current .stop-when { color: var(--ink); }
.stop-body { display: grid; gap: 12px; justify-items: start; }
.stop-body > p { max-width: 62ch; }
.stop-title { font-size: clamp(1.375rem, 1rem + 1vw, 1.875rem); font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.stop-title .code { color: var(--cobalt); margin-right: .3em; letter-spacing: 0; }
.stop-more { width: 100%; }
.stop-more summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-size: var(--t-sm); font-weight: 700; padding: 4px 0;
}
.stop-more summary::-webkit-details-marker { display: none; }
.stop-more summary::before {
  content: "+"; display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--ink); border-radius: 50%;
  font-size: 14px; line-height: 1; transition: transform .25s var(--ease);
}
.stop-more[open] summary::before { content: "–"; }
.stop-more summary:hover { color: var(--cobalt); }
.stop-more-body { display: grid; gap: 14px; padding-top: 10px; max-width: 62ch; color: var(--ink-2); }
.stop-photo { display: grid; gap: 8px; }
.stop-photo img { width: 100%; max-width: 560px; border-radius: 4px; }
.stop-logo { width: 150px; margin-top: 4px; }
.case-link {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1.5px solid var(--ink); background: var(--paper); border-radius: 999px;
  padding: 5px 6px 5px 14px; font-size: var(--t-sm); font-weight: 700;
}
.flight-tag { padding: 3px 8px; border-radius: 999px; background: var(--ink); color: var(--signal); font-size: .75rem; font-stretch: 87%; letter-spacing: .04em; }
.case-link:hover { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }

@media (max-width: 900px) {
  .journey-grid { grid-template-columns: minmax(0, 1fr); }
  .journey-aside { position: static; }
  .now-at {
    position: sticky; top: calc(var(--bar-h) + 8px); z-index: 5; margin: 0 calc(-1 * var(--gutter));
    padding: 10px var(--gutter); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--rule);
    grid-template-columns: auto 1fr; align-items: center; column-gap: 14px;
    display: none;
  }
  .stop { grid-template-columns: minmax(0, 1fr); padding-left: 44px; }
  .route-svg { width: 40px; }
  .stop-dot { left: 13px; top: 30px; }
  .stop-when { padding: 0 0 4px; }
}

/* ========================= D · PASSPORT ========================= */
.passport-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: clamp(28px, 4vw, 56px); align-items: center; }
.passport { position: relative; width: 100%; max-width: 900px; aspect-ratio: 176 / 125; perspective: 2600px; transition: transform 1.4s var(--ease-io); }
.passport:not(.is-open) { transform: translateX(-25%); }
.pp-spread {
  position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--page); border-radius: 10px;
  box-shadow: 0 1px 0 rgba(11, 42, 156, .08), 0 24px 48px -28px rgba(11, 42, 156, .35);
}
.passport:not(.is-open) .pp-data { visibility: hidden; opacity: 0; }
.pp-data { transition: opacity .6s ease .5s; }
.pp-page { position: relative; padding: 7% 7% 6%; overflow: hidden; container-type: inline-size; display: flex; flex-direction: column; }
.pp-data { border-radius: 10px 0 0 10px; box-shadow: inset -18px 0 24px -22px rgba(11, 42, 156, .35); }
.pp-visas { border-radius: 0 10px 10px 0; box-shadow: inset 18px 0 24px -22px rgba(11, 42, 156, .35); }
.pp-guilloche {
  position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='24' viewBox='0 0 120 24'%3E%3Cpath d='M0 12 C 15 0, 45 0, 60 12 S 105 24, 120 12' fill='none' stroke='%231340d8' stroke-opacity='.12' stroke-width='.8'/%3E%3Cpath d='M0 12 C 15 24, 45 24, 60 12 S 105 0, 120 12' fill='none' stroke='%231340d8' stroke-opacity='.08' stroke-width='.8'/%3E%3C/svg%3E");
  background-size: 120px 24px;
}
.pp-doc { position: relative; display: flex; justify-content: space-between; font-size: 3.4cqw; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--cobalt-ink); }
.pp-doc-type { font-weight: 600; letter-spacing: .1em; color: var(--ink-3); }
.pp-data-grid { position: relative; display: grid; grid-template-columns: 34% minmax(0, 1fr); gap: 6cqw; margin-top: 7cqw; }
.pp-photo { width: 100%; height: auto; aspect-ratio: 3 / 4; background: #fff; border-radius: 2px; }
.pp-fields { display: grid; gap: 3.2cqw; align-content: start; }
.pp-fields > div { display: grid; gap: .6cqw; }
.pp-fields dt { font-size: 2.3cqw; }
.pp-fields dd { font-size: 3.6cqw; font-weight: 750; line-height: 1.2; letter-spacing: .02em; }
.pp-langs { display: grid; gap: 1.2cqw; font-weight: 500 !important; font-size: 3cqw !important; letter-spacing: 0 !important; }
.pp-langs b { display: inline-block; min-width: 2.2em; font-weight: 800; color: var(--cobalt-ink); }
.pp-mrz {
  position: relative; margin-top: auto; padding-top: 3cqw;
  font-family: var(--mono); font-size: calc(100cqw / 44 / .64); letter-spacing: .04em; line-height: 1.5;
  color: var(--ink); white-space: nowrap; overflow: hidden;
}
.pp-doc--right { justify-content: flex-end; gap: 1em; }
.stamps { position: absolute; inset: 15% 4% 4% 4%; }
.stamp {
  position: absolute; left: var(--x); top: var(--y); width: var(--w);
  padding: 0; border: 0; background: none; cursor: pointer; color: var(--c, var(--cobalt));
  transform: rotate(var(--r, 0deg)); transition: transform .35s var(--ease), opacity .35s;
  mix-blend-mode: multiply; border-radius: 50%;
}
.stamp svg { display: block; width: 100%; height: auto; overflow: visible; }
.stamp:hover { transform: rotate(var(--r, 0deg)) scale(1.06); }
.stamp .hl { fill: var(--signal); opacity: 0; transition: opacity .25s; }
.stamp[aria-pressed="true"] .hl { opacity: 1; }
.stamp text { font-family: var(--font); fill: currentColor; }
.stamps.is-pre .stamp { opacity: 0; transform: rotate(var(--r, 0deg)) scale(1.7); }
.stamps.is-stamping .stamp { transition: transform .32s cubic-bezier(.3, 1.5, .5, 1), opacity .18s; transition-delay: var(--d, 0s); }

.pp-cover {
  position: absolute; top: 0; right: 0; width: 50%; height: 100%; z-index: 4;
  padding: 0; border: 0; cursor: pointer; background: none;
  transform-origin: left center; transform-style: preserve-3d;
  transition: transform 1.5s var(--ease-io);
  border-radius: 4px 12px 12px 4px;
}
.passport.is-open .pp-cover { transform: rotateY(-180deg); pointer-events: none; }
.cover-face {
  position: absolute; inset: 0; display: grid; justify-items: center; align-content: space-between;
  padding: 12% 8% 10%; border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: radial-gradient(120% 90% at 30% 10%, #1846e8 0%, var(--cobalt-ink) 62%, #08217d 100%);
  color: #fff; box-shadow: inset 6px 0 10px -6px rgba(0, 0, 0, .5), 0 24px 40px -24px rgba(5, 18, 70, .6);
}
.cover-top { font-size: clamp(.875rem, 1.6vw, 1.375rem); font-weight: 800; letter-spacing: .32em; text-transform: uppercase; color: var(--signal); }
.cover-globe { width: 58%; height: auto; }
.cover-name { font-size: clamp(.75rem, 1.15vw, 1rem); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: .85; }
.cover-code { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 900; font-stretch: 125%; letter-spacing: .06em; color: var(--signal); line-height: 1; }
.pp-cover:hover .cover-face { filter: brightness(1.08); }
.pp-cover:focus-visible { outline-offset: 6px; }

.visa { display: grid; gap: 16px; align-content: start; min-height: 320px; padding: 26px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--paper); }
.visa-kicker { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; white-space: nowrap; font-size: .6875rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.visa h3 { font-size: var(--t-lg); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.visa .visa-issuer { color: var(--ink-2); font-size: var(--t-sm); margin-top: -8px; }
.visa p { font-size: .9688rem; }
.visa .quote p { font-size: 1rem; }
.visa .link-row { margin-top: 4px; }
.visa-hint { font-size: var(--t-cap); color: var(--ink-3); }

@media (max-width: 1100px) {
  .passport-wrap { grid-template-columns: minmax(0, 1fr); }
  .passport { max-width: 820px; margin-inline: auto; }
  .visa { min-height: 0; }
}
@media (max-width: 680px) {
  .passport, .passport:not(.is-open) { aspect-ratio: auto; transform: none; perspective: none; }
  .pp-spread { position: relative; grid-template-columns: 1fr; }
  .passport:not(.is-open) .pp-data { visibility: visible; opacity: 1; }
  .pp-cover { display: none; }
  .pp-data { border-radius: 10px 10px 0 0; box-shadow: inset 0 -18px 24px -22px rgba(11, 42, 156, .35); }
  .pp-visas { border-radius: 0 0 10px 10px; box-shadow: none; aspect-ratio: 88 / 110; }
}

/* ========================= E · ACROSS BORDERS ========================= */
.atlas { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(290px, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.atlas-map { display: grid; gap: 14px; min-width: 0; }
.atlas-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--t-sm); color: var(--ink-2); }
.lg { display: inline-block; border-radius: 50%; }
.lg-lived { width: 12px; height: 12px; background: var(--cobalt); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--cobalt); margin-left: 3px; }
.lg-trip { width: 7px; height: 7px; background: var(--ink); margin-left: 10px; }
.map-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--paper); border: 1.5px solid var(--ink); touch-action: pan-y; }
.map-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-markers { position: absolute; inset: 0; }
.mk {
  position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none; cursor: pointer;
  transform: translate(calc(var(--mx) - 50%), calc(var(--my) - 50%));
  display: grid; place-items: center; width: 26px; height: 26px;
}
.mk[hidden] { display: none !important; }
.mk .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); transition: transform .2s var(--ease); }
.mk--lived .dot { width: 13px; height: 13px; background: var(--cobalt); box-shadow: 0 0 0 2px #fff; }
.mk--country .dot { width: 22px; height: 22px; background: rgba(19, 64, 216, .12); box-shadow: inset 0 0 0 2px var(--cobalt); }
.mk .tag {
  position: absolute; left: calc(50% + 10px); top: 50%; transform: translateY(-50%);
  padding: 2px 6px; background: var(--paper); border-radius: 3px; white-space: nowrap;
  font-size: .6875rem; font-weight: 800; font-stretch: 112%; letter-spacing: .03em; line-height: 1.3;
  box-shadow: 0 0 0 1px var(--rule);
}
.mk--trip .tag { opacity: 0; transform: translateY(-50%) translateX(-4px); transition: opacity .15s, transform .15s; pointer-events: none; font-stretch: 100%; font-weight: 650; }
.mk--trip:hover .tag, .mk--trip:focus-visible .tag, .mk--trip.is-selected .tag { opacity: 1; transform: translateY(-50%); }
.mk:hover .dot { transform: scale(1.35); }
.mk.is-selected .dot { box-shadow: 0 0 0 2px #fff, 0 0 0 6px var(--signal); }
.mk--trip.is-selected .dot { box-shadow: 0 0 0 4px var(--signal); }
.mk.is-selected { z-index: 3; }
.mk--lived { z-index: 2; }
.mk:focus-visible { outline-offset: 0; border-radius: 50%; }

.atlas-panel { display: grid; gap: 20px; min-width: 0; }
.place-list { display: grid; border-top: 1.5px solid var(--ink); }
.place-list button {
  width: 100%; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: baseline;
  padding: 9px 4px; border: 0; border-bottom: 1px solid var(--rule); background: none; cursor: pointer; text-align: left;
}
.place-list .pl-code { font-stretch: 125%; font-weight: 800; font-size: .9375rem; }
.place-list .pl-city { font-weight: 600; }
.place-list .pl-when { font-size: var(--t-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.place-list button:hover { background: var(--cobalt-wash); }
.place-list button[aria-pressed="true"] .pl-code { background: var(--signal); margin-left: -4px; padding: 0 4px; border-radius: 2px; }
.place-list button[aria-pressed="true"] .pl-city { font-weight: 800; }
.place-card { display: grid; gap: 12px; }
.place-card .pc-photos { display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); gap: 8px; }
.place-card .pc-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.place-card .pc-photos.n1 img { aspect-ratio: 16 / 10; }
.place-card .pc-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.place-card .pc-code { font-size: 2.25rem; font-weight: 900; font-stretch: 125%; color: var(--cobalt); line-height: 1; letter-spacing: -.02em; }
.place-card h3 { font-size: var(--t-md); font-weight: 750; }
.place-card .pc-when { font-size: var(--t-sm); color: var(--ink-3); width: 100%; }
.place-card p { color: var(--ink-2); font-size: .9688rem; }
.place-card .pc-kind { font-size: .6875rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }

@media (max-width: 980px) {
  .atlas { grid-template-columns: minmax(0, 1fr); }
  .atlas-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 640px) {
  .map-stage { aspect-ratio: 4 / 3; }
  .atlas-panel { grid-template-columns: minmax(0, 1fr); }
  .seg button { padding: 7px 10px; }
}

/* ========================= F · BEYOND THE CV ========================= */
.beyond-grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(20px, 2.6vw, 36px) clamp(16px, 2vw, 28px);
  align-items: start;
}
.by-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.by-photo--family { grid-column: 1 / 8; grid-row: 1 / 3; }
.by-photo--family img { aspect-ratio: 4 / 3; }
.by-item--family { grid-column: 9 / 13; grid-row: 1; align-self: end; }
.by-item--nature { grid-column: 9 / 13; grid-row: 2; align-self: start; }
.by-photo--nature { grid-column: 1 / 6; grid-row: 3; }
.by-photo--nature img { aspect-ratio: 4 / 3; }
.by-photo--maine { grid-column: 6 / 9; grid-row: 3 / 5; }
.by-photo--maine img { aspect-ratio: 3 / 4; }
.by-item--health { grid-column: 9 / 13; grid-row: 3; }
.by-item--teach { grid-column: 1 / 6; grid-row: 4; }
.by-item--invest { grid-column: 9 / 13; grid-row: 4; }
.by-item { display: grid; gap: 10px; }
.by-item h3 { font-size: var(--t-lg); font-weight: 800; font-stretch: 110%; letter-spacing: -.025em; line-height: 1.05; }
.by-item p { color: var(--ink-2); max-width: 48ch; }

.postcards-block { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(20px, 3vw, 40px); margin-top: clamp(56px, 7vw, 104px); align-items: start; }
.postcards {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 4px 18px;
  scrollbar-width: thin; scrollbar-color: var(--ink) transparent;
}
.postcard {
  position: relative; flex: 0 0 auto; width: clamp(240px, 30vw, 380px); scroll-snap-align: start;
  display: grid; gap: 10px; padding: 10px 10px 14px; background: var(--paper);
  border: 1px solid var(--rule); border-radius: 3px;
}
.postcard--tall { width: clamp(180px, 20vw, 250px); }
.postcard img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.postcard--tall img { aspect-ratio: 3 / 4; }
.postcard p { font-size: var(--t-sm); font-weight: 600; }
.postmark {
  position: absolute; right: 18px; top: 18px; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  border: 2px solid rgba(255, 255, 255, .92); color: #fff;
  font-size: .9375rem; font-weight: 900; font-stretch: 125%; line-height: 1; letter-spacing: .02em;
  transform: rotate(-12deg); text-shadow: 0 1px 6px rgba(0, 0, 0, .35); box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}
.postmark small { display: block; font-size: .5625rem; font-weight: 700; letter-spacing: .12em; margin-top: 3px; font-stretch: 100%; }

.destinations { margin-top: clamp(56px, 7vw, 104px); background: var(--board); color: var(--board-text); border-radius: 8px; padding: clamp(18px, 2.6vw, 34px); }
.dest-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.dest-title { font-size: var(--t-lg); font-weight: 750; font-stretch: 112%; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 12px; }
.dest-count { font-size: var(--t-sm); font-weight: 650; color: var(--signal); font-stretch: 100%; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.dest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 18px 12px; }
.dest-grid li { display: grid; gap: 6px; }
.dest-grid .flap { font-size: 1.5rem; }
.dest-grid .flap--tiles .ft { background: var(--board-tile); font-stretch: 112%; font-weight: 750; width: 1em; min-width: 0; }
.dest-name { font-size: .75rem; color: var(--board-dim); line-height: 1.3; }
.dest-note { margin-top: 20px; font-size: var(--t-cap); color: var(--board-dim); }

@media (max-width: 900px) {
  .beyond-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .by-photo--family { grid-column: 1 / -1; grid-row: auto; }
  .by-item--family, .by-item--nature, .by-item--health, .by-item--teach, .by-item--invest { grid-column: span 3; grid-row: auto; }
  .by-photo--nature { grid-column: 1 / 5; grid-row: auto; }
  .by-photo--maine { grid-column: 5 / -1; grid-row: auto; }
  .by-photo--maine img { aspect-ratio: 3 / 4; height: auto; }
  .by-photo--nature img { height: 100%; }
  .postcards-block { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .by-item--family, .by-item--nature, .by-item--health, .by-item--teach, .by-item--invest { grid-column: 1 / -1; }
  .by-photo--nature { grid-column: 1 / 4; } .by-photo--maine { grid-column: 4 / -1; }
  .by-photo--nature img { aspect-ratio: 3 / 4; }
  .dest-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .dest-grid .flap { font-size: 1.25rem; }
}

/* ========================= G · NEXT DESTINATION ========================= */
.next .section-head { margin-bottom: 32px; }
.next-board {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px 28px;
  background: var(--board); color: var(--board-text); border-radius: 8px; padding: clamp(18px, 2.6vw, 32px);
}
.next-board .nb-label { color: var(--board-dim); }
.nb-value { min-width: 0; overflow: hidden; }
.nb-value .flap { font-size: clamp(1.25rem, .4rem + 3.1vw, 3.5rem); }
.nb-value .flap--tiles .ft { background: var(--board-tile); font-stretch: 112%; font-weight: 750; width: .9em; min-width: 0; }
.nb-status { color: var(--signal); font-weight: 750; font-size: var(--t-sm); text-transform: uppercase; letter-spacing: .06em; font-stretch: 87%; white-space: nowrap; }
.next-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 80px); margin-top: clamp(36px, 5vw, 64px); align-items: start; }
.next-text p { font-size: var(--t-lg); line-height: 1.3; font-weight: 550; letter-spacing: -.015em; max-width: 30ch; }
.checkin { display: grid; border-top: 1.5px solid var(--ink); }
.checkin li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.ci-value { font-size: clamp(1.0625rem, .55rem + 1.05vw, 1.625rem); font-weight: 700; letter-spacing: -.015em; text-decoration: none; overflow-wrap: anywhere; }
.ci-value:hover { color: var(--cobalt); text-decoration: underline; }
.ci-action {
  display: inline-flex; align-items: center; justify-content: center; min-width: 92px; padding: 8px 14px; cursor: pointer;
  border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper);
  font-size: var(--t-sm); font-weight: 700; text-decoration: none; color: var(--ink);
}
.ci-action:hover { background: var(--ink); color: var(--paper); }
.copy-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 6px; font-size: var(--t-sm); font-weight: 650;
  transition: opacity .25s, transform .25s var(--ease);
}
.copy-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 860px) {
  .next-board { grid-template-columns: minmax(0, 1fr); }
  .next-grid { grid-template-columns: minmax(0, 1fr); }
  .checkin li { grid-template-columns: minmax(0, 1fr) auto; }
  .ci-label { grid-column: 1 / -1; }
}

/* ---------- footer ---------- */
.footer { max-width: var(--maxw); margin: clamp(88px, 11vw, 160px) auto 0; padding: 28px var(--gutter) 40px; border-top: 1.5px solid var(--ink); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; align-items: baseline; }
.footer-route { display: flex; flex-wrap: wrap; align-items: center; gap: 0; font-stretch: 125%; font-weight: 800; font-size: var(--t-sm); }
.footer-route span { display: inline-flex; align-items: center; }
.footer-route span + span::before { content: ""; width: 28px; height: 2px; margin: 0 8px; background: radial-gradient(circle, var(--ink-3) 1px, transparent 1.5px) 0 50% / 6px 2px repeat-x; }
.footer-route .tba { color: var(--cobalt); }
.footer-meta { display: flex; gap: 24px; font-size: var(--t-sm); color: var(--ink-3); }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
