/* ==========================================================================
   Explore Venture World — main stylesheet
   ========================================================================== */

/* ---------- Design tokens (chosen 2026-09-30: ocean palette, Archivo + Source Serif 4, Schibsted Grotesk headings) ---------- */
:root {
  /* colour */
  --ink: #0c2230;
  --ink-2: #14354a;
  --paper: #f3f5f2;
  --paper-2: #e5ebe8;
  --card: #ffffff;
  --accent: #1f5f66;
  --red: #d7141e;
  --red-ink: #b50f18;
  --line: #c6d0cc;
  --muted: #4b5f66;
  --on-ink: #eef3f1;
  --on-ink-muted: #a7bbbe;
  --on-ink-line: rgb(238 243 241 / 0.14);

  /* type */
  --f-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Source Serif 4", Georgia, serif;
  --display-stretch: 100%;
  --display-weight: 800;
  --display-case: uppercase;
  --display-track: -0.012em;
  --title-stretch: 100%;
  --title-weight: 640;
  --title-track: -0.012em;
}

/* ---------- Scale & rhythm ---------- */
:root {
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1320px;
  --section-y: clamp(72px, 9vw, 136px);
  --head-gap: clamp(28px, 3.5vw, 48px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --t-display: clamp(2.75rem, 7.6vw, 6rem);
  --t-h2: clamp(1.9rem, 3.6vw, 3rem);
  --t-h3: clamp(1.2rem, 1.6vw, 1.45rem);
  --t-body: 1.0625rem;
  --t-small: 0.8125rem;
  --header-h: 76px;
  /* corner radii: soften without losing the atlas precision */
  --radius-sm: 8px;    /* buttons, inputs inside fields, small thumbs */
  --radius: 12px;      /* cards & photos, search field, dropdowns */
  --radius-lg: 18px;   /* large feature images, sheets */
  --radius-pill: 999px;/* filter & suggestion chips */
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
fieldset { border: 0; margin: 0; padding: 0; }
svg { flex: none; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
html { scrollbar-color: var(--accent) var(--paper-2); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--red); color: #fff; padding: 10px 16px; font-family: var(--f-ui); font-weight: 600; }
.skip:focus { top: 16px; }
.wrap { width: 100%; max-width: calc(var(--maxw) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Buttons & small parts ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  font-family: var(--f-ui); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em;
  text-decoration: none; border: 1px solid transparent;
  transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}
.btn svg, .more svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 300ms var(--ease-out); }
.btn:hover svg, .more:hover svg, a:hover .btn svg { transform: translateX(4px); }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-ink); }
.btn--ghost { border-color: currentColor; }
.btn--ghost:hover, a:hover .btn--ghost { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.section--ink .btn--ghost:hover { background: var(--on-ink); color: var(--ink); }

.more {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-ui); font-weight: 600; font-size: 0.95rem;
  text-decoration: none; white-space: nowrap;
  border-bottom: 1px solid var(--line); padding-bottom: 4px;
  transition: border-color 200ms;
}
.more:hover { border-color: var(--red); }

/* Data plate: region + coordinates on every story */
.plate {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  font-family: var(--f-ui); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted);
}
.plate__region { color: var(--red); }
.plate__coord { font-variant-numeric: tabular-nums; font-weight: 500; letter-spacing: 0.06em; }
.plate__coord::before { content: ""; display: inline-block; width: 14px; height: 1px; background: currentColor; vertical-align: middle; margin-right: 12px; opacity: 0.6; }
.plate--light { color: rgb(255 255 255 / 0.82); }
.plate--light .plate__region { color: #fff; }

/* Arrows */
.arrow {
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  border: 1px solid rgb(255 255 255 / 0.45); color: #fff;
  transition: background-color 200ms, border-color 200ms, color 200ms;
}
.arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.arrow:hover { background: #fff; color: var(--ink); border-color: #fff; }
.arrow--ink { border-color: var(--line); color: var(--ink); }
.arrow--ink:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.arrow:disabled { opacity: 0.35; pointer-events: none; }

/* ---------- Header (shared) ---------- */
.site-header { z-index: 50; font-family: var(--f-ui); }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }
.brand { display: block; flex: none; }
.brand__logo { height: 38px; width: auto; }

/* Header: overlay on photo, turns solid when scrolled */
.header--overlay { position: fixed; inset: 0 0 auto; color: #fff; transition: background-color 300ms var(--ease-out), box-shadow 300ms; }
.header--overlay::before { content: ""; position: absolute; inset: 0 0 -40px; background: linear-gradient(rgb(0 0 0 / 0.45), transparent); pointer-events: none; transition: opacity 300ms; }
.header--overlay .brand__logo--color { display: none; }
.header--overlay.is-scrolled { background: var(--ink); box-shadow: 0 8px 24px -12px rgb(0 0 0 / 0.4); }
.header--overlay.is-scrolled::before { opacity: 0; }
.header--overlay .site-header__bar { position: relative; }

/* Navigation */
.nav__list { display: flex; align-items: center; gap: 2px; }
.nav__item { position: relative; display: flex; align-items: center; }
.nav__link { display: block; padding: 10px 10px; font-size: 0.92rem; font-weight: 550; text-decoration: none; white-space: nowrap; }
.nav__link:hover { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.nav__toggle { display: grid; place-items: center; width: 22px; height: 32px; margin-left: -6px; }
.nav__toggle svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 200ms var(--ease-out); }
.nav__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav__sub {
  position: absolute; top: calc(100% + 4px); left: 0; min-width: 220px;
  background: var(--card); color: var(--ink); padding: 10px 0;
  box-shadow: 0 18px 40px -16px rgb(12 34 48 / 0.35), 0 2px 6px rgb(12 34 48 / 0.08);
  border-top: 2px solid var(--red);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 180ms var(--ease-out), transform 220ms var(--ease-out), visibility 0s linear 220ms;
}
.nav__sub a { display: block; padding: 8px 20px; font-size: 0.92rem; text-decoration: none; }
.nav__sub a:hover { background: var(--paper); color: var(--red-ink); }
.nav__sub li:first-child a { font-weight: 650; }
.nav__item:hover > .nav__sub,
.nav__item:focus-within > .nav__sub,
.nav__item.is-open > .nav__sub { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.nav__item:last-child .nav__sub { left: auto; right: 0; }

.menu-btn { display: none; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.menu-btn__lines, .menu-btn__lines::before { display: block; width: 22px; height: 2px; background: currentColor; position: relative; transition: transform 250ms var(--ease-out); }
.menu-btn__lines::before { content: ""; position: absolute; top: 7px; }
.menu-btn__lines { transform: translateY(-3.5px); }
.menu-btn[aria-expanded="true"] .menu-btn__lines { transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__lines::before { transform: translateY(-7px) rotate(-90deg); }

@media (max-width: 1099px) {
  .menu-btn { display: inline-flex; position: relative; z-index: 2; }
  .nav {
    position: fixed; inset: 0; z-index: 1; background: var(--ink); color: var(--on-ink);
    padding: calc(var(--header-h) + 16px) var(--gutter) 40px; overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 250ms var(--ease-out), transform 300ms var(--ease-out), visibility 0s linear 300ms;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__item { flex-wrap: wrap; border-bottom: 1px solid var(--on-ink-line); }
  .nav__link { flex: 1; padding: 16px 0; font-family: var(--f-display); font-stretch: var(--display-stretch); font-size: 1.35rem; font-weight: 650; text-transform: var(--display-case); }
  .nav__toggle { width: 48px; height: 48px; margin: 0; }
  .nav__toggle svg { width: 16px; height: 16px; }
  .nav__sub {
    position: static; flex-basis: 100%; min-width: 0; display: none;
    background: transparent; color: var(--on-ink-muted); box-shadow: none; border: 0; padding: 0 0 12px;
    opacity: 1; visibility: visible; transform: none;
  }
  .nav__item.is-open > .nav__sub { display: grid; grid-template-columns: 1fr 1fr; }
  .nav__item:hover > .nav__sub, .nav__item:focus-within > .nav__sub { display: none; }
  .nav__item.is-open:hover > .nav__sub, .nav__item.is-open:focus-within > .nav__sub { display: grid; }
  .nav__sub a { padding: 8px 0; }
  .nav__sub a:hover { background: none; color: #fff; }
}
body.nav-open { overflow: hidden; }
body.nav-open .header--overlay { background: var(--ink); }

/* ---------- Hero: route-line slider ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  height: 100vh; height: 100svh; min-height: 600px; max-height: 960px;
  background: var(--ink); color: #fff;
}
.hero__intro { position: absolute; z-index: 3; left: 0; right: 0; top: calc(var(--header-h) + clamp(12px, 3vh, 36px)); }
.hero__h1 {
  max-width: 22ch; font-family: var(--f-ui); font-weight: 500; font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  line-height: 1.4; letter-spacing: 0.01em; color: rgb(255 255 255 / 0.88);
  padding-left: 16px; border-left: 1px solid rgb(255 255 255 / 0.5);
}
.hero__slides { position: absolute; inset: 0; }
.slide { position: absolute; inset: 0; visibility: hidden; opacity: 0; transition: opacity 900ms var(--ease-inout), visibility 0s linear 900ms; }
.slide.is-active { visibility: visible; opacity: 1; transition-delay: 0s; z-index: 1; }
.slide__media { position: absolute; inset: 0; }
.slide__media picture { display: block; width: 100%; height: 100%; }
.slide__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 7.5s cubic-bezier(0.2, 0.6, 0.35, 1); }
.slide.is-active .slide__media img { transform: scale(1); }
.slide__media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgb(8 20 28 / 0.72) 0%, rgb(8 20 28 / 0.35) 45%, rgb(8 20 28 / 0) 75%),
    linear-gradient(0deg, rgb(8 20 28 / 0.85) 0%, rgb(8 20 28 / 0) 55%);
}
.slide__content { position: absolute; left: 0; right: 0; bottom: clamp(120px, 17vh, 170px); z-index: 2; }
.slide__place {
  font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: var(--display-weight);
  text-transform: var(--display-case); letter-spacing: var(--display-track);
  font-size: var(--t-display); line-height: 0.92; margin-bottom: clamp(14px, 2vh, 24px);
  max-width: 100%; overflow-wrap: anywhere;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1100ms var(--ease-out) 150ms;
}
.slide.is-active .slide__place { clip-path: inset(0 0 -0.2em 0); }
.slide__title, .slide__lede, .slide__meta { opacity: 0; transform: translateY(14px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); }
.slide.is-active .slide__title { opacity: 1; transform: none; transition-delay: 350ms; }
.slide.is-active .slide__lede { opacity: 1; transform: none; transition-delay: 450ms; }
.slide.is-active .slide__meta { opacity: 1; transform: none; transition-delay: 550ms; }
.slide__title { max-width: 30ch; font-family: var(--f-ui); font-weight: var(--title-weight); letter-spacing: var(--title-track); font-size: clamp(1.25rem, 2.1vw, 1.75rem); line-height: 1.2; text-wrap: balance; }
.slide__title a { text-decoration: none; }
.slide__title a:hover { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.slide__lede { max-width: 52ch; margin-top: 10px; font-size: clamp(1rem, 1.2vw, 1.1rem); color: rgb(255 255 255 / 0.85); }
.slide__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 24px; }

/* Route line */
.route { position: absolute; left: 0; right: 0; bottom: clamp(20px, 4vh, 40px); z-index: 4; display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); }
.route__pause { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 1px solid rgb(255 255 255 / 0.45); border-radius: 50%; }
.route__pause svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 2; fill: none; stroke-linecap: round; }
.route__pause .i-play { fill: #fff; stroke: none; display: none; }
.route__pause[aria-pressed="true"] .i-play { display: block; }
.route__pause[aria-pressed="true"] .i-pause { display: none; }
.route__track { position: relative; flex: 1; min-width: 0; }
.route__line { position: absolute; left: 7px; right: 7px; top: 7px; height: 1px; background: rgb(255 255 255 / 0.35); }
.route__fill { position: absolute; inset: -0.5px 0; background: var(--red); transform-origin: left; transform: scaleX(var(--p, 0)); height: 2px; }
.route__stops { position: relative; display: flex; justify-content: space-between; }
.route__stop { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 44px; padding-right: 8px; color: rgb(255 255 255 / 0.62); font-family: var(--f-ui); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; transition: color 250ms; }
.route__stops li:last-child .route__stop { align-items: flex-end; padding-right: 0; }
.route__dot { width: 15px; height: 15px; border-radius: 50%; background: var(--ink); border: 2px solid rgb(255 255 255 / 0.7); transition: background-color 300ms, border-color 300ms, transform 400ms var(--ease-out); }
.route__stop:hover { color: #fff; }
.route__stop.is-passed .route__dot { background: var(--red); border-color: var(--red); }
.route__stop.is-active { color: #fff; }
.route__stop.is-active .route__dot { background: var(--red); border-color: #fff; transform: scale(1.25); }
.route__arrows { display: flex; gap: 8px; flex: none; }

@media (max-width: 760px) {
  .hero { max-height: none; min-height: 640px; }
  .route__name { display: none; }
  .route__arrows { display: none; }
  .slide__content { bottom: 96px; }
  .slide__lede { display: none; }
  .slide__media::after { background: linear-gradient(0deg, rgb(8 20 28 / 0.9) 0%, rgb(8 20 28 / 0.45) 55%, rgb(8 20 28 / 0.2) 100%); }
  .hero__h1 { max-width: 26ch; }
}

/* ---------- Sections (shared) ---------- */
.section { padding-block: var(--section-y); }
.section__head {
  position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px 40px; padding-top: 22px; margin-bottom: var(--head-gap);
}
/* horizon axis with graticule ticks */
.section__head::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 7px;
  border-top: 1px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 48px);
  opacity: 0.55;
}
.section--ink .section__head::before { border-color: var(--on-ink); background-image: repeating-linear-gradient(90deg, var(--on-ink) 0 1px, transparent 1px 48px); opacity: 0.3; }
.section__title {
  font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: var(--display-weight);
  text-transform: var(--display-case); letter-spacing: var(--display-track);
  font-size: var(--t-h2); line-height: 1.06; text-wrap: balance; max-width: 22ch;
}
.section__lede { max-width: 56ch; color: var(--muted); font-size: 1.05rem; }

/* ---------- Cards ---------- */
.card__link { display: block; text-decoration: none; height: 100%; }
.card__media { overflow: hidden; aspect-ratio: 3 / 2; background: var(--paper-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.card__link:hover .card__media img { transform: scale(1.045); }
.card__body { padding-top: 16px; display: grid; gap: 8px; }
.card__title { font-family: var(--f-ui); font-stretch: var(--title-stretch); font-weight: var(--title-weight); letter-spacing: var(--title-track); font-size: var(--t-h3); line-height: 1.25; text-wrap: balance; }
.card__link:hover .card__title { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }

/* ---------- Atlas index ---------- */
.atlas { padding-bottom: calc(var(--section-y) * 0.6); }
.atlas__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 5vw, 80px); counter-reset: none; }
.atlas__row { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 18px; row-gap: 6px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.atlas__ref { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; background: var(--ink); color: var(--paper); font-family: var(--f-ui); font-weight: 700; font-size: 0.9rem; align-self: start; }
.atlas__name { font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: 700; text-transform: var(--display-case); letter-spacing: var(--display-track); font-size: clamp(1.2rem, 1.8vw, 1.5rem); text-decoration: none; line-height: 1.15; }
.atlas__name:hover { color: var(--red-ink); }
.atlas__countries { display: flex; flex-wrap: wrap; gap: 2px 0; font-family: var(--f-ui); font-size: 0.95rem; color: var(--muted); }
.atlas__countries li:not(:last-child)::after { content: "·"; margin: 0 8px; color: var(--line); }
.atlas__countries a { text-decoration: none; }
.atlas__countries a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); }
.atlas__row:has(.atlas__countries:empty) .atlas__ref { grid-row: auto; }
@media (max-width: 760px) { .atlas__list { grid-template-columns: 1fr; } }

/* ---------- Featured ---------- */
.featured { padding-top: calc(var(--section-y) * 0.5); }
.featured__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(24px, 3vw, 44px); }
.lead { grid-column: span 7; }
.lead__link { display: block; text-decoration: none; }
.lead__media { overflow: hidden; aspect-ratio: 3 / 2; background: var(--paper-2); }
.lead__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
.lead__link:hover .lead__media img { transform: scale(1.035); }
.lead__body { display: grid; gap: 14px; padding-top: 22px; justify-items: start; }
.lead__title { font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: var(--display-weight); letter-spacing: var(--display-track); text-transform: none; font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1.08; max-width: 24ch; text-wrap: balance; }
.lead__excerpt { max-width: 58ch; color: var(--muted); font-size: 1.1rem; }
.lead__body .btn { margin-top: 6px; }
.featured__side { grid-column: span 5; display: grid; gap: 0; align-content: start; }
.card--row { border-top: 1px solid var(--line); padding-block: 22px; }
.card--row:first-child { border-top: 0; padding-top: 0; }
.card--row .card__link { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.card--row .card__body { padding-top: 0; }
@media (max-width: 960px) {
  .lead, .featured__side { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .card--row .card__link { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; }
  .card--row .card__title { font-size: 1.05rem; }
  .card--row .card__media { aspect-ratio: 4 / 3; }
}

/* ---------- Australia scroller ---------- */
.aus { background: var(--paper-2); }
.citylinks { display: flex; flex-wrap: wrap; margin-top: 12px; font-family: var(--f-ui); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.citylinks li:not(:last-child)::after { content: "—"; margin: 0 10px; color: var(--line); }
.scroller__ctl { display: flex; align-items: center; gap: 8px; }
.scroller__ctl .more { margin-right: 16px; }
.scroller {
  --edge: max(var(--gutter), calc((100vw - var(--maxw)) / 2));
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(260px, 29vw, 410px); gap: clamp(18px, 2vw, 28px);
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding-inline: var(--edge); scroll-padding-inline: var(--edge); padding-bottom: 20px;
  scrollbar-width: thin; scrollbar-color: var(--accent) transparent;
}
.scroller:focus-visible { outline-offset: -2px; }
.card--slide { scroll-snap-align: start; }
@media (hover: hover) and (pointer: fine) { .scroller { cursor: grab; } }
.scroller.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.scroller.is-dragging a { pointer-events: none; }
.scroller img { -webkit-user-drag: none; user-select: none; }
@media (max-width: 760px) { .scroller__ctl .arrow { display: none; } .scroller { grid-auto-columns: 78vw; } }

/* ---------- Editor plate (ink) ---------- */
.section--ink { position: relative; isolation: isolate; background: var(--ink); color: var(--on-ink); overflow: hidden; }
.section--ink .section__lede, .section--ink .plate { color: var(--on-ink-muted); }
.graticule { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.graticule path { stroke: var(--on-ink); stroke-opacity: 0.07; stroke-width: 1; vector-effect: non-scaling-stroke; }
.graticule .graticule__eq { stroke: var(--red); stroke-opacity: 0.5; stroke-dasharray: 6 8; }
.editor__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(28px, 4vw, 64px); align-items: start; }
.editor__lead { grid-column: span 8; }
.editor__link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 3vw, 44px); align-items: center; text-decoration: none; }
.editor__media { overflow: hidden; aspect-ratio: 3 / 2; }
.editor__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
.editor__link:hover .editor__media img { transform: scale(1.035); }
.editor__body { display: grid; gap: 18px; justify-items: start; }
.editor__title { font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-track); font-size: clamp(1.9rem, 3.2vw, 2.9rem); line-height: 1.02; text-wrap: balance; }
.editor__excerpt { font-size: 1.12rem; color: var(--on-ink-muted); max-width: 40ch; }
.editor__aside { grid-column: span 4; border-left: 1px solid var(--on-ink-line); padding-left: clamp(20px, 2.5vw, 36px); }
.editor__aside-title { font-family: var(--f-ui); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-ink-muted); padding-bottom: 14px; border-bottom: 1px solid var(--on-ink-line); }
.card--mini { padding-block: 20px; border-bottom: 1px solid var(--on-ink-line); }
.card--mini .card__link { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; align-items: center; }
.card--mini .card__media { aspect-ratio: 4 / 3; }
.card--mini .card__body { padding-top: 0; }
.card--mini .card__title { font-size: 1.08rem; }
.card--mini .plate__region { color: #ff6b6b; }
@media (max-width: 960px) {
  .editor__lead, .editor__aside { grid-column: 1 / -1; }
  .editor__aside { border-left: 0; padding-left: 0; }
}
@media (max-width: 620px) { .editor__link { grid-template-columns: 1fr; } }

/* ---------- Teams (brand banners) ---------- */
.teams__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.5vw, 36px); }
.team__link { display: grid; gap: 10px; text-decoration: none; }
.team__media { overflow: hidden; aspect-ratio: 2 / 1; background: var(--paper-2); margin-bottom: 8px; }
.team__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 800ms var(--ease-out); }
.team__link:hover .team__media img { transform: scale(1.04); }
.team__title { font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: 700; text-transform: var(--display-case); letter-spacing: var(--display-track); font-size: 1.3rem; line-height: 1.1; }
.team__link:hover .team__title { color: var(--red-ink); }
.team__text { color: var(--muted); max-width: 40ch; }
@media (max-width: 860px) { .teams__list { grid-template-columns: 1fr; } }

/* ---------- Authors ---------- */
.authors { background: var(--card); border-block: 1px solid var(--line); }
.authors__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(28px, 4vw, 64px); align-items: start; }
.authors__intro { grid-column: span 4; display: grid; gap: 20px; position: sticky; top: calc(var(--header-h) + 24px); }
.authors__banner { max-width: 260px; margin-top: 8px; }
.authors__banner img { width: 100%; }
.authors__list { grid-column: span 8; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 3vw, 48px) clamp(20px, 3vw, 40px); }
.author__photo { aspect-ratio: 1; overflow: hidden; background: var(--paper-2); margin-bottom: 16px; }
.author__photo img { width: 100%; height: 100%; object-fit: cover; }
.author__name { font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: 700; text-transform: var(--display-case); letter-spacing: var(--display-track); font-size: 1.3rem; line-height: 1.1; }
.author__role { margin-top: 6px; font-family: var(--f-ui); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); }
.author__beat { margin-top: 4px; color: var(--muted); font-size: 0.98rem; }
@media (min-width: 1200px) { .authors__list { grid-template-columns: repeat(4, minmax(0, 1fr)); } .authors__intro { grid-column: span 12; position: static; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; } .authors__banner { display: none; } .authors__list { grid-column: span 12; } }
@media (max-width: 860px) { .authors__intro, .authors__list { grid-column: 1 / -1; } .authors__intro { position: static; } .authors__banner { display: none; } }

/* ---------- Latest ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.chip {
  min-height: 40px; padding: 0 16px; border: 1px solid var(--line);
  font-family: var(--f-ui); font-size: 0.86rem; font-weight: 600; letter-spacing: 0.02em;
  transition: background-color 180ms, color 180ms, border-color 180ms;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.latest__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(36px, 4vw, 56px) clamp(20px, 2.5vw, 36px); }
[data-latest].is-collapsed [data-more] { display: none; }
.latest__grid > [hidden] { display: none; }
.latest__empty { color: var(--muted); }
.latest__more { display: flex; justify-content: center; margin-top: 56px; }
.latest__more[hidden] { display: none; }
@media (max-width: 1000px) { .latest__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .latest__grid { grid-template-columns: 1fr; } }

/* ---------- Follow ---------- */
.follow { background: var(--paper-2); }
.follow__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.follow__body { display: grid; gap: 18px; }
.follow__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
@media (max-width: 860px) { .follow__grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.footer--atlas { background: var(--ink); color: var(--on-ink); padding-top: clamp(64px, 8vw, 112px); font-family: var(--f-ui); }
.footer__top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 48px; padding-bottom: clamp(40px, 5vw, 72px); border-bottom: 1px solid var(--on-ink-line); }
.footer__claim { font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-track); font-size: clamp(2rem, 5vw, 4.25rem); line-height: 0.98; max-width: 16ch; text-wrap: balance; }
.footer__mail { font-size: clamp(1rem, 1.5vw, 1.25rem); text-decoration: none; border-bottom: 1px solid var(--red); padding-bottom: 4px; }
.footer__mail:hover { color: #fff; border-bottom-width: 2px; }
.footer__cols { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); gap: 40px 32px; padding-block: clamp(40px, 5vw, 64px); }
.footer__brand img { width: 200px; margin-bottom: 18px; }
.footer__brand p { color: var(--on-ink-muted); max-width: 34ch; font-family: var(--f-body); }
.footer__h { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-ink-muted); margin-bottom: 14px; }
.footer--atlas nav li + li { margin-top: 8px; }
.footer--atlas nav a { text-decoration: none; }
.footer--atlas nav a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--red); }
.footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 22px; border-top: 1px solid var(--on-ink-line); font-size: 0.85rem; color: var(--on-ink-muted); }
.footer__coord { letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.72rem; }
@media (max-width: 960px) { .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer__brand { grid-column: 1 / -1; } }

/* ---------- Search ---------- */
.search-btn { order: 2; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; font-weight: 600; font-size: 0.92rem; }
.search-btn svg, .search__icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.search-btn:hover .search-btn__label { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.site-header__bar .brand { margin-right: auto; }
.site-header__bar .nav { order: 1; }
.site-header__bar .menu-btn { order: 3; }
@media (max-width: 1099px) { .search-btn__label { display: none; } .search-btn { width: 44px; justify-content: center; } }
@media (min-width: 1100px) and (max-width: 1260px) { .search-btn__label { display: none; } }

.search { position: relative; font-family: var(--f-ui); }
.search__label { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.search__field {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 8px 0 20px;
  background: var(--card); border: 1px solid var(--ink); color: var(--ink);
  transition: box-shadow 200ms var(--ease-out);
}
.search__field:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 28%, transparent); }
.search__icon { width: 22px; height: 22px; color: var(--muted); }
.search__input {
  flex: 1; min-width: 0; height: 60px; border: 0; background: transparent; color: inherit;
  font: 500 1.15rem/1.2 var(--f-ui); letter-spacing: 0.005em; outline: none;
}
.search__input::placeholder { color: var(--muted); opacity: 0.85; }
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search__kbd { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border: 1px solid var(--line); font: 600 0.8rem var(--f-ui); color: var(--muted); }
.search__submit { min-height: 48px; padding: 0 22px; background: var(--red); color: #fff; font-weight: 600; font-size: 0.95rem; transition: background-color 200ms; }
.search__submit:hover { background: var(--red-ink); }
.search__panel {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--card); color: var(--ink); border-top: 2px solid var(--red);
  box-shadow: 0 24px 60px -24px rgb(12 34 48 / 0.45), 0 2px 8px rgb(12 34 48 / 0.08);
  padding: 14px 0 10px; max-height: min(70vh, 620px); overflow: auto; overscroll-behavior: contain;
  animation: search-in 220ms var(--ease-out);
}
@keyframes search-in { from { opacity: 0; transform: translateY(-6px); } }
.search__status { padding: 0 20px 8px; font-size: 0.82rem; color: var(--muted); }
.search__status:empty { display: none; }
.search__results { display: grid; }
.res { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: center; padding: 10px 20px; text-decoration: none; }
.res img, .res__ph { width: 64px; height: 64px; object-fit: cover; background: var(--paper-2); }
.res__ph { background: var(--paper-2) url("../img/brand/logo-mark.png") center / 28px no-repeat; }
.res__body { display: grid; gap: 3px; min-width: 0; }
.res__title { font-weight: 600; font-size: 1rem; line-height: 1.3; }
.res__meta { font-size: 0.76rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res__meta b { color: var(--red); font-weight: 700; }
.res mark { background: color-mix(in srgb, var(--red) 14%, transparent); color: inherit; padding: 0 1px; }
[role="option"][aria-selected="true"] .res { background: var(--paper); }
[role="option"][aria-selected="true"] .res__title { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.search__suggest { padding: 4px 20px 10px; }
.search__suggest[hidden] { display: none; }
.search__suggest-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.search__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.search__chips button { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); font-size: 0.88rem; font-weight: 600; transition: border-color 150ms, background-color 150ms, color 150ms; }
.search__chips button:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.search__all { display: flex; align-items: center; gap: 8px; margin: 6px 20px 4px; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 600; font-size: 0.9rem; text-decoration: none; color: var(--red-ink); }
.search__all[hidden] { display: none; }
.search__all svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.search__all:hover { text-decoration: underline; }

.atlas__search { margin-bottom: clamp(32px, 4vw, 52px); max-width: 880px; }
@media (max-width: 600px) {
  .search__kbd { display: none; }
  .search__submit { padding: 0 14px; }
  .search__field { padding-left: 14px; min-height: 56px; }
  .search__input { height: 52px; font-size: 1rem; }
}
@media (hover: none) { .search__kbd { display: none; } }

/* Search dialog */
.search-dialog {
  position: fixed; inset: 0 0 auto; width: 100%; max-width: none; max-height: 100dvh; margin: 0; padding: 0; border: 0;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.55);
}
.search-dialog[open] { animation: sheet-in 320ms var(--ease-out); }
@keyframes sheet-in { from { transform: translateY(-24px); opacity: 0; } }
.search-dialog::backdrop { background: rgb(8 20 28 / 0.62); }
.search-dialog__inner { padding-block: 20px clamp(24px, 4vw, 48px); }
.search-dialog__bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.search-dialog__title { font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-track); font-size: clamp(1.3rem, 2.4vw, 1.9rem); }
.search-dialog__close { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); }
.search-dialog__close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.search-dialog__close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.search-dialog .search__panel { position: static; box-shadow: none; border-top: 0; padding: 18px 0 0; max-height: calc(100dvh - 220px); animation: none; background: transparent; }
.search-dialog .res, .search-dialog .search__status, .search-dialog .search__suggest { padding-inline: 0; }
.search-dialog .search__all { margin-inline: 0; }
.search-dialog [role="option"][aria-selected="true"] .res { background: var(--paper-2); }
body.search-open { overflow: hidden; }

/* ---------- Radius (soft corners) ---------- */
.btn, .arrow, .search__submit, .search-dialog__close { border-radius: var(--radius-sm); }
.chip, .search__chips button { border-radius: var(--radius-pill); }
.search__field { border-radius: var(--radius); }
.search__kbd { border-radius: 6px; }
.search__panel { border-radius: var(--radius); }
.search-dialog .search__panel { border-radius: 0; }
.search-dialog { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.res { border-radius: var(--radius-sm); }
.search-dialog .res { padding-inline: 10px; margin-inline: -10px; }
.res img, .res__ph { border-radius: var(--radius-sm); }
.nav__sub { border-radius: var(--radius); overflow: hidden; }
.card__media, .team__media, .author__photo { border-radius: var(--radius); }
.lead__media, .editor__media { border-radius: var(--radius-lg); }
.card--mini .card__media { border-radius: var(--radius-sm); }
.follow__media img, .authors__banner img { border-radius: var(--radius); }
.atlas__ref { border-radius: var(--radius-sm); }
.card__media, .lead__media, .editor__media, .team__media, .author__photo { isolation: isolate; } /* keeps corners clipped while images scale on hover */
@media (max-width: 1099px) { .nav__sub { border-radius: 0; } }

/* ==========================================================================
   Inner pages (PHP templates)
   ========================================================================== */

/* Pages without a photo hero: overlay header becomes a solid bar */
body:not(.has-hero) .header--overlay { position: sticky; background: var(--ink); }
body:not(.has-hero) .header--overlay::before { display: none; }
.img-ph { display: block; width: 100%; height: 100%; background: var(--paper-2) url("../img/brand/logo-mark.png") center / 48px no-repeat; }
.author__link { display: block; text-decoration: none; }
.author__link:hover .author__name { color: var(--red-ink); }

/* Breadcrumbs */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; font-family: var(--f-ui); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.crumbs li:not(:last-child)::after { content: "/"; margin: 0 10px; opacity: 0.5; }
.crumbs a { text-decoration: none; opacity: 0.85; }
.crumbs a:hover { opacity: 1; text-decoration: underline; text-decoration-color: var(--red); }
.crumbs--ink { color: var(--muted); margin-bottom: 20px; }

/* Reading progress: the red route line, drawn as you read */
.read-progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 60; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--red); transform-origin: left; transform: scaleX(var(--read, 0)); }

/* Post hero */
.post-hero { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: min(86svh, 820px); padding: calc(var(--header-h) + 40px) 0 clamp(36px, 6vh, 64px); color: #fff; background: var(--ink); overflow: hidden; }
.post-hero__media { position: absolute; inset: 0; z-index: -1; }
.post-hero__media picture, .post-hero__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgb(8 20 28 / 0.9) 0%, rgb(8 20 28 / 0.55) 42%, rgb(8 20 28 / 0.15) 75%, rgb(8 20 28 / 0.35) 100%); }
.post-hero__content { display: grid; gap: 18px; }
.post-hero__credit { position: absolute; right: var(--gutter); bottom: 12px; z-index: 1; font-family: var(--f-ui); font-size: 0.72rem; color: rgb(255 255 255 / 0.7); }
.post-hero__credit a { color: inherit; }
.post-hero__title { font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: var(--display-weight); letter-spacing: var(--display-track); font-size: clamp(2.2rem, 5.4vw, 4.6rem); line-height: 1.04; max-width: 20ch; text-wrap: balance; }
.post-hero__dek { max-width: 60ch; font-size: clamp(1.05rem, 1.4vw, 1.25rem); color: rgb(255 255 255 / 0.88); }
.post-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 6px; font-family: var(--f-ui); font-size: 0.92rem; color: rgb(255 255 255 / 0.85); }
.post-hero__dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.byline { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.byline__photo { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--paper-2); flex: none; }
.byline__photo img { width: 100%; height: 100%; object-fit: cover; }
a.byline:hover strong { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }

/* Post layout */
.post { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); gap: clamp(32px, 5vw, 80px); padding-block: clamp(48px, 7vw, 96px); align-items: start; }
/* grid children never grow past the column (wide tables scroll inside .table-wrap) */
.post > *, .page-body > *, .prose { min-width: 0; }
.post__aside { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow: auto; scrollbar-width: thin; }
.post__aside-inner { display: grid; gap: 28px; font-family: var(--f-ui); }
.toc__title { list-style: none; cursor: pointer; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.toc__title::-webkit-details-marker { display: none; }
.toc__list { counter-reset: toc; display: grid; margin-top: 8px; }
.toc__list a { counter-increment: toc; display: grid; grid-template-columns: 28px 1fr; gap: 6px; padding: 8px 0; font-size: 0.92rem; line-height: 1.35; text-decoration: none; color: var(--muted); transition: color 150ms; }
.toc__list a::before { content: counter(toc, decimal-leading-zero); font-size: 0.74rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--line); padding-top: 2px; transition: color 150ms; }
.toc__list a:hover { color: var(--ink); }
.toc__list a.is-current { color: var(--ink); font-weight: 650; }
.toc__list a.is-current::before { color: var(--red); }
.facts { display: grid; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px; }
.facts div { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; text-align: right; }
.facts dd a { text-decoration: none; color: var(--red-ink); }
.facts__num { font-variant-numeric: tabular-nums; }
.share__title { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.share__list { display: flex; flex-wrap: wrap; gap: 8px; }
.share__btn { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); font-size: 0.84rem; font-weight: 600; text-decoration: none; transition: background-color 150ms, color 150ms, border-color 150ms; }
.share__btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (max-width: 960px) {
  .post { grid-template-columns: 1fr; gap: 28px; }
  .post__aside { position: static; max-height: none; overflow: visible; }
  .toc:not([open]) .toc__title { border-bottom: 0; }
  .toc__title::after { content: " +"; }
  .toc[open] .toc__title::after { content: " –"; }
}

.only-desktop { display: grid; gap: 28px; }
.only-mobile { display: none; }
@media (max-width: 960px) {
  .only-desktop { display: none; }
  .only-mobile { display: grid; gap: 24px; margin-top: 3em; font-family: var(--f-ui); }
}

/* Article typography */
.prose { max-width: 72ch; font-size: 1.14rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose p a, .prose li a { color: var(--red-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.prose p a:hover, .prose li a:hover { text-decoration-thickness: 2px; }
.prose h2 {
  position: relative; margin-top: 2.6em; padding-top: 22px; scroll-margin-top: calc(var(--header-h) + 20px);
  font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: var(--display-weight); letter-spacing: var(--display-track);
  font-size: clamp(1.7rem, 2.6vw, 2.2rem); line-height: 1.12; text-wrap: balance;
}
.prose h2::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 7px; border-top: 1px solid var(--ink); background: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 48px); opacity: 0.45; }
.prose h3 { margin-top: 2em; scroll-margin-top: calc(var(--header-h) + 20px); font-family: var(--f-ui); font-weight: 700; font-size: 1.32rem; line-height: 1.3; letter-spacing: -0.01em; }
.prose h2 + h3, .prose h2 + p, .prose h3 + p { margin-top: 0.7em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--red); }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 1px solid var(--ink); font-size: 1.25rem; font-style: italic; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--f-ui); font-size: 0.95rem; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { background: var(--paper-2); }

.figure { margin: 2.2em 0 0; }
.figure__link { display: block; overflow: hidden; border-radius: var(--radius-lg); background: var(--paper-2); cursor: zoom-in; }
.figure__link img { width: 100%; height: auto; transition: transform 700ms var(--ease-out); }
.figure__link:hover img { transform: scale(1.02); }
.figure figcaption, .gallery__item figcaption { margin-top: 10px; font-family: var(--f-ui); font-size: 0.86rem; color: var(--muted); }
.credit { display: block; margin-top: 4px; font-size: 0.76rem; color: var(--muted); opacity: 0.85; }
.credit a { color: inherit; }
.figure figcaption .credit:first-child { margin-top: 0; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gallery__item { margin: 0; }
.gallery .figure__link { border-radius: var(--radius); aspect-ratio: 3 / 2; }
.gallery .figure__link img { height: 100%; object-fit: cover; }
@media (max-width: 600px) { .gallery { grid-template-columns: 1fr; } }

.faq { display: grid; gap: 10px; }
.faq__item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color 200ms; }
.faq__item[open] { border-color: var(--ink); }
.faq__q { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; cursor: pointer; list-style: none; font-family: var(--f-ui); font-weight: 650; font-size: 1.05rem; line-height: 1.35; }
.faq__q::-webkit-details-marker { display: none; }
.faq__q svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--red); stroke-width: 1.8; transition: transform 250ms var(--ease-out); }
.faq__item[open] .faq__q svg { transform: rotate(45deg); }
.faq__a { padding: 0 20px 18px; font-size: 1.05rem; }
.faq__a p + p { margin-top: 0.8em; }

.sources { margin-top: 3em; padding-top: 18px; border-top: 1px solid var(--line); font-family: var(--f-ui); }
.sources__title { font-size: 0.78rem !important; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px !important; padding: 0 !important; }
.sources__title::before { display: none !important; }
.sources__list { list-style: none !important; padding: 0 !important; display: grid; gap: 6px; font-size: 0.9rem; }
.sources__list li + li { margin-top: 0 !important; }
.sources__list a { color: var(--muted) !important; }
.author-box { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 22px; margin-top: 3.2em; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.author-box__photo { display: block; width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: var(--paper-2); }
.author-box__photo img { width: 100%; height: 100%; object-fit: cover; }
.author-box__label { font-family: var(--f-ui); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.author-box__name { margin-top: 2px; font-family: var(--f-display); font-weight: var(--display-weight); font-size: 1.45rem; line-height: 1.2; }
.author-box__name a { text-decoration: none; }
.author-box__name a:hover { color: var(--red-ink); }
.author-box__role { margin-top: 4px; font-family: var(--f-ui); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); }
.author-box__bio { margin-top: 10px; font-size: 1rem; line-height: 1.65; color: var(--muted); }
@media (max-width: 520px) { .author-box { grid-template-columns: 1fr; } }

.related { background: var(--paper-2); }
.section--tight { padding-block: 0 var(--section-y); }

/* Lightbox */
.lightbox { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(6 14 20 / 0.94); color: #fff; }
.lightbox[open] { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; animation: search-in 220ms var(--ease-out); }
.lightbox::backdrop { background: transparent; }
.lightbox__figure { margin: 0; display: grid; justify-items: center; gap: 14px; padding: 64px 0 32px; }
.lightbox__figure img { max-width: 100%; max-height: calc(100vh - 160px); width: auto; height: auto; border-radius: var(--radius); }
.lightbox__figure figcaption { font-family: var(--f-ui); font-size: 0.95rem; color: rgb(255 255 255 / 0.85); text-align: center; max-width: 70ch; }
.lightbox__close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgb(255 255 255 / 0.4); border-radius: var(--radius-sm); }
.lightbox__close svg, .lightbox__nav svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.7; }
.lightbox__nav { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 8px; border: 1px solid rgb(255 255 255 / 0.4); border-radius: var(--radius-sm); }
.lightbox__close:hover, .lightbox__nav:hover { background: #fff; }
.lightbox__close:hover svg, .lightbox__nav:hover svg { stroke: var(--ink); }
body.lightbox-open { overflow: hidden; }

/* Page head (placeholder / 404) */
.page-head { padding-block: clamp(64px, 10vw, 140px) clamp(40px, 6vw, 80px); }
.page-head__title { font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: var(--display-weight); letter-spacing: var(--display-track); font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; max-width: 22ch; text-wrap: balance; }
.page-head__lede { margin-top: 16px; max-width: 56ch; font-size: 1.15rem; color: var(--muted); }
.page-head__code { font-family: var(--f-ui); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.page-head__search { max-width: 760px; margin-top: 32px; }
.placeholder__card { max-width: 480px; }

/* ==========================================================================
   Archive, writer, content page, blog, search
   ========================================================================== */
.section--tint { background: var(--paper-2); }
.section--flush-top { padding-top: 0; }
.page-body { padding-block: clamp(40px, 6vw, 80px) var(--section-y); }
.page-body .prose { margin-inline: auto; }

/* Content page head */
.page-head--content { padding-block: clamp(48px, 7vw, 96px) clamp(32px, 4vw, 56px); border-bottom: 1px solid var(--line); }
.page-head__grid.has-visual { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.page-head__visual { overflow: hidden; border-radius: var(--radius-lg); background: var(--paper-2); }
.page-head__visual img { width: 100%; height: auto; }
.page-head__meta { margin-top: 18px; font-family: var(--f-ui); font-size: 0.86rem; color: var(--muted); }
@media (max-width: 860px) { .page-head__grid.has-visual { grid-template-columns: 1fr; } }

.contact-card { margin-top: 2.4em; padding: 28px; border-radius: var(--radius-lg); background: var(--ink); color: var(--on-ink); display: grid; gap: 14px; font-family: var(--f-ui); }
.contact-card__label { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-ink-muted); }
.contact-card__mail { font-family: var(--f-display); font-weight: var(--display-weight); font-size: clamp(1.4rem, 3vw, 2.1rem); line-height: 1.1; text-decoration: none; color: #fff !important; overflow-wrap: anywhere; }
.contact-card__mail:hover { text-decoration: underline; text-decoration-color: var(--red); }
.contact-card__note { color: var(--on-ink-muted); font-size: 0.98rem; }
.contact-card .share__btn { border-color: var(--on-ink-line); color: var(--on-ink); }
.contact-card .share__btn:hover { background: #fff; color: var(--ink); }

/* Archive head (ink plate with graticule) */
.archive-head { position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(56px, 8vw, 112px) clamp(40px, 5vw, 72px); }
body:not(.has-hero) .archive-head, body:not(.has-hero) .writer-head { margin-top: 0; }
.archive-head__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: end; }
.archive-head__title { margin-top: 16px; font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-track); font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1; text-wrap: balance; }
.archive-head__lede { margin-top: 16px; max-width: 56ch; font-size: 1.15rem; color: var(--on-ink-muted); }
.archive-head__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chip--light { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid var(--on-ink-line); border-radius: var(--radius-pill); color: var(--on-ink); font-family: var(--f-ui); font-weight: 600; font-size: 0.9rem; text-decoration: none; transition: background-color 150ms, color 150ms; }
.chip--light span { font-size: 0.78rem; color: var(--on-ink-muted); font-variant-numeric: tabular-nums; }
.chip--light:hover { background: #fff; color: var(--ink); }
.chip--light:hover span { color: var(--muted); }
.archive-head__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; margin: 0; background: var(--on-ink-line); border: 1px solid var(--on-ink-line); border-radius: var(--radius); overflow: hidden; }
.archive-head__stats div { background: var(--ink); padding: 16px 18px; }
.archive-head__stats dt { font-family: var(--f-ui); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-ink-muted); }
.archive-head__stats dd { margin: 6px 0 0; font-family: var(--f-display); font-weight: var(--display-weight); font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.archive-head__stats--inline { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; max-width: 520px; }
@media (max-width: 860px) { .archive-head__grid { grid-template-columns: 1fr; } }

.lead--wide .lead__link { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.lead--wide .lead__body { padding-top: 0; }
@media (max-width: 860px) { .lead--wide .lead__link { grid-template-columns: 1fr; } .lead--wide .lead__body { padding-top: 20px; } }

/* Writer */
.writer-head { position: relative; padding-block: clamp(48px, 7vw, 96px); }
.writer-head__grid { display: grid; grid-template-columns: minmax(180px, 320px) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.writer-head__photo { overflow: hidden; border-radius: var(--radius-lg); aspect-ratio: 1; background: var(--ink-2); }
.writer-head__photo img { width: 100%; height: 100%; object-fit: cover; }
.writer-head__name { margin-top: 14px; font-family: var(--f-display); font-stretch: var(--display-stretch); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-track); font-size: clamp(2.4rem, 5.5vw, 4.4rem); line-height: 1; }
.writer-head__role { margin-top: 12px; font-family: var(--f-ui); font-size: 0.9rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #ff6b6b; }
@media (max-width: 700px) { .writer-head__grid { grid-template-columns: 1fr; } .writer-head__photo { max-width: 240px; } }
.writer-bio__mail { font-family: var(--f-ui); font-size: 1rem; }
.author__count { margin-top: 6px; font-family: var(--f-ui); font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.authors__list--wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .authors__list--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.atlas__count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; margin-left: 6px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--paper-2); font-family: var(--f-ui); font-size: 0.72rem; font-weight: 700; letter-spacing: 0; vertical-align: middle; color: var(--muted); font-variant-numeric: tabular-nums; }
.gallery--single { grid-template-columns: 1fr; }
.post-grid .chips { margin-top: 0; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; transition-delay: 0s !important; animation: none !important; }
  .slide__media img { transform: none !important; }
  .slide__place { clip-path: none !important; }
}
