/* Kenya National Archives building — an independent 3D journey
   Exhibition design system (23 Nov 2026). Tokens first, then components. Fonts are faces already on the device:
   an editorial Garamond-style serif for titles (Georgia as the last fallback) and the system sans-serif for reading,
   navigation and metadata. Nothing is downloaded. */

:root {
  /* colour: ink, paper, stone, deep teal and a restrained brass accent */
  --ink: #1c1b18;          /* charcoal text and dark surfaces */
  --ink-2: #45413a;        /* secondary text on paper (9:1) */
  --ink-3: #625d53;        /* tertiary text on paper (6:1) */
  --paper: #f5f0e6;        /* ivory surfaces */
  --paper-2: #ece5d7;
  --paper-3: #ded5c3;
  --stone: #9a9387;
  --teal: #1f5156;         /* documented / headings accents (7.8:1 on paper) */
  --teal-2: #2b6a6f;
  --teal-wash: #dde8e5;
  --brass: #a9701f;        /* decoration and large numerals only (3.7:1) */
  --brass-ink: #7a4b10;    /* brass for text on paper (6.2:1) */
  --brass-wash: #f2e4c8;
  --night: #121210;
  --line: rgba(28, 27, 24, 0.14);
  --line-2: rgba(28, 27, 24, 0.26);
  --on-dark: #f5f0e6;
  --on-dark-2: #d8d0c0;

  /* type */
  --font-display: "Cormorant Garamond", "EB Garamond", Garamond, "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, "Noto Sans", Arial, sans-serif;
  --fs-meta: 0.8125rem;                                        /* 13px: metadata, never the only carrier of meaning */
  --fs-small: 0.875rem;                                        /* 14px */
  --fs-body: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);         /* 16–17px */
  --fs-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --fs-h3: clamp(1.125rem, 1.05rem + 0.3vw, 1.3rem);
  --fs-h2: clamp(1.75rem, 1.45rem + 1.1vw, 2.4rem);
  --fs-h1: clamp(2.4rem, 1.7rem + 3vw, 4rem);
  --fs-num: clamp(2.6rem, 2.1rem + 1.6vw, 3.4rem);
  --lh-body: 1.6;
  --lh-tight: 1.08;
  --measure: 62ch;

  /* space, surfaces, motion */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --r-1: 2px; --r-2: 4px; --r-3: 8px;
  --shadow-1: 0 1px 2px rgba(18, 18, 16, 0.08), 0 10px 30px rgba(18, 18, 16, 0.18);
  --shadow-2: 0 2px 4px rgba(18, 18, 16, 0.10), 0 18px 48px rgba(18, 18, 16, 0.24);
  --dur-1: 160ms; --dur-2: 320ms; --dur-3: 600ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --stage-h: 100vh;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --gutter: max(clamp(16px, 4vw, 56px), var(--safe-l), var(--safe-r));
  color-scheme: light;
}
@supports (height: 100svh) { :root { --stage-h: 100svh; } }
@media (prefers-reduced-motion: reduce) { :root { --dur-1: 0ms; --dur-2: 0ms; --dur-3: 0ms; } }

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* component display rules must never override the hidden attribute */
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body { margin: 0; background: var(--night); color: var(--ink); font: 400 var(--fs-body)/var(--lh-body) var(--font-sans); }
a { color: var(--teal); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: var(--r-1); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: var(--s-2); z-index: 60; background: var(--paper); color: var(--ink); padding: var(--s-2) var(--s-3);
  font-weight: 600; border-radius: var(--r-2); box-shadow: var(--shadow-1); }
.skip:focus { left: var(--s-2); }

.btn { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 10px 18px; border-radius: var(--r-2);
  font: 600 var(--fs-small)/1.2 var(--font-sans); letter-spacing: 0.01em; color: var(--paper); background: var(--teal);
  border: 1px solid var(--teal); cursor: pointer; text-decoration: none; transition: background var(--dur-1) var(--ease); }
.btn:hover { background: var(--teal-2); }
.btn-quiet { color: var(--teal); background: transparent; border-color: var(--line-2); }
.btn-quiet:hover { background: var(--teal-wash); }

/* footnote markers: small numbered tags, large enough to tap and read, kept with the word they follow */
.nw { white-space: nowrap; }
.cite { font-size: 0; line-height: 0; vertical-align: super; margin-left: 2px; }
.cite a { display: inline-block; min-width: 1.45em; margin-right: 2px; padding: 0.12em 0.32em; border-radius: var(--r-1);
  font: 700 0.6875rem/1.15 var(--font-sans); text-align: center; text-decoration: none; color: var(--brass-ink);
  background: var(--brass-wash); border: 1px solid rgba(122, 75, 16, 0.28); vertical-align: 0.35em; }
.cite a:hover, .cite a:focus-visible { background: var(--brass-ink); color: var(--paper); }

/* evidence tags: the words carry the meaning; colour only reinforces it */
.ev { display: inline-block; padding: 1px 7px; border-radius: var(--r-1); font: 600 0.75rem/1.5 var(--font-sans); white-space: nowrap;
  vertical-align: 0.08em; }
.ev-doc { color: var(--paper); background: var(--teal); }
.ev-inf { color: var(--ink-2); background: transparent; border: 1px dashed var(--ink-3); }
.ev-ill { color: var(--brass-ink); background: var(--brass-wash); border: 1px solid rgba(122, 75, 16, 0.35); }

/* ---------- modes: scroll journey (default with JavaScript) or still images ---------- */
.stills { display: none; }
.no-js #journey, .no-js .index, .mode-stills #journey, .mode-stills .index { display: none !important; }
.no-js .stills, .mode-stills .stills { display: block; }
.no-js #to-stills, .no-js #skip-stills, .mode-stills #skip-stills, .no-js #to-top { display: none; }

/* ---------- stage: the 3D journey stays the dominant layer ---------- */
#journey { position: relative; }
.stage { position: sticky; top: 0; height: var(--stage-h); overflow: hidden; background: #d3d6d3; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.grade, .glow { position: absolute; inset: 0; pointer-events: none; }
.grade { mix-blend-mode: multiply;
  background:
    radial-gradient(62% 80% at 100% 52%, rgba(255, 236, 216, 1), rgba(255, 236, 216, 0) 100%),
    linear-gradient(to bottom, rgb(250, 250, 252) 48%, rgb(242, 241, 245) 53%, rgb(222, 221, 226) 59%, rgb(201, 201, 207) 66%,
      rgb(186, 186, 192) 75%, rgb(171, 170, 176) 85%, rgb(160, 160, 166) 97%); }
.glow { mix-blend-mode: screen; background: radial-gradient(42% 22% at 100% 51%, rgb(125, 69, 23), rgba(125, 69, 23, 0) 100%); }

.status { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; max-width: min(420px, calc(100% - 32px));
  margin: 0; padding: var(--s-3) var(--s-4); background: var(--paper); color: var(--ink); border-radius: var(--r-2);
  box-shadow: var(--shadow-1); font: 500 var(--fs-small)/1.45 var(--font-sans); text-align: center; }
.status:empty { display: none; }
.status p { margin: 0 0 var(--s-3); }
.status .btn { margin-top: 2px; }
.badge { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 4; margin: 0;
  max-width: calc(100% - 32px); padding: 5px 12px 5px 10px; border-radius: 999px; background: rgba(245, 240, 230, 0.94); color: var(--ink);
  font: 500 var(--fs-meta)/1.35 var(--font-sans); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15); text-align: center; }
.badge::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--brass); vertical-align: 1px; }

/* ---------- opening: the cover of the exhibition (composition from the 18 Nov mock-up) ---------- */
.hero { position: absolute; top: 0; left: 0; right: 0; height: var(--stage-h); z-index: 3; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(40px, 9.2vh, 112px) var(--gutter) 0; color: var(--ink); }
.hero a { pointer-events: auto; }
/* the mock-up's sunset sky (lettering painted out by tools/make_hero_sky.py); its horizon is at 89.8% of the image, so a
   box 56% of the screen tall puts the horizon at half height, as in the mock-up */
.hero-sky { position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: 56%;
  background: #b9c6d3 url("../public/hero/sky-1584.webp") center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 89%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 0, #000 89%, transparent 96%); }
.hero-marks { position: absolute; top: max(var(--s-4), env(safe-area-inset-top, 0px)); left: var(--gutter); right: var(--gutter);
  display: flex; justify-content: space-between; gap: var(--s-4); text-align: left; }
.mark { margin: 0; display: flex; flex-direction: column; gap: 1px; font: 600 var(--fs-meta)/1.35 var(--font-sans); color: var(--ink);
  padding-left: 10px; border-left: 2px solid var(--brass); }
.mark-note { font-weight: 400; color: var(--ink-2); }
.mark-place { text-align: right; padding-left: 0; padding-right: 10px; border-left: 0; border-right: 2px solid var(--brass); }
.mark .cite a { vertical-align: 0.2em; }
.hero-rule { display: block; width: 72px; height: 1px; background: #8c6a3c; margin-bottom: clamp(8px, 1.2vh, 14px); }
.hero-title { margin: 0; font: 700 clamp(38px, min(4.5vw, 7vh), 80px)/0.94 var(--font-display);
  letter-spacing: 0.02em; text-transform: uppercase; color: #171511; text-shadow: 0 1px 24px rgba(255, 255, 255, 0.35); }
.hero-title .line { display: block; }
.hero-sub { margin: clamp(14px, 2.9vh, 32px) 0 0; font: 400 clamp(18px, min(1.65vw, 2.6vh), 28px)/1.3 var(--font-display);
  color: #29261f; letter-spacing: 0.005em; }
.hero-cta { margin-top: clamp(18px, 3.3vh, 36px); padding: 10px 6px 8px; min-height: 44px; display: inline-flex; align-items: center;
  font: 600 clamp(12.5px, 0.95vw, 15px)/1.2 var(--font-sans); letter-spacing: 0.18em; text-transform: uppercase; color: #8a4812;
  text-decoration: none; border-bottom: 1px solid transparent; transition: border-color var(--dur-1) var(--ease); }
.hero-cta:hover { border-bottom-color: currentColor; }
.hero-cta:focus-visible { outline-color: #8a4812; outline-offset: 2px; }
/* scroll cue in the lower-left corner (the building sits at the bottom centre): light text with a soft shadow over the city */
.hero-cue { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(var(--s-5) + var(--safe-b)); margin: 0; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: flex-start; gap: 6px 12px; font: 500 var(--fs-small)/1.4 var(--font-sans); color: var(--on-dark);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 18px rgba(0, 0, 0, 0.5); text-align: left; }
.hero-cue a { color: var(--on-dark); text-decoration: underline; min-height: 32px; display: inline-flex; align-items: center; }
.hero-cue a:focus-visible { outline-color: var(--on-dark); }
.cue-line { position: relative; width: 1px; height: 28px; background: rgba(245, 240, 230, 0.35); overflow: hidden; }
.cue-line::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--on-dark);
  animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { to { top: 100%; } }
@media (prefers-reduced-motion: reduce) { .cue-line::after { animation: none; top: 30%; } }

/* ---------- chapter panels: an exhibit-label system ---------- */
.cards { position: absolute; inset: 0; pointer-events: none; }
.card { position: absolute; width: min(452px, calc(100% - 2 * var(--gutter))); pointer-events: auto;
  background: rgba(245, 240, 230, 0.96); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-1);
  box-shadow: var(--shadow-1); padding: var(--s-5) var(--s-5) var(--s-4);
  transition: opacity var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease); }
.card::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; background: var(--stone);
  transition: background var(--dur-2) var(--ease); }
.card[data-side="left"] { left: var(--gutter); }
.card[data-side="right"] { right: max(calc(var(--gutter) + 24px), 104px); }   /* clear of the chapter index (66px + margins) */
.card.is-active { box-shadow: var(--shadow-2); }
.card.is-active::before { background: var(--brass); }
.card-head { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-2); }
.card-num { margin: 0; font: 500 var(--fs-num)/0.85 var(--font-display); color: var(--brass); font-variant-numeric: lining-nums; }
.card-meta { margin: 0; font: 600 var(--fs-meta)/1.3 var(--font-sans); color: var(--ink-3); letter-spacing: 0.02em; }
.card h2 { margin: 0 0 var(--s-2); font: 600 var(--fs-h2)/var(--lh-tight) var(--font-display); letter-spacing: -0.005em; color: var(--ink); }
.card h2:focus:not(:focus-visible) { outline: none; }
.basis { display: inline-block; margin: 0 0 var(--s-3); padding: 2px 8px; border-radius: var(--r-1); font: 600 var(--fs-meta)/1.5 var(--font-sans);
  color: var(--ink-2); background: var(--paper-2); border-left: 3px solid var(--stone); }
.basis-exterior { border-left-color: var(--teal); }
.basis-entrance { border-left-color: var(--brass); }
.basis-interior { border-left-color: var(--brass); }
.card-body p { margin: 0 0 var(--s-3); color: var(--ink-2); max-width: var(--measure); }
.card-body p:last-child { margin-bottom: 0; }
.card .note { font-size: var(--fs-small); color: var(--ink-2); padding: var(--s-2) var(--s-3); background: var(--paper-2); border-radius: var(--r-1); }
.card .alt-link { font-size: var(--fs-small); font-weight: 600; }
.places { margin-top: var(--s-4); border-top: 1px solid var(--line); padding-top: var(--s-2); }
.places summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; gap: 6px; font: 600 var(--fs-small)/1.3 var(--font-sans); color: var(--teal); list-style: none; }
.places summary::-webkit-details-marker { display: none; }
.places summary::before { content: "+"; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 50%; font-size: 13px; line-height: 1; }
.places[open] summary::before { content: "−"; }
.places .count { color: var(--ink-3); font-weight: 500; }
.places ul, .places-open ul { margin: var(--s-2) 0 0; padding: 0; list-style: none; }
.places li, .places-open li { margin: 0 0 var(--s-2); font-size: var(--fs-small); line-height: 1.5; color: var(--ink-2); }
.places li .ev, .places-open li .ev { margin-right: 4px; }

/* ---------- room labels on the scene ---------- */
.labels { position: absolute; inset: 0; pointer-events: none; }
.label { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; text-align: left; color: var(--ink);
  background: rgba(245, 240, 230, 0.95); border: 1px solid var(--line); border-radius: var(--r-2); padding: 6px 10px 7px;
  font: 600 var(--fs-small)/1.25 var(--font-sans); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  opacity: 0; transition: opacity var(--dur-2) ease; pointer-events: none; cursor: pointer; }
.label.on { opacity: 1; pointer-events: auto; }
.label::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 1px; height: 7px; background: rgba(245, 240, 230, 0.95); }
.label small { display: flex; align-items: center; gap: 5px; margin-top: 2px; font: 600 0.75rem/1.3 var(--font-sans); color: var(--ink-3); }
.label small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); flex: none; }
.label[data-ev="inf"] small::before { background: transparent; border: 1px dashed var(--ink-3); }
.label[data-ev="ill"] small::before { background: var(--brass); }
.label .l-desc { display: none; white-space: normal; width: 250px; font: 400 var(--fs-meta)/1.45 var(--font-sans); color: var(--ink-2); margin-top: 6px; }
.label.open { z-index: 2; }
.label.open .l-desc { display: block; }

/* ---------- chapter index: where you are in the nine-chapter journey ---------- */
.index { position: fixed; z-index: 20; right: calc(var(--s-4) + var(--safe-r)); top: 50%; transform: translateY(-50%);
  transition: opacity var(--dur-2) var(--ease); font-family: var(--font-sans); }
.index.away { opacity: 0; visibility: hidden; transition: opacity var(--dur-2) var(--ease), visibility 0s var(--dur-2); }
.index-bar { display: none; }
.index-panel { background: rgba(245, 240, 230, 0.94); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--shadow-1); padding: 6px; }
.index-h { display: none; }
.index-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.index-btn { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 4px 6px; border: 0;
  border-radius: var(--r-1); background: transparent; color: var(--ink-2); cursor: pointer; font: 600 var(--fs-meta)/1 var(--font-sans);
  font-variant-numeric: tabular-nums; }
.index-btn:hover { background: var(--paper-2); color: var(--ink); }
.index-btn .num { width: 20px; text-align: right; }
.index-btn .bar { position: relative; width: 22px; height: 3px; border-radius: 2px; background: var(--paper-3); overflow: hidden; }
.index-btn .bar i { position: absolute; inset: 0; width: var(--fill, 0%); background: var(--brass); }
.index-btn[aria-current="step"] { color: var(--ink); background: var(--paper-2); }
.index-btn[aria-current="step"] .num { color: var(--brass-ink); }
/* titles fly out to the left: always for the current chapter, and on hover or keyboard focus for the others */
.index-btn .ttl { position: absolute; right: calc(100% + 12px); top: 50%; transform: translate(6px, -50%); white-space: nowrap; opacity: 0;
  pointer-events: none; padding: 6px 10px; border-radius: var(--r-2); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1);
  font: 600 var(--fs-small)/1.2 var(--font-sans); transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.index-btn:hover .ttl, .index-btn:focus-visible .ttl { opacity: 1; transform: translate(0, -50%); }
.index-list:not(:hover):not(:focus-within) .index-btn[aria-current="step"] .ttl { opacity: 1; transform: translate(0, -50%); }
.index-panel { width: 66px; }
.index-stills { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
.index-stills a { position: relative; display: flex; align-items: center; justify-content: center; min-height: 34px; font: 600 var(--fs-meta)/1.2 var(--font-sans);
  color: var(--teal); text-decoration: none; text-align: center; padding: 4px; border-radius: var(--r-1); }
.index-stills a:hover { background: var(--teal-wash); }
.index-stills .s-long { position: absolute; right: calc(100% + 12px); top: 50%; transform: translate(6px, -50%); width: max-content; max-width: 260px;
  opacity: 0; pointer-events: none; padding: 8px 10px; border-radius: var(--r-2); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1);
  font: 600 var(--fs-small)/1.3 var(--font-sans); text-align: left; transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.index-stills a:hover .s-long, .index-stills a:focus-visible .s-long { opacity: 1; transform: translate(0, -50%); }
.index-stills p { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }

/* ---------- still images: the journey as an exhibition catalogue ---------- */
.stills { background: var(--paper); padding: var(--s-8) var(--gutter) var(--s-7); }
.stills-inner { max-width: 1240px; margin: 0 auto; }
.eyebrow { margin: 0 0 var(--s-3); font: 600 var(--fs-small)/1.3 var(--font-sans); color: var(--brass-ink); letter-spacing: 0.02em; }
.stills-head { max-width: 760px; padding-bottom: var(--s-6); border-bottom: 1px solid var(--line-2); }
.stills h1 { margin: 0 0 var(--s-2); font: 600 var(--fs-h1)/1.02 var(--font-display); letter-spacing: -0.01em; }
.stills-sub { margin: 0 0 var(--s-4); font: 400 var(--fs-lead)/1.4 var(--font-display); font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem); color: var(--ink-2); }
.stills-intro { color: var(--ink-2); max-width: var(--measure); }
.independent-line { font-size: var(--fs-small); color: var(--ink-3); max-width: var(--measure); }
.still { margin: 0; padding: var(--s-7) 0; border-bottom: 1px solid var(--line); display: grid; gap: var(--s-5); }
.still img { display: block; width: 100%; height: auto; max-height: 82vh; object-fit: contain; border-radius: var(--r-1); background: var(--paper-3); }
.still figcaption { max-width: var(--measure); }
.still figcaption .card-num { margin-bottom: var(--s-1); }
.still h2 { margin: var(--s-1) 0 var(--s-2); font: 600 var(--fs-h2)/var(--lh-tight) var(--font-display); }
.still figcaption p { color: var(--ink-2); margin: 0 0 var(--s-3); }
.places-open { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.places-h { margin: 0; font: 600 var(--fs-small)/1.3 var(--font-sans); color: var(--teal); }
@media (min-width: 1100px) {
  .still { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; gap: var(--s-6); }
  .still figcaption { position: sticky; top: var(--s-5); }
}

/* ---------- about this journey: the closing exhibition section ---------- */
.about { position: relative; z-index: 5; background: var(--paper); padding: var(--s-9) var(--gutter) calc(var(--s-8) + var(--safe-b)); border-top: 4px solid var(--brass); }
.about-inner { max-width: 1040px; margin: 0 auto; }
.about-head h2 { margin: 0 0 var(--s-5); font: 600 var(--fs-h1)/1.02 var(--font-display); letter-spacing: -0.01em; }
.callout { margin: 0 0 var(--s-7); padding: var(--s-5) var(--s-5); background: var(--teal); color: var(--paper); border-radius: var(--r-2); max-width: 760px; }
.callout p { margin: 0; font-size: var(--fs-lead); line-height: 1.5; }
.callout strong { color: var(--paper); }
.about h3 { margin: 0 0 var(--s-4); font: 600 var(--fs-h3)/1.25 var(--font-sans); color: var(--teal); }
.about-grid { display: grid; gap: var(--s-6); margin-bottom: var(--s-7); }
@media (min-width: 860px) { .about-grid { grid-template-columns: 1.2fr 1fr; gap: var(--s-7); } }
.notice-list, .legend, .credits { list-style: none; margin: 0; padding: 0; }
.notice-list li { margin: 0 0 var(--s-4); padding-left: var(--s-4); border-left: 2px solid var(--paper-3); color: var(--ink-2); max-width: var(--measure); }
.notice-list strong { color: var(--ink); }
.legend li { margin: 0 0 var(--s-3); color: var(--ink-2); font-size: var(--fs-small); line-height: 1.5; }
.legend .ev { margin-right: 6px; }
.ref-block { padding-top: var(--s-6); margin-top: var(--s-6); border-top: 1px solid var(--line-2); }
.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
@media (min-width: 860px) { .sources { grid-template-columns: 1fr 1fr; gap: var(--s-4) var(--s-7); } }
.sources li { display: grid; grid-template-columns: 34px 1fr; gap: var(--s-3); align-items: start; scroll-margin-top: var(--s-6); border-radius: var(--r-2); }
.sources li:target { background: var(--brass-wash); outline: 6px solid var(--brass-wash); }
.src-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--brass); color: var(--brass-ink);
  font: 700 var(--fs-small)/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.sources p, .credits p { margin: 0; color: var(--ink-2); font-size: var(--fs-small); line-height: 1.55; }
.sources a, .credits a { font-weight: 600; white-space: nowrap; }
.credits li { margin: 0 0 var(--s-3); padding-left: var(--s-4); border-left: 2px solid var(--paper-3); max-width: 80ch; }
.about-foot { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line-2); }
.about-foot .actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: 0 0 var(--s-4); }

/* ---------- tuning panel (prototype only, ?tune) ---------- */
.tuner-toggle { position: fixed; left: 12px; bottom: 12px; z-index: 31; font: 600 13px var(--font-sans);
  background: var(--paper); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-3); padding: 7px 12px; cursor: pointer; }
.tuner { position: fixed; left: 12px; bottom: 56px; z-index: 30; width: min(340px, calc(100vw - 24px)); max-height: calc(100vh - 80px);
  overflow: auto; background: rgba(16, 15, 12, 0.94); color: var(--on-dark); border: 1px solid rgba(245, 240, 230, 0.2); border-radius: 10px; padding: 12px 14px;
  font: 13px/1.4 var(--font-sans); }
.tuner h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #e2b65c; margin: 10px 0 6px; }
.tuner h3:first-child { margin-top: 0; }
.tuner label { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin: 4px 0; }
.tuner input[type=range] { grid-column: 1 / -1; width: 100%; }
.tuner input[type=number] { width: 64px; background: #222; color: var(--on-dark); border: 1px solid rgba(245, 240, 230, 0.2); border-radius: 4px; padding: 2px 4px; }
.tuner .stats { font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre; color: var(--on-dark-2); }
.tuner .row { display: flex; gap: 8px; margin-top: 10px; }
.tuner button { flex: 1; background: #2b2924; color: var(--on-dark); border: 1px solid rgba(245, 240, 230, 0.2); border-radius: 6px; padding: 6px; cursor: pointer; font: inherit; }
.clean .badge, .clean .tuner-toggle, .clean .tuner { display: none !important; }

/* ---------- portrait screens and narrow windows ---------- */
@media (max-aspect-ratio: 1/1), (max-width: 760px) {
  .hero { padding-top: clamp(100px, 13.5vh, 124px); }
  /* the two marks become one compact block: name · note on running lines */
  .hero-marks { flex-direction: column; gap: 2px; padding-left: 10px; border-left: 2px solid var(--brass); }
  .mark { display: block; padding: 0; border: 0; font-size: 0.78rem; line-height: 1.35; }
  .mark-name::after { content: " · "; font-weight: 400; color: var(--ink-3); }
  .mark-place { text-align: left; border: 0; padding: 0; }
  .hero-title { font-size: clamp(34px, 11.5vw, 64px); }
  .hero-sub { font-size: clamp(16px, 4.6vw, 22px); }
  .hero-cta { font-size: 12.5px; }
  .hero-cue { bottom: calc(var(--s-4) + var(--safe-b)); font-size: var(--fs-meta); }
  .card { width: auto; left: var(--gutter) !important; right: var(--gutter) !important; padding: var(--s-4) var(--s-4) var(--s-3); }
  .card-num { font-size: 2.4rem; }
  .card h2 { font-size: clamp(1.5rem, 1.2rem + 1.6vw, 1.9rem); }

  /* the index becomes a compact bar at the bottom; the full list opens as a sheet */
  .index { left: 0; right: 0; top: auto; bottom: 0; transform: none; padding: 0 0 var(--safe-b); background: rgba(245, 240, 230, 0.96);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12); }
  .index-bar { display: flex; align-items: center; gap: var(--s-3); height: 48px; padding: 0 var(--s-2) 0 var(--gutter); position: relative; }
  .index-progress { position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: var(--paper-3); }
  .index-progress i { display: block; height: 100%; width: var(--fill, 0%); background: var(--brass); }
  .index-now { flex: 1; min-width: 0; margin: 0; display: flex; align-items: baseline; gap: 6px; font: 600 var(--fs-small)/1.2 var(--font-sans); color: var(--ink); }
  .index-now .n { color: var(--brass-ink); font-variant-numeric: tabular-nums; }
  .index-now .of { color: var(--ink-3); font-weight: 500; }
  .index-now .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .index-toggle { min-height: 40px; padding: 0 14px; border-radius: var(--r-2); border: 1px solid var(--line-2); background: var(--paper);
    color: var(--teal); font: 600 var(--fs-small)/1 var(--font-sans); cursor: pointer; }
  .index-toggle[aria-expanded="true"] { background: var(--teal); color: var(--paper); border-color: var(--teal); }
  .index-panel { display: none; position: absolute; left: 0; right: 0; bottom: 100%; max-height: min(70vh, 560px); overflow: auto;
    border-radius: var(--r-3) var(--r-3) 0 0; border: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
    padding: var(--s-4) var(--gutter) var(--s-3); background: var(--paper); }
  .index.open .index-panel { display: block; }
  .index-h { display: block; margin: 0 0 var(--s-2); font: 600 var(--fs-small)/1.3 var(--font-sans); color: var(--ink-3); }
  .index-btn { min-height: 44px; font-size: var(--fs-body); gap: var(--s-3); padding: 6px 8px; }
  .index-btn .num { width: 24px; font-size: var(--fs-small); }
  .index-btn .bar { order: 3; margin-left: auto; width: 32px; }
  .index-btn .ttl { position: static; opacity: 1; transform: none; padding: 0; background: none; box-shadow: none; font: 500 var(--fs-body)/1.3 var(--font-sans); white-space: normal; text-align: left; }
  .index-panel { width: auto; }
  .index-stills { margin-top: var(--s-3); padding-top: var(--s-3); }
  .index-stills a { justify-content: flex-start; min-height: 44px; font-size: var(--fs-body); padding: 6px 8px; }
  .index-stills .s-short { display: none; }
  .index-stills .s-long { position: static; opacity: 1; transform: none; padding: 0; background: none; box-shadow: none; max-width: none;
    font: 600 var(--fs-body)/1.3 var(--font-sans); color: var(--teal); }
  .index-stills p { position: static; width: auto; height: auto; overflow: visible; clip-path: none; margin: 0 8px var(--s-2); font-size: var(--fs-small); color: var(--ink-3); }
  .badge { top: max(8px, env(safe-area-inset-top, 0px)); }
}
@media (max-aspect-ratio: 1/1) {
  .hero-sky { height: 46%; }
  .grade { background:
    radial-gradient(70% 45% at 100% 41%, rgba(255, 236, 216, 1), rgba(255, 236, 216, 0) 100%),
    linear-gradient(to bottom, rgb(250, 250, 252) 38%, rgb(240, 239, 243) 44%, rgb(215, 214, 220) 55%, rgb(192, 192, 198) 68%,
      rgb(172, 171, 177) 84%, rgb(152, 152, 159) 97%); }
  .glow { background: radial-gradient(60% 16% at 100% 41%, rgb(125, 69, 23), rgba(125, 69, 23, 0) 100%); }
}
/* short landscape phones: keep the cover inside the screen */
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
  .hero { padding-top: 64px; }
  .hero-title { font-size: clamp(26px, 8vh, 40px); }
  .hero-sub { font-size: 16px; margin-top: 8px; }
  .hero-cta { margin-top: 6px; }
  .hero-cue { display: none; }
  .mark:not(.mark-place) { display: block; }
  .mark:not(.mark-place) .mark-name::after { content: " · "; font-weight: 400; color: var(--ink-3); }
  .mark-place .mark-note { display: none; }
  .card { width: min(400px, 46vw); padding: var(--s-3) var(--s-4); }
  .card-num { font-size: 2rem; }
  .card h2 { font-size: 1.3rem; margin-bottom: 6px; }
  .basis { margin-bottom: var(--s-2); }
  .card-body p { font-size: 0.9375rem; line-height: 1.5; margin-bottom: var(--s-2); }
  .card .note { font-size: var(--fs-meta); }
  .index-btn { min-height: 28px; }
  .index-stills a { min-height: 28px; }
}
@media (prefers-reduced-motion: reduce) { .label { transition: none; } .card { transition: none; } }
