/* ============================================================
   Shijie Zhou — Photography
   Warm paper, one red, an orderly grid. Dark mode brings the stars.
   ============================================================ */

:root {
  --bg: #f9f7f4;
  --paper: #ffffff;
  --ink: #1c1b19;
  --ink-soft: #6d6a64;
  --ink-faint: #b5b0a7;
  --hairline: rgba(28, 27, 25, 0.12);
  --accent: #c0392b;
  --link: #2e86c1;
  --shadow: rgba(28, 27, 25, 0.14);
  --stars-alpha: 0;

  --serif: "IBM Plex Serif", Georgia, "Times New Roman", "Songti SC", serif;
  --display: "IBM Plex Serif", Georgia, "Times New Roman", "Songti SC", serif;
  --sans: "IBM Plex Sans", "Segoe UI", -apple-system, Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --container: 72rem;
  --radius: 4px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e0f12;
  --paper: #17181c;
  --ink: #ebe8e1;
  --ink-soft: #9a968e;
  --ink-faint: #4d4c4a;
  --hairline: rgba(235, 232, 225, 0.14);
  --accent: #e0584a;
  --link: #6db3e6;
  --shadow: rgba(0, 0, 0, 0.6);
  --stars-alpha: 1;
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* three faint colour washes, fixed to the viewport and drifting very slowly — the homepage trick, alive */
body::before {
  content: ""; position: fixed; inset: -12%; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(60rem 40rem at 12% 8%, rgba(192, 57, 43, 0.08), transparent 62%),
    radial-gradient(55rem 45rem at 88% 26%, rgba(46, 134, 193, 0.09), transparent 64%),
    radial-gradient(50rem 40rem at 60% 96%, rgba(214, 158, 46, 0.08), transparent 62%);
  animation: drift 48s ease-in-out infinite alternate;
}
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(2.5%, -1.5%) scale(1.04); }
  100% { transform: translate(-2%, 2%) scale(1.02); }
}
:root[data-theme="dark"] body::before { display: none; }
body.no-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; }
::selection { background: var(--accent); color: #fff; }

.skip-link { position: absolute; left: -9999px; top: 0; padding: 0.6rem 1rem; background: var(--ink); color: var(--bg); z-index: 100; }
.skip-link:focus { left: 0; }

/* small caps label */
.eyebrow, .label,
.contents-list .num, .contents-list .count,
.series-num, .series-meta, .series-places,
.index-list .num, .rail-num,
.footer-links, .footer-copy,
.lb-meta, .topbar-link, .index-toggle {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow { color: var(--accent); margin-bottom: 1.1rem; }

/* ---------- stars (dark mode only) ---------- */

#stars {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: var(--stars-alpha);
  transition: opacity 0.6s ease;
}
:root:not([data-theme="dark"]) #stars { opacity: 0 !important; }
main, .site-footer, .topbar, .index-overlay, .lightbox, .rail { position: relative; z-index: 1; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem var(--gutter);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.topbar.scrolled { border-bottom-color: var(--hairline); }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand-mark { width: 1.7rem; height: 1.7rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.12)); transition: transform 0.25s ease; }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); }
.brand-name { font-family: var(--serif); font-size: 1.15rem; letter-spacing: 0.01em; }
:root[data-theme="dark"] .brand-mark, :root[data-theme="dark"] .footer-mark { content: url("../assets/sz-mark-light.svg"); }

.topbar-nav { display: flex; align-items: center; gap: 1.4rem; }
.topbar-link:hover, .index-toggle:hover { color: var(--accent); }
.topbar-link, .index-toggle { color: var(--ink); }
.index-toggle { display: none; }

.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; color: var(--ink); }
.theme-toggle:hover { color: var(--accent); }
.tt-icon { width: 1.1rem; height: 1.1rem; overflow: visible; }
.tt-icon .tt-core { transform-origin: 12px 12px; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.tt-icon .tt-mask-circle { transform: translate(14px, -12px); transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.tt-icon .tt-rays line { transform-origin: 12px 12px; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; }
.dark-active .tt-icon .tt-core { transform: rotate(-30deg) scale(1.35); }
.dark-active .tt-icon .tt-mask-circle { transform: translate(5px, -4px); }
.dark-active .tt-icon .tt-rays line { transform: scale(0); opacity: 0; }

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-group(lb-photo) { animation-duration: 0.55s; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
::view-transition-old(lb-photo), ::view-transition-new(lb-photo) { animation: none; mix-blend-mode: normal; height: 100%; overflow: hidden; }
::view-transition-new(lb-photo) { object-fit: cover; }
.lightbox.vt .lb-media img { transition: none; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
body, .topbar, .index-overlay, .lightbox { transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease; }

/* ---------- index overlay (small screens) ---------- */

.index-overlay {
  position: fixed; inset: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  overflow-y: auto; padding: 5rem 1.5rem;
}
.index-overlay.open { opacity: 1; visibility: visible; }
.index-list { list-style: none; width: min(100%, 24rem); }
.index-list li { border-bottom: 1px solid var(--hairline); }
.index-list a { display: flex; align-items: baseline; gap: 1rem; padding: 0.9rem 0; font-family: var(--serif); font-size: 1.35rem; }
.index-list .num { color: var(--accent); }
.index-list .count { margin-left: auto; font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.16em; color: var(--ink-soft); }

/* ---------- right rail (wide screens) ---------- */

.rail {
  position: fixed; right: 1.4rem; top: 50%; transform: translateY(-50%);
  display: none; flex-direction: column; gap: 0.35rem;
  z-index: 20;
}
.rail a {
  display: flex; align-items: center; justify-content: flex-end; gap: 0.7rem;
  padding: 0.25rem 0;
}
.rail-title {
  font-family: var(--serif); font-size: 0.9rem; color: var(--ink-soft);
  opacity: 0; transform: translateX(6px);
  transition: opacity 0.25s ease, transform 0.35s var(--ease), color 0.2s ease;
  white-space: nowrap;
}
.rail-num { font-size: 0.62rem; color: var(--ink-faint); transition: color 0.2s ease; width: 1.4rem; text-align: right; }
.rail a:hover .rail-title, .rail a.active .rail-title { opacity: 1; transform: none; }
.rail a:hover .rail-num, .rail a.active .rail-num { color: var(--accent); }
.rail a.active .rail-title { color: var(--ink); }
@media (min-width: 1240px) { .rail { display: flex; } }
.rail[hidden] { display: none !important; }

/* ---------- intro ---------- */

.container { max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.intro {
  max-width: var(--container); margin: 0 auto;
  padding: clamp(3.5rem, 9vh, 7rem) var(--gutter) clamp(3rem, 7vh, 5rem);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 3rem clamp(3rem, 8vw, 8rem);
  align-items: start;
}
.intro-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.intro-quote { margin: 1.5rem 0 0; max-width: 32em; }
.intro-statement {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: var(--ink);
  text-wrap: pretty;
}
/* the credit sits under the line, right-aligned, the way the homepage credits its lyric */
.intro-quote .quote-by { margin-top: 0.5rem; text-align: right; padding-right: 0.15em; }
.quote-by {
  font-family: var(--serif); font-size: 0.8rem; letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.quote-by:empty { display: none; }
.quote-by .dash { color: var(--accent); margin-right: 0.45em; }
.quote-by cite { font-style: italic; }

/* compass: hairline rose, red north, the needle is driven by main.js */
.compass { width: 4.2rem; height: 4.2rem; margin: 0 0 1.4rem -0.2rem; }
.compass svg { width: 100%; height: 100%; overflow: visible; }
.compass .c-ring { fill: none; stroke: var(--ink); stroke-width: 0.8; opacity: 0.55; }
.compass .c-ring2 { fill: none; stroke: var(--ink); stroke-width: 0.4; opacity: 0.25; stroke-dasharray: 1 3; }
.compass .c-ticks line { stroke: var(--ink); stroke-width: 0.6; opacity: 0.45; }
.compass .c-ticks line.major { stroke-width: 1.1; opacity: 0.8; }
.compass .c-l { font-family: var(--sans); font-size: 7.5px; font-weight: 600; letter-spacing: 0.05em; fill: var(--ink-soft); }
.compass .c-needle { transform-origin: 50px 50px; will-change: transform; }
.compass .c-n { fill: var(--accent); }
.compass .c-s { fill: var(--ink); opacity: 0.55; }
.compass .c-pin { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }





.intro-stats { margin-top: 2rem; font-size: 0.78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.intro-stats .n { color: var(--ink); font-weight: 500; }
.intro-stats .dot { margin: 0 0.6em; color: var(--ink-faint); }

.contents-list { list-style: none; border-top: 1px solid var(--hairline); }
.contents-list li { border-bottom: 1px solid var(--hairline); }
.contents-list a {
  display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: baseline; gap: 0.8rem;
  position: relative;
  padding: 0.7rem 0;
  transition: color 0.2s ease;
}
.contents-list a:hover .name { color: var(--accent); }
.contents-list .num { color: var(--accent); }
.contents-list .name { font-family: var(--serif); font-size: 1.15rem; transition: color 0.2s ease; }
.contents-list .count { white-space: nowrap; }


/* ---------- series ---------- */

.series {
  max-width: var(--container); margin: 0 auto;
  padding: clamp(2.5rem, 6vh, 4.5rem) var(--gutter) clamp(2rem, 5vh, 3.5rem);
  border-top: 1px solid var(--hairline);
}
.series-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1rem 2rem;
  margin-bottom: 1.6rem;
}
.series-num { display: block; color: var(--accent); margin-bottom: 0.6rem; }
.series-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.1; letter-spacing: -0.01em; }
.series-tagline { font-family: var(--serif); font-style: italic; color: var(--ink-soft); font-size: 1.05rem; margin-top: 0.5rem; }
.series-meta { text-align: right; line-height: 1.9; }
.series-places {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.55rem 2.2rem;
  margin: -0.4rem 0 1.9rem; max-width: 64rem;
  text-transform: none; letter-spacing: 0; font-weight: 400;
}
.pl { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.7rem; line-height: 1.55; min-width: 0; }
.pl.wide { grid-column: 1 / -1; }
.pl-label {
  font-family: var(--sans); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); white-space: nowrap;
}
.pl-names { font-family: var(--serif); font-size: 0.98rem; color: var(--ink); }
.pl-names .sep { margin: 0 0.15em; color: var(--ink-faint); }

/* ---------- home ---------- */

.view-all {
  margin-top: 0.6rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em;
  color: var(--accent);
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, gap 0.3s var(--ease);
}
.view-all:hover { border-bottom-color: var(--accent); gap: 0.8rem; }

/* ---------- series page (#/slug): everything in the series ---------- */

.series-page { max-width: var(--container); margin: 0 auto; padding: 2rem var(--gutter) 4rem; }
.back-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em; color: var(--ink-soft);
  margin-bottom: 2.5rem;
}
.back-link:hover { color: var(--accent); }
.series-page .series-head { margin-top: 0; }
.series-page .series-title { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }

.masonry { columns: 3 17rem; column-gap: 1.2rem; margin-top: 0.5rem; }
.photo-card {
  break-inside: avoid; margin-bottom: 1.2rem;
  cursor: zoom-in;
}
.photo-frame {
  position: relative; overflow: hidden;
  background: var(--paper); border-radius: var(--radius);
  box-shadow: 0 1px 2px var(--shadow);
  aspect-ratio: var(--ar, 3 / 2);
}
.photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.7s ease, transform 0.9s var(--ease); }
.photo-frame img.swap-in { opacity: 0; transform: scale(1.08); transition: opacity 1.3s ease, transform 2.2s var(--ease); z-index: 2; }
.photo-frame img.swap-in.in { opacity: 1; transform: scale(1); }
.photo-caption { transition: opacity 0.35s ease, transform 0.45s var(--ease); }
.photo-caption.fade { opacity: 0; transform: translateY(5px); }
.photo-card { transition: transform 0.6s var(--ease); }
.photo-card:hover { transform: translateY(-3px); }
.photo-card:hover .photo-frame { box-shadow: 0 14px 30px -14px var(--shadow), 0 1px 2px var(--shadow); }
.photo-frame { transition: box-shadow 0.6s ease; }
.photo-frame.loaded img { opacity: 1; }
.photo-card:hover .photo-frame img { transform: scale(1.03); }
.photo-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-caption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.1rem 0.8rem; margin-top: 0.45rem; }
.photo-caption .l { margin-left: auto; text-align: right; }
.photo-caption .t { font-family: var(--serif); font-size: 0.92rem; }
.photo-caption .l { font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }

/* reveal — staggered with --d, cards also un-blur */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s ease var(--d, 0ms), transform 0.9s var(--ease) var(--d, 0ms), filter 0.9s ease var(--d, 0ms); }
.photo-card.reveal { transform: translateY(26px) scale(0.97); filter: blur(8px); }
.contents-list li.reveal { transform: translateX(-10px); }
.reveal.visible, .photo-card.reveal.visible, .contents-list li.reveal.visible { opacity: 1; transform: none; filter: none; }

/* intro: words rise out of a mask */
.intro-title .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.intro-title .w > span { display: inline-block; transform: translateY(105%); animation: rise 1s var(--ease) var(--d, 0ms) both; }
@keyframes rise { to { transform: none; } }
.compass { animation: fadeUp 0.9s var(--ease) 0ms both; }
.intro-text > .eyebrow { animation: fadeUp 0.8s var(--ease) 120ms both; }
.intro-statement { animation: fadeUp 0.9s var(--ease) 400ms both; }
.intro-quote .quote-by { animation: fadeUp 0.9s var(--ease) 480ms both; }
.intro-stats { animation: fadeUp 0.9s var(--ease) 560ms both; }
.contents > .eyebrow { animation: fadeUp 0.8s var(--ease) 260ms both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.intro { will-change: transform, opacity; }

/* view switch (home ⇄ series page) */
.page-in { animation: pageIn 0.6s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- footer ---------- */

.site-footer {
  max-width: var(--container); margin: 0 auto;
  border-top: 1px solid var(--hairline);
  text-align: center;
  padding: 4rem var(--gutter) 3rem;
}
.footer-mark { content: url("../assets/sz-mark-light.svg"); }

.topbar-nav { display: flex; align-items: center; gap: 1.4rem; }
.topbar-link:hover, .index-toggle:hover { color: var(--accent); }
.topbar-link, .index-toggle { color: var(--ink); }
.index-toggle { display: none; }

.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; color: var(--ink); }
.theme-toggle:hover { color: var(--accent); }
.tt-icon { width: 1.1rem; height: 1.1rem; overflow: visible; }
.tt-icon .tt-core { transform-origin: 12px 12px; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.tt-icon .tt-mask-circle { transform: translate(14px, -12px); transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.tt-icon .tt-rays line { transform-origin: 12px 12px; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; }
.dark-active .tt-icon .tt-core { transform: rotate(-30deg) scale(1.35); }
.dark-active .tt-icon .tt-mask-circle { transform: translate(5px, -4px); }
.dark-active .tt-icon .tt-rays line { transform: scale(0); opacity: 0; }

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-group(lb-photo) { animation-duration: 0.55s; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
::view-transition-old(lb-photo), ::view-transition-new(lb-photo) { animation: none; mix-blend-mode: normal; height: 100%; overflow: hidden; }
::view-transition-new(lb-photo) { object-fit: cover; }
.lightbox.vt .lb-media img { transition: none; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
body, .topbar, .index-overlay, .lightbox { transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease; }

/* ---------- index overlay (small screens) ---------- */

.index-overlay {
  position: fixed; inset: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  overflow-y: auto; padding: 5rem 1.5rem;
}
.index-overlay.open { opacity: 1; visibility: visible; }
.index-list { list-style: none; width: min(100%, 24rem); }
.index-list li { border-bottom: 1px solid var(--hairline); }
.index-list a { display: flex; align-items: baseline; gap: 1rem; padding: 0.9rem 0; font-family: var(--serif); font-size: 1.35rem; }
.index-list .num { color: var(--accent); }
.index-list .count { margin-left: auto; font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.16em; color: var(--ink-soft); }

/* ---------- right rail (wide screens) ---------- */

.rail {
  position: fixed; right: 1.4rem; top: 50%; transform: translateY(-50%);
  display: none; flex-direction: column; gap: 0.35rem;
  z-index: 20;
}
.rail a {
  display: flex; align-items: center; justify-content: flex-end; gap: 0.7rem;
  padding: 0.25rem 0;
}
.rail-title {
  font-family: var(--serif); font-size: 0.9rem; color: var(--ink-soft);
  opacity: 0; transform: translateX(6px);
  transition: opacity 0.25s ease, transform 0.35s var(--ease), color 0.2s ease;
  white-space: nowrap;
}
.rail-num { font-size: 0.62rem; color: var(--ink-faint); transition: color 0.2s ease; width: 1.4rem; text-align: right; }
.rail a:hover .rail-title, .rail a.active .rail-title { opacity: 1; transform: none; }
.rail a:hover .rail-num, .rail a.active .rail-num { color: var(--accent); }
.rail a.active .rail-title { color: var(--ink); }
@media (min-width: 1240px) { .rail { display: flex; } }
.rail[hidden] { display: none !important; }

/* ---------- intro ---------- */

.container { max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.intro {
  max-width: var(--container); margin: 0 auto;
  padding: clamp(3.5rem, 9vh, 7rem) var(--gutter) clamp(3rem, 7vh, 5rem);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 3rem clamp(3rem, 8vw, 8rem);
  align-items: start;
}
.contents-list { list-style: none; border-top: 1px solid var(--hairline); }
.contents-list li { border-bottom: 1px solid var(--hairline); }
.contents-list a {
  display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: baseline; gap: 0.8rem;
  position: relative;
  padding: 0.7rem 0;
  transition: color 0.2s ease;
}
.contents-list a:hover .name { color: var(--accent); }
.contents-list .num { color: var(--accent); }
.contents-list .name { font-family: var(--serif); font-size: 1.15rem; transition: color 0.2s ease; }
.contents-list .count { white-space: nowrap; }

/* ---------- series ---------- */

.series {
  max-width: var(--container); margin: 0 auto;
  padding: clamp(2.5rem, 6vh, 4.5rem) var(--gutter) clamp(2rem, 5vh, 3.5rem);
  border-top: 1px solid var(--hairline);
}
.series-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1rem 2rem;
  margin-bottom: 1.6rem;
}
.series-num { display: block; color: var(--accent); margin-bottom: 0.6rem; }
.series-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.1; letter-spacing: -0.01em; }
.series-tagline { font-family: var(--serif); font-style: italic; color: var(--ink-soft); font-size: 1.05rem; margin-top: 0.5rem; }
.series-meta { text-align: right; line-height: 1.9; }
.series-places {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.55rem 2.2rem;
  margin: -0.4rem 0 1.9rem; max-width: 64rem;
  text-transform: none; letter-spacing: 0; font-weight: 400;
}
.pl { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.7rem; line-height: 1.55; min-width: 0; }
.pl.wide { grid-column: 1 / -1; }
.pl-label {
  font-family: var(--sans); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); white-space: nowrap;
}
.pl-names { font-family: var(--serif); font-size: 0.98rem; color: var(--ink); }
.pl-names .sep { margin: 0 0.15em; color: var(--ink-faint); }

/* ---------- home ---------- */

.view-all {
  margin-top: 0.6rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em;
  color: var(--accent);
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, gap 0.3s var(--ease);
}
.view-all:hover { border-bottom-color: var(--accent); gap: 0.8rem; }

/* ---------- series page (#/slug): everything in the series ---------- */

.series-page { max-width: var(--container); margin: 0 auto; padding: 2rem var(--gutter) 4rem; }
.back-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em; color: var(--ink-soft);
  margin-bottom: 2.5rem;
}
.back-link:hover { color: var(--accent); }
.series-page .series-head { margin-top: 0; }
.series-page .series-title { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }

.masonry { columns: 3 17rem; column-gap: 1.2rem; margin-top: 0.5rem; }
.photo-card {
  break-inside: avoid; margin-bottom: 1.2rem;
  cursor: zoom-in;
}
.photo-frame {
  position: relative; overflow: hidden;
  background: var(--paper); border-radius: var(--radius);
  box-shadow: 0 1px 2px var(--shadow);
  aspect-ratio: var(--ar, 3 / 2);
}
.photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.7s ease, transform 0.9s var(--ease); }
.photo-frame img.swap-in { opacity: 0; transform: scale(1.08); transition: opacity 1.3s ease, transform 2.2s var(--ease); z-index: 2; }
.photo-frame img.swap-in.in { opacity: 1; transform: scale(1); }
.photo-caption { transition: opacity 0.35s ease, transform 0.45s var(--ease); }
.photo-caption.fade { opacity: 0; transform: translateY(5px); }
.photo-card { transition: transform 0.6s var(--ease); }
.photo-card:hover { transform: translateY(-3px); }
.photo-card:hover .photo-frame { box-shadow: 0 14px 30px -14px var(--shadow), 0 1px 2px var(--shadow); }
.photo-frame { transition: box-shadow 0.6s ease; }
.photo-frame.loaded img { opacity: 1; }
.photo-card:hover .photo-frame img { transform: scale(1.03); }
.photo-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-caption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.1rem 0.8rem; margin-top: 0.45rem; }
.photo-caption .l { margin-left: auto; text-align: right; }
.photo-caption .t { font-family: var(--serif); font-size: 0.92rem; }
.photo-caption .l { font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }

/* reveal — staggered with --d, cards also un-blur */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s ease var(--d, 0ms), transform 0.9s var(--ease) var(--d, 0ms), filter 0.9s ease var(--d, 0ms); }
.photo-card.reveal { transform: translateY(26px) scale(0.97); filter: blur(8px); }
.contents-list li.reveal { transform: translateX(-10px); }
.reveal.visible, .photo-card.reveal.visible, .contents-list li.reveal.visible { opacity: 1; transform: none; filter: none; }

/* intro: words rise out of a mask */
.intro-title .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.intro-title .w > span { display: inline-block; transform: translateY(105%); animation: rise 1s var(--ease) var(--d, 0ms) both; }
@keyframes rise { to { transform: none; } }
.intro-text > .eyebrow { animation: fadeUp 0.8s var(--ease) 0ms both; }
.footer-mark { width: 2.2rem; height: 2.2rem; margin: 0 auto 1rem; }
.footer-name { font-family: var(--serif); font-size: 1.4rem; }
.footer-statement { font-family: var(--serif); font-size: 1.05rem; letter-spacing: 0.03em; color: var(--ink-soft); margin-top: 0.5rem; }
.footer-by { margin-top: 0.3rem; }
.footer-links { display: flex; justify-content: center; gap: 1.8rem; margin: 1.8rem 0 1.4rem; }
.footer-links a { color: var(--ink); }
.footer-links a:hover { color: var(--accent); }
.footer-copy { letter-spacing: 0.06em; text-transform: none; font-size: 0.72rem; }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  touch-action: pan-y;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-figure { width: 100%; text-align: center; padding: 0 var(--gutter); }
.lb-media { display: flex; align-items: center; justify-content: center; min-height: 40vh; }
.lb-media img {
  max-width: min(94vw, 90rem); max-height: 80vh; width: auto; height: auto;
  border-radius: var(--radius);
  box-shadow: 0 30px 60px -24px var(--shadow);
  opacity: 0; transform: scale(0.985);
  transition: opacity 0.35s ease, transform 0.45s var(--ease);
}
.lb-media img.in { opacity: 1; transform: none; }
.lightbox.vt .lb-media img { opacity: 1; transform: none; }
.lb-caption { margin-top: 1rem; }
.lb-line { display: flex; justify-content: center; align-items: baseline; gap: 1.2rem; }
.lb-title { font-family: var(--serif); font-size: 1.1rem; }
.lb-exif {
  margin-top: 0.45rem; font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.05em;
  color: var(--ink-soft); font-variant-numeric: tabular-nums; min-height: 1em;
}
.lb-exif .cam { color: var(--ink); font-weight: 500; }
.lb-exif .sep { margin: 0 0.55em; color: var(--ink-faint); }
.lb-figure { padding-bottom: 4.2rem; }

.lb-strip {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 61;
  display: flex; gap: 6px; padding: 0.7rem var(--gutter) 0.9rem;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
  justify-content: safe center;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.lb-strip::-webkit-scrollbar { display: none; }
.lb-strip button {
  flex: 0 0 auto; height: 2.6rem; aspect-ratio: var(--ar, 3 / 2); padding: 0;
  border-radius: 2px; overflow: hidden; opacity: 0.45; scroll-snap-align: center;
  transition: opacity 0.3s ease, transform 0.4s var(--ease), box-shadow 0.3s ease;
}
.lb-strip button img { width: 100%; height: 100%; object-fit: cover; }
.lb-strip button:hover { opacity: 0.85; }
.lb-strip button.on { opacity: 1; transform: translateY(-3px); box-shadow: 0 0 0 1.5px var(--accent), 0 6px 14px -6px var(--shadow); }
.lb-close, .lb-nav {
  position: absolute; z-index: 61;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.8rem; height: 2.8rem; border-radius: 50%;
  color: var(--ink-soft);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.lb-close:hover, .lb-nav:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.lb-close { top: 1rem; right: var(--gutter); }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: calc(var(--gutter) - 0.5rem); }
.lb-next { right: calc(var(--gutter) - 0.5rem); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 640px) {
  .topbar-link { display: none; }
  .index-toggle { display: inline; }
  .series-head { grid-template-columns: 1fr; align-items: start; }
  .series-meta { text-align: left; line-height: 1.6; }
  .masonry { columns: 2 8rem; column-gap: 0.6rem; }
  .photo-card { margin-bottom: 0.6rem; }
  .photo-caption { flex-direction: column; gap: 0.1rem; }
  .lb-nav { display: none; }
  .lb-media img { max-height: 66vh; }
  .lb-strip button { height: 2.2rem; }
  .series-places { grid-template-columns: 1fr; gap: 0.35rem; }
  .contents-list .peek { display: none; }
}

/* ---------- atlas ---------- */

.atlas {
  max-width: var(--container); margin: 0 auto;
  padding: clamp(2rem, 5vh, 3.5rem) var(--gutter) clamp(3rem, 7vh, 5rem);
  border-top: 1px solid var(--hairline);
}
.atlas-head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 1.6rem; }
.atlas-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.1; letter-spacing: -0.01em; }
.atlas-stats { font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); text-align: right; line-height: 1.9; white-space: nowrap; }

.atlas-frame { position: relative; }
.atlas-map { display: flex; gap: 1rem; align-items: stretch; }
.plate {
  position: relative; flex: 1 1 0; min-width: 0;
  background: var(--paper); border-radius: 6px; overflow: hidden;
  box-shadow: 0 1px 2px var(--shadow), 0 20px 50px -30px var(--shadow);
}
.plate::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 70px color-mix(in srgb, var(--bg) 65%, transparent);
}
.plate svg { display: block; width: 100%; height: auto; }
.plate-name {
  position: absolute; left: 0.9rem; bottom: 0.7rem; z-index: 2;
  font-family: var(--serif); font-style: italic; font-size: 0.85rem; color: var(--ink-soft);
}

/* engraved-atlas look: tinted sea with water-lining along the coast, land with a fine coastline, dashed frontiers, spaced caps for countries and italics for seas */
.atlas-map { --sea: #5b87a8; --sea-tint: 9%; }
:root[data-theme="dark"] .atlas-map { --sea: #6f9cc2; --sea-tint: 11%; }
.atlas-map .sea-hi { stop-color: color-mix(in srgb, var(--sea) calc(var(--sea-tint) * 0.6), var(--paper)); }
.atlas-map .sea-lo { stop-color: color-mix(in srgb, var(--sea) var(--sea-tint), var(--paper)); }
.atlas-map .grat { fill: none; stroke: color-mix(in srgb, var(--sea) 22%, transparent); stroke-width: 0.8; stroke-dasharray: 2 6; }
.atlas-map .ripples use { fill: none; stroke-linejoin: round; }
.atlas-map .ripples .ring { stroke: color-mix(in srgb, var(--sea) 45%, var(--paper)); }
:root[data-theme="dark"] .atlas-map .ripples .ring { stroke: color-mix(in srgb, var(--sea) 42%, var(--paper)); }
.atlas-map .land { fill: color-mix(in srgb, var(--ink) 6%, var(--paper)); stroke: color-mix(in srgb, var(--ink) 45%, transparent); stroke-width: 1; stroke-linejoin: round; fill-rule: evenodd; }
:root[data-theme="dark"] .atlas-map .land { fill: color-mix(in srgb, var(--ink) 9%, var(--paper)); stroke: color-mix(in srgb, var(--ink) 42%, transparent); }
.atlas-map .lake { fill: color-mix(in srgb, var(--sea) var(--sea-tint), var(--paper)); stroke: color-mix(in srgb, var(--ink) 30%, transparent); stroke-width: 0.7; fill-rule: evenodd; }
.atlas-map .border { fill: none; stroke: color-mix(in srgb, var(--ink) 30%, transparent); stroke-width: 0.9; stroke-dasharray: 5 2.5 1 2.5; stroke-linejoin: round; }
.atlas-map .names, .atlas-map .frame { pointer-events: none; }
.atlas-map .names text { paint-order: stroke; stroke-linejoin: round; }
.atlas-map .country {
  font-family: var(--sans); font-weight: 500; text-transform: uppercase;
  fill: color-mix(in srgb, var(--ink) 42%, transparent); stroke: color-mix(in srgb, var(--ink) 6%, var(--paper)); stroke-width: 3;
}
.atlas-map .t-C { font-size: 14px; letter-spacing: 0.42em; }
.atlas-map .t-c { font-size: 11.5px; letter-spacing: 0.3em; }
.atlas-map .t-k { font-size: 9.5px; letter-spacing: 0.2em; fill: color-mix(in srgb, var(--ink) 36%, transparent); }
:root[data-theme="dark"] .atlas-map .country { stroke: color-mix(in srgb, var(--ink) 9%, var(--paper)); }
.atlas-map .sea-name { font-family: var(--serif); font-style: italic; fill: color-mix(in srgb, var(--sea) 72%, var(--ink-soft)); }
.atlas-map .t-O { font-size: 17px; letter-spacing: 0.34em; text-transform: uppercase; }
.atlas-map .t-s { font-size: 15px; letter-spacing: 0.16em; }
.atlas-map .t-g { font-size: 12.5px; letter-spacing: 0.12em; }
.atlas-map .frame .margin { fill: var(--paper); fill-rule: evenodd; }
.atlas-map .frame .band { fill: color-mix(in srgb, var(--ink) 55%, var(--paper)); }
.atlas-map .frame .rule { fill: none; stroke: color-mix(in srgb, var(--ink) 55%, var(--paper)); stroke-width: 1; }
.atlas-map .frame .rule.thin { stroke-width: 0.6; }
.atlas-map .frame text { font-family: var(--sans); font-size: 9.5px; letter-spacing: 0.08em; fill: color-mix(in srgb, var(--ink) 50%, transparent); paint-order: stroke; stroke: color-mix(in srgb, var(--sea) var(--sea-tint), var(--paper)); stroke-width: 3; }
.atlas-map .scale rect { stroke: color-mix(in srgb, var(--ink) 55%, var(--paper)); stroke-width: 0.6; }
.atlas-map .scale .f { fill: color-mix(in srgb, var(--ink) 55%, var(--paper)); }
.atlas-map .scale .o { fill: var(--paper); }
.atlas-map .scale .card { fill: color-mix(in srgb, var(--paper) 82%, transparent); stroke: none; }

/* one visited place = a dot, a ring that breathes, and a label on hover */
.atlas-map .pin { cursor: pointer; transform-box: fill-box; transform-origin: center; }
.atlas-map .pin:not(.on) { opacity: 0; transform: scale(0.2); pointer-events: none; }
.atlas-map .pin.on { opacity: 1; transform: none; transition: opacity 0.3s ease, transform 0.35s var(--ease); }
.atlas-map .pin.pop { animation: pinPop 0.6s var(--ease); }
@keyframes pinPop { 0% { transform: scale(0.2); opacity: 0; } 55% { transform: scale(1.5); opacity: 1; } 100% { transform: scale(1); } }
.atlas-map .pin circle.dot { fill: var(--accent); stroke: var(--paper); stroke-width: 2.4; transition: r 0.3s var(--ease); }
.atlas-map .pin circle.halo { fill: var(--accent); opacity: 0; }
.atlas-map .pin:hover circle.dot, .atlas-map .pin:focus-visible circle.dot, .atlas-map .pin.current circle.dot { r: 12; }
.atlas-map .pin:focus-visible { outline: none; }
.atlas-map .pin .lbl {
  font-family: "Georgia", serif; font-size: 21px; fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 5px; stroke-linejoin: round;
  opacity: 0; transition: opacity 0.25s ease; pointer-events: none;
}
.atlas-map .pin:hover .lbl, .atlas-map .pin.named.on .lbl, .atlas-map .pin.current .lbl { opacity: 1; }
.atlas-map .pin.current .lbl { font-style: italic; }

/* each arrival sends one ripple; once the journey is done every city breathes slowly */
.atlas-map .pin.pop circle.halo { animation: halo 1.1s ease-out; }
.atlas-frame.done:not(.playing) .atlas-map .pin.on circle.halo { animation: halo 3.4s ease-out infinite; animation-delay: calc(var(--j, 0) * 700ms); }
@keyframes halo { 0% { r: 6; opacity: 0.5; } 70% { r: 34; opacity: 0; } 100% { r: 34; opacity: 0; } }

/* the route: arcs draw themselves from city to city; a bright comet rides the leading edge */
.atlas-map .arc { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; opacity: 0; transition: opacity 0.9s ease; }
.atlas-map .arc.live { stroke-width: 3; transition: none; }
.atlas-map .comet { fill: var(--paper); stroke: var(--accent); stroke-width: 3.5; pointer-events: none; filter: drop-shadow(0 0 5px var(--accent)); }
:root[data-theme="dark"] .atlas-map .arc { filter: drop-shadow(0 0 3px var(--accent)); }
:root[data-theme="dark"] .atlas-map .pin circle.dot { filter: drop-shadow(0 0 4px var(--accent)); }

/* ---------- journey bar ---------- */
.journey {
  display: grid; grid-template-columns: auto minmax(11rem, 14rem) 1fr; align-items: center; gap: 1rem 1.3rem;
  margin-top: 1.1rem; padding: 0.2rem 0.2rem 0;
}
.jr-play {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center;
  color: var(--paper); background: var(--accent);
  box-shadow: 0 4px 14px -6px var(--accent);
  transition: transform 0.3s var(--ease), box-shadow 0.3s ease;
}
.jr-play:hover { transform: scale(1.07); box-shadow: 0 6px 18px -6px var(--accent); }
.jr-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.jr-play svg { width: 1.05rem; height: 1.05rem; display: none; }
.jr-play[data-state="play"] .i-play, .jr-play[data-state="pause"] .i-pause, .jr-play[data-state="replay"] .i-replay { display: block; }
.jr-now { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.jr-date { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.jr-place { font-family: var(--sans); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); min-height: 1.3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jr-track { position: relative; height: 2.4rem; }
.jr-rail { position: absolute; left: 0; right: 0; top: 0.95rem; height: 2px; border-radius: 2px; background: var(--hairline); overflow: hidden; }
.jr-fill { height: 100%; width: 0; background: var(--accent); }
.jr-marks i { position: absolute; top: calc(0.95rem - 2px); width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 1px var(--ink-faint); }
.jr-year { position: absolute; top: 1.55rem; transform: translateX(-50%); font-family: var(--sans); font-size: 0.6rem; font-weight: 500; letter-spacing: 0.12em; color: var(--ink-soft); }
.jr-range { position: absolute; inset: 0; width: 100%; margin: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
.jr-range:focus { outline: none; }
.jr-range::-webkit-slider-runnable-track { height: 2.4rem; background: transparent; }
.jr-range::-moz-range-track { height: 2.4rem; background: transparent; }
.jr-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 15px; height: 15px; margin-top: calc(0.95rem - 6.5px); border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); box-shadow: 0 2px 6px var(--shadow); }
.jr-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); box-shadow: 0 2px 6px var(--shadow); }
.jr-range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }


.atlas-tip {
  position: absolute; z-index: 3; pointer-events: none;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.7rem 0.4rem 0.4rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 4px; box-shadow: 0 8px 24px -8px var(--shadow), 0 0 0 1px var(--hairline);
  transform: translate(-50%, calc(-100% - 14px));
  transition: opacity 0.2s ease, transform 0.3s var(--ease);
  white-space: nowrap;
}
.atlas-tip[hidden] { display: flex; opacity: 0; transform: translate(-50%, calc(-100% - 6px)); }
.atlas-tip img { width: 3.4rem; height: 2.5rem; object-fit: cover; border-radius: 2px; }
.atlas-tip b { display: block; font-family: var(--serif); font-weight: 400; font-size: 0.95rem; line-height: 1.2; }
.atlas-tip span { font-family: var(--sans); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }

@media (max-width: 760px) {
  .atlas-head { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .atlas-stats { text-align: left; }
  .atlas-map { flex-direction: column; }
  .plate { flex: 0 0 auto !important; }
  .atlas-map .pin .lbl { font-size: 24px; }
  .journey { grid-template-columns: auto 1fr; }
  .jr-track { grid-column: 1 / -1; }
}

/* screenshot mode: every entrance already finished */
html.noreveal .atlas-map .land, html.noreveal .intro-title .w > span,
html.noreveal .intro-text > .eyebrow, html.noreveal .intro-statement, html.noreveal .intro-quote .quote-by, html.noreveal .compass, html.noreveal .intro-stats, html.noreveal .contents > .eyebrow {
  animation: none !important; opacity: 1 !important; transform: none !important;
}

/* ---------- visitors ---------- */
.visitors {
  max-width: var(--container); margin: 0 auto;
  padding: clamp(2rem, 5vh, 3.5rem) var(--gutter) clamp(3rem, 7vh, 5rem);
  border-top: 1px solid var(--hairline);
}
/* the square is reserved up front so the lazy iframe doesn't shift the page. The widget
   page declares no colour scheme, so pin "light" to match it; otherwise dark mode paints
   an opaque white backdrop behind the transparent iframe. */
.visitors-globe { width: 300px; max-width: 100%; aspect-ratio: 1 / 1; margin: 0 auto; color-scheme: light; }
@media (max-width: 760px) {
  .visitors .atlas-head { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .visitors .atlas-stats { text-align: left; }
}
.jr-year.end { transform: translateX(calc(-100% + 3px)); }
.jr-year.start { transform: translateX(-3px); }
.pl-names .nm { white-space: nowrap; }

/* ---------- passport ---------- */
.passport {
  position: relative; margin: 0 0 1.4rem; padding: 1.6rem 1.8rem 1.5rem;
  background: var(--paper); border-radius: 6px;
  box-shadow: 0 1px 2px var(--shadow), 0 20px 50px -30px var(--shadow);
  overflow: hidden;
}
.passport::before { content: none; }
.passport > * { position: relative; }
.pp-top { display: flex; align-items: flex-end; gap: 1.6rem; flex-wrap: wrap; }
.pp-count { display: flex; align-items: baseline; gap: 0.5rem; line-height: 0.85; }
.pp-n {
  font-family: var(--display); font-size: clamp(4.2rem, 9vw, 6.8rem); font-weight: 400; color: var(--accent);
  font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
}
.pp-of { font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 2rem); color: var(--ink-soft); }
.pp-words { padding-bottom: 0.45rem; }
.pp-label { font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink); }
.pp-dream {
  margin-top: 0.35rem; font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--ink-soft);
}
.pp-dream .sep { margin: 0 0.5em; color: var(--ink-faint); font-style: normal; }

.pp-bar { margin: 1.2rem 0 1.3rem; height: 3px; border-radius: 3px; background: var(--hairline); overflow: hidden; }
.pp-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 1.6s var(--ease) 0.25s; }

.pp-ledger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--hairline); }
.pp-c {
  display: grid; grid-template-columns: 2.6rem 1fr; grid-template-rows: auto auto; column-gap: 0.75rem; row-gap: 0.35rem; align-items: center;
  padding: 0.85rem 1rem 0.85rem 0; border-bottom: 1px solid var(--hairline);
}
.pp-c:not(:nth-child(3n)) { border-right: 1px solid var(--hairline); }
.pp-c:not(:nth-child(3n+1)) { padding-left: 1rem; }
.pp-ring { width: 2.6rem; height: 2.6rem; transform: rotate(-90deg); grid-row: 1 / 3; }
.pp-ring-bg { fill: none; stroke: var(--hairline); stroke-width: 3; }
.pp-ring-fg { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: var(--len); stroke-dashoffset: var(--len); transition: stroke-dashoffset 1.6s var(--ease); transition-delay: calc(0.45s + var(--row, 0) * 110ms); }
.passport.open .pp-ring-fg { stroke-dashoffset: var(--to); }
.pp-ring-t { transform: rotate(90deg); transform-origin: 24px 24px; text-anchor: middle; dominant-baseline: central;
  font-family: var(--sans); font-size: 9.5px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.pp-c.none .pp-ring-t { fill: var(--ink-faint); }
.pp-ch { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; min-width: 0; }
.pp-cn { font-family: var(--serif); font-size: 1.02rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-c.none .pp-cn { color: var(--ink-soft); }
.pp-cv { font-family: var(--sans); font-size: 0.66rem; letter-spacing: 0.06em; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-cv b { color: var(--accent); font-weight: 600; font-size: 0.82rem; }
.pp-c.none .pp-cv b { color: var(--ink-faint); }
.pp-codes { display: flex; flex-wrap: wrap; gap: 0.15rem 0.45rem; font-family: var(--sans); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.1em; color: var(--accent); min-height: 1em; }
.pp-codes span { cursor: default; }
.pp-codes em { font-family: var(--serif); font-weight: 400; letter-spacing: 0.02em; font-size: 0.8rem; color: var(--ink-faint); }

.stamp {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 4.6rem; height: 4.6rem; border-radius: 50%;
  border: 1.5px solid var(--accent); box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent); text-align: center; line-height: 1.05;
  transform: rotate(var(--r)) scale(0.4); opacity: 0;
  transition: transform 0.55s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.3s ease;
  transition-delay: calc(0.6s + var(--i) * 55ms);
  mix-blend-mode: multiply; cursor: default;
}
.passport.open .stamp { transform: rotate(var(--r)) scale(1); opacity: 0.88; }
.stamp:hover { opacity: 1; transform: rotate(0deg) scale(1.08) !important; transition-delay: 0s; }
.stamp b { font-family: var(--sans); font-size: 0.92rem; font-weight: 700; letter-spacing: 0.08em; }
.stamp small { font-family: var(--sans); font-size: 0.48rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 0.15rem; max-width: 3.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stamp em { font-family: var(--sans); font-style: normal; font-size: 0.55rem; letter-spacing: 0.12em; margin-top: 0.12rem; opacity: 0.8; }
:root[data-theme="dark"] .stamp { mix-blend-mode: normal; box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent); }

@media (max-width: 900px) { .pp-ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pp-c:not(:nth-child(3n)) { border-right: 0; } .pp-c:not(:nth-child(3n+1)) { padding-left: 0; } .pp-c:nth-child(odd) { border-right: 1px solid var(--hairline); } .pp-c:nth-child(even) { padding-left: 1rem; } }
@media (max-width: 560px) {
  .passport { padding: 1.3rem 1.1rem 1.2rem; }
  .pp-top { gap: 0.4rem 1rem; }
  .stamp { width: 4.1rem; height: 4.1rem; }
}
html.noreveal .stamp { transition: none; }

/* ---------- reading progress ---------- */
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); transform-origin: left; transform: scaleX(0); pointer-events: none; }

/* ---------- soundtrack ---------- */
.soundtrack { position: fixed; left: 1.1rem; bottom: 1.1rem; z-index: 45; display: flex; align-items: center; gap: 0.7rem; }
.st-disc { position: relative; width: 3.4rem; height: 3.4rem; border-radius: 50%; padding: 0; flex: 0 0 auto;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.25)); transition: transform 0.35s var(--ease); }
.st-disc:hover { transform: scale(1.06); }
.st-disc:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.st-vinyl { position: absolute; inset: 0; border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, #1b1b1e 0 1.5px, #26262b 1.5px 3px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), inset 0 0 12px rgba(0,0,0,0.6); }
.st-vinyl::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 40%, rgba(255,255,255,0.14) 50%, transparent 60% 100%); }
.st-label { position: absolute; left: 50%; top: 50%; width: 36%; height: 36%; transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--accent); box-shadow: inset 0 0 0 2px rgba(0,0,0,0.25); }
.st-label::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18%; height: 18%; transform: translate(-50%, -50%); border-radius: 50%; background: #1b1b1e; }
.soundtrack.playing .st-vinyl { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.st-meta { display: flex; flex-direction: column; line-height: 1.2; pointer-events: none;
  opacity: 0; transform: translateX(-6px); transition: opacity 0.3s ease, transform 0.4s var(--ease); }
.soundtrack:hover .st-meta, .soundtrack.playing .st-meta, .soundtrack.open .st-meta { opacity: 1; transform: none; }
.st-kicker { font-family: var(--sans); font-size: 0.56rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.st-title { font-family: var(--serif); font-style: italic; font-size: 0.98rem; color: var(--ink); white-space: nowrap; }
.st-artist { font-family: var(--sans); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.st-panel { position: absolute; left: 0; bottom: calc(100% + 0.7rem); width: min(22rem, calc(100vw - 2.2rem));
  background: var(--paper); border-radius: 12px; padding: 0.55rem; box-shadow: 0 2px 4px var(--shadow), 0 24px 50px -24px var(--shadow);
  animation: pageIn 0.4s var(--ease) both; }
.st-embed { min-height: 80px; border-radius: 10px; overflow: hidden; }
.st-embed iframe { display: block; border-radius: 10px; }
.st-foot { display: flex; justify-content: space-between; align-items: center; padding: 0.45rem 0.3rem 0.1rem; }
.st-alt { font-family: var(--sans); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.st-alt:hover { color: var(--accent); }
.st-close { width: 1.6rem; height: 1.6rem; border-radius: 50%; color: var(--ink-soft); font-size: 1.1rem; line-height: 1; }
.st-close:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
@media (max-width: 640px) {
  .soundtrack { left: 0.8rem; bottom: 0.8rem; }
  .st-disc { width: 2.9rem; height: 2.9rem; }
  .st-meta { display: none; }
  .compass { width: 3.4rem; height: 3.4rem; }
}

/* ---------- intro: photograph trail ---------- */
.intro { position: relative; }
.trail { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; }
.trail img {
  position: absolute; transform: translate(-50%, -50%);
  object-fit: cover; border-radius: 3px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.12);
  animation: trailLife 1.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes trailLife {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.72); }
  14%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  62%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -46%) scale(0.94); }
}

/* ---------- video ---------- */
.photo-frame .clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.8s ease; pointer-events: none; z-index: 1; }
.photo-frame.playing .clip { opacity: 1; }
.clip-badge {
  position: absolute; left: 0.6rem; bottom: 0.6rem; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.22rem 0.55rem 0.22rem 0.45rem; border-radius: 999px;
  background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: #fff; font-family: var(--sans); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.08em; font-variant-numeric: tabular-nums;
}
.clip-badge i { width: 0; height: 0; border-left: 6px solid #fff; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.photo-frame.playing .clip-badge i { width: 6px; height: 6px; border: 0; border-radius: 50%; background: var(--accent); animation: rec 1.6s ease-in-out infinite; }
@keyframes rec { 50% { opacity: 0.25; } }
.lb-media video.lb-video {
  max-width: min(94vw, 90rem); max-height: 80vh; width: auto; height: auto; display: block;
  border-radius: var(--radius); box-shadow: 0 30px 60px -24px var(--shadow); background: #000;
  opacity: 0; transition: opacity 0.35s ease;
}
.lb-media video.lb-video.in { opacity: 1; }
.lb-strip button.vid { position: relative; }
.lb-strip button.vid::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-40%, -50%);
  border-left: 7px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent; filter: drop-shadow(0 0 2px rgba(0,0,0,0.6)); }
@media (max-width: 640px) { .lb-media video.lb-video { max-height: 66vh; } }

/* ---------- atlas by continent ---------- */
.continents { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.ct {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.12rem;
  padding: 0.55rem 0.95rem 0.6rem; border-radius: 8px;
  border: 1px solid var(--hairline); background: color-mix(in srgb, var(--paper) 70%, transparent);
  text-align: left; transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.3s var(--ease), box-shadow 0.3s ease;
}
.ct-name { font-family: var(--serif); font-size: 1rem; color: var(--ink); }
.ct-num { font-family: var(--sans); font-size: 0.6rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ct:not(.empty):hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--hairline)); transform: translateY(-1px); }
.ct[aria-selected="true"] { background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 20px -12px var(--accent); }
.ct[aria-selected="true"] .ct-name, .ct[aria-selected="true"] .ct-num { color: #fff; }
.ct.empty { border-style: dashed; background: transparent; cursor: default; }
.ct.empty .ct-name { color: var(--ink-soft); }
.ct.empty .ct-num { font-family: var(--serif); font-style: italic; text-transform: none; letter-spacing: 0.02em; font-size: 0.78rem; color: var(--ink-faint); }
.ct:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.atlas-body { display: block; }
.atlas-frame.solo .atlas-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(15rem, 1fr); gap: 1rem; align-items: start; }
.plate[hidden] { display: none !important; }
.atlas-frame.solo .plate { flex: 1 1 100%; animation: pageIn 0.5s var(--ease) both; }

.atlas-side {
  background: var(--paper); border-radius: 6px; padding: 1.3rem 1.3rem 1.1rem;
  box-shadow: 0 1px 2px var(--shadow), 0 20px 50px -30px var(--shadow);
  max-height: 100%; overflow: auto;
}
.atlas-side.in { animation: pageIn 0.5s var(--ease) 80ms both; }
.as-kicker { font-family: var(--sans); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.as-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 0.7rem 0 0.4rem; }
.as-figs div { display: flex; flex-direction: column; }
.as-figs b { font-family: var(--serif); font-weight: 400; font-size: 2.1rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.as-figs span { font-family: var(--sans); font-size: 0.58rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin-top: 0.25rem; }
.as-since { font-family: var(--serif); font-style: italic; font-size: 0.88rem; color: var(--ink-soft); padding-bottom: 0.9rem; border-bottom: 1px solid var(--hairline); }
.as-list { display: flex; flex-direction: column; }
.as-country { padding: 0.7rem 0; border-bottom: 1px solid var(--hairline); }
.as-cn { display: block; font-family: var(--sans); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.4rem; }
.as-cities { display: flex; flex-wrap: wrap; gap: 0.3rem 0.35rem; }
.as-city {
  display: inline-flex; align-items: baseline; gap: 0.35rem; padding: 0.18rem 0.55rem; border-radius: 999px;
  font-family: var(--serif); font-size: 0.88rem; color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.as-city i { font-style: normal; font-family: var(--sans); font-size: 0.6rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.as-city:hover { background: var(--accent); color: #fff; }
.as-city:hover i { color: rgba(255,255,255,0.8); }
/* the pin of the city under the pointer in the list */
.atlas-map .pin.hl circle.dot { r: 13; }
.atlas-map .pin.hl .lbl { opacity: 1; }
.atlas-map .pin.hl circle.halo { animation: halo 1.2s ease-out infinite; }

@media (max-width: 900px) {
  .atlas-frame.solo .atlas-body { grid-template-columns: 1fr; }
  .continents { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.2rem; }
  .continents::-webkit-scrollbar { display: none; }
  .ct { flex: 0 0 auto; }
}
html.noreveal .reveal, html.noreveal .atlas-side.in, html.noreveal .atlas-frame.solo .plate { transition: none !important; animation: none !important; }

/* passport, refined: quiet card, softer rules, numbers do the talking */
.passport { border-radius: 14px; box-shadow: 0 1px 2px var(--shadow), 0 24px 60px -36px var(--shadow); }
.pp-bar { height: 4px; margin: 1.1rem 0 0.4rem; }
.pp-ledger { border-top: 0; margin-top: 0.6rem; gap: 0.6rem; }
.pp-c, .pp-c:not(:nth-child(3n)), .pp-c:nth-child(odd) { border: 0; padding: 0.85rem 0.9rem; }
.pp-c { background: color-mix(in srgb, var(--ink) 3%, transparent); border-radius: 10px; }
.pp-c.none { background: transparent; box-shadow: inset 0 0 0 1px var(--hairline); }
.pp-ch { flex-wrap: wrap; row-gap: 0.1rem; }
.pp-cn { overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.2; }
@media (max-width: 900px) {
  .pp-c, .pp-c:nth-child(even), .pp-c:not(:nth-child(3n+1)) { padding: 0.75rem 0.75rem; }
  .pp-ch { flex-direction: column; align-items: flex-start; }
}

