/* ==========================================================================
   Until He Rises — Companion Archive (amarna.compossible.blog)
   Aesthetic: Tura Noon (cut limestone & mineral pigments) / Nile Night (basalt & sesame lamp)
   Guardrails: Zero exclamation marks, zero italics, zero global SVG transform overrides.
   ========================================================================== */

:root,
[data-theme="light"] {
  --bg: #FAF6EE;
  --bg-elevated: #F2EBDD;
  --bg-card: #FFFDFA;
  --bg-inset: #EAE1CE;
  --ink: #1A1815;
  --ink-secondary: #433D35;
  --ink-muted: #696054;
  --lapis: #1A3A6E;
  --accent: #1D6A87;
  --accent-strong: #145068;
  --accent-soft: rgba(29, 106, 135, 0.11);
  --malachite: #2B674B;
  --ochre: #9A6D1B;
  --ochre-soft: rgba(179, 130, 40, 0.14);
  --rubric: #9B3724;
  --rubric-soft: rgba(155, 55, 36, 0.10);
  --border: rgba(26, 24, 21, 0.13);
  --border-strong: rgba(26, 24, 21, 0.25);
  --shadow-card: 0 8px 26px rgba(26, 24, 21, 0.06);
  --shadow-vitrine: 0 16px 38px rgba(18, 16, 13, 0.22);
  --vitrine-cradle: #1B1D24;
  --map-ground: #F5EFE2;
  --map-water: #CBE1EA;
  --map-water-stroke: #2C7894;
  --map-cultivation: #D9E5CE;
  --map-escarpment: #B79E7A;
}

[data-theme="dark"] {
  --bg: #111317;
  --bg-elevated: #181B22;
  --bg-card: #1C2029;
  --bg-inset: #232834;
  --ink: #EDE6D8;
  --ink-secondary: #C8BFB0;
  --ink-muted: #988F80;
  --lapis: #8AB2EA;
  --accent: #4BA6B2;
  --accent-strong: #6CC0CB;
  --accent-soft: rgba(75, 166, 178, 0.15);
  --malachite: #5CB88E;
  --ochre: #DFAA4E;
  --ochre-soft: rgba(223, 170, 78, 0.16);
  --rubric: #E07A64;
  --rubric-soft: rgba(224, 122, 100, 0.15);
  --border: rgba(237, 230, 216, 0.13);
  --border-strong: rgba(237, 230, 216, 0.27);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.34);
  --shadow-vitrine: 0 18px 42px rgba(0, 0, 0, 0.55);
  --vitrine-cradle: #0B0D11;
  --map-ground: #181C24;
  --map-water: #183442;
  --map-water-stroke: #4BA6B2;
  --map-cultivation: #1F3329;
  --map-escarpment: #8C7658;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg);
  color: var(--ink);
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  background-color: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

/* Guarantee zero accidental italic rendering anywhere */
em,
i,
cite,
dfn,
var,
address {
  font-style: normal;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-strong);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 999;
  padding: 0.55rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  left: 0.75rem;
}

/* Four-pigment architectural cornice band at very top of page */
.mineral-cornice {
  height: 5px;
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    #1D6A87 0px,
    #1D6A87 28px,
    #1A1815 28px,
    #1A1815 31px,
    #9B3724 31px,
    #9B3724 59px,
    #1A1815 59px,
    #1A1815 62px,
    #2B674B 62px,
    #2B674B 90px,
    #1A1815 90px,
    #1A1815 93px,
    #B38228 93px,
    #B38228 121px,
    #1A1815 121px,
    #1A1815 124px
  );
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   Site Header & Compact Moon/Sun Toggle
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.brand-sub {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.primary-nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.12rem;
}

.nav-link {
  padding: 0.38rem 0.52rem;
  border-radius: 5px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--bg-elevated);
  color: var(--ink);
}

.nav-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.horizon-pill-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--bg-elevated);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--ink);
  cursor: pointer;
}

[data-theme="dark"] .theme-icon-sun {
  color: var(--ochre);
}

.icon-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

[data-theme="light"] .theme-icon-sun {
  display: none;
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

/* Mobile menu disclosure */
.mobile-nav-toggle {
  display: none;
}

/* ==========================================================================
   Typography & Broken-Lintel Architectural Dividers
   ========================================================================== */

h1,
h2,
h3,
h4,
.serif-display {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  line-height: 1.18;
  color: var(--ink);
  margin-top: 0;
}

h1 {
  font-size: clamp(2.15rem, 3.8vw, 3.35rem);
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  margin-bottom: 0.65rem;
}

h3 {
  font-size: 1.32rem;
  margin-bottom: 0.45rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rubric);
  margin-bottom: 0.65rem;
}

.age-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.14rem 0.48rem;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.lede {
  font-size: 1.12rem;
  line-height: 1.68;
  color: var(--ink-secondary);
  max-width: 64ch;
  margin-top: 0;
  margin-bottom: 1.35rem;
}

.broken-lintel {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 2.8rem 0;
}

.broken-lintel::before,
.broken-lintel::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

.broken-lintel-disc {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--ochre);
  background: transparent;
  flex-shrink: 0;
}

/* ==========================================================================
   Buttons & Interactive Segmented Controls
   ========================================================================== */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.68rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
}

[data-theme="dark"] .btn-primary {
  color: #0D1116;
}

.btn-primary:hover {
  background: var(--accent-strong);
  color: #FFFFFF;
}

[data-theme="dark"] .btn-primary:hover {
  color: #0D1116;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--ink);
}

.segmented-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.28rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.seg-btn {
  padding: 0.45rem 0.82rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.seg-btn:hover {
  color: var(--ink);
}

.seg-btn[aria-pressed="true"],
.seg-btn.is-active {
  background: var(--bg-card);
  color: var(--accent);
  border-color: var(--border-strong);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Homepage Hero & Continuous-Spine Trilogy Vitrine
   ========================================================================== */

.hero-section {
  padding: 2.6rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: 2.5rem;
  align-items: start;
}

.horizon-panel {
  margin: 1.35rem 0 1.5rem;
  padding: 1rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ochre);
  border-radius: 8px;
}

.horizon-panel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-secondary);
  margin-bottom: 0.55rem;
}

.horizon-rungs {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.horizon-rung-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 0.52rem 0.78rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.horizon-rung-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.horizon-rung-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.vitrine-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: var(--shadow-card);
}

.vitrine-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.vitrine-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.vitrine-stage {
  background: var(--vitrine-cradle);
  border-radius: 9px;
  padding: 1.35rem 1.1rem;
  min-height: 410px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.45);
}

.vitrine-spines {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  transition: gap 0.32s ease;
  max-width: 320px;
  width: 100%;
}

.vitrine-stage[data-vitrine-mode="parted"] .vitrine-spines {
  gap: 16px;
  max-width: 356px;
}

.vitrine-spine-item {
  flex: 1 1 0;
  display: block;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: var(--shadow-vitrine);
  transition: transform 0.28s ease;
}

.vitrine-spine-item:hover {
  transform: translateY(-3px);
}

.vitrine-spine-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 320 / 1440;
  object-fit: cover;
}

.vitrine-covers {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.vitrine-stage[data-vitrine-mode="covers"] .vitrine-spines {
  display: none;
}

.vitrine-stage[data-vitrine-mode="covers"] .vitrine-covers {
  display: grid;
}

.vitrine-cover-item {
  display: block;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: var(--shadow-vitrine);
  text-decoration: none;
}

.vitrine-cover-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.vitrine-caption {
  margin: 0.85rem 0 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Cards, Grids & Two-Snakes Section
   ========================================================================== */

.section-block {
  padding: 2rem 0;
}

.section-head {
  margin-bottom: 1.5rem;
  max-width: 72ch;
}

.two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
}

.three-col-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.surface-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.35rem;
  box-shadow: var(--shadow-card);
}

.surface-card.accent-top-blue {
  border-top: 3px solid var(--accent);
}

.surface-card.accent-top-rubric {
  border-top: 3px solid var(--rubric);
}

.surface-card.accent-top-ochre {
  border-top: 3px solid var(--ochre);
}

.card-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rubric);
  margin-bottom: 0.35rem;
}

.triad-svg-frame {
  background: #F6F2E9;
  border: 1px solid rgba(26, 24, 21, 0.16);
  border-radius: 7px;
  padding: 0.55rem;
  margin: 0.75rem 0;
}

.triad-svg-frame svg,
.epigraphy-svg-wrap svg {
  width: 100%;
  height: auto;
}

/* ==========================================================================
   Books Showcase, Cast Grid, Plates & Single-Row Unused Covers
   ========================================================================== */

.book-showcase-row {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding: 1.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}

.book-cover-frame {
  border-radius: 7px;
  overflow: hidden;
  box-shadow: var(--shadow-vitrine);
  border: 1px solid var(--border-strong);
}

.book-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.8rem;
  font-size: 0.83rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.horizon-reveal-box {
  margin-top: 1rem;
  padding: 0.9rem 1.05rem;
  border-radius: 7px;
  background: var(--ochre-soft);
  border-left: 3px solid var(--ochre);
  font-size: 0.92rem;
}

.cast-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.plate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
}

.plate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.plate-card.is-spread {
  grid-column: 1 / -1;
}

.plate-card img {
  width: 100%;
  height: auto;
  display: block;
}

.plate-card-body {
  padding: 1rem 1.15rem 1.15rem;
}

/* Strictly ONE single row of unused candidate covers */
.alt-covers-single-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.alt-cover-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem;
}

.alt-cover-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 0.55rem;
}

.alt-cover-card h4 {
  font-size: 0.98rem;
  margin: 0 0 0.25rem;
}

.alt-cover-card p {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.45;
}

/* ==========================================================================
   Reading Room Literary Typography
   ========================================================================== */

.reading-shell {
  max-width: 720px;
  margin: 0 auto;
}

.reading-chapter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.reading-prose {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.16rem, 1.4vw, 1.28rem);
  line-height: 1.78;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(1.4rem, 4vw, 3rem);
  box-shadow: var(--shadow-card);
}

.reading-prose h2 {
  font-size: 1.85rem;
  margin-top: 2.2rem;
  margin-bottom: 0.35rem;
}

.reading-prose h2:first-child {
  margin-top: 0;
}

.reading-prose .ch-kicker {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--rubric);
  margin-bottom: 0.25rem;
}

.reading-prose p {
  margin: 0 0 1.15rem;
}

.scene-break {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.9rem 0;
  color: var(--ochre);
  font-size: 0.9rem;
  letter-spacing: 0.3em;
}

/* ==========================================================================
   Scripts Studio, Damnatio Memoriae Explorer & Searchable Lexicon
   ========================================================================== */

.damnatio-explorer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  box-shadow: var(--shadow-card);
}

.damnatio-stage-frame {
  background: #F6F2E9;
  border: 1px solid rgba(26, 24, 21, 0.2);
  border-radius: 8px;
  padding: 0.65rem;
  margin: 1rem 0;
}

.damnatio-stage-panel svg {
  width: 100%;
  height: auto;
}

.specimen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.specimen-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8rem;
}

.epigraphy-svg-wrap {
  background: #F6F2E9;
  border: 1px solid rgba(26, 24, 21, 0.16);
  border-radius: 6px;
  padding: 0.45rem;
}

.specimen-meta {
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.specimen-translit {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0.25rem 0;
}

.specimen-dl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.dl-chip {
  padding: 0.26rem 0.6rem;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 600;
}

.dl-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lexicon-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.search-input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 0.62rem 0.9rem;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.93rem;
}

.lexicon-count {
  font-size: 0.84rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.lexicon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.lexicon-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}

.lexicon-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.3rem;
}

.lexicon-term {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--ink);
}

.lexicon-translit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.lexicon-gloss {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-secondary);
  margin: 0 0 0.35rem;
}

.lexicon-note {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.52;
}

/* ==========================================================================
   World Map Lab, City Plan & Metrology Workbench
   ========================================================================== */

.map-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 0.82fr);
  gap: 1.35rem;
  align-items: start;
}

.map-canvas-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow-card);
}

.map-dossier-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

/* SVG Map Styling Tokens */
.map-ground {
  fill: var(--map-ground);
}

.map-graticule {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.map-grat-label {
  fill: var(--ink-muted);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 10px;
}

.map-coastline {
  fill: none;
  stroke: var(--map-water-stroke);
  stroke-width: 1.8;
}

.map-island,
.map-lake {
  fill: var(--map-water);
  stroke: var(--map-water-stroke);
  stroke-width: 1.4;
}

.map-river-major {
  fill: none;
  stroke: var(--map-water-stroke);
  stroke-width: 3.2;
  stroke-linecap: round;
}

.map-river-minor {
  fill: none;
  stroke: var(--map-water-stroke);
  stroke-width: 2;
  stroke-linecap: round;
}

.map-courier-route {
  fill: none;
  stroke: var(--rubric);
  stroke-width: 1.8;
  stroke-dasharray: 5 5;
}

.map-region-water {
  fill: var(--accent);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  opacity: 0.85;
}

.map-region-land {
  fill: var(--ink-muted);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.map-compass-ring {
  fill: var(--bg-card);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}

.map-compass-needle-top {
  fill: var(--rubric);
}

.map-compass-needle-bot {
  fill: var(--ink-muted);
  opacity: 0.45;
}

.map-compass-label {
  fill: var(--rubric);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.map-compass-sub {
  fill: var(--ink-muted);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 9.5px;
  font-weight: 600;
}

.map-pin-group,
.city-pin-group {
  cursor: pointer;
}

.map-pin-hit {
  fill: transparent;
}

.map-pin-dot,
.city-pin-dot {
  fill: var(--bg-card);
  stroke: var(--accent);
  stroke-width: 2.4;
}

.map-pin-dot.is-capital {
  fill: var(--ochre);
  stroke: var(--rubric);
  stroke-width: 2.6;
}

.map-pin-group.is-selected .map-pin-dot,
.city-pin-group.is-selected .city-pin-dot {
  fill: var(--rubric);
  stroke: var(--ink);
  stroke-width: 2.8;
}

.map-pin-label,
.city-pin-label {
  fill: var(--ink);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
}

.map-scale-line {
  stroke: var(--ink-secondary);
  stroke-width: 1.6;
}

.map-scale-label {
  fill: var(--ink-secondary);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 10.5px;
  font-weight: 600;
}

/* City Plan specific tokens */
.city-nile-water {
  fill: var(--map-water);
}

.city-nile-bank {
  fill: none;
  stroke: var(--map-water-stroke);
  stroke-width: 2.2;
}

.city-cultivation {
  fill: var(--map-cultivation);
}

.city-escarpment-rim {
  fill: none;
  stroke: var(--map-escarpment);
  stroke-width: 4;
  stroke-linecap: round;
}

.city-escarpment-hachure {
  fill: none;
  stroke: var(--map-escarpment);
  stroke-width: 1.5;
  stroke-dasharray: 3 6;
}

.city-desert-ridge {
  fill: none;
  stroke: var(--map-escarpment);
  stroke-width: 2;
  stroke-dasharray: 6 5;
  opacity: 0.75;
}

.city-royal-road {
  fill: none;
  stroke: var(--rubric);
  stroke-width: 3;
}

.city-swept-track {
  fill: none;
  stroke: var(--ochre);
  stroke-width: 1.8;
  stroke-dasharray: 4 4;
}

.city-footprint {
  fill: var(--ochre-soft);
  stroke: var(--ochre);
  stroke-width: 1.4;
}

.city-footprint-village {
  fill: var(--rubric-soft);
  stroke: var(--rubric);
  stroke-width: 1.6;
}

.city-bridge-span {
  stroke: var(--rubric);
  stroke-width: 4;
}

.city-solar-axis {
  stroke: var(--ochre);
  stroke-width: 1.4;
  stroke-dasharray: 7 5;
  opacity: 0.75;
}

.city-dawn-disc {
  fill: var(--ochre);
  opacity: 0.85;
}

.city-sub-note,
.city-stela-label {
  fill: var(--ink-muted);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 10px;
  font-weight: 600;
}

.city-road-label {
  fill: var(--rubric);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.city-stela-stone {
  fill: var(--ochre);
  stroke: var(--ink);
  stroke-width: 1;
}

/* Accessible Est. Toggletip */
.toggletip-wrap {
  position: relative;
  display: inline-block;
}

.toggletip-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.42rem;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
}

.toggletip-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 40;
  width: 270px;
  padding: 0.65rem 0.8rem;
  border-radius: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  font-size: 0.79rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

/* Metrology Calculator Grid */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.calc-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0.75rem 0;
}

.calc-input,
.calc-select {
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  min-width: 0;
}

.calc-input {
  width: 110px;
}

.calc-select {
  flex: 1 1 180px;
}

.calc-output-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.calc-output-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

/* ==========================================================================
   Atelier Mineral Swatches & Expandable Contact-Sheet Drawer
   ========================================================================== */

.swatch-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.swatch-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.swatch-btn[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.swatch-chip {
  width: 100%;
  height: 36px;
  border-radius: 5px;
  border: 1px solid rgba(26, 24, 21, 0.22);
}

.swatch-label {
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.25;
}

.archive-drawer {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.archive-drawer summary {
  cursor: pointer;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0.25rem 0;
}

.contact-sheet-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

/* ==========================================================================
   Footer & Instant Search Dialog
   ========================================================================== */

.site-footer {
  margin-top: 3.5rem;
  padding: 2.4rem 0 2.8rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.footer-links a {
  color: var(--ink-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ==========================================================================
   Responsive Breakpoints (Zero Horizontal Overflow at 375x812)
   ========================================================================== */

@media (max-width: 1120px) {
  .primary-nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .map-workbench,
  .book-showcase-row {
    grid-template-columns: 1fr;
  }

  .book-showcase-row .book-cover-frame {
    max-width: 240px;
  }

  .swatch-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }
}

@media (max-width: 760px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    display: none;
    width: 100%;
    order: 4;
    flex-direction: column;
    align-items: stretch;
    padding: 0.55rem 0 0.35rem;
    border-top: 1px solid var(--border);
  }

  .primary-nav.is-open {
    display: flex;
  }

  .horizon-pill-mini {
    display: none;
  }

  .two-col-grid,
  .three-col-grid,
  .cast-grid,
  .plate-grid,
  .specimen-grid,
  .lexicon-grid,
  .calc-grid {
    grid-template-columns: 1fr;
  }

  /* Keep unused covers in a single horizontal filmstrip row on narrow screens too */
  .alt-covers-single-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(210px, 72%);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 0.45rem;
    scroll-snap-type: x mandatory;
  }

  .alt-cover-card {
    scroll-snap-align: start;
  }

  .swatch-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toggletip-pop {
    left: auto;
    right: 0;
    width: 240px;
  }
}
