/* ============================================================
   STORY & STONE — house stylesheet
   Palette drawn from the subject's own materials:
   techelet (the indigo of the tzitzit thread), vellum,
   Jerusalem stone, basalt, gold leaf, pomegranate.
   Type: Frank Ruhl Libre (a Hebrew-heritage face) for display,
   Newsreader for narrative prose, Inter for utility labels.
   ============================================================ */

:root {
  --night:      #131C38;   /* deep techelet — site ground */
  --night-2:    #1B2750;   /* raised night surfaces */
  --land:       #232F5C;   /* map landmass */
  --techelet:   #5C7FC4;   /* interactive blue */
  --vellum:     #F5EDDF;   /* story register ground */
  --vellum-2:   #EDE2CC;
  --ink:        #2A2419;   /* story register text */
  --basalt:     #221E1B;   /* stone register ground */
  --stone:      #CBB995;   /* Jerusalem stone — text on basalt */
  --gold:       #C7A24B;   /* gold leaf — persistence */
  --gold-soft:  #E3C87E;
  --pomegranate:#9E3B2E;   /* sparing */
  --empire:     rgba(158, 92, 70, 0.30);

  --display: "Frank Ruhl Libre", Georgia, serif;
  --body:    "Newsreader", Georgia, serif;
  --utility: "Inter", -apple-system, sans-serif;

  --measure: 64ch;
}

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

html { scroll-behavior: smooth; font-size: 17px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--body);
  background: var(--night);
  color: var(--vellum);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: var(--night); }

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

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

/* ---------- article figures ---------- */
.article-figure {
  margin: 2.2rem 0;
  border: 1px solid rgba(42,36,25,0.12);
  border-radius: 3px;
  overflow: hidden;
}
.article-figure img {
  width: 100%;
  height: auto;
  display: block;
}
.article-figure figcaption {
  padding: 0.55rem 0.85rem;
  font-family: var(--utility);
  font-size: 0.74rem;
  line-height: 1.5;
  color: rgba(42,36,25,0.82);
  background: rgba(42,36,25,0.03);
  border-top: 1px solid rgba(42,36,25,0.08);
}
.article-figure figcaption a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-figure figcaption .attrib {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.67rem;
  opacity: 0.7;
}

/* ---------- inline external links ---------- */
.ext-links {
  margin: 1.4rem 0;
  padding: 0.9rem 1.1rem;
  background: rgba(42,36,25,0.03);
  border-left: 3px solid var(--gold);
  border-radius: 0 3px 3px 0;
}
.ext-links p {
  margin: 0 0 0.35rem;
  font-family: var(--utility);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(42,36,25,0.55);
}
.ext-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ext-links ul li {
  margin: 0.2rem 0;
  font-family: var(--utility);
  font-size: 0.82rem;
}
.ext-links ul li a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ext-links ul li a::before {
  content: "→ ";
  opacity: 0.7;
}

/* ---------- utility text styles ---------- */
.eyebrow {
  font-family: var(--utility);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.eyebrow .tick { color: var(--gold); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--night) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(199, 162, 75, 0.22);
}
.wordmark {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .amp { color: var(--gold); font-weight: 300; }
.wordmark-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  flex-shrink: 0;
}
.site-tagline {
  font-family: var(--utility);
  font-weight: 400;
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--gold) 65%, transparent);
  margin: 0.1rem 0 0 0;
  line-height: 1;
  white-space: nowrap;
}
.site-tagline .hebrew,
footer .fine .hebrew {
  direction: rtl;
  unicode-bidi: isolate;
  letter-spacing: 0;
  text-transform: none;
}
.article-page .site-tagline {
  color: color-mix(in srgb, var(--pomegranate) 60%, transparent);
}
.wordmark .heb {
  font-weight: 400; color: var(--gold-soft);
  letter-spacing: 0; margin-left: 0.6em; font-size: 0.95em;
}
.topnav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.2rem); }
.topnav a {
  font-family: var(--utility);
  font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; color: var(--vellum);
  opacity: 0.95;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.topnav a:hover, .topnav a[aria-current="page"] {
  opacity: 1; border-bottom-color: var(--gold);
}
/* search collapses to a magnifier - stays at every width, costs almost no room */
.topnav a.nav-search {
  display: inline-flex; align-items: center;
  align-self: center;
  padding-bottom: 0; border-bottom: 0;
}
.topnav a.nav-search svg { width: 1.06rem; height: 1.06rem; display: block; }
.topnav a.nav-search:hover, .topnav a.nav-search[aria-current="page"] {
  opacity: 1; color: var(--gold);
}
/* tiered nav: secondary destinations bow out before things get cramped */
@media (max-width: 1180px) {
  .topnav a.hide-md { display: none; }
  .topnav { gap: clamp(0.8rem, 2vw, 1.6rem); }
  .topnav a { font-size: 0.76rem; letter-spacing: 0.1em; white-space: nowrap; }
}
@media (max-width: 900px) {
  .topbar { align-items: center; gap: 0.8rem; overflow: hidden; }
  .wordmark-group { min-width: 0; flex: 0 1 auto; }
  .topnav {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    gap: clamp(0.65rem, 1.8vw, 1rem);
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { font-size: 0.7rem; letter-spacing: 0.08em; }
}
@media (max-width: 640px) {
  .topnav a.hide-sm, .topnav a.hide-md { display: none; }
  .topbar { flex-wrap: nowrap; align-items: center; padding: 0.7rem 1rem; gap: 0.8rem; }
  .wordmark { font-size: 0.88rem; letter-spacing: 0.12em; }
  /* the nav itself scrolls sideways rather than stretching the page */
  .topnav { gap: 0.9rem; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { font-size: 0.67rem; letter-spacing: 0.08em; white-space: nowrap; }
}

/* ============================================================
   HOMEPAGE — the map hero, full screen
   The map is the thesis, so the map is the page. Its palette is
   driven by --m-* variables set per-era from map.js: papyrus →
   parchment → portolan → engraved atlas → the earth at night.
   Gold never changes. Gold is persistence.
   ============================================================ */
.hero {
  position: relative;
  height: calc(100svh - var(--topbar-h, 58px));
  min-height: 560px;
  overflow: hidden;
  background: var(--m-ocean);

  /* first-paint epoch: papyrus */
  --m-ocean:   #EAD9B4;
  --m-land:    #D9BE8E;
  --m-coast:   #7A5837;
  --m-ink:     #5E4226;
  --m-hero-fg: #402E1B;
  --m-panel-bg: rgba(246,235,210,0.92);
  --m-panel-fg: #3A2A18;
  --m-accent:  #9E3B2E;
  --m-grat:    rgba(122,90,56,0.3);
  --m-emp-label: #8C3A22;
  --m-dotring: rgba(90,60,30,0.85);
  --m-vig-c:   rgba(94,63,28,0.5);
  --m-tex:     0.5;
  --m-comp:    0.9;
  --m-frame-o: 0.8;
  --m-coastw:  1.4px;
}
.map-stage { position: absolute; inset: 0; }
#worldmap { width: 100%; height: 100%; display: block; }
/* the symbol overlay: light vectors above the paper, below the texture */
#symmap { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the dissolve: two paper snapshots stacked, one cross-fading on the compositor */
.glide-bitmap {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: fill; pointer-events: none; will-change: opacity;
}

/* ----- the aging of the map: overlays ----- */
.map-texture {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  opacity: var(--m-tex);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.33 0 0 0 0 0.19 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23p)'/%3E%3C/svg%3E");
}
.map-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(120% 95% at 50% 42%, transparent 52%, var(--m-vig-c) 100%);
}
.map-frame-line {
  position: absolute; inset: 14px; pointer-events: none; z-index: 3;
  border: 3px double color-mix(in srgb, var(--m-ink) 60%, transparent);
  opacity: var(--m-frame-o);
}
.ground {
  transition: opacity 0.4s ease;
}
.compass {
  position: absolute; z-index: 4;
  top: 1.4rem; right: 1.6rem;
  width: clamp(60px, 8vw, 104px);
  color: var(--m-ink);
  opacity: var(--m-comp);
  pointer-events: none;
}
@media (max-width: 640px) { .compass { width: 52px; top: 1rem; right: 1rem; } }

/* ----- title, floating over the map ----- */
.hero-title {
  position: absolute; z-index: 5;
  top: clamp(1.2rem, 4vh, 3rem);
  left: clamp(1.25rem, 4vw, 3rem);
  max-width: min(640px, calc(100% - 2.5rem));
  color: var(--m-hero-fg);
  pointer-events: none;
}
.hero-title h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2rem, 4.8vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  max-width: 18ch;
  margin-top: 0.4rem;
}
.hero-title h1 em {
  font-style: normal;
  color: color-mix(in srgb, var(--gold) 74%, var(--m-hero-fg) 26%);
}
.hero-title .hero-sub {
  margin-top: 0.8rem;
  max-width: 46ch;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: color-mix(in srgb, var(--m-hero-fg) 80%, transparent);
  transition: opacity 1.2s ease;
}
/* by the modern eras the visitor has read the standfirst — clear the
   stage so the North American lights aren't tangled in text */
.hero[data-epoch="print"] .hero-sub,
.hero[data-epoch="night"] .hero-sub { opacity: 0; }
@media (max-width: 640px) {
  .hero-title .hero-sub { display: none; }
}

/* ----- era panel: readout + time slider ----- */
.era-panel {
  position: absolute; z-index: 6;
  left: clamp(1rem, 3vw, 2.5rem);
  bottom: clamp(1rem, 3vh, 2rem);
  width: min(700px, calc(100% - 2rem));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0.5rem 1.5rem;
  align-items: end;
  padding: 1.1rem 1.3rem 1rem;
  border-radius: 6px;
  background: var(--m-panel-bg);
  color: var(--m-panel-fg);
  border: 1px solid color-mix(in srgb, var(--m-ink) 35%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 22px 50px -22px rgba(15, 10, 4, 0.5);
}
@media (max-width: 760px) {
  .era-panel {
    left: 0.75rem; right: 0.75rem; width: auto;
    grid-template-columns: 1fr;
    padding: 0.75rem 0.9rem 0.7rem;
    gap: 0.4rem;
  }
  .era-readout .era-caption { display: none; }
  .era-readout .era-year { font-size: 1.2rem; }
  .era-readout .era-title { font-size: 0.95rem; }
}

/* ----- community card drawer (Phase 3) ----- */
.community-card {
  position: absolute; z-index: 8;
  right: clamp(1rem, 3vw, 2.5rem);
  top: 50%; transform: translateY(-50%);
  width: min(340px, calc(100% - 2rem));
  max-height: 70%;
  overflow-y: auto;
  background: var(--m-panel-bg);
  color: var(--m-panel-fg);
  border: 1px solid color-mix(in srgb, var(--m-ink) 35%, transparent);
  border-radius: 6px;
  padding: 1.4rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 22px 50px -22px rgba(15, 10, 4, 0.5);
}
aside.community-card[hidden] { display: none; }
.community-card .eyebrow {
  color: var(--m-accent);
  margin-bottom: 0.35rem;
}
.community-card h3 {
  font-family: var(--display); font-weight: 900;
  font-size: 1.5rem; line-height: 1.1;
  margin-top: 0.1rem;
}
.card-story {
  font-size: 0.95rem; line-height: 1.55;
  margin-top: 0.6rem;
}
.card-stone-block {
  background: #221E1B;
  color: #CBB995;
  border-radius: 4px;
  padding: 0.8rem 0.9rem;
  margin-top: 0.8rem;
}
.card-stone-block .when {
  display: block;
  font-family: var(--utility); font-weight: 600;
  font-size: 0.68rem; letter-spacing: 0.18em;
  text-transform: uppercase; font-variant: small-caps;
  color: #C7A24B;
  margin-bottom: 0.35rem;
}
.card-stone-block p {
  font-size: 0.88rem; line-height: 1.55;
  margin-top: 0;
}
.card-stone-block .src {
  display: block;
  margin-top: 0.45rem;
  font-family: var(--utility); font-size: 0.72rem;
  letter-spacing: 0.1em;
  opacity: 0.65;
}
.card-links {
  margin-top: 0.9rem;
}
.card-links a {
  display: inline-block;
  font-family: var(--utility); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; font-variant: small-caps;
  color: var(--m-accent); text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--m-accent) 50%, transparent);
  padding-bottom: 2px;
}
.card-links a:hover { border-bottom-color: var(--m-accent); }
.card-links .workshop {
  font-family: var(--body); font-style: italic;
  font-size: 0.85rem;
  opacity: 0.7;
}
.card-close {
  position: absolute; top: 0.85rem; right: 0.9rem;
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; line-height: 1;
  color: inherit; opacity: 0.7;
  padding: 0.1rem 0.2rem;
}
.card-close:hover { opacity: 1; }
@media (max-width: 760px) {
  .community-card {
    left: 0.75rem; right: 0.75rem;
    top: auto; bottom: 0.75rem;
    transform: none;
    max-height: 55%;
    width: auto;
  }
}

.era-readout { transition: opacity 0.45s ease; }
.era-readout.swap { opacity: 0; }
.era-readout .era-year {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  color: var(--m-accent);
  line-height: 1.05;
}
.era-readout .era-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  margin-top: 0.1rem;
}
.era-readout .era-caption {
  margin-top: 0.45rem;
  font-size: 0.94rem;
  line-height: 1.5;
  color: color-mix(in srgb, var(--m-panel-fg) 94%, transparent);
  max-width: 52ch;
  min-height: 5.7em;
}
@media (max-width: 760px) {
  .era-readout .era-caption {
    min-height: 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
.era-readout .era-link {
  display: inline-block; margin-top: 0.45rem;
  font-family: var(--utility); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--m-accent); text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--m-accent) 50%, transparent);
  padding-bottom: 2px;
}
.era-readout .era-link:hover { border-bottom-color: var(--m-accent); }

.slider-block { padding-bottom: 0.2rem; }
.slider-row { display: flex; align-items: center; gap: 0.7rem; }
.era-btn {
  font-family: var(--utility), "Segoe UI Symbol", "Apple Symbols", "Symbola", sans-serif; font-size: 0.9rem;
  background: none;
  border: 1px solid color-mix(in srgb, var(--m-panel-fg) 40%, transparent);
  color: var(--m-panel-fg); border-radius: 3px;
  width: 2rem; height: 2rem; cursor: pointer; flex: none;
  transition: border-color 0.15s, color 0.15s;
}
.era-btn:hover { border-color: var(--m-accent); color: var(--m-accent); }

input[type="range"].era-slider {
  flex: 1; appearance: none; -webkit-appearance: none;
  height: 2px;
  background: color-mix(in srgb, var(--m-panel-fg) 35%, transparent);
  border-radius: 2px; cursor: pointer;
  min-width: 0;
}
/* the thumb is gold: the one thing that crosses every era unchanged */
input[type="range"].era-slider::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--m-panel-bg);
  box-shadow: 0 0 0 1px var(--gold), 0 0 12px rgba(199,162,75,0.7);
}
input[type="range"].era-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--m-panel-bg);
  box-shadow: 0 0 0 1px var(--gold), 0 0 12px rgba(199,162,75,0.7);
}
.slider-ticks {
  display: flex; justify-content: space-between;
  margin-top: 0.5rem; padding: 0 2.7rem;
  font-family: var(--utility); font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: color-mix(in srgb, var(--m-panel-fg) 55%, transparent);
}
/* the panel is too narrow for ten tick labels — keep the endpoints */
.slider-ticks span { display: none; }
.slider-ticks span:first-child, .slider-ticks span:last-child { display: inline; }
.slider-hint {
  margin-top: 0.6rem; padding: 0 2.7rem;
  font-family: var(--utility); font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--m-panel-fg) 55%, transparent);
}
@media (max-width: 760px) {
  .slider-ticks, .slider-hint { display: none; }
}

/* ----- zoom controls ----- */
.map-zoom {
  position: absolute; z-index: 6;
  right: clamp(1rem, 3vw, 2.5rem);
  bottom: 3.2rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.map-zoom button {
  width: 2.1rem; height: 2.1rem;
  font-family: var(--utility); font-size: 1rem; line-height: 1;
  background: var(--m-panel-bg); color: var(--m-panel-fg);
  border: 1px solid color-mix(in srgb, var(--m-ink) 40%, transparent);
  border-radius: 3px; cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 0.15s, color 0.15s;
}
.map-zoom button:hover { border-color: var(--m-accent); color: var(--m-accent); }
@media (max-width: 760px) {
  .map-zoom { bottom: auto; top: 5.5rem; right: 0.75rem; }
  #stone-toggle { font-size: 0.7rem !important; padding: 0 0.5rem !important; letter-spacing: 0; }
}

.hero.zoomed #symmap { cursor: grab; }
.hero.zoomed #symmap:active { cursor: grabbing; }

/* second-tier lights: smaller, quieter, no halo */
.dot:not(.on) { pointer-events: none; }
.dot.minor.on { opacity: 0.92; }
.place-label.minor.on { opacity: 0.8; }

/* the opening frame names the ground: shown in era 0 only */
.region-label {
  font-family: var(--utility); font-weight: 600;
  letter-spacing: 0.3em; text-transform: uppercase;
  fill: var(--m-accent);
  opacity: 0;
  transition: opacity 1.1s ease;
  pointer-events: none;
}
.region-label.on { opacity: 0.82; }

/* the home light: same gold, burning brightest (final era) */
.dot-halo.home.on {
  opacity: 0.85;
  stroke-width: 1.3px;
  animation: home-pulse 2.6s ease-in-out infinite;
}
@keyframes home-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.45); opacity: 0.55; }
}

/* stone evidence marks: basalt diamonds, distinct from gold dots */
.stone-mark {
  fill: #221E1B;
  stroke: #CBB995;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity 0.8s ease;
  cursor: pointer;
}
.stone-mark.on { opacity: 0.95; }
.stone-mark:not(.on) { pointer-events: none; }

/* stone toggle: on-state uses basalt ground with Jerusalem-stone glyph */
#stone-toggle {
  width: auto !important;
  padding: 0 0.75rem !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.05em;
  font-weight: 600;
}
#stone-toggle.stone-on {
  background: #221E1B;
  color: #CBB995;
  border-color: #CBB995;
}
#stone-toggle:not(.stone-on) {
  color: color-mix(in srgb, var(--m-panel-fg) 60%, transparent);
}

.scroll-cue {
  position: absolute; z-index: 5;
  right: clamp(1rem, 3vw, 2.5rem); bottom: 1rem;
  font-family: var(--utility); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: color-mix(in srgb, var(--m-hero-fg) 70%, transparent);
}
.scroll-cue .chev { display: inline-block; animation: cue-bob 2.4s ease-in-out infinite; }
@keyframes cue-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (max-width: 900px) { .scroll-cue { display: none; } }

/* ----- tooltip ----- */
.map-tooltip {
  position: absolute; pointer-events: none; z-index: 7;
  max-width: 250px;
  background: var(--m-panel-bg); color: var(--m-panel-fg);
  border: 1px solid color-mix(in srgb, var(--m-ink) 55%, transparent);
  padding: 0.5rem 0.7rem;
  font-family: var(--utility); font-size: 0.74rem; line-height: 1.45;
  border-radius: 3px;
  backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.map-tooltip.show { opacity: 1; transform: translateY(0); }
.map-tooltip strong {
  display: block; color: var(--m-accent);
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 0.15rem;
}

/* ----- map svg internals ----- */
.ocean { fill: var(--m-ocean); opacity: var(--m-ocean-a); }
.ghost-land {
  fill: none;
  stroke: var(--m-ghost);
  stroke-width: 0.8px;
  stroke-dasharray: 1.5 2.5;
}
.land  { fill: var(--m-land); stroke: none; opacity: var(--m-land-a); }
.coast-flood { flood-color: var(--m-coast); }
.graticule { stroke: var(--m-grat); stroke-width: 0.7px; fill: none; }
.empire {
  fill: rgba(158, 59, 46, 0.19);
  stroke: rgba(170, 90, 60, 0.5);
  stroke-width: 1px;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.empire.on { opacity: 1; }
.empire-label {
  font-family: var(--utility); font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  fill: var(--m-emp-label); opacity: 0;
  transition: opacity 1.1s ease;
}
.empire-label.on { opacity: 0.9; }
.dot {
  fill: var(--gold);
  stroke: var(--m-dotring);
  stroke-width: 1px;
  opacity: 0;
  transition: opacity 0.8s ease;
  cursor: pointer;
}
.dot.on { opacity: 1; }
.dot-halo {
  fill: none; stroke: var(--gold); stroke-width: 0.8px;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  transform-box: fill-box; transform-origin: center;
}
.dot-halo.on { opacity: 0.4; animation: halo-pulse 3.4s ease-in-out infinite; }
@keyframes halo-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.28); }
}
.place-label {
  fill: var(--m-ink);
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--m-land); stroke-width: 0.18em; stroke-linejoin: round;
}
.place-label.on { opacity: 0.92; }
.hero[data-epoch="antique"] .place-label { font-family: var(--body); font-style: italic; }
.hero[data-epoch="print"] .place-label,
.hero[data-epoch="night"] .place-label {
  font-family: var(--utility); font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.hero[data-epoch="night"] .place-label { stroke: none; }

.sea-label {
  fill: var(--m-ink);
  opacity: var(--m-sea-o);
  font-family: var(--body);
  font-style: italic;
}
.dress       { pointer-events: none; }
.rhumb       { stroke: var(--m-rhumb); stroke-width: 0.5px; }
.rose        { stroke: var(--m-rhumb); stroke-width: 1px; }
.rose-needle { fill: var(--m-rhumb); }

.furniture       { pointer-events: none; }
.furniture image { mix-blend-mode: multiply; }
.kiepert-dull  { pointer-events: none; filter: grayscale(0.8) brightness(1.1) contrast(0.92); }
.kiepert-vivid { pointer-events: none; filter: saturate(1.35) contrast(1.05); }

.israel { pointer-events: none; }
.israel-frame     { fill: none; stroke: #4A3015; stroke-width: 0.28px; }  /* opacity driven per-era from map.js */
.israel .relief   { opacity: var(--m-rel-o); }
.israel .hachures { stroke: #5E4226; opacity: calc(var(--m-rel-o) * 0.7); }
.israel .rift-water { fill: #3D4F5C; opacity: var(--m-rel-o); }
.israel .rift-river { stroke: #3D4F5C; opacity: var(--m-rel-o); }
.israel-halo {
  animation: flame-breath 7s ease-in-out infinite;
  transform-origin: 597.3px 162.5px;
  transform-box: view-box;
}
@keyframes flame-breath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}
@media (prefers-reduced-motion: reduce) {
  .israel-halo { animation: none; }
}

/* ---------- manifesto strip ---------- */
.manifesto {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.25rem, 4vw, 3rem);
  text-align: center;
  overflow: hidden;
}
.manifesto .heb-bg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 900;
  font-size: clamp(10rem, 30vw, 22rem);
  color: rgba(199, 162, 75, 0.05);
  pointer-events: none; user-select: none;
}
.manifesto blockquote {
  position: relative;
  font-family: var(--display); font-weight: 300;
  font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  line-height: 1.25;
  max-width: 26ch; margin: 0 auto;
}
.manifesto blockquote strong { font-weight: 700; color: var(--gold-soft); }
.manifesto cite {
  position: relative; display: block; margin-top: 1.4rem;
  font-family: var(--utility); font-style: normal;
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: color-mix(in srgb, var(--vellum) 78%, transparent);
}

/* ---------- registers explainer ---------- */
.registers {
  max-width: 1200px; margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem) clamp(3rem, 7vw, 5rem);
}
.registers-head { max-width: var(--measure); margin-bottom: 2rem; }
.registers-head h2 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.1;
  margin-top: 0.5rem;
}
.registers-head p {
  margin-top: 0.8rem;
  color: color-mix(in srgb, var(--vellum) 92%, transparent);
}
.register-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}
@media (max-width: 760px) { .register-cards { grid-template-columns: 1fr; } }
.register-card { padding: 2rem; border-radius: 4px; }
.register-card h3 {
  font-family: var(--display); font-weight: 900;
  font-size: 1.5rem; margin-top: 0.6rem;
}
.register-card p { margin-top: 0.7rem; font-size: 0.98rem; }
.register-card.story {
  background: var(--vellum); color: var(--ink);
}
.register-card.story .eyebrow { color: var(--pomegranate); }
.register-card.story p em { font-family: var(--body); }
.register-card.stone {
  background: var(--basalt); color: var(--stone);
  border: 1px solid rgba(203,185,149,0.25);
}
.register-card.stone .eyebrow { color: var(--gold); }
.register-card.stone h3 {
  font-weight: 400; letter-spacing: 0.18em; text-transform: uppercase;
  font-size: 1.2rem;
}

/* ---------- stories grid ---------- */
.stories {
  max-width: 1200px; margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem) clamp(3.5rem, 8vw, 6rem);
}
.stories-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.stories-head h2 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
}
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.25rem;
}
.story-card {
  position: relative;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 340px;
  padding: 1.6rem;
  border-radius: 4px;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.25s ease;
}
.story-card:hover { transform: translateY(-4px); }
.story-card .glyph {
  position: absolute; top: 0.6rem; right: 1rem;
  font-family: var(--display); font-weight: 900;
  font-size: 7rem; line-height: 1; opacity: 0.12;
  user-select: none;
}
.story-card .eyebrow { margin-bottom: 0.6rem; }
.story-card h3 {
  font-family: var(--display); font-weight: 700;
  font-size: 1.45rem; line-height: 1.15;
}
.story-card p { margin-top: 0.55rem; font-size: 0.94rem; opacity: 0.96; }
.story-card .cta {
  margin-top: 0.9rem;
  font-family: var(--utility); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.story-card.featured { grid-column: span 2; min-height: 380px; }
@media (max-width: 640px) { .story-card.featured { grid-column: span 1; } }

.card-vellum { background: var(--vellum); color: var(--ink); }
.card-vellum .eyebrow { color: var(--pomegranate); }
.card-vellum .cta { color: var(--pomegranate); }
.card-basalt {
  background: var(--basalt); color: var(--stone);
  border: 1px solid rgba(203,185,149,0.22);
}
.card-basalt .eyebrow, .card-basalt .cta { color: var(--gold); }
.card-night {
  background: var(--night-2); color: var(--vellum);
  border: 1px solid rgba(92,127,196,0.3);
}
.card-night .eyebrow, .card-night .cta { color: var(--techelet); }
.card-pom { background: var(--pomegranate); color: var(--vellum); }
.card-pom .eyebrow, .card-pom .cta { color: var(--gold-soft); }
.story-card .soon {
  position: absolute; top: 1.1rem; left: 1.6rem;
  font-family: var(--utility); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  border: 1px solid currentColor; border-radius: 2px;
  padding: 0.2rem 0.45rem; opacity: 0.7;
}

/* ---------- contribute band ---------- */
.contribute {
  background: var(--vellum); color: var(--ink);
}
.contribute-inner {
  max-width: 1200px; margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 4vw, 3rem);
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 2.5rem; align-items: center;
}
@media (max-width: 760px) { .contribute-inner { grid-template-columns: 1fr; } }
.contribute h2 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.08;
  margin-top: 0.5rem;
}
.contribute .eyebrow { color: var(--pomegranate); }
.contribute p { margin-top: 0.9rem; max-width: 54ch; }
.btn {
  display: inline-block;
  font-family: var(--utility); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 1.5rem;
  border-radius: 3px;
}
.btn-dark { background: var(--night); color: var(--vellum); }
.btn-dark:hover { background: var(--night-2); }
.contribute .rules {
  font-family: var(--utility); font-size: 0.88rem; line-height: 1.7;
  border-left: 2px solid var(--gold);
  padding-left: 1.2rem;
  color: color-mix(in srgb, var(--ink) 94%, transparent);
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid rgba(199,162,75,0.22);
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between; align-items: baseline;
}
footer .fine {
  font-family: var(--utility); font-size: 0.74rem;
  color: color-mix(in srgb, var(--vellum) 72%, transparent);
  max-width: 60ch;
}
.article-page footer .fine {
  color: rgba(42,36,25,0.6);
}

/* ============================================================
   ARTICLE — story register (vellum), with daf margin notes
   ============================================================ */
.article-page { background: var(--vellum); color: var(--ink); }
.article-page .topbar {
  background: color-mix(in srgb, var(--vellum) 90%, transparent);
  border-bottom-color: rgba(42,36,25,0.15);
}
.article-page .topbar .wordmark, .article-page .topnav a { color: var(--ink); }
.article-page .wordmark .amp, .article-page .wordmark .heb { color: var(--pomegranate); }

.article-hero {
  position: relative;
  max-width: 1100px; margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.25rem, 4vw, 3rem) clamp(2rem, 4vw, 3rem);
  overflow: hidden;
}
.article-hero .heb-bg {
  position: absolute; top: -0.18em; right: -0.05em;
  font-family: var(--display); font-weight: 900;
  font-size: clamp(8rem, 24vw, 17rem); line-height: 1;
  color: rgba(158, 59, 46, 0.07);
  pointer-events: none; user-select: none;
}
.article-hero .eyebrow { color: var(--pomegranate); }
.article-hero h1 {
  position: relative;
  font-family: var(--display); font-weight: 900;
  font-size: clamp(2.3rem, 6vw, 4.2rem);
  line-height: 1.04; letter-spacing: -0.01em;
  max-width: 17ch; margin-top: 0.8rem;
}
.article-hero .standfirst {
  position: relative;
  margin-top: 1.2rem; max-width: 52ch;
  font-size: clamp(1.08rem, 1.9vw, 1.3rem);
  font-weight: 500;
  color: color-mix(in srgb, var(--ink) 94%, transparent);
}
.article-hero .meta {
  margin-top: 1.4rem;
  font-family: var(--utility); font-size: 0.76rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 75%, transparent);
}
.article-hero .meta .sep { color: var(--gold); margin: 0 0.5em; }

/* daf grid: prose centre, commentary margin */
.daf {
  max-width: 1100px; margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) minmax(180px, 240px);
  column-gap: clamp(2rem, 5vw, 4rem);
}
@media (max-width: 860px) { .daf { grid-template-columns: 1fr; } }

.daf .prose { grid-column: 1; }
.prose p {
  margin-top: 1.2rem;
  font-size: 1.08rem;
}
.prose p:first-of-type { margin-top: 0; }
.prose p.opener::first-letter {
  font-family: var(--display); font-weight: 900;
  font-size: 3.4em; float: left;
  line-height: 0.82; padding-right: 0.12em;
  color: var(--pomegranate);
}
.prose h2 {
  font-family: var(--display); font-weight: 700;
  font-size: 1.65rem; line-height: 1.15;
  margin-top: 2.6rem;
  margin-bottom: 1rem;
}
.prose h2::before {
  content: "";
  display: block; width: 3rem; height: 3px;
  background: var(--gold);
  margin-bottom: 0.9rem;
}

/* margin notes — the commentary, daf-style */
.note {
  grid-column: 2;
  align-self: start;
  font-family: var(--utility);
  font-size: 0.8rem; line-height: 1.55;
  color: color-mix(in srgb, var(--ink) 88%, transparent);
  border-top: 2px solid var(--gold);
  padding-top: 0.6rem;
  margin-top: 1.4rem;
}
.note strong {
  display: block;
  font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--pomegranate); margin-bottom: 0.3rem;
}
@media (max-width: 860px) {
  .note {
    grid-column: 1;
    border: 1px solid rgba(158,59,46,0.3); border-top: 2px solid var(--gold);
    background: var(--vellum-2);
    padding: 0.9rem 1rem; border-radius: 3px;
    max-width: 32rem;
  }
}

/* stone blocks — the record, set in basalt */
.stone-block {
  grid-column: 1 / -1;
  background: var(--basalt); color: var(--stone);
  border-radius: 4px;
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  margin-top: 2.6rem;
  display: grid;
  grid-template-columns: minmax(90px, 130px) 1fr;
  gap: 1.5rem;
}
@media (max-width: 640px) { .stone-block { grid-template-columns: 1fr; } }
.stone-block .date {
  font-family: var(--display); font-weight: 900;
  font-size: 1.7rem; line-height: 1.1;
  color: var(--gold);
}
.stone-block .date small {
  display: block;
  font-family: var(--utility); font-weight: 600;
  font-size: 0.62rem; letter-spacing: 0.2em;
  color: color-mix(in srgb, var(--stone) 65%, transparent);
  margin-top: 0.4rem;
}
.stone-block h3 {
  font-family: var(--display); font-weight: 400;
  font-size: 1.05rem; letter-spacing: 0.2em; text-transform: uppercase;
}
.stone-block h3::after {
  content: ""; display: block;
  width: 2.4rem; height: 1px; background: var(--gold);
  margin-top: 0.55rem;
}
.stone-block p { margin-top: 0.8rem; font-size: 0.97rem; line-height: 1.65; }
.stone-block .tag {
  display: inline-block; margin-top: 1rem;
  font-family: var(--utility); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(199,162,75,0.4); border-radius: 2px;
  padding: 0.25rem 0.5rem;
}

/* pull quote */
.pull {
  grid-column: 1 / -1;
  margin: 3rem 0 0.5rem;
  text-align: center;
}
.pull blockquote {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(1.5rem, 3.4vw, 2.3rem); line-height: 1.25;
  max-width: 26ch; margin: 0 auto;
}
.pull blockquote strong { font-weight: 700; color: var(--pomegranate); }

/* mini timeline strip */
.strip {
  grid-column: 1 / -1;
  margin-top: 2.6rem;
  border-top: 1px solid rgba(42,36,25,0.2);
  border-bottom: 1px solid rgba(42,36,25,0.2);
  padding: 1.4rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.2rem;
}
.strip .step { position: relative; padding-left: 1rem; }
.strip .step::before {
  content: ""; position: absolute; left: 0; top: 0.35em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
}
.strip .step .when {
  font-family: var(--utility); font-weight: 600;
  font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--pomegranate);
}
.strip .step .what { font-size: 0.9rem; margin-top: 0.25rem; line-height: 1.5; }

/* end matter */
.endmatter {
  grid-column: 1 / -1;
  margin-top: 3rem;
  border-top: 3px double rgba(42,36,25,0.35);
  padding-top: 1.4rem;
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  justify-content: space-between; align-items: baseline;
}
.endmatter .sig {
  font-family: var(--display); font-weight: 700; font-size: 1.05rem;
}
.endmatter .sig span { color: var(--pomegranate); }
.endmatter a.next {
  font-family: var(--utility); font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--pomegranate); text-decoration: none;
  border-bottom: 1px solid rgba(158,59,46,0.4); padding-bottom: 2px;
}
.endmatter a.next:hover { border-bottom-color: var(--pomegranate); }

/* ============================================================
   ARTICLE V2 — daf note types, expandable notes, draft banner
   All rules here are additive. Existing .note rules above are
   unchanged; these only apply to modifier classes and new
   elements introduced in article-template.html (Phase A).
   ============================================================ */

/* -- draft banner --
   Rendered above .article-hero when body[data-status="draft"].
   Promote a piece to live by changing that one attribute.
   Hidden by default so the element can sit inert in the markup. */
.draft-banner {
  display: none;
  width: 100%;
  padding: 0.45rem clamp(1.25rem, 4vw, 3rem);
  background: var(--pomegranate);
  color: var(--vellum);
  font-family: var(--utility);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
}
body[data-status="draft"] .draft-banner {
  display: block;
}

/* -- typed note: stone (.note--stone) --
   The record: sourced, dated, checkable. Gold-rule top (inherited
   from .note) stays; accent on the label shifts to Jerusalem stone
   on basalt, to echo the stone-block register. */
.note--stone {
  border-top-color: var(--stone);
  background: var(--basalt);
  color: var(--stone);
  border-radius: 3px;
  padding: 0.75rem 0.85rem;
}
.note--stone strong {
  color: var(--gold);
  letter-spacing: 0.2em;
}
@media (max-width: 860px) {
  .note--stone {
    background: var(--basalt);
    color: var(--stone);
    border-color: rgba(203,185,149,0.35);
    border-top: 2px solid var(--stone);
  }
}

/* -- typed note: dispute (.note--dispute) --
   The scholarly argument. Techelet accent signals learned
   disagreement - not resolved, worth tracking. */
.note--dispute {
  border-top-color: var(--techelet);
}
.note--dispute strong {
  color: var(--techelet);
}

/* -- typed note: aside (.note--aside) --
   The wry remark, the joke that earns its keep. Pomegranate label
   is the warmest accent in the palette; use sparingly. */
.note--aside {
  border-top-color: var(--pomegranate);
}
.note--aside strong {
  color: var(--pomegranate);
}

/* -- expandable note depth --
   .note-more: the extended commentary, hidden by default.
   .note-toggle: the control that reveals it. Depth stays
   behind a click - the margin never shouts. */
.note-more {
  display: none;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(42,36,25,0.18);
}
.note--stone .note-more {
  border-top-color: rgba(203,185,149,0.25);
}
.note-more.is-open {
  display: block;
}
.note-toggle {
  display: inline-block;
  margin-top: 0.55rem;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--utility);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  cursor: pointer;
  text-decoration: none;
}
.note-toggle:hover {
  color: var(--pomegranate);
}
/* on mobile the note is already a boxed aside; toggle sits flush */
@media (max-width: 860px) {
  .note-toggle { margin-top: 0.5rem; }
  .note-more { border-top-color: rgba(42,36,25,0.15); }
  .note--stone .note-more { border-top-color: rgba(203,185,149,0.2); }
}

/* ============================================================
   HOUSE STYLE page helpers
   ============================================================ */
.guide-section { margin-top: 3rem; }
.swatches {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem; margin-top: 1.4rem;
}
.swatch {
  border-radius: 4px; padding: 1rem;
  min-height: 110px;
  display: flex; flex-direction: column; justify-content: flex-end;
  font-family: var(--utility); font-size: 0.72rem;
  border: 1px solid rgba(42,36,25,0.15);
}
.swatch .hex { opacity: 0.7; }
.specimen {
  grid-column: 1 / -1;
  margin-top: 1.4rem;
  border: 1px solid rgba(42,36,25,0.2); border-radius: 4px;
  padding: 1.6rem;
}
.specimen + .specimen { margin-top: 0.9rem; }
.specimen .label {
  font-family: var(--utility); font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--pomegranate); margin-bottom: 0.6rem;
}
.rule-list { margin-top: 1rem; }
.rule-list li {
  list-style: none;
  padding: 0.85rem 0 0.85rem 2.2rem;
  position: relative;
  border-bottom: 1px solid rgba(42,36,25,0.12);
  font-size: 1rem;
}
.rule-list li::before {
  content: "✦";
  position: absolute; left: 0.3rem; top: 0.8rem;
  color: var(--gold);
}
.rule-list li strong { font-weight: 700; }
