@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..700;1,9..144,400..500&family=Inter:wght@300;400;500;600&display=swap');

/* ===========================================================================
   Digital Preservation of Newari History — The Bunga Dyo Painting
   v2 design system: warm cream editorial base, deep crimson accent drawn
   from the painting itself, characterful serif display, visible column grid.
   ========================================================================== */

:root {
  --bg: #f8f6f1;              /* warm cream */
  --bg-raise: #efeae0;        /* slightly deeper cream for panels */
  --ink: #1c1814;             /* warm near-black */
  --muted: #6d6459;           /* body paragraphs */
  --faint: #a39a8e;           /* captions, labels */
  --line: rgba(28, 24, 20, 0.14);
  --hairline: rgba(28, 24, 20, 0.08);

  --crimson: #8b2015;         /* deep crimson from the painting's ground */
  --crimson-deep: #6e170e;    /* hover / pressed */
  --on-crimson: #f6efe3;      /* cream text on crimson */
  --crimson-line: rgba(246, 239, 227, 0.22);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --nav-h: 72px;
  --pad-x: clamp(20px, 4vw, 56px);
  --section-y: clamp(72px, 9vw, 132px);
  --measure: 640px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.75;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

::selection { background: var(--crimson); color: var(--on-crimson); }

main { position: relative; z-index: 2; }

/* ===========================================================================
   Typography
   ========================================================================== */

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -0.015em; }

.display {
  font-size: clamp(46px, 7.4vw, 104px);
  font-weight: 600;
}

.title {
  font-size: clamp(30px, 4.2vw, 54px);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 14px;
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--ink);
  opacity: 0.5;
}

.eyebrow .num {
  color: var(--crimson);
  font-weight: 600;
}

.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--muted);
  max-width: var(--measure);
}

/* Descriptive subheading beneath a section's proper name */
.subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(18px, 2.1vw, 24px);
  line-height: 1.4;
  color: var(--muted);
  max-width: 34ch;
}

.band .subtitle { color: rgba(246, 239, 227, 0.85); }

.caption {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  color: var(--faint);
}

/* ===========================================================================
   Navigation
   ========================================================================== */

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  background: rgba(248, 246, 241, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand .brand-chariot {
  height: 46px;
  width: auto;
  flex: none;
  margin-top: -4px;
}

.brand .brand-date {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--crimson);
  vertical-align: super;
  margin-left: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-links > li { position: relative; }

.nav-links a, .nav-links button.drop-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links button.drop-btn:hover { color: var(--ink); }

.nav-links a.active, .nav-links li.active > button.drop-btn { color: var(--crimson); font-weight: 500; }

.drop-btn .chev {
  font-size: 9px;
  transition: transform 0.2s ease;
}

li.open > .drop-btn .chev { transform: rotate(180deg); }

.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 8px;
  min-width: 230px;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(28, 24, 20, 0.12);
  padding: 8px 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

li.open > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 11px 20px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 14px;
}

.dropdown a:hover { background: var(--bg-raise); color: var(--ink); }

.dropdown a.active { color: var(--crimson); }

.dropdown .drop-note {
  display: block;
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: 0;
  margin-top: 1px;
}

/* Explore page zoom controls, bottom right corner */
#exploreTools {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
}

#exploreTools .tool-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(233, 226, 214, 0.35);
  background: rgba(10, 8, 6, 0.85);
  color: #f2ecdf;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

#exploreTools .tool-btn:hover { background: #f2ecdf; color: #14110e; }

#exploreTools .tool-btn.wide { width: auto; padding: 0 12px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-family: var(--font-body); }

/* Hamburger (mobile) */
.nav-burger {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 40px;
  height: 40px;
  position: relative;
}

.nav-burger span, .nav-burger span::before, .nav-burger span::after {
  content: "";
  position: absolute;
  left: 8px;
  width: 24px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-burger span { top: 19px; }
.nav-burger span::before { left: 0; top: -7px; }
.nav-burger span::after { left: 0; top: 7px; }

body.menu-open .nav-burger span { background: transparent; }
body.menu-open .nav-burger span::before { transform: translateY(7px) rotate(45deg); }
body.menu-open .nav-burger span::after { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: 99;
  background: var(--bg);
  padding: 28px var(--pad-x) 48px;
  overflow-y: auto;
  display: none;
}

body.menu-open .mobile-menu { display: block; }

.mobile-menu .group { border-top: 1px solid var(--line); padding: 18px 0; }

.mobile-menu .group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--faint);
  margin-bottom: 6px;
}

.mobile-menu a {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 0;
}

.mobile-menu a.active { color: var(--crimson); }

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-burger { display: block; }
}

/* Dark nav variant — Explore (Full View) page */
body.dark { background: #14110e; color: #e9e2d6; }
body.dark .site-nav { background: rgba(20, 17, 14, 0.9); border-bottom-color: rgba(233, 226, 214, 0.12); }
body.dark .brand, body.dark .nav-links a:hover, body.dark .nav-links button.drop-btn:hover { color: #e9e2d6; }
body.dark .nav-links a, body.dark .nav-links button.drop-btn { color: #9d948a; }
body.dark .nav-links a.active, body.dark .nav-links li.active > button.drop-btn { color: #e0a89a; }
body.dark .dropdown { background: #1d1915; border-color: rgba(233, 226, 214, 0.14); }
body.dark .dropdown a:hover { background: #262119; color: #e9e2d6; }
body.dark .nav-burger span, body.dark .nav-burger span::before, body.dark .nav-burger span::after { background: #e9e2d6; }
body.dark.menu-open .nav-burger span { background: transparent; }
body.dark .mobile-menu { background: #14110e; }

/* ===========================================================================
   Buttons & links
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding: 17px 30px;
  border: 1px solid var(--ink);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.btn-solid { background: var(--crimson); border-color: var(--crimson); color: var(--on-crimson); }
.btn-solid:hover { background: var(--crimson-deep); border-color: var(--crimson-deep); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

.btn-ghost.on-crimson { border-color: var(--on-crimson); color: var(--on-crimson); }
.btn-ghost.on-crimson:hover { background: var(--on-crimson); color: var(--crimson); }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
}

.arrow-link .arr { transition: transform 0.2s ease; }
.arrow-link:hover .arr { transform: translateX(6px); }

/* ===========================================================================
   Section shells
   ========================================================================== */

section.shell { padding: var(--section-y) var(--pad-x); }

.shell-inner { max-width: 1240px; margin: 0 auto; }

.section-head { display: grid; gap: 14px; margin-bottom: clamp(36px, 5vw, 64px); }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

@media (max-width: 880px) {
  .two-col { grid-template-columns: 1fr; }
}

.prose { max-width: var(--measure); }
.prose p { color: var(--muted); margin-bottom: 18px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 500; }

.placeholder-note {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--faint);
}

hr.rule { border: 0; border-top: 1px solid var(--line); }

/* Crimson color-block section */
.band {
  background: var(--crimson);
  color: var(--on-crimson);
}

.band .eyebrow { color: rgba(246, 239, 227, 0.72); }
.band .eyebrow::before { background: var(--on-crimson); }
.band .eyebrow .num { color: var(--on-crimson); }
.band .prose p { color: rgba(246, 239, 227, 0.85); }
.band .lede { color: rgba(246, 239, 227, 0.85); }
.band .arrow-link { color: var(--on-crimson); }
.band hr.rule { border-top-color: var(--crimson-line); }

/* Ink (near-black) color-block */
.band-ink { background: var(--ink); color: #ece5d8; }
.band-ink .eyebrow { color: rgba(236, 229, 216, 0.6); }
.band-ink .eyebrow::before { background: #ece5d8; }
.band-ink .prose p, .band-ink .lede { color: rgba(236, 229, 216, 0.8); }

/* ===========================================================================
   Home page specifics
   ========================================================================== */

/* Cinematic hero: slow pan-and-zoom slideshow of the painting's scenes */
.hero-cine {
  position: relative;
  height: min(88vh, 880px);
  min-height: 520px;
  margin-top: var(--nav-h);
  overflow: hidden;
  background: #14110e;
}

.hero-cine .slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  will-change: transform, opacity;
}

.hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 12, 9, 0.52) 0%, rgba(16, 12, 9, 0.2) 45%, rgba(16, 12, 9, 0.55) 100%);
  pointer-events: none;
}

.hero-center {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--pad-x);
}

.hero-kicker {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(246, 239, 227, 0.78);
  margin-bottom: clamp(14px, 2vw, 22px);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 1.05;
  color: #f6efe3;
  text-shadow: 0 2px 34px rgba(10, 8, 6, 0.45);
  max-width: 16ch;
}

/* The gap under the title belongs to the row, not to each button: an inline
   <a> ignores margin-top, so with two buttons the spacing disappeared. */
.hero-actions {
  margin-top: clamp(26px, 3.4vw, 40px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(10px, 1.4vw, 16px);
  /* without this the row is shrink-to-fit inside the centred column, so it
     never wraps on a narrow screen and drags the whole hero off-centre */
  max-width: 100%;
}

.hero-cta {
  padding: 13px 28px;
  border: 1px solid rgba(246, 239, 227, 0.8);
  color: #f6efe3;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-decoration: none;
  background: rgba(16, 12, 9, 0.28);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  transition: background 0.25s ease, color 0.25s ease;
}

.hero-cta:hover { background: #f6efe3; color: #241d16; }

.hero-pause {
  position: absolute;
  z-index: 3;
  right: clamp(16px, 2.4vw, 30px);
  bottom: clamp(16px, 2.4vw, 30px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(246, 239, 227, 0.55);
  background: rgba(16, 12, 9, 0.45);
  color: #f6efe3;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.hero-pause:hover { background: rgba(16, 12, 9, 0.72); border-color: rgba(246, 239, 227, 0.95); }
.hero-pause svg { width: 13px; height: 13px; display: block; }
.hero-pause .ic-play { display: none; margin-left: 2px; }
.hero-pause.paused .ic-pause { display: none; }
.hero-pause.paused .ic-play { display: block; }

@media (max-width: 640px) {
  .hero-cine { height: 74vh; min-height: 440px; }
}

.hero-figure {
  max-width: 1400px;
  margin: clamp(40px, 6vw, 80px) auto 0;
}

.hero-figure .frame {
  border: 1px solid var(--line);
  padding: clamp(10px, 1.6vw, 22px);
  background: #fdfcf9;
  overflow: hidden;
}

.hero-figure img { width: 100%; }

.hero-figure figcaption {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* Object details table (compact) */
.object-table { border-top: 1px solid var(--line); }

.object-table .row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
}

.object-table .k {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  padding-top: 3px;
}

.object-table .v { font-size: 14px; color: var(--ink); font-weight: 400; }
.object-table .v a { color: var(--crimson); text-decoration: none; border-bottom: 1px solid rgba(139, 32, 21, 0.3); }
.object-table .v a:hover { border-bottom-color: var(--crimson); }

@media (max-width: 640px) {
  .object-table .row { grid-template-columns: 1fr; gap: 4px; }
}

/* Video placeholder */
.video-slot {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  color: #ece5d8;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.video-slot iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.video-slot .coming {
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 24px;
}

.video-slot .coming .ring {
  width: 64px; height: 64px;
  border: 1px solid rgba(236, 229, 216, 0.4);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
}

/* Explore CTA cards */
.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--crimson-line);
}

.mode-card {
  padding: clamp(30px, 4vw, 52px) clamp(22px, 3vw, 44px);
  text-decoration: none;
  color: var(--on-crimson);
  display: grid;
  gap: 12px;
  align-content: start;
  transition: background 0.25s ease;
}

.mode-card + .mode-card { border-left: 1px solid var(--crimson-line); }
.mode-card:hover { background: var(--crimson-deep); }

.mode-card h3 { font-size: clamp(24px, 2.6vw, 34px); }
.mode-card p { color: rgba(246, 239, 227, 0.82); font-size: 15px; max-width: 44ch; }
.mode-card .mode-tag { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(246, 239, 227, 0.65); }
.mode-card .arr { font-size: 22px; margin-top: 8px; }

@media (max-width: 720px) {
  .mode-cards { grid-template-columns: 1fr; }
  .mode-card + .mode-card { border-left: 0; border-top: 1px solid var(--crimson-line); }
}

/* ===========================================================================
   Reading pages (Deep Dive, About)
   ========================================================================== */

.article {
  padding: calc(var(--nav-h) + clamp(48px, 7vw, 96px)) var(--pad-x) var(--section-y);
}

.article-inner { max-width: 900px; margin: 0 auto; }

.article-head { display: grid; gap: 14px; padding-bottom: clamp(30px, 4vw, 48px); border-bottom: 1px solid var(--line); margin-bottom: clamp(30px, 4vw, 56px); }

.article-head .title { max-width: 16ch; }

.article section.block { padding: 26px 0; border-bottom: 1px solid var(--hairline); }
.article section.block:last-of-type { border-bottom: 0; }
.article section.block h2 { font-size: clamp(22px, 2.4vw, 30px); margin-bottom: 14px; }
.article section.block h3 { font-size: 18px; margin: 20px 0 8px; }

/* Portrait mounted beside its text, labelled like a catalogue plate. */
.bio-figure {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: clamp(22px, 3vw, 34px);
  align-items: start;
}

.bio-figure figure { margin: 0; }

.bio-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--line);
}

.bio-figure p { max-width: 52ch; }

.bio-figure figcaption { margin-top: 10px; }

@media (max-width: 640px) {
  .bio-figure { grid-template-columns: 1fr; gap: 18px; }
  .bio-figure figure { max-width: 196px; }
}

.figure-slot {
  border: 1px dashed var(--line);
  background: var(--bg-raise);
  padding: clamp(28px, 4vw, 56px);
  text-align: center;
  color: var(--faint);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  margin: 20px 0;
}

/* Reading toggle (segmented control) */
.toggle-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin: 24px 0 12px;
}

.toggle-hint {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  margin: 0;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--crimson);
  overflow: hidden;
}

.seg button {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 18px;
  background: transparent;
  color: var(--crimson);
  border: 0;
  border-left: 1px solid var(--crimson);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg button:first-child { border-left: 0; }
.seg button.active { background: var(--crimson); color: var(--on-crimson); }
.seg button:hover:not(.active) { background: rgba(139, 32, 21, 0.08); }

/* Highlighted callout */
/* A callout is always labelled. The label states which kind of note it is, so a
   reference key, a finding of this project, and a cited source are never mistaken
   for one another. The source line carries either a citation or, where the work is
   unpublished field research, the scholars it is owed to. */
.callout {
  border-left: 3px solid var(--crimson);
  background: var(--bg-raise);
  padding: 20px 24px;
  margin: 24px 0;
}

.callout h3 { font-size: 19px; margin-bottom: 8px; }
.callout p { color: var(--muted); margin: 0; }
.callout p + p { margin-top: 12px; }

.callout .callout-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--crimson);
  margin: 0 0 7px;
}

.callout .callout-source {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.65;
  color: var(--faint);
}

.callout .callout-source cite { font-style: italic; }

.callout .callout-source a {
  color: var(--crimson);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.callout .callout-source a:hover { color: var(--crimson-deep); }

/* A document offered to the reader. Deliberately not a .callout: a callout is
   something to read here, this is something to open. Hence the full border and
   the arrow, rather than the crimson spine. */
.doc-link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5px 20px;
  border: 1px solid var(--line);
  background: #fdfcf9;
  padding: 18px 22px;
  margin: 26px 0;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.doc-link:hover, .doc-link:focus-visible { background: var(--bg-raise); border-color: var(--crimson); }

.doc-link .doc-kind {
  grid-column: 1;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--crimson);
}

.doc-link .doc-title {
  grid-column: 1;
  font-family: var(--font-display);
  font-size: clamp(16px, 1.7vw, 19px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.doc-link .doc-meta { grid-column: 1; font-size: 13px; line-height: 1.6; color: var(--faint); }

.doc-link .doc-arr {
  grid-column: 2;
  grid-row: 1 / -1;
  font-size: 20px;
  color: var(--crimson);
  transition: transform 0.2s ease;
}

.doc-link:hover .doc-arr { transform: translate(3px, -3px); }

/* Chart table (Chart II) */
.chart-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); }

table.chart { border-collapse: collapse; width: 100%; min-width: 880px; font-size: 13.5px; }

table.chart th, table.chart td { border: 1px solid var(--hairline); padding: 12px 14px; text-align: left; vertical-align: top; }

table.chart thead th {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: var(--bg-raise);
}

table.chart tbody th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  background: var(--bg-raise);
}

table.chart td { color: var(--muted); }

/* Scene Map: the painting itself, dimmed, divided into its 23 scenes */
/* The map is a figure, so it gets room to breathe on both sides. The bottom is
   padding rather than margin so it cannot collapse into the next heading. */
.map-scroller {
  margin-top: clamp(28px, 4vw, 48px);
  padding-bottom: clamp(22px, 3vw, 36px);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.map-figure {
  display: flex;
  align-items: stretch;
  gap: 12px;
  min-width: 860px;
  padding-bottom: 4px;
}

/* Left gutter: one label per inscription line, pinned to its band */
.map-lines {
  position: relative;
  flex: 0 0 104px;
}

.map-lines b {
  position: absolute;
  right: 0;
  width: 100%;
  text-align: right;
  font: 500 10px/1.35 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.map-lines b::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -12px;
  width: 12px;
  border-top: 1px solid rgba(180, 145, 70, 0.75);
}

.map-cloth {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fdfcf9;
  line-height: 0;
}

.map-cloth > img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.55) brightness(1.04) contrast(0.92);
  opacity: 0.62;
}

/* The gold inscription bands, traced on the cloth */
.map-ins {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(180, 145, 70, 0.8);
  border-bottom: 1px solid rgba(180, 145, 70, 0.8);
  background: rgba(214, 178, 92, 0.16);
  pointer-events: none;
  z-index: 2;
}

/* One clickable box per scene; the borders are the scene divisions */
.map-scene {
  position: absolute;
  display: block;
  text-decoration: none;
  border: 1px solid rgba(28, 24, 20, 0.42);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

/* the un-dimmed slice of painting, revealed on hover.
   --bs / --bp are set per scene from its coords in scenes.json */
.map-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("painting-full.jpg") var(--bp) / var(--bs) no-repeat;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.map-scene i {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 1;
  min-width: 17px;
  padding: 1px 4px;
  border-radius: 2px;
  background: rgba(248, 246, 241, 0.86);
  color: var(--ink);
  font: 600 11px/1.5 var(--font-display);
  font-style: normal;
  text-align: center;
}

.map-scene:hover,
.map-scene:focus-visible {
  z-index: 3;
  border-color: var(--crimson);
  box-shadow: 0 0 0 2px var(--crimson);
  outline: none;
}

.map-scene:hover::before,
.map-scene:focus-visible::before { opacity: 1; }

.map-scene:hover i,
.map-scene:focus-visible i { background: var(--crimson); color: var(--on-crimson); }

/* the divide between section one and section two, running the whole cloth */
.map-split {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--crimson);
  pointer-events: none;
  z-index: 4;
}

/* Section one / section two, named under the cloth they divide */
.map-secs {
  display: flex;
  min-width: 860px;
  padding-left: 116px;
  margin-top: 7px;
}

.map-secs span {
  min-width: 0;
  text-align: center;
  font: 500 10px/1.35 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.map-hint { font-size: 12px; color: var(--faint); margin-top: 8px; }

@media (min-width: 900px) { .map-hint { display: none; } }


/* Watercolor plate opening a telling of the legend */
.legend-plate { margin: 2px 0 24px; }
.legend-plate img { width: 100%; height: auto; }

/* Numbered methodology steps */
.method-list { color: var(--muted); padding-left: 22px; display: grid; gap: 12px; margin: 14px 0 0; }
.method-list li::marker { color: var(--crimson); font-weight: 600; }
.method-list strong { color: var(--ink); }

/* Inscription line study (Inscriptions page) */
.line-study {
  border: 1px solid var(--line);
  background: #fdfcf9;
  padding: clamp(18px, 2.6vw, 28px);
  margin: 18px 0 26px;
  display: grid;
  gap: 18px;
}

.line-study h3 { margin: 0; font-size: 19px; }

/* Each field is a different kind of reading of the same line, so they are
   separated the way the FAQ separates questions: a crimson label over a
   hairline rule, rather than three faint labels running together. */
.line-field + .line-field {
  border-top: 1px solid var(--hairline);
  padding-top: 20px;
}

.line-field .k {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--crimson);
  margin-bottom: 10px;
}

.line-field .v { font-size: 15px; color: var(--muted); line-height: 1.9; }

/* FAQ (interview) */
.qa-group {
  margin: 30px 0 4px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--faint);
}

.qa-group:first-of-type { margin-top: 8px; }

.qa {
  border-top: 1px solid var(--hairline);
  padding: 24px 0;
  display: grid;
  gap: 8px;
}

.qa:first-of-type { border-top: 0; padding-top: 8px; }

.qa .qnum {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--crimson);
}

.qa h3 { margin: 0; font-size: clamp(19px, 2vw, 23px); }
.qa p { color: var(--muted); }

/* Article pager (bottom of legend, iconography, faq, and Story Mode) */
.pager {
  margin-top: clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.pager a {
  padding: 26px 6px;
  text-decoration: none;
  display: grid;
  gap: 6px;
}

.pager a:last-child { text-align: right; border-left: 1px solid var(--hairline); }
.pager a:first-child:last-child { border-left: 0; }
.pager .plabel { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--faint); }
.pager .ptitle { font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.pager a:hover .ptitle { color: var(--crimson); }

/* ===========================================================================
   Explore — Full View (light)
   ========================================================================== */

#viewer {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: #ffffff;
}

#viewerHint {
  position: fixed;
  left: var(--pad-x);
  bottom: 22px;
  z-index: 10;
  font-size: 12px;
  color: #9d948a;
  letter-spacing: 0.04em;
  pointer-events: none;
}

/* People: one per row, portrait alongside the text, as on the FAQ page */
.people { display: grid; gap: clamp(34px, 4.5vw, 56px); margin-top: 28px; }

.person {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(22px, 3vw, 38px);
  align-items: start;
  border-top: 1px solid var(--ink);
  padding-top: 20px;
}

.person figure { margin: 0; }

.person img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--line);
}

.person-text .role {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--crimson); font-weight: 500;
}
.person-text h3 { font-size: 25px; margin: 7px 0 12px; }
.person-text p { color: var(--muted); font-size: 15px; max-width: 62ch; }
.person-text p + p { margin-top: 12px; }

@media (max-width: 640px) {
  .person { grid-template-columns: 1fr; gap: 18px; }
  .person figure { max-width: 220px; }
}

/* ===========================================================================
   Gallery: a masonry wall that opens into a full-screen viewer
   ========================================================================== */

/* linked to from the footers as about.html#gallery, so it has to clear the nav */
#gallery { scroll-margin-top: calc(var(--nav-h) + 24px); }

.masonry { columns: 3; column-gap: 14px; }
@media (max-width: 900px) { .masonry { columns: 2; } }
@media (max-width: 520px) { .masonry { columns: 2; column-gap: 10px; } }

.masonry figure {
  break-inside: avoid;
  margin: 0 0 14px;
  position: relative;
  overflow: hidden;
  background: var(--bg-raise);
}

.masonry button {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  cursor: zoom-in; line-height: 0;
}

.masonry img {
  width: 100%; height: auto; display: block;
  transition: transform 0.45s cubic-bezier(.2,.6,.2,1), filter 0.3s ease;
}

.masonry button:hover img { transform: scale(1.035); filter: brightness(0.94); }
.masonry button:focus-visible { outline: 2px solid var(--crimson); outline-offset: 2px; }
.masonry figcaption { margin-top: 8px; }

.gallery-empty {
  border: 1px dashed var(--line);
  background: var(--bg-raise);
  padding: clamp(40px, 6vw, 80px);
  text-align: center;
  color: var(--faint);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
}

/* ---- The viewer: the photo centred, everything else dimmed away ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12, 10, 8, 0.94);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(48px, 7vh, 84px) clamp(14px, 5vw, 76px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.lightbox.open { display: flex; }
.lightbox.shown { opacity: 1; }

.lightbox figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: scale(0.985);
  transition: transform 0.22s ease;
}
.lightbox.shown figure { transform: none; }

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - clamp(120px, 18vh, 190px));
  width: auto; height: auto;
  display: block;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.lightbox .lb-caption {
  text-align: center;
  color: rgba(233, 226, 214, 0.72);
  margin-top: 14px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14.5px;
  max-width: 62ch;
}
.lightbox .lb-caption:empty { display: none; }

/* controls: quiet until you want them */
.lightbox button {
  position: fixed;
  border: 1px solid rgba(233, 226, 214, 0.26);
  background: rgba(20, 17, 14, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #f2ecdf;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.lightbox button:hover { background: #f2ecdf; color: #14110e; border-color: #f2ecdf; }
.lightbox button[disabled] { opacity: 0.25; cursor: default; }
.lightbox button[disabled]:hover { background: rgba(20, 17, 14, 0.5); color: #f2ecdf; border-color: rgba(233, 226, 214, 0.26); }

.lightbox .lb-close {
  top: clamp(14px, 2.4vh, 26px); right: clamp(14px, 2.4vw, 30px);
  width: 42px; height: 42px; font-size: 21px; line-height: 1;
}
.lightbox .lb-prev, .lightbox .lb-next {
  top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; font-size: 22px; line-height: 1;
}
.lightbox .lb-prev { left: clamp(10px, 2vw, 26px); }
.lightbox .lb-next { right: clamp(10px, 2vw, 26px); }

.lightbox .lb-count {
  position: fixed;
  bottom: clamp(14px, 2.4vh, 26px); left: 50%; transform: translateX(-50%);
  color: rgba(233, 226, 214, 0.6);
  font-size: 12.5px; letter-spacing: 0.14em;
}

@media (max-width: 560px) {
  .lightbox .lb-prev, .lightbox .lb-next { width: 38px; height: 38px; font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox figure { transition: none; }
  .masonry img { transition: none; }
  .masonry button:hover img { transform: none; }
}

/* ===========================================================================
   Footer — crimson color block
   ========================================================================== */

.site-footer {
  background: var(--crimson);
  color: var(--on-crimson);
  padding: clamp(52px, 7vw, 96px) var(--pad-x) 34px;
  position: relative;
  z-index: 2;
}

.footer-inner { max-width: 1240px; margin: 0 auto; }

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr);
  gap: clamp(32px, 5vw, 72px);
  padding-bottom: clamp(36px, 5vw, 64px);
}

@media (max-width: 880px) { .footer-top { grid-template-columns: 1fr; } }

.footer-top h2 { font-size: clamp(30px, 3.6vw, 46px); max-width: 14ch; }

.footer-col .flabel {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(246, 239, 227, 0.6);
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  color: var(--on-crimson);
  text-decoration: none;
  font-size: 15px;
  padding: 5px 0;
  opacity: 0.9;
}

.footer-col a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.footer-bottom {
  border-top: 1px solid var(--crimson-line);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: rgba(246, 239, 227, 0.75);
}

.footer-bottom a { color: inherit; }

/* ===========================================================================
   Reveal-on-scroll targets (GSAP animates FROM hidden, so content is
   always visible without JS)
   ========================================================================== */

[data-reveal] { will-change: transform, opacity; }
