/* =====================================================================
   EARLY MUSIC EUROPE — styles
   Two palettes (parchment + midnight), three pin reveals.
   ===================================================================== */

/* ---- THEMES ------------------------------------------------------- */
/* Two palettes: a daytime parchment + claret, and a midnight + ember
   night view. The gold variable is repurposed as a secondary red
   highlight, keeping the existing component vocabulary intact. */

:root,
:root[data-theme="parchment"] {
  /* Whiter parchment — soft off-white paper, neutral cool greys */
  --paper:       #f5f3ee;
  --paper-2:     #e8e5dd;
  --paper-3:     #d2cec3;
  --ink:         #14161a;
  --ink-soft:    #555a60;
  --ink-faint:   #aeaca6;
  --land:        #eceae1;
  --land-edge:   #b1aea3;
  --accent:      #a51424;
  --accent-dark: #7d0e1b;
  --accent-soft: rgba(165, 20, 36, 0.09);
  --gold:        #5e0c14;
  --gold-soft:   #c46672;
  --rule:        #cbc7bc;
  --shadow:      0 4px 20px rgba(30, 30, 36, 0.10), 0 1px 3px rgba(30, 30, 36, 0.07);
  --shadow-card: 0 22px 46px rgba(20, 22, 28, 0.14), 0 4px 10px rgba(20, 22, 28, 0.09);
  --font-serif:  'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --font-sans:   'Inter', system-ui, sans-serif;
}

:root[data-theme="midnight"] {
  /* Warm near-black paper, ember-red accent — night view */
  --paper:       #14110c;
  --paper-2:     #1d1913;
  --paper-3:     #29231b;
  --ink:         #ede2c8;
  --ink-soft:    #a89784;
  --ink-faint:   #5a5142;
  --land:        #1b1610;
  --land-edge:   #6b5a48;
  --accent:      #d94f3a;
  --accent-dark: #b03828;
  --accent-soft: rgba(217, 79, 58, 0.16);
  --gold:        #f08a78;
  --gold-soft:   #f4ad9c;
  --rule:        #2f2620;
  --shadow:      0 4px 20px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 24px 50px rgba(0, 0, 0, 0.65), 0 4px 10px rgba(0, 0, 0, 0.5);
  --font-serif:  'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --font-sans:   'Inter', system-ui, sans-serif;
}

/* ---- BASE --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-serif);
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 17px;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

#root { min-height: 100%; display: flex; flex-direction: column; }
.app { flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }

/* ---- TYPOGRAPHY --------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.005em; margin: 0; }
h1 { font-size: 56px; line-height: 1.05; }
h2 { font-size: 32px; line-height: 1.15; }
h3 { font-size: 20px; line-height: 1.25; }
p  { margin: 0 0 1em 0; text-wrap: pretty; }

em, .italic { font-style: italic; }

.section-h {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-sans);
}

.section-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-meta { font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.08em; color: var(--ink-soft); text-transform: uppercase; }
.section-lede { color: var(--ink-soft); font-style: italic; margin-bottom: 18px; }

/* ---- TOP BAR ------------------------------------------------------ */
.topbar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 16px 36px;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark { width: 24px; height: 24px; color: var(--accent); }
.brand__text { font-family: var(--font-serif); font-size: 18px; font-weight: 400; letter-spacing: 0.005em; }
.brand__text strong { font-weight: 700; font-style: normal; }
.brand__text em { font-style: italic; font-weight: 400; }

.topnav { display: flex; gap: 28px; margin-left: 12px; }
.topnav a {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 4px 0;
  border-bottom: 1.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.topnav a:hover { color: var(--ink); }
.topnav a.is-active { color: var(--ink); border-bottom-color: var(--accent); }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 20px; }

.tuition-toggle {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px;
  background: var(--paper-2);
}
.tuition-toggle__opt {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  transition: background 0.25s, color 0.25s;
}
.tuition-toggle__opt.is-active { background: var(--ink); color: var(--paper); }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px;
  background: transparent;
}
.lang-toggle__opt {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--ink-faint);
  transition: background 0.2s, color 0.2s;
}
.lang-toggle__opt.is-active { color: var(--gold); background: var(--accent-soft); }
.lang-toggle__opt:hover { color: var(--ink); }

.link-btn {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-soft);
  border-bottom: 1px dashed transparent;
  transition: color 0.2s, border-color 0.2s;
  padding-bottom: 1px;
}
.link-btn:hover { color: var(--ink); border-bottom-color: var(--ink-soft); }
.link-btn--mini { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---- BUTTONS ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--accent); }
.btn--ghost   { border-color: var(--rule); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn .arrow { transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(3px); }

.tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}
.tag--ghost { background: transparent; }

.dot { color: var(--ink-faint); margin: 0 6px; }

/* ---- CRUMBS ------------------------------------------------------- */
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.crumbs a:hover { color: var(--ink); }
.crumbs .crumb-current { color: var(--ink); }
.crumbs .crumb-sep { color: var(--ink-faint); }

/* =====================================================================
   MAP SCREEN
   ===================================================================== */
.map-screen {
  display: grid;
  grid-template-columns: 1fr 380px;
  min-height: calc(100vh - 64px);
}

/* Atlas (map route) — lock to viewport, no page scroll.
   Above 1000px (sidebar visible side-by-side) AND on phones ≤760px
   (sidebar hidden, map fills the viewport). In the 761–1000px band
   the sidebar stacks below the map and the page scrolls normally. */
@media (min-width: 1001px), (max-width: 760px) {
  body.route-map-active,
  html:has(main.route-map),
  body:has(main.route-map) {
    height: 100vh;
    overflow: hidden;
  }
  body.route-map-active #root,
  body:has(main.route-map) #root { height: 100vh; min-height: 0; }
  body.route-map-active .app,
  body:has(main.route-map) .app { height: 100vh; min-height: 0; }
  body.route-map-active main.route-map,
  body:has(main.route-map) main.route-map {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
  }
  body.route-map-active .map-screen,
  body:has(main.route-map) .map-screen {
    min-height: 0;
    height: 100%;
    flex: 1 1 0;
  }
  body.route-map-active .map-screen__sidebar,
  body:has(main.route-map) .map-screen__sidebar {
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
  }
  /* Slim chrome on the atlas route so the map keeps the most vertical
     room — Spain (southernmost pin) should always be visible. */
  body.route-map-active .topbar,
  body:has(main.route-map) .topbar { padding: 10px 28px; }
  body.route-map-active .app-foot,
  body:has(main.route-map) .app-foot {
    padding: 8px 28px 10px;
    gap: 2px;
    flex-shrink: 0;
  }
  body.route-map-active .app-foot__row--links,
  body:has(main.route-map) .app-foot__row--links { padding-top: 4px; }
}
.map-screen__map {
  background: var(--paper-2);
  border-right: 1px solid var(--rule);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  position: relative;
  touch-action: none;
}
.europe-map-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  touch-action: none;
}
.europe-map {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}
.europe-map.is-zoomed { cursor: grab; }
.europe-map.is-zoomed.is-dragging { cursor: grabbing; }

/* decorative title cartouche — HTML overlay in the upper-left of the map */
.map-cartouche {
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 4;
  pointer-events: none;
  color: var(--ink);
  font-family: var(--font-serif);
  max-width: 520px;
  user-select: none;
}
.map-cartouche__kicker {
  font-size: 26px;
  font-style: italic;
  line-height: 1.1;
  color: var(--ink);
  opacity: 0.92;
}
.map-cartouche__title {
  font-size: 50px;
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -0.01em;
  margin-top: 4px;
}
.map-cartouche__sub {
  font-size: 18px;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 8px;
  letter-spacing: 0.01em;
}
.map-cartouche__rules {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.map-cartouche__rule {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}
.map-cartouche__rule--1 { width: 360px; }
.map-cartouche__rule--2 { width: 160px; height: 1px; background: var(--gold-soft); }
@media (max-width: 1280px) {
  .map-cartouche__title { font-size: 40px; }
  .map-cartouche__kicker { font-size: 22px; }
  .map-cartouche__sub { font-size: 15px; }
  .map-cartouche__rule--1 { width: 280px; }
}

/* Country borders read stronger in the midnight palette specifically. */
:root[data-theme="midnight"] .country-path {
  stroke-width: 1.25 !important;
}

/* theme toggle (sun/moon) — upper-right of the map */
.map-theme-toggle {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-soft);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.4s cubic-bezier(0.4, 1.6, 0.4, 1);
}
.map-theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(-12deg);
}
:root[data-theme="midnight"] .map-theme-toggle:hover { transform: rotate(12deg); }
.map-theme-toggle svg { display: block; }

/* zoom controls — HTML overlay (stays fixed pixel size, never scales with map) */
.map-zoom {
  position: absolute;
  bottom: 18px;
  left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 4px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.map-zoom__btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1;
  color: var(--ink);
  background: transparent;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}
.map-zoom__btn:hover { background: var(--paper-2); color: var(--accent); }
.map-zoom__btn:disabled { opacity: 0.35; cursor: default; }
.map-zoom__btn:disabled:hover { background: transparent; color: var(--ink); }
.map-zoom__btn--reset { font-size: 16px; border-top: 1px solid var(--rule); margin-top: 2px; padding-top: 4px; height: 30px; }

/* Pins */
.pin-mark {
  transform-origin: center;
}
/* Active (selected) pin no longer scales — the popup card emerging from it
   is signal enough; the previous scale-on-click felt like the pin was
   jumping. Hover ripples (below) carry the interactive feedback. */

/* Hover ripples — three concentric waves emanating from the pin.
   Hidden by default, triggered on group hover. */
.pin-ripple {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  opacity: 0;
  transform-origin: center;
  transform-box: fill-box;
  /* will-change keeps the transform on the compositor; no layout thrash */
  will-change: transform, opacity;
}
g[data-pin-id]:hover .pin-ripple {
  animation: pinRipple 1.6s cubic-bezier(0.2, 0.6, 0.2, 1) infinite;
}
g[data-pin-id]:hover .pin-ripple--2 { animation-delay: 0.5s; }
g[data-pin-id]:hover .pin-ripple--3 { animation-delay: 1s; }
@keyframes pinRipple {
  0%   { transform: scale(1);   opacity: 0.55; stroke-width: 1.6; }
  70%  {                         opacity: 0.08; }
  100% { transform: scale(4.2); opacity: 0;    stroke-width: 0.6; }
}
/* Smaller pins get a slightly tighter ripple footprint */
g[data-pin-id][data-small="true"]:hover .pin-ripple {
  animation-duration: 1.4s;
}

.pin-label { fill: var(--ink); stroke: none; font-weight: 600; }
.pin-label__name { fill: var(--ink-soft); }
/* Legacy halo class retained as no-op for any cached markup */
.pin-halo { display: none; }
g[data-pin-id][data-active="true"] circle:nth-of-type(3) {
  fill: var(--accent-dark);
}
@keyframes pinPulse {
  0%   { r: 9;  opacity: 0.5; }
  100% { r: 26; opacity: 0;   }
}
g[data-pin-id]:hover circle:nth-of-type(3) {
  filter: brightness(1.15);
}

/* hide compass / graticule per tweak */
:root[data-show-compass="false"] .compass-rose { display: none; }
:root[data-show-graticule="false"] .graticule { display: none; }

/* ---- map sidebar -------------------------------------------------- */
.map-screen__sidebar {
  padding: 48px 38px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  background: var(--paper);
}
.sidebar-header__kicker {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.sidebar-header__kicker::after {
  content: '';
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.sidebar-header__title {
  font-size: 42px;
  line-height: 1.05;
  font-weight: 600;
  margin-bottom: 18px;
  font-style: italic;
}
.sidebar-header__lede {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
}

.sidebar-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.sidebar-stats > div { display: flex; flex-direction: column; align-items: flex-start; }
.sidebar-stats strong { font-size: 32px; font-weight: 600; font-family: var(--font-serif); }
.sidebar-stats span { font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }

.sidebar-instructions { display: flex; flex-direction: column; gap: 14px; }
.sidebar-instructions__line { display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 15px; color: var(--ink-soft); line-height: 1.5; }
.sidebar-instructions .ord { color: var(--gold); font-weight: 600; font-size: 17px; line-height: 1.4; }

.sidebar-foot { margin-top: auto; padding-top: 24px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* Short-viewport polish — tighten sidebar so the atlas fits without
   spawning an internal sidebar scrollbar on typical 800–900px laptops. */
@media (max-height: 900px) {
  .map-screen__sidebar { padding: 32px 34px; gap: 24px; }
  .sidebar-header__title { font-size: 36px; margin-bottom: 14px; }
  .sidebar-header__lede { font-size: 15px; }
  .sidebar-stats { padding: 14px 0; }
  .sidebar-stats strong { font-size: 26px; }
  .sidebar-instructions { gap: 10px; }
  .sidebar-instructions__line { font-size: 14px; }
  .sidebar-foot { padding-top: 16px; }
}
@media (max-height: 760px) {
  .map-screen__sidebar { padding: 24px 30px; gap: 18px; }
  .sidebar-header__kicker { margin-bottom: 10px; }
  .sidebar-header__title { font-size: 30px; margin-bottom: 10px; }
  .sidebar-header__lede { font-size: 14px; line-height: 1.45; }
  .sidebar-stats strong { font-size: 22px; }
}

/* =====================================================================
   PIN-EMERGING PREVIEW CARD
   ===================================================================== */
.pin-preview-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 0%, transparent);
  animation: dim 0.4s ease forwards;
}
@keyframes dim {
  to { background: color-mix(in srgb, var(--ink) 18%, transparent); }
}

.pin-preview {
  position: fixed;
  left: var(--origin-x);
  top: var(--origin-y);
  z-index: 41;
  pointer-events: none;
  width: 0;
  height: 0;
}

.pin-preview__card {
  position: absolute;
  /* default: open to the right of pin, vertically centered */
  left: 28px;
  top: -180px;
  width: 360px;
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-card);
  pointer-events: auto;
  border-radius: 2px;
  /* origin lives at the pin */
  transform-origin: -28px 180px;
}

/* Auto-flip if the pin sits in the right half */
.pin-preview[style*="--origin-x"] { /* always present */ }
@media (min-width: 900px) {
  /* note: we can't read --origin-x in CSS math reliably, so we handle
     overflow via a JS-set class .pin-preview--flip-x */
}
.pin-preview--flip-x .pin-preview__card {
  left: auto;
  right: 28px;
  transform-origin: calc(100% + 28px) 180px;
}
.pin-preview--flip-y .pin-preview__card {
  top: 28px;
}
.pin-preview--flip-y.pin-preview--flip-x .pin-preview__card {
  transform-origin: calc(100% + 28px) -28px;
}
.pin-preview--flip-y:not(.pin-preview--flip-x) .pin-preview__card {
  transform-origin: -28px -28px;
}

/* ---- BLOOM animation (default) ----------------------------------- */
:root[data-pin-anim="bloom"] .pin-preview--emerging .pin-preview__card {
  animation: bloom 0.62s cubic-bezier(0.2, 0.9, 0.25, 1.05) forwards;
}
@keyframes bloom {
  0%   { transform: scale(0) rotate(-4deg); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ---- UNFURL animation -------------------------------------------- */
:root[data-pin-anim="unfurl"] .pin-preview--emerging .pin-preview__card {
  animation: unfurl 0.7s cubic-bezier(0.3, 0.9, 0.2, 1) forwards;
  transform-origin: center top !important;
}
@keyframes unfurl {
  0%   { transform: scaleY(0) translateY(-10px); opacity: 0; }
  50%  { opacity: 1; }
  100% { transform: scaleY(1) translateY(0); opacity: 1; }
}

/* ---- RISE animation ---------------------------------------------- */
:root[data-pin-anim="rise"] .pin-preview--emerging .pin-preview__card {
  animation: rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes rise {
  0%   { transform: translateY(24px) scale(0.92); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* ---- card contents ------------------------------------------------ */
.pin-preview__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: white;
  font-size: 20px;
  line-height: 1;
  z-index: 2;
  transition: background 0.2s;
}
.pin-preview__close:hover { background: rgba(0,0,0,0.65); }

.pin-preview__hero {
  height: 130px;
  background-size: cover;
  background-position: center;
  background-color: var(--paper-3);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  background-blend-mode: multiply;
}
.pin-preview__hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.55), rgba(0,0,0,0));
}
.pin-preview__locale {
  position: relative;
  z-index: 1;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #fff;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pin-preview__body { padding: 18px 20px 22px; }
.pin-preview__name { font-size: 24px; font-weight: 600; line-height: 1.1; margin-bottom: 8px; }
.pin-preview__blurb { color: var(--ink-soft); font-size: 15px; line-height: 1.4; margin-bottom: 14px; }

.pin-preview__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 14px;
}
.pin-preview__stats--two { grid-template-columns: repeat(2, 1fr); }
.pin-preview__stats > div { display: flex; flex-direction: column; }
.pin-preview__stats strong { font-size: 22px; font-weight: 600; }
.pin-preview__stats span { font-family: var(--font-sans); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }

.pin-preview__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.pin-preview__tags .tag { font-size: 10px; padding: 3px 8px; }

.pin-preview__cta { width: 100%; justify-content: center; }

/* =====================================================================
   DETAIL PAGES
   ===================================================================== */
.detail-page { max-width: 1180px; margin: 0 auto; padding: 36px 36px 80px; }
.page-empty { padding: 80px; text-align: center; color: var(--ink-soft); font-style: italic; }

/* ---- Institution hero -------------------------------------------- */
.inst-hero { position: relative; height: 380px; margin-bottom: 48px; overflow: hidden; }
.inst-hero__image { position: absolute; inset: 0; background-size: cover; background-position: center; }
.inst-hero__vignette {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.55) 70%, rgba(0,0,0,0.8) 100%);
}
.inst-hero__overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 36px 42px;
  color: #fff;
}
.inst-hero__locale {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: 0.92;
}
.inst-hero__locale .dot { color: rgba(255,255,255,0.5); }
.inst-hero__name {
  font-size: 56px;
  font-weight: 600;
  line-height: 1.05;
  margin-bottom: 12px;
  max-width: 800px;
  letter-spacing: -0.01em;
}
.inst-hero__blurb {
  font-size: 19px;
  line-height: 1.4;
  font-style: italic;
  max-width: 720px;
  opacity: 0.94;
  margin-bottom: 16px;
}
.inst-hero__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.inst-hero__tags .tag { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); color: rgba(255,255,255,0.92); backdrop-filter: blur(4px); }

/* Conservatory logo in upper-right of the hero photo.
   Uses a small white card so logos with or without their own
   transparency read cleanly against any banner image. */
.inst-hero__logo {
  position: absolute;
  top: 22px;
  right: 26px;
  z-index: 2;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 4px;
  padding: 10px 14px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  max-width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inst-hero__logo img {
  display: block;
  max-width: 100%;
  max-height: 64px;
  height: auto;
  width: auto;
  object-fit: contain;
}

/* ---- Institution body grid --------------------------------------- */
.inst-body { display: grid; grid-template-columns: 1fr 320px; gap: 56px; }
.inst-body__main { min-width: 0; }
.inst-body__side { display: flex; flex-direction: column; gap: 20px; }

.prose-section { margin-bottom: 56px; }
.prose-section p { font-size: 17px; line-height: 1.65; color: var(--ink); }

/* side cards */
.side-card { padding: 22px 24px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 2px; }
.side-card h3 {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.defs { margin: 0; display: grid; grid-template-columns: 110px 1fr; row-gap: 10px; }
.defs dt { color: var(--ink-soft); font-size: 14px; }
.defs dd { margin: 0; font-size: 14px; }

.side-card--tuition { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.side-card--tuition h3 { color: var(--paper); opacity: 0.6; }
.tuition-amount { font-size: 38px; font-weight: 600; line-height: 1; margin-bottom: 6px; }
.tuition-period { font-size: 14px; opacity: 0.5; font-weight: 400; }
.tuition-mode { font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.65; margin-bottom: 14px; }
.tuition-other { font-family: var(--font-sans); font-size: 12px; opacity: 0.55; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.12); }

.bulleted { margin: 0; padding-left: 18px; }
.bulleted li { font-size: 15px; line-height: 1.5; margin-bottom: 4px; }

/* ---- INSTRUMENTS LIST (clickable teacher names → faculty pages) ---- */
.instruments-section { }
.instr-group { margin-bottom: 22px; }
.instr-group:last-child { margin-bottom: 0; }
.instr-group__head {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin: 18px 0 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gold-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}
.instr-group:first-child .instr-group__head { margin-top: 4px; }

.instr-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.instr-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 9px 4px;
  border-bottom: 1px solid var(--rule);
  outline: none;
}
.instr-row:last-child { border-bottom: 0; }
.instr-row__main { min-width: 0; }
.instr-row__name {
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-serif);
  line-height: 1.25;
  margin-bottom: 3px;
  letter-spacing: -0.005em;
}
.instr-row__teachers {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
}
.instr-row__teacher-label {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  flex-shrink: 0;
}
.teacher-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.teacher-chip {
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink-soft);
}
.teacher-chip__btn {
  font: inherit;
  color: var(--ink);
  font-style: italic;
  font-weight: 500;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.teacher-chip__btn:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.teacher-chip__btn:focus-visible {
  outline: none;
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.teacher-chip__note {
  font-style: italic;
  color: var(--ink-faint);
  font-size: 13px;
}
.instr-row__levels {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  padding-top: 2px;
}

/* legacy instruments-grid (kept in case theme is reused) */
.instruments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
  margin-top: 8px;
}
.inst-instrument {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.inst-instrument:hover { border-color: var(--ink-soft); box-shadow: var(--shadow); }
.inst-instrument__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.inst-instrument__name {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  font-family: var(--font-serif);
  letter-spacing: -0.005em;
}
.inst-instrument__levels {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.level-pill {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  background: var(--paper-2);
}
.level-pill--ba { color: var(--ink); border-color: var(--ink-soft); }
.level-pill--ma { color: white; background: var(--accent); border-color: var(--accent); }

.inst-instrument__teacher {
  display: grid;
  grid-template-columns: 52px 1fr 16px;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 10px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  width: 100%;
}
.inst-instrument__teacher:hover {
  background: var(--paper);
  border-color: var(--accent);
}
.inst-instrument__teacher:hover .inst-instrument__arrow {
  color: var(--accent);
  transform: translateX(3px);
}
.inst-instrument__portrait {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-size: cover;
  background-position: center top;
  background-color: var(--paper-3);
  filter: grayscale(0.3);
  border: 1px solid var(--rule);
}
.inst-instrument__teacher-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.inst-instrument__teacher-label {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1px;
}
.inst-instrument__teacher-name {
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-serif);
  line-height: 1.2;
}
.inst-instrument__teacher-also {
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: var(--accent);
  margin-top: 3px;
  letter-spacing: 0.02em;
}
.inst-instrument__arrow {
  color: var(--ink-soft);
  font-size: 16px;
  transition: color 0.2s, transform 0.2s;
}

/* ---- GENERAL COURSES ---- */
.gencourses-section { }
.gencourse-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.gencourse-chip {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 12px 16px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: 15px;
  line-height: 1.35;
}
.gencourse-chip__bullet {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--accent);
  font-size: 18px;
  font-weight: 600;
}
.gencourse-chip__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.gencourse-chip__name {
  display: block;
}
.gencourse-chip--with-teachers .gencourse-chip__name {
  font-weight: 600;
  font-family: var(--font-serif);
  font-size: 16px;
}
.teacher-chips--mini {
  font-size: 13px;
}
.teacher-chips--mini .teacher-chip { font-size: 13px; }
.teacher-chips--mini .teacher-chip__btn { font-size: 13px; }

/* ---- DEGREE LIST (small, secondary now) ---- */
.degree-list { list-style: none; margin: 0; padding: 0; }
.degree-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
  font-style: italic;
  color: var(--ink-soft);
}
.degree-row:first-child { border-top: 1px solid var(--rule); }

/* ---- SPECIAL DEGREES OFFERED ---- */
.special-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.special-pill {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper-2);
  transition: border-color 0.2s, background 0.2s;
}
.special-pill__glyph {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1;
  text-align: center;
  color: var(--ink-faint);
}
.special-pill__label {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink-soft);
}
.special-pill__state {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.special-pill.is-on {
  background: var(--paper);
  border-color: var(--gold);
}
.special-pill.is-on .special-pill__glyph { color: var(--gold); }
.special-pill.is-on .special-pill__label { color: var(--ink); }
.special-pill.is-on .special-pill__state { color: var(--gold); font-weight: 600; }
.special-pill.is-off { opacity: 0.55; }
.special-pill.is-off .special-pill__label { text-decoration: line-through; text-decoration-color: var(--ink-faint); text-decoration-thickness: 1px; }

/* ---- Course list rows -------------------------------------------- */
.course-list { list-style: none; margin: 0; padding: 0; }
.course-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: padding-left 0.2s;
}
.course-row:hover { padding-left: 8px; }
.course-row__title { display: flex; align-items: baseline; gap: 12px; }
.course-row__degree {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-soft);
}
.course-row__name { font-size: 18px; font-weight: 500; }
.course-row__meta { font-family: var(--font-sans); font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }

/* ---- Faculty grid ------------------------------------------------- */
.faculty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.faculty-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
}
.faculty-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.faculty-card__portrait {
  height: 180px;
  background-size: cover;
  background-position: center top;
  background-color: var(--paper-3);
  filter: grayscale(0.4) sepia(0.05);
}
:root[data-theme="midnight"] .faculty-card__portrait { filter: grayscale(0.45) brightness(0.82); }
:root[data-theme="midnight"] .fac-hero__portrait     { filter: grayscale(0.35) brightness(0.85); }
:root[data-theme="midnight"] .inst-instrument__portrait { filter: grayscale(0.4) brightness(0.85); }
:root[data-theme="midnight"] .peer-chip__portrait { filter: grayscale(0.4) brightness(0.85); }
:root[data-theme="midnight"] .pin-preview__hero { background-blend-mode: normal; }
.faculty-card__body { padding: 14px 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.faculty-card__name { font-size: 19px; font-weight: 600; line-height: 1.15; }
.faculty-card__instrument { font-size: 15px; font-style: italic; color: var(--ink-soft); margin-bottom: 2px; }
.faculty-card__also {
  margin-top: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent);
  border-top: 1px dashed var(--rule);
  padding-top: 8px;
}

/* ---- Cross-section: shared faculty ------------------------------- */
.cross-section { background: var(--paper-2); padding: 32px 36px; margin-left: -36px; margin-right: -36px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 56px; }
.cross-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.cross-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.cross-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.cross-card__head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.cross-card__arrow { color: var(--accent); font-size: 18px; }
.cross-card__name { font-weight: 600; font-size: 17px; flex: 1; }
.cross-card__city { font-family: var(--font-sans); font-size: 11px; color: var(--ink-soft); letter-spacing: 0.04em; }
.cross-card__list { list-style: none; margin: 0; padding: 0; }
.cross-card__list li { font-size: 14px; padding: 4px 0; color: var(--ink-soft); cursor: pointer; }
.cross-card__list li em { color: var(--ink); font-style: italic; }
.cross-card__list li:hover { color: var(--accent); }

/* =====================================================================
   FACULTY PAGE
   ===================================================================== */
.fac-hero { display: grid; grid-template-columns: 240px 1fr; gap: 40px; margin-bottom: 48px; padding-bottom: 40px; border-bottom: 1px solid var(--rule); }
.fac-hero__portrait-wrap { display: flex; flex-direction: column; gap: 8px; }
.fac-hero__portrait {
  width: 240px; height: 300px;
  background-size: cover; background-position: center top;
  background-color: var(--paper-3);
  filter: grayscale(0.3);
  border: 1px solid var(--rule);
}
.fac-hero__credit {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-transform: uppercase;
  line-height: 1.3;
  max-width: 240px;
}
.fac-hero__instrument {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.fac-hero__name { font-size: 56px; font-weight: 600; line-height: 1.0; margin-bottom: 16px; }
.fac-hero__line { display: flex; align-items: center; gap: 8px; font-family: var(--font-sans); font-size: 12px; color: var(--ink-soft); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 20px; }
.fac-hero__bio { font-size: 17px; line-height: 1.55; color: var(--ink); margin-bottom: 18px; max-width: 640px; }
.fac-hero__focus { display: flex; flex-wrap: wrap; gap: 8px; }

.teaches-at-section { padding: 28px 32px; background: var(--paper-2); margin-left: -32px; margin-right: -32px; border-radius: 2px; border: 1px solid var(--rule); }
.teaches-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.teaches-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
  align-items: center;
}
.teaches-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.teaches-card__thumb { width: 80px; height: 80px; background-size: cover; background-position: center; border: 1px solid var(--rule); }
.teaches-card__body { min-width: 0; }
.teaches-card__locale { display: flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.teaches-card__name { font-size: 16px; font-weight: 600; line-height: 1.2; margin-bottom: 4px; }
.teaches-card__blurb { font-size: 12px; font-style: italic; color: var(--ink-soft); }
.teaches-card__cta { position: absolute; right: 14px; top: 14px; font-family: var(--font-sans); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); opacity: 0; transition: opacity 0.2s; }
.teaches-card:hover .teaches-card__cta { opacity: 1; }

/* peers */
.peers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.peer-chip { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--rule); cursor: pointer; transition: border-color 0.2s; }
.peer-chip:hover { border-color: var(--accent); }
.peer-chip__portrait { width: 48px; height: 48px; border-radius: 50%; background-size: cover; background-position: center top; filter: grayscale(0.3); }
.peer-chip__name { font-size: 14px; font-weight: 600; line-height: 1.2; }
.peer-chip__inst { font-size: 11px; font-style: italic; color: var(--ink-soft); }

/* =====================================================================
   COURSE PAGE
   ===================================================================== */
.course-hero { padding: 36px 0 32px; border-bottom: 1px solid var(--rule); margin-bottom: 48px; }
.course-hero__kicker {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.course-hero__degree-badge {
  font-family: var(--font-sans);
  background: var(--accent);
  color: white;
  padding: 4px 10px;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.course-hero__inst { border-bottom: 1px solid var(--rule); color: var(--ink); padding-bottom: 1px; }
.course-hero__inst:hover { border-bottom-color: var(--accent); }
.course-hero__title { font-size: 52px; font-weight: 600; line-height: 1.05; margin-bottom: 26px; max-width: 900px; }
.course-hero__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; padding-top: 16px; border-top: 1px solid var(--rule); }
.course-hero__facts > div { display: flex; flex-direction: column; }
.fact-label { font-family: var(--font-sans); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.fact-value { font-size: 18px; font-weight: 500; }

/* =====================================================================
   DIRECTORY
   ===================================================================== */
.directory-page, .search-page { max-width: 1180px; margin: 0 auto; padding: 36px 36px 80px; }
.dir-header { margin-bottom: 32px; }
.dir-header h1 { font-size: 56px; margin-bottom: 8px; font-style: italic; }
.dir-header .lede { color: var(--ink-soft); font-size: 18px; font-style: italic; margin: 0; }
.dir-header .lede-link { color: var(--ink); border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
.dir-header .lede-link:hover { color: var(--accent); }

.dir-table__muted { color: var(--ink-soft); font-size: 13px; }

.dir-controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.dir-tabs { display: flex; gap: 24px; }
.dir-tab {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 1.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.dir-tab span { margin-left: 6px; font-size: 11px; color: var(--ink-faint); }
.dir-tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.dir-tab.is-active span { color: var(--accent); }

.dir-search {
  font: inherit;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 14px;
  width: 220px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.dir-search:focus { border-color: var(--accent); }

.dir-table { width: 100%; border-collapse: collapse; }
.dir-table th {
  text-align: left;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}
.dir-table td { padding: 16px; border-bottom: 1px solid var(--rule); font-size: 15px; }
.dir-table tr { cursor: pointer; transition: background 0.15s; }
.dir-table tbody tr:hover { background: var(--paper-2); }
.dir-table strong { font-weight: 600; }

/* =====================================================================
   SEARCH PAGE
   ===================================================================== */
.search-controls {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.search-input {
  width: 100%;
  font: inherit;
  font-size: 18px;
  padding: 14px 18px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 16px;
  font-family: var(--font-serif);
  font-style: italic;
}
.search-input::placeholder { color: var(--ink-faint); font-style: italic; }
.search-input:focus { border-color: var(--accent); background: var(--paper); }

.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  align-items: flex-end;
}
.search-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-sans);
}
.search-filter > span {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}
.search-filter select {
  font: inherit;
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 7px 28px 7px 12px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%236b5d4f' stroke-width='1.2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 140px;
  transition: border-color 0.2s;
}
.search-filter select:focus { border-color: var(--accent); outline: none; }

.search-clear {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 8px 4px;
  border-bottom: 1px dashed transparent;
  align-self: flex-end;
}
.search-clear:hover { border-bottom-color: var(--accent); }

.search-section { margin-bottom: 48px; }
.search-section__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.search-section__head .section-h { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; flex: 1; }
.section-count {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--accent);
  font-style: normal;
  letter-spacing: 0.04em;
}
.search-empty {
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  background: var(--paper-2);
  border: 1px dashed var(--rule);
}

/* =====================================================================
   TUTORIAL
   ===================================================================== */
.tutorial-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 12, 4, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.tutorial {
  background: var(--paper);
  width: min(900px, calc(100vw - 32px));
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 380px 1fr;
  animation: tutSlide 0.5s cubic-bezier(0.2, 0.9, 0.2, 1);
  overflow: hidden;
}
.tutorial--choice {
  grid-template-columns: 1fr;
  width: min(560px, calc(100vw - 48px));
}
.tutorial--choice .tutorial__body { padding: 40px 40px 32px; }

.tutorial--support {
  grid-template-columns: 380px 1fr;
}
.tutorial__art--support {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-2);
  border-right: 1px solid var(--rule);
  padding: 20px;
}
.tutorial__art--support .tut-art {
  max-width: 220px;
  width: 100%;
  height: auto;
}
.tutorial__support-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.tutorial__support-actions .btn { padding: 14px 24px; }

/* tutorial Europe preview keeps its container fully */
.tut-europe-wrap {
  width: 100%;
  height: 100%;
  min-height: 360px;
  display: flex;
}
.tut-art--europe {
  width: 100%;
  height: 100%;
}
.tutorial__choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 22px 0 18px;
}
.choice-card {
  text-align: left;
  padding: 20px 22px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.choice-card:hover { border-color: var(--accent); background: var(--paper); transform: translateY(-2px); }
.choice-card__title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  font-style: italic;
}
.choice-card__sub {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
}
.tutorial__choice-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  margin-top: 8px;
}
.tutorial__choice-hint {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  font-style: italic;
}
@keyframes tutSlide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.tutorial__art { background: var(--paper-2); border-right: 1px solid var(--rule); display: flex; align-items: stretch; justify-content: stretch; padding: 0; min-height: 380px; }
.tut-art { width: 100%; height: auto; max-width: 360px; display: block; }
/* legacy schematic arts (cross, zoom) keep their fixed centered layout */
.tutorial__art:has(.tut-art:not(.tut-art--europe)) {
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tutorial__body { padding: 36px 36px 28px; display: flex; flex-direction: column; }
.tutorial__step { font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.tutorial__body h2 { font-size: 28px; line-height: 1.1; margin-bottom: 14px; font-style: italic; }
.tutorial__body p { color: var(--ink-soft); font-size: 16px; line-height: 1.5; flex: 1; }
.tutorial__nav { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--rule); }
.tutorial__nav-right { display: flex; gap: 10px; }

/* =====================================================================
   FOOTER
   ===================================================================== */
.app-foot {
  padding: 24px 36px 28px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.app-foot__row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.app-foot__row--links {
  border-top: 1px dashed var(--rule);
  padding-top: 12px;
  justify-content: flex-start;
  gap: 6px;
}
.app-foot__row--links .link-btn--mini { font-size: 11px; }

/* =====================================================================
   CONSENT BANNER
   ===================================================================== */
.consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 720px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: var(--shadow-card);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 200;
  animation: consentSlide 0.4s cubic-bezier(0.2, 0.9, 0.2, 1);
}
@keyframes consentSlide {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.consent-banner__text {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  flex: 1;
}
.consent-banner__text .link-btn--mini {
  color: var(--gold);
  border-bottom-color: var(--gold-soft);
  font-size: 12px;
}
.consent-banner__btn {
  padding: 8px 18px;
  font-size: 11px;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .consent-banner { flex-direction: column; align-items: stretch; padding: 16px; }
  .consent-banner__btn { width: 100%; }
}

/* =====================================================================
   LEGAL PAGES (Privacy / Terms / Sources)
   ===================================================================== */
.legal-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 36px 80px;
}
.legal-page__head {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.legal-page__kicker {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 14px;
}
.legal-page__title {
  font-size: 52px;
  line-height: 1.05;
  font-weight: 600;
  margin-bottom: 14px;
  font-style: italic;
}
.legal-page__lede {
  font-family: var(--font-serif);
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1.5;
  font-style: italic;
  margin: 0;
}
.legal-page__body { color: var(--ink); }
.legal-page__body section {
  margin-bottom: 36px;
}
.legal-page__body h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 12px;
  line-height: 1.25;
  font-style: italic;
}
.legal-page__body p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 12px;
}
.legal-page__body ul {
  padding-left: 22px;
  margin: 8px 0 16px;
}
.legal-page__body li {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.legal-page__body li strong { color: var(--ink); }
.legal-page__body code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 13px;
  padding: 1px 6px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink);
}
.legal-page__sigblock {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.legal-page__updated {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}
.lp-link {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color 0.2s, color 0.2s;
  padding-bottom: 0;
}
.lp-link:hover { border-bottom-color: var(--accent); }
.lp-link--btn {
  background: none;
  border: none;
  border-bottom: 1px solid var(--accent-soft);
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--accent);
  text-align: inherit;
}
.lp-link--btn:hover { border-bottom-color: var(--accent); }

.legal-note {
  padding: 14px 18px;
  background: var(--accent-soft);
  border-left: 3px solid var(--gold);
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 32px;
}
.legal-note em { font-style: italic; color: var(--ink); }

.sources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 8px 0 0;
}
.sources-table th {
  text-align: left;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}
.sources-table td {
  padding: 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}

/* =====================================================================
   SUPPORT PAGE
   ===================================================================== */
.support-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 36px 80px;
}
.support-hero {
  text-align: center;
  margin-bottom: 56px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}
.support-hero__kicker {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 16px;
}
.support-hero__title {
  font-size: 60px;
  line-height: 1.05;
  font-weight: 600;
  margin-bottom: 16px;
  font-style: italic;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.support-hero__lede {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--ink-soft);
  line-height: 1.55;
  font-style: italic;
  max-width: 640px;
  margin: 0 auto;
}
.support-section {
  margin: 0 auto 48px;
  max-width: 760px;
}
.support-section p {
  font-size: 16px;
  line-height: 1.65;
}

.cost-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.cost-table th {
  text-align: left;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}
.cost-table td {
  padding: 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
}
.cost-table__num {
  text-align: right;
  font-feature-settings: "tnum";
  color: var(--ink-soft);
}
.cost-table__total td {
  border-top: 1.5px solid var(--ink);
  border-bottom: 0;
  padding-top: 14px;
}
.lp-placeholder {
  display: inline-block;
  min-width: 1.5em;
  color: var(--ink-faint);
  border-bottom: 1px dashed var(--ink-faint);
}
.lp-microcopy {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-soft);
  font-style: italic;
  line-height: 1.5;
}

.support-crowdfund {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 28px 28px 24px;
  margin-bottom: 36px;
}
.crowdfund-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 16px;
}
.crowdfund-widget-wrap {
  width: 220px;
  height: 250px;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}
.crowdfund-widget {
  width: 220px;
  height: 250px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  display: block;
}
.crowdfund-copy { display: flex; flex-direction: column; gap: 14px; }
.crowdfund-copy p { margin: 0; font-family: var(--font-serif); font-size: 16px; line-height: 1.6; color: var(--ink); }
.crowdfund-copy .btn { align-self: flex-start; }

/* Larger "hero" variant — used when crowdfund block is the first thing on the page */
.support-crowdfund--hero {
  max-width: 1000px;
  padding: 40px 44px 36px;
  margin-bottom: 56px;
  border-left-width: 4px;
}
.support-crowdfund--hero .section-h { font-size: 28px; margin-bottom: 6px; }
.support-crowdfund--hero .section-lede { font-size: 18px; line-height: 1.55; }
.support-crowdfund--hero .crowdfund-row {
  grid-template-columns: 374px 1fr;
  gap: 40px;
  align-items: center;
  margin-top: 24px;
}
.support-crowdfund--hero .crowdfund-widget-wrap {
  width: 374px;
  height: 425px;
}
.support-crowdfund--hero .crowdfund-widget {
  width: 220px;
  height: 250px;
  transform: scale(1.7);
  transform-origin: top left;
}
.support-crowdfund--hero .crowdfund-copy { gap: 18px; }
.support-crowdfund--hero .crowdfund-copy p { font-size: 18px; line-height: 1.6; }
.support-crowdfund--hero .btn--lg {
  padding: 16px 26px;
  font-size: 15px;
  letter-spacing: 0.04em;
}

@media (max-width: 760px) {
  .crowdfund-row { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .crowdfund-copy .btn { align-self: center; }
  .support-crowdfund--hero { padding: 24px 20px; }
  .support-crowdfund--hero .crowdfund-row { grid-template-columns: 1fr; gap: 24px; justify-items: center; }
  .support-crowdfund--hero .crowdfund-widget-wrap { width: 330px; height: 375px; }
  .support-crowdfund--hero .crowdfund-widget { transform: scale(1.5); }
}

.support-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 48px;
}
.tier-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.tier-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.tier-card--featured {
  background: var(--paper);
  border-color: var(--gold);
  border-width: 1.5px;
  position: relative;
}
.tier-card--featured::before {
  content: '';
  position: absolute;
  top: -1.5px; left: -1.5px; right: -1.5px;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold), var(--gold-soft));
  border-radius: 4px 4px 0 0;
}
.tier-card__icon { font-size: 28px; line-height: 1; }
.tier-card__title {
  font-size: 22px;
  font-weight: 600;
  font-style: italic;
}
.tier-card__price {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.tier-card__body {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  flex: 1;
  margin: 0;
}
.tier-card__cta { width: 100%; justify-content: center; margin-top: 6px; }

.support-legal {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  border-radius: 2px;
  padding: 22px 26px;
  margin: 0 auto 48px;
  max-width: 760px;
}
.support-legal h3 {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 10px;
}
.support-legal p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}

.support-other-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.support-other-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
  line-height: 1.55;
}
.support-other-list li:first-child { border-top: 1px solid var(--rule); }

/* =====================================================================
   CONTACT PAGE
   ===================================================================== */
.contact-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 36px 80px;
}
.contact-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 32px;
}
.contact-tab {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 22px;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}
.contact-tab:hover { color: var(--ink); }
.contact-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.contact-panel {}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 640px;
}
.contact-form__intro {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  padding: 12px 16px;
  background: var(--paper-2);
  border-left: 3px solid var(--ink-faint);
  border-radius: 2px;
  margin: 0 0 8px;
}
.contact-form__intro--priority {
  background: rgba(176, 138, 62, 0.10);
  border-left-color: var(--gold);
}
.contact-form__intro--gdpr {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-field > span {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}
.contact-field input,
.contact-field select,
.contact-field textarea {
  font: inherit;
  font-size: 15px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
  font-family: var(--font-serif);
}
.contact-field textarea { font-family: var(--font-serif); resize: vertical; }
.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  border-color: var(--accent);
}
.contact-field__warn {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--accent);
  font-style: italic;
  margin-top: 2px;
}
.contact-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.contact-form button[type="submit"] {
  align-self: flex-start;
  margin-top: 8px;
}

.lp-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 14px 22px;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 13px;
  z-index: 300;
  box-shadow: var(--shadow-card);
  animation: toastIn 0.3s ease;
  max-width: 90vw;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* generic legal/support modal */
.lp-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 12, 4, 0.55);
  backdrop-filter: blur(4px);
  z-index: 250;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.lp-modal {
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-card);
  padding: 32px 36px 28px;
  max-width: 480px;
  width: 100%;
  position: relative;
  border-radius: 4px;
}
.lp-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  border-radius: 50%;
}
.lp-modal__close:hover { color: var(--ink); background: var(--paper-2); }
.lp-modal h2 {
  font-size: 24px;
  font-style: italic;
  margin: 0 0 12px;
}
.lp-modal p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

@media (max-width: 700px) {
  .support-tiers { grid-template-columns: 1fr; }
  .contact-field-row { grid-template-columns: 1fr; }
  .contact-tabs { overflow-x: auto; }
  .contact-tab { white-space: nowrap; padding: 12px 14px; font-size: 11px; }
  .legal-page__title, .support-hero__title { font-size: 38px; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1000px) {
  .map-screen { grid-template-columns: 1fr; }
  .map-screen__map { min-height: 60vh; }
  .map-screen__sidebar { padding: 32px 24px; border-top: 1px solid var(--rule); }
  .inst-body { grid-template-columns: 1fr; gap: 40px; }
  .inst-hero__name, .fac-hero__name, .course-hero__title, .dir-header h1 { font-size: 40px; }
  .fac-hero { grid-template-columns: 1fr; }
  .fac-hero__portrait { width: 200px; height: 250px; }
  .pin-preview__card { width: 320px; }
  .tutorial { grid-template-columns: 1fr; }
  .tutorial--choice { grid-template-columns: 1fr; }
  .tutorial--support { grid-template-columns: 1fr; }
  .tutorial__art { height: 280px; min-height: 220px; }
  .tut-europe-wrap { min-height: 240px; }
  .tutorial__art:has(.tut-art:not(.tut-art--europe)) { padding: 20px; }
}

@media (max-width: 760px) {
  /* On phones, the atlas IS the page — drop the "where to study" sidebar
     so the map gets the full viewport. */
  body.route-map-active .map-screen { grid-template-columns: 1fr; }
  body.route-map-active .map-screen__sidebar { display: none; }
  body.route-map-active .map-screen__map { border-right: 0; min-height: 0; }

  /* Atlas cartouche shrinks on phones so it doesn't dominate the map. */
  .map-cartouche { top: 12px; left: 14px; max-width: 70%; }
  .map-cartouche__kicker { font-size: 14px; }
  .map-cartouche__title { font-size: 22px; }
  .map-cartouche__sub { font-size: 11px; margin-top: 4px; }
  .map-cartouche__rule--1 { width: 140px; height: 1.5px; }
  .map-cartouche__rule--2 { width: 70px; }

  /* Directory + search: tables become a card list so nothing overflows. */
  .directory-page, .search-page { padding: 20px 14px 60px; }
  .dir-table, .dir-table thead, .dir-table tbody, .dir-table tr, .dir-table th, .dir-table td { display: block; }
  .dir-table thead { display: none; }
  .dir-table tr {
    border: 1px solid var(--rule);
    border-radius: 4px;
    margin-bottom: 12px;
    padding: 14px 16px;
    background: var(--paper);
  }
  .dir-table tbody tr:hover { background: var(--paper); }
  .dir-table td {
    border-bottom: 0;
    padding: 4px 0;
    font-size: 14px;
    line-height: 1.4;
  }
  .dir-table td:first-child {
    font-size: 17px;
    padding-bottom: 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--rule);
  }
  .dir-table td:first-child strong { font-size: 17px; font-weight: 600; }
  .dir-table td[data-label]::before {
    content: attr(data-label);
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-right: 8px;
  }
  .dir-table__muted { color: var(--ink-soft); }

  .dir-header h1 { font-size: 38px; }
  .dir-header .lede { font-size: 15px; }
}

@media (max-width: 600px) {
  .topbar { padding: 12px 16px; gap: 16px; flex-wrap: wrap; }
  .topnav { gap: 16px; }
  .detail-page, .directory-page, .search-page { padding: 24px 14px 60px; }
  .inst-hero__overlay { padding: 24px 20px; }
  .inst-hero__name { font-size: 32px; }
  .inst-hero__logo { top: 14px; right: 14px; padding: 6px 10px; max-width: 120px; }
  .inst-hero__logo img { max-height: 44px; }
  .dir-controls { flex-direction: column; align-items: stretch; gap: 12px; }
  .dir-search { width: 100%; }
  .search-filters { gap: 12px; }
  .search-filter { flex: 1; min-width: 140px; }
  .search-filter select { width: 100%; min-width: 0; }

  /* Pin previews stack vertically on phones — equal sized, never overlap.
     The layer becomes a scrollable column so Brussels (KCB + CRB) and any
     future shared-pin city read cleanly.
     Solid backdrop on mobile so the page underneath doesn't bleed through
     and make the card look transparent. */
  .pin-preview-layer {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 18px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: color-mix(in srgb, var(--ink) 55%, transparent) !important;
    animation: none !important;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
  /* CRITICAL: the desktop rule sets width:0; height:0 on .pin-preview (it's a
     pointer-anchor in the desktop layout). On mobile we have to wipe BOTH
     dimensions or the flex container collapses the card to 0 height and
     the page below appears to "bleed through" the popup. */
  .pin-preview {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
    pointer-events: auto !important;
  }
  .pin-preview__card {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    width: min(calc(100vw - 28px), 420px) !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    transform-origin: center center !important;
    margin: 0 !important;
    background: var(--paper) !important;
  }
  .pin-preview__hero { height: 110px; }
  .pin-preview__body { padding: 16px 18px 20px; }
  .pin-preview__name { font-size: 21px; }
  .pin-preview__blurb { font-size: 14px; }
  .tutorial__choice { grid-template-columns: 1fr; }
  .choice-card { padding: 16px 18px; }
}

/* =====================================================================
   UPDATE LOG (sidebar)
   ===================================================================== */
.update-log {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--rule);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.update-log__head { display: flex; flex-direction: column; gap: 4px; }
.update-log__title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}
.update-log__sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-faint);
  margin: 0;
}
.update-log__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.update-log__list::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--rule);
}
.update-log__item {
  position: relative;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13.5px;
  line-height: 1.45;
}
.update-log__item::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--accent);
}
.update-log__item:first-child::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.update-log__date {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.update-log__body {
  color: var(--ink-soft);
  font-size: 13.5px;
}

@media (max-height: 860px) {
  .update-log { margin-top: 14px; padding-top: 14px; gap: 10px; }
  .update-log__list { gap: 8px; }
  .update-log__item { font-size: 12.5px; }
  .update-log__body { font-size: 12.5px; }
}

/* =====================================================================
   MAP VERSION / BETA BADGE
   ===================================================================== */
.map-version {
  position: absolute;
  right: 20px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 8px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  z-index: 4;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  user-select: none;
  pointer-events: none;
}
.map-version__badge {
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  background: var(--accent);
  color: var(--paper);
  padding: 3px 7px;
  border-radius: 999px;
  line-height: 1;
}
.map-version__num {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
}
.map-version__edition {
  font-style: italic;
  font-family: var(--font-serif);
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0;
  border-left: 1px solid var(--rule);
  padding-left: 10px;
}
@media (max-width: 760px) {
  .map-version { right: 12px; bottom: 12px; padding: 4px 10px 4px 6px; gap: 8px; }
  .map-version__edition { display: none; }
}

/* =====================================================================
   GLOBAL ALPHA — topbar button
   ===================================================================== */
.global-alpha-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}
.global-alpha-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--paper);
}
.global-alpha-btn__globe { display: inline-flex; color: var(--accent); }
.global-alpha-btn__label { line-height: 1; }
.global-alpha-btn__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--paper);
  line-height: 1;
  margin-left: 2px;
}
@media (max-width: 900px) {
  .global-alpha-btn__label { display: none; }
}

/* =====================================================================
   GLOBAL ALPHA — page
   ===================================================================== */
.global-alpha-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 32px 80px;
  background:
    radial-gradient(ellipse 800px 500px at 80% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    radial-gradient(ellipse 700px 500px at 10% 110%, color-mix(in srgb, var(--gold) 8%, transparent), transparent 60%),
    var(--paper);
}
.global-alpha-page__inner {
  max-width: 720px;
  width: 100%;
}
.global-alpha-page__kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
  padding: 5px 12px 5px 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.global-alpha-page__alpha {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}
.global-alpha-page__title {
  font-family: var(--font-serif);
  font-size: 54px;
  font-weight: 600;
  line-height: 1.05;
  margin: 0 0 18px;
  letter-spacing: -0.005em;
}
.global-alpha-page__lede {
  font-family: var(--font-serif);
  font-size: 20px;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.45;
  margin: 0 0 36px;
  max-width: 60ch;
}
.global-alpha-page__regions-h {
  margin-bottom: 14px;
  border-bottom: none;
  padding-bottom: 0;
}

.global-regions {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  border-top: 1px solid var(--rule);
}
.global-region {
  display: grid;
  grid-template-columns: 14px 1fr 28px;
  align-items: center;
  gap: 18px;
  padding: 18px 8px 18px 6px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background 0.2s, padding 0.2s;
}
.global-region:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); padding-left: 12px; }
.global-region__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.global-region__dot--live {
  background: #2e7d4f;
  box-shadow: 0 0 0 3px color-mix(in srgb, #2e7d4f 22%, transparent);
}
.global-region__dot--soon {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.global-region__dot--idea {
  background: var(--paper);
  border: 1.5px solid var(--ink-faint);
}
.global-region__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.global-region__name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}
.global-region__status {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.global-region__action {
  text-align: right;
  font-family: var(--font-sans);
  font-size: 18px;
  color: var(--ink-faint);
  transition: color 0.2s, transform 0.2s;
}
.global-region:hover .global-region__action { color: var(--accent); transform: translateX(2px); }
.global-region.is-marked .global-region__action { color: #2e7d4f; }
.global-region.is-marked .global-region__dot--idea {
  background: #2e7d4f;
  border-color: #2e7d4f;
  box-shadow: 0 0 0 3px color-mix(in srgb, #2e7d4f 18%, transparent);
}

.global-alpha-page__note {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-faint);
  margin: 0 0 28px;
  padding: 14px 18px;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.global-alpha-page__foot {
  display: flex;
  justify-content: flex-start;
}
@media (max-width: 720px) {
  .global-alpha-page { padding: 36px 20px 60px; }
  .global-alpha-page__title { font-size: 36px; }
  .global-alpha-page__lede { font-size: 16px; }
  .global-region__name { font-size: 18px; }
}

/* ===================================================================
 * Under-construction placeholder (institutions without a real photo)
 * Hero & thumb show a silhouette SVG; a yellow/black hazard banner
 * stamps across them.
 * =================================================================== */
.inst-hero--placeholder .inst-hero__image {
  background-color: #b8a283;          /* fallback if SVG fails */
  background-size: cover;
  background-position: center bottom;
  filter: sepia(0.15) saturate(0.85);
}
.inst-hero--placeholder .inst-hero__vignette {
  background: linear-gradient(180deg, rgba(60,42,20,0.10) 0%, rgba(20,12,4,0.55) 70%, rgba(0,0,0,0.85) 100%);
}

/* Diagonal hazard ribbon across hero (right-to-left, ~22° tilt). */
.uc-banner {
  position: absolute;
  top: 38%;
  left: -10%;
  right: -10%;
  pointer-events: none;
  transform: rotate(-6deg);
  z-index: 3;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.35));
}
.uc-banner__stripe {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 14px 24px;
  background:
    repeating-linear-gradient(
      135deg,
      #f5c518 0 28px,
      #1a1a1a 28px 56px
    );
  color: #fff8e1;
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7), 0 0 6px rgba(0,0,0,0.45);
  border-top: 2px solid rgba(0,0,0,0.4);
  border-bottom: 2px solid rgba(0,0,0,0.4);
}
.uc-banner__stripe > span:nth-child(even) {
  opacity: 0.85;
  font-weight: 400;
  letter-spacing: 0.1em;
}

/* Teaches-card thumb in placeholder mode: keep the silhouette,
   tag it with a small "UC" pill in the corner. */
.teaches-card__thumb--placeholder {
  position: relative;
  background-color: #b8a283;
  background-size: cover;
  background-position: center bottom;
  filter: sepia(0.15) saturate(0.85);
}
.uc-pill {
  position: absolute;
  top: 4px; left: 4px;
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 2px 5px;
  background: #f5c518;
  color: #1a1a1a;
  border: 1px solid #1a1a1a;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Pin-preview hero (the map popup) gets a smaller hazard ribbon. */
.pin-preview__hero--placeholder {
  background-color: #b8a283 !important;
  background-size: cover !important;
  background-position: center bottom !important;
  filter: sepia(0.15) saturate(0.85);
  position: relative;
}
.uc-pin-banner {
  position: absolute;
  top: 50%;
  left: -8%;
  right: -8%;
  transform: translateY(-50%) rotate(-5deg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 5px 8px;
  background:
    repeating-linear-gradient(135deg, #f5c518 0 16px, #1a1a1a 16px 32px);
  color: #fff8e1;
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  border-top: 1px solid rgba(0,0,0,0.4);
  border-bottom: 1px solid rgba(0,0,0,0.4);
  z-index: 2;
  pointer-events: none;
}
.uc-pin-banner > span:nth-child(even) { opacity: 0.85; font-weight: 400; }

@media (max-width: 720px) {
  .uc-banner__stripe { font-size: 13px; padding: 10px 14px; gap: 14px; letter-spacing: 0.16em; }
}


/* =====================================================================
   SIDEBAR — CTA card linking to the Updates page
   ===================================================================== */
.sidebar-cta {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.sidebar-cta__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 4px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
  position: relative;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}
.sidebar-cta__link:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--rule));
  background: color-mix(in srgb, var(--accent-soft) 40%, var(--paper-2));
}
.sidebar-cta__link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-left: 3px solid var(--accent);
  border-radius: 4px 0 0 4px;
  pointer-events: none;
}
.sidebar-cta__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 2px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
  flex-shrink: 0;
}
.sidebar-cta__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sidebar-cta__title {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.sidebar-cta__sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
}
.sidebar-cta__arrow {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.22s ease;
}
.sidebar-cta__link:hover .sidebar-cta__arrow { transform: translateX(4px); }

/* =====================================================================
   UPDATES PAGE (patch notes / changelog)
   ===================================================================== */
.updates-page {
  max-width: 1020px;
  margin: 0 auto;
  padding: 36px 36px 80px;
  color: var(--ink);
}
.updates-head {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.updates-head__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.updates-head__kicker {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.updates-head__title {
  font-family: var(--font-serif);
  font-size: 52px;
  line-height: 1.04;
  font-weight: 500;
  font-style: italic;
  margin: 0 0 14px;
  color: var(--ink);
}
.updates-head__lede {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 64ch;
  margin: 0;
}
.updates-head__meta { flex-shrink: 0; }
.updates-head__build {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper-2);
  position: relative;
}
.updates-head__build::before {
  content: '';
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 1px dashed color-mix(in srgb, var(--ink-soft) 30%, transparent);
  pointer-events: none;
}
.updates-head__build-label {
  font-family: var(--font-sans);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.updates-head__build-num {
  font-family: var(--font-sans);
  font-feature-settings: "tnum" 1;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.updates-filter {
  display: flex;
  gap: 4px;
  margin-top: 24px;
  border-bottom: 1px solid var(--rule);
}
.updates-filter__btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  position: relative;
  margin-bottom: -1px;
  transition: color 0.15s ease;
}
.updates-filter__btn:hover { color: var(--ink); }
.updates-filter__btn.is-active {
  color: var(--accent);
}
.updates-filter__btn.is-active::after {
  content: '';
  position: absolute;
  left: 8px; right: 8px; bottom: -1px;
  height: 2px;
  background: var(--accent);
}

/* ---- featured patch ---------------------------------------------- */
.patch {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.patch--featured { margin-bottom: 56px; }
.patch__hero {
  position: relative;
  aspect-ratio: 1402 / 700;
  background-size: cover;
  background-position: center;
  background-color: var(--paper-3);
  isolation: isolate;
}
.patch__hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20,17,12,0) 30%, rgba(20,17,12,0.55) 70%, rgba(20,17,12,0.85) 100%),
    linear-gradient(120deg, rgba(20,17,12,0.45) 0%, rgba(20,17,12,0) 50%);
  z-index: 0;
}
.patch__hero-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 36px 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #f6efe1;
  z-index: 1;
}
.patch__hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 12px;
  border: 1px solid rgba(246, 239, 225, 0.45);
  background: rgba(20, 17, 12, 0.45);
  backdrop-filter: blur(4px);
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.patch__tag-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
.patch__tag-sep { opacity: 0.5; }
.patch__hero-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 48px;
  line-height: 1.05;
  margin: 0;
  text-shadow: 0 2px 16px rgba(0,0,0,0.45);
  color: #fff;
}
.patch__hero-sub {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(246, 239, 225, 0.85);
}
.patch__hero-by {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0;
  opacity: 0.85;
}

.patch__body {
  padding: 32px 36px 40px;
}
.patch__lede {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 28px;
  max-width: 68ch;
}
.patch__h3 {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.patch__h3:first-child { margin-top: 0; }

/* ---- patch notes (badge + line) ---------------------------------- */
.patch-notes {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.patch-notes__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
}
.patch-notes__count {
  font-family: var(--font-sans);
  font-feature-settings: "tnum" 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
}
.patch-notes__text { flex: 1; }
.patch-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 1px;
}
.patch-badge--added {
  background: color-mix(in srgb, #2d8255 18%, var(--paper));
  color: #2d8255;
  border: 1px solid color-mix(in srgb, #2d8255 35%, transparent);
}
.patch-badge--changed {
  background: color-mix(in srgb, #b87b1b 18%, var(--paper));
  color: #b87b1b;
  border: 1px solid color-mix(in srgb, #b87b1b 35%, transparent);
}
.patch-badge--fixed {
  background: color-mix(in srgb, var(--accent) 14%, var(--paper));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
:root[data-theme="midnight"] .patch-badge--added {
  color: #6ec48a;
  border-color: color-mix(in srgb, #6ec48a 40%, transparent);
  background: color-mix(in srgb, #6ec48a 14%, var(--paper));
}
:root[data-theme="midnight"] .patch-badge--changed {
  color: #e9b660;
  border-color: color-mix(in srgb, #e9b660 40%, transparent);
  background: color-mix(in srgb, #e9b660 14%, var(--paper));
}

/* ---- spotlight grid ---------------------------------------------- */
.patch-spotlight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 6px 0 28px;
}
.patch-spotlight__col {
  padding: 22px 24px 24px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}
.patch-spotlight__col::before {
  content: '';
  position: absolute;
  inset: 0;
  border-top: 3px solid var(--accent);
  pointer-events: none;
}
.patch-spotlight__flag {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.patch-spotlight__num {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 56px;
  line-height: 1;
  color: var(--accent);
  font-feature-settings: "tnum" 1;
  margin-bottom: 4px;
}
.patch-spotlight__label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.patch-spotlight__body {
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
}

.patch__cta-row {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* ---- archive (compact patch list) ------------------------------- */
.updates-archive { margin-top: 24px; }
.updates-archive__h {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.updates-archive__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.patch--compact {
  padding: 20px 24px 22px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 22px;
  align-items: flex-start;
  box-shadow: none;
}
.patch-compact__head { display: flex; flex-direction: column; gap: 10px; }
.patch-compact__verbox {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper-2);
  align-items: flex-start;
}
.patch-compact__ver {
  font-family: var(--font-sans);
  font-feature-settings: "tnum" 1;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}
.patch-compact__tag {
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.patch-compact__title-wrap { display: none; }
.patch-compact__title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  line-height: 1.15;
  margin: 0 0 4px;
  color: var(--ink);
  grid-column: 2;
}
.patch-compact__date {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
/* lay out the compact card */
.patch--compact > .patch-compact__head {
  grid-row: 1 / span 2;
}
.patch--compact > .patch-notes--compact {
  grid-column: 2;
}
.patch--compact .patch-compact__title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  grid-column: 2;
  grid-row: 1;
  position: absolute;
}
/* simpler: drop the absolute trick — render title inline */

/* re-flow compact card cleanly using a flex column on the right */
.patch--compact {
  display: grid;
  grid-template-columns: 130px 1fr;
  grid-template-rows: auto auto;
  column-gap: 24px;
  row-gap: 12px;
}
.patch--compact .patch-compact__title-wrap {
  position: static;
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.patch--compact .patch-notes--compact {
  grid-column: 2;
  grid-row: 2;
}
.patch--compact .patch-compact__head {
  grid-column: 1;
  grid-row: 1 / span 2;
}
.patch-notes--compact .patch-notes__row {
  padding: 8px 12px;
  font-size: 14.5px;
}

.updates-foot {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
}

/* ---- responsive -------------------------------------------------- */
@media (max-width: 800px) {
  .updates-page { padding: 24px 18px 60px; }
  .updates-head__title { font-size: 36px; }
  .updates-head__lede { font-size: 16px; }
  .updates-head__row { flex-direction: column; align-items: stretch; gap: 16px; }
  .updates-head__build { flex-direction: row; align-items: center; justify-content: space-between; }
  .updates-filter { overflow-x: auto; }
  .patch__hero-title { font-size: 30px; }
  .patch__hero-overlay { padding: 20px 22px 22px; }
  .patch__body { padding: 24px 22px 30px; }
  .patch__lede { font-size: 16px; }
  .patch-spotlight { grid-template-columns: 1fr; }
  .patch-spotlight__num { font-size: 44px; }
  .patch--compact {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .patch--compact .patch-compact__head { grid-column: 1; grid-row: 1; flex-direction: row; align-items: center; gap: 12px; }
  .patch--compact .patch-compact__verbox { flex-direction: row; gap: 10px; align-items: center; }
  .patch--compact .patch-compact__title-wrap { grid-column: 1; grid-row: 2; }
  .patch--compact .patch-notes--compact { grid-column: 1; grid-row: 3; }
}
