/* ═══════════════════════════════════════════════════════
   BASARABI-MURFATLAR — Chalk, incision, fading ink
   ═══════════════════════════════════════════════════════ */

/* ── Fonts ──────────────────────────────────────────── */
@font-face {
  font-family: 'Cormorant';
  src: url('/basarabi-murfatlar/assets/fonts/Cormorant.woff2?v=09515caf46') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant';
  src: url('/basarabi-murfatlar/assets/fonts/Cormorant-Italic.woff2?v=163033751d') format('woff2');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

/* ── Tokens: light ──────────────────────────────────── */
:root {
  --paper:    #f2eee3;
  --surface:  #e6dfcd;
  --surface-2:#d9cfb6;
  --stone:    #c4b89e;

  --ink:      #211c14;
  --ink-2:    #453d30;
  --ink-3:    #6b6252;
  --ink-4:    #8d8471;

  --accent:   #7a4a16;
  --accent-bg:#f0e2c8;

  --read:     #1b5e3e;
  --read-bg:  #d8e8de;
  --unread:   #8b1a1a;
  --unread-bg:#f0d4d4;
  --part:     #4a3b8c;
  --part-bg:  #e4dff5;

  --chalk:    #faf7ef;
  --chalk-line:#b9ae94;

  --focus:    #2a6b8c;
  --border:   rgba(33,28,20,.14);

  --bar-h:    2.75rem;
  --measure:  38rem;
  --gap:      clamp(1.5rem, 3vw, 3rem);

  --font-display: 'Cormorant', 'Georgia', 'Times New Roman', serif;
  --font-body:    'Georgia', 'Times New Roman', serif;
  --font-mono:    'SFMono-Regular', 'Consolas', monospace;
}

/* ── Tokens: dark ───────────────────────────────────── */
[data-theme="dark"] {
  --paper:    #14110c;
  --surface:  #1f1a13;
  --surface-2:#2b2419;
  --stone:    #453c2c;

  --ink:      #ece4d2;
  --ink-2:    #cfc6b0;
  --ink-3:    #ada48d;
  --ink-4:    #8a8270;

  --accent:   #d9a45f;
  --accent-bg:#2b2011;

  --read:     #7cc8a0;
  --read-bg:  #162a20;
  --unread:   #e89090;
  --unread-bg:#2a1616;
  --part:     #b8a8e8;
  --part-bg:  #1e1a30;

  --chalk:    #221d15;
  --chalk-line:#6e6450;

  --focus:    #6aadcc;
  --border:   rgba(236,228,210,.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:    #14110c;
    --surface:  #1f1a13;
    --surface-2:#2b2419;
    --stone:    #453c2c;
    --ink:      #ece4d2;
    --ink-2:    #cfc6b0;
    --ink-3:    #ada48d;
    --ink-4:    #8a8270;
    --accent:   #d9a45f;
    --accent-bg:#2b2011;
    --read:     #7cc8a0;
    --read-bg:  #162a20;
    --unread:   #e89090;
    --unread-bg:#2a1616;
    --part:     #b8a8e8;
    --part-bg:  #1e1a30;
    --chalk:    #221d15;
    --chalk-line:#6e6450;
    --focus:    #6aadcc;
    --border:   rgba(236,228,210,.12);
  }
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1rem + .22vw, 1.17rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }

/* ── Focus ──────────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Layout ─────────────────────────────────────────── */
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }
.wide { max-width: 56rem; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }

/* ── Topbar ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: .5rem;
  height: var(--bar-h);
  padding: 0 clamp(.75rem, 2vw, 1.25rem);
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: .85rem;
  letter-spacing: .02em;
}
.topbar .home { color: var(--ink-3); text-decoration: none; white-space: nowrap; }
.topbar .home:hover { color: var(--ink); }
.topnav { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  color: var(--ink-3); text-decoration: none; white-space: nowrap;
  padding: .25rem .5rem; border-radius: 4px;
}
.topnav a:hover { color: var(--ink); background: var(--surface); }
.topnav a[aria-current="true"] { color: var(--ink); font-weight: 600; }
.spacer { flex: 1; }
.chip {
  color: var(--ink-3); text-decoration: none; white-space: nowrap;
  padding: .2rem .6rem; border-radius: 4px;
  font-size: .8rem;
}
.chip:hover { color: var(--ink); background: var(--surface); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  border: none; background: none; color: var(--ink-3);
  cursor: pointer; padding: 0;
}
.icon-btn:hover { color: var(--ink); background: var(--surface); }
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }

/* ── Sections ───────────────────────────────────────── */
section, header.hero { scroll-margin-top: calc(var(--bar-h) + 1rem); }
.block { padding: var(--gap) 0; }
.block + .block { border-top: 1px solid var(--border); }

/* ── Typography ─────────────────────────────────────── */
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 1.4rem + 3.5vw, 4.2rem);
  line-height: 1.06;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--ink);
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.2rem);
  line-height: 1.15;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 1rem;
}
h2 .anchor { color: inherit; text-decoration: none; }
h2 .anchor:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.kicker {
  font-family: var(--font-display);
  font-size: .95rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .5rem;
}
.deck {
  font-size: clamp(1.1rem, 1.02rem + .35vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-2);
  margin-top: 1rem;
}
.lede {
  font-size: 1.12em;
  line-height: 1.6;
  color: var(--ink-2);
  margin-bottom: 1.25rem;
}
.prose p + p { margin-top: 1rem; }
.byline {
  font-size: .92rem;
  color: var(--ink-3);
  margin-top: 1.25rem;
}

/* ── Hero ───────────────────────────────────────────── */
.hero { padding: clamp(2rem, 4vw, 4rem) 0 var(--gap); }
.hero-text { margin-bottom: 2rem; }

/* ── Figures ────────────────────────────────────────── */
figure.fig { margin: 2rem 0 0; }
figure.fig img {
  border-radius: 6px;
  border: 1px solid var(--border);
  width: 100%;
}
figcaption {
  font-size: .92rem;
  line-height: 1.55;
  color: var(--ink-3);
  margin-top: .6rem;
}
figcaption .cr { display: block; margin-top: .25rem; font-size: .85rem; color: var(--ink-4); }
figcaption .cr a { color: var(--ink-3); }

/* ── Facts ──────────────────────────────────────────── */
dl.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .4rem 1rem;
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .98rem;
}
dl.facts dt { color: var(--ink-3); white-space: nowrap; }
dl.facts dd { color: var(--ink-2); }

/* ── The wall (interaction) ─────────────────────────── */
.wall-stage {
  background: var(--chalk);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: clamp(1rem, 3vw, 1.75rem);
  margin: 1.5rem 0;
}
.wall-svg { width: 100%; height: auto; display: block; }
.wall-svg .zone { fill: none; stroke: var(--chalk-line); stroke-width: 1.5; opacity: .55; }
.wall-svg .zone-glyph { stroke: var(--ink-3); stroke-width: 2; fill: none; stroke-linecap: round; opacity: .7; }
.wall-svg g.z { cursor: default; }
.wall-svg g.z.active .zone { stroke: var(--accent); stroke-width: 3; opacity: 1; }
.wall-svg g.z.active .zone-glyph { stroke: var(--accent); opacity: 1; }
.wall-cap { font-size: .88rem; color: var(--ink-4); margin-top: .75rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 0; list-style: none; padding: 0; }
.chips button {
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .45rem 1rem;
  min-height: 2.75rem;
  cursor: pointer;
}
.chips button:hover { border-color: var(--ink-3); }
.chips button[aria-pressed="true"] {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--ink);
  font-weight: 700;
}
.chips .dot { display: inline-block; width: .6em; height: .6em; border-radius: 50%; margin-right: .45em; }

/* ── Script cards ───────────────────────────────────── */
ol.cards { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; }
.card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--stone);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  background: var(--paper);
}
.card h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 400; }
.card .count { font-size: .92rem; color: var(--ink-3); }
.card .verdict { display: flex; align-items: center; gap: .5em; font-size: .92rem; margin: .4rem 0 .5rem; }
.card .verdict .dot { width: .7em; height: .7em; border-radius: 50%; flex: none; }
.card p.why { font-size: .99rem; color: var(--ink-2); }
.card.v-read { border-left-color: var(--read); }
.card.v-read .verdict { color: var(--read); }
.card.v-read .verdict .dot, .chips .dot.d-read { background: var(--read); }
.card.v-unread { border-left-color: var(--unread); }
.card.v-unread .verdict { color: var(--unread); }
.card.v-unread .verdict .dot, .chips .dot.d-unread { background: var(--unread); }
.card.v-part { border-left-color: var(--part); }
.card.v-part .verdict { color: var(--part); }
.card.v-part .verdict .dot, .chips .dot.d-part { background: var(--part); }
.card.match { outline: 2px solid var(--accent); outline-offset: 2px; }
.tally { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink-2); margin-top: 1rem; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; list-style: none; padding: 0; margin-top: 1rem; font-size: .92rem; color: var(--ink-3); }
.legend .dot { display: inline-block; width: .65em; height: .65em; border-radius: 50%; margin-right: .4em; }
.legend .v-read .dot { background: var(--read); }
.legend .v-unread .dot { background: var(--unread); }
.legend .v-part .dot { background: var(--part); }

/* ── Sources ────────────────────────────────────────── */
.sources { list-style: none; padding: 0; margin-top: 1rem; display: grid; gap: .6rem; font-size: .98rem; }
.sources li { padding-left: 1.1rem; position: relative; color: var(--ink-2); }
.sources li::before { content: "—"; position: absolute; left: 0; color: var(--ink-4); }
.verify-bar {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--read);
  border-radius: 6px;
  background: var(--read-bg);
  font-size: .95rem;
  color: var(--ink-2);
}

/* ── Rail ───────────────────────────────────────────── */
.rail {
  position: fixed; right: 1rem; top: 50%; transform: translateY(-50%);
  display: none; flex-direction: column; gap: .35rem; z-index: 50;
}
@media (min-width: 80rem) {
  .rail { display: flex; }
}
.rail a {
  display: flex; align-items: center; gap: .5rem; justify-content: flex-end;
  color: var(--ink-4); text-decoration: none; font-size: .8rem;
  font-family: var(--font-display);
}
.rail a i { display: block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--stone); flex: none; }
.rail a[aria-current="true"] { color: var(--ink); }
.rail a[aria-current="true"] i { background: var(--accent); }

/* ── Footer ─────────────────────────────────────────── */
footer.site {
  border-top: 1px solid var(--border);
  padding: 2rem 0 3rem;
  font-size: .92rem;
  color: var(--ink-3);
}

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

/* ── Small screens ──────────────────────────────────── */
@media (max-width: 40rem) {
  dl.facts { grid-template-columns: 1fr; gap: .15rem; }
  dl.facts dt { margin-top: .5rem; }
  dl.facts dt:first-child { margin-top: 0; }
}

/* ═══════════════════════════════════════════════════════
   v2 — the scan, the blade, the scroll story
   ═══════════════════════════════════════════════════════ */
:root { --sky: #2b2620; --glass: rgba(20, 17, 12, 0.88); --glass-ink: #f3ecdc; --glass-ink-2: #d2c8b2; --glass-rule: rgba(243, 236, 220, 0.18); --glass-accent: #f0b877; --blade: #d8742a; }
[data-theme="dark"] { --sky: #14110c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sky: #14110c; } }

body { background: var(--sky); }
.topbar { position: fixed; inset: 0 0 auto 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.sr-only:focus { width: auto; height: auto; clip: auto; left: 16px; top: calc(var(--bar-h) + 8px); z-index: 150; padding: 8px 12px; background: var(--paper); color: var(--ink); border-radius: 6px; }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; display: block; pointer-events: none; background: var(--sky); }
html.scene-ready #scene { pointer-events: auto; cursor: grab; }
.exploring #scene { pointer-events: auto; cursor: grab; touch-action: none; }
.exploring #scene:active { cursor: grabbing; }
#scene-fallback { display: none; position: fixed; inset: 0; z-index: 0; background: var(--sky) url(/basarabi-murfatlar/assets/img/fallback.webp?v=d6e5935d8d) center / cover no-repeat; }
.no-webgl #scene, .no-webgl #labels, .no-webgl #taie { display: none; }
.no-webgl #scene-fallback { display: block; }
.scene-status { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; margin: 0; font: .85rem/1.2 var(--font-mono); color: var(--glass-ink-2); }
.scene-status:empty { display: none; }

.story { position: relative; z-index: 10; padding: 0 0 30vh; }
.step { position: relative; width: min(440px, calc(100vw - 32px)); margin: 0 0 90vh 5vw; padding: 20px 22px 22px; background: var(--glass); color: var(--glass-ink); border: 1px solid var(--glass-rule); border-radius: 12px; font-size: 1.02rem; line-height: 1.58; }
.step:first-child { margin-top: 60vh; }
.step p { margin: 0 0 .8em; }
.step p:last-child { margin-bottom: 0; }
.step h2 { font-family: var(--font-display); font-size: 1.65rem; line-height: 1.12; margin: 0 0 .5em; font-weight: 600; color: var(--glass-ink); }
.step .kicker { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--glass-accent); margin: 0 0 8px; }
.step a { color: var(--glass-accent); }
.step.right { margin-left: auto; margin-right: 5vw; }
.hero { width: min(640px, calc(100vw - 32px)); padding: 26px 26px 24px; }
.hero h1 { font-weight: 600; color: var(--glass-ink); font-size: clamp(2.3rem, 1.5rem + 3.4vw, 4rem); margin: 0 0 12px; }
.hero .deck { color: var(--glass-ink); margin-top: 0; }
.hero .cue { font-family: var(--font-mono); font-size: .82rem; color: var(--glass-accent); margin-top: 14px; }
.hero .byline { font-family: var(--font-mono); font-size: .78rem; color: var(--glass-ink-2); margin-top: 6px; }

#labels { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; font: 600 .8rem/1.2 var(--font-mono); padding: 3px 8px; border-radius: 5px; background: rgba(14, 12, 9, .86); color: #f6efdf; white-space: nowrap; opacity: 0; will-change: transform; box-shadow: inset 0 -2px 0 var(--blade); }
.lbl-n { box-shadow: none; font-weight: 400; background: rgba(14, 12, 9, .6); }
.lbl-photo::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .4rem; border-radius: 50%; background: var(--blade); border: 1px solid var(--glass-ink); box-shadow: 0 0 0 2px var(--glass-rule); vertical-align: .02rem; }
.step-photo { width: min(11rem, 100%); margin: 1rem 0 0; }
.step-photo img { display: block; width: 100%; height: auto; border: 1px solid var(--glass-rule); border-radius: 5px; }
.step-photo figcaption { margin-top: .4rem; color: var(--glass-ink-2); font-size: .78rem; line-height: 1.45; }
.step-photo figcaption .cr { color: var(--glass-ink-2); font-size: .75rem; }
.step-photo figcaption a { color: var(--glass-ink); }

/* the blade panel */
#taie { position: relative; z-index: 10; min-height: 170vh; pointer-events: none; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 80px; }
#taie .panel { pointer-events: auto; position: sticky; bottom: 24px; background: var(--glass); color: var(--glass-ink); border: 1px solid var(--glass-rule); border-radius: 12px; padding: 16px 18px; width: min(620px, 100%); visibility: hidden; opacity: 0; transition: opacity .35s, visibility 0s .35s; }
body.exploring #taie .panel { visibility: visible; opacity: 1; transition: opacity .35s; }
#taie h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; margin: 0 0 4px; color: var(--glass-ink); }
#taie p { margin: 0 0 10px; font-size: 1rem; }
.blade-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; }
.blade-end { font: .78rem var(--font-mono); color: var(--glass-ink-2); }
#blade { flex: 1; min-height: 44px; accent-color: var(--blade); cursor: pointer; }
.blade-read { font: 600 .9rem var(--font-mono); color: var(--glass-accent); min-height: 1.4em; }
.ex-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.ex-toggle { font: .8rem/1 var(--font-mono); color: var(--glass-ink); background: transparent; border: 1px solid var(--glass-rule); border-radius: 999px; padding: 10px 12px; min-height: 44px; cursor: pointer; }
.ex-toggle.on, .ex-toggle[aria-pressed="true"] { background: var(--glass-ink); color: #15120d; }
.ex-zoom { display: none; gap: 8px; }
.exploring .ex-zoom { display: flex; }
.ex-zoom button { font: 1.1rem/1 var(--font-mono); color: var(--glass-ink); background: transparent; border: 1px solid var(--glass-rule); border-radius: 999px; width: 44px; min-height: 44px; cursor: pointer; }
.exploring .story .step { visibility: hidden; }
.exploring .to-top { display: none; }

/* the article */
.paper { position: relative; z-index: 12; display: block; background: var(--paper); color: var(--ink); padding-top: 1rem; border-top: 1px solid var(--border); }
.table-wrap { overflow-x: auto; margin: 1.25rem 0; }
table.churches { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.churches caption { text-align: left; font-family: var(--font-display); font-size: 1.1rem; color: var(--ink-3); padding-bottom: .5rem; }
table.churches th, table.churches td { text-align: left; vertical-align: top; padding: .55rem .6rem; border-top: 1px solid var(--border); }
table.churches thead th { font-weight: 600; color: var(--ink-3); font-size: .85rem; border-top: 0; }
table.churches tbody th { font-family: var(--font-display); font-size: 1.2rem; color: var(--accent); }
figure.plans img { background: #14110c; }
footer.site { position: relative; z-index: 12; background: var(--surface); }
.to-top { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; min-width: 48px; height: 48px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--paper); color: var(--ink); font: 600 .85rem/1 var(--font-mono); cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.to-top[hidden] { display: none; }

/* quiet share controls at the foot of each edition */
.share-bottom { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.share-row { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.share-label { color: var(--ink-2); font: .85rem var(--font-mono); margin-right: .25rem; }
.share-row a, .share-row button { display: inline-grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: transparent; color: var(--ink-2); text-decoration: none; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.share-row a:hover, .share-row button:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.share-row a:focus-visible, .share-row button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.share-row [hidden], .share-status[hidden], .share-field[hidden] { display: none !important; }
.share-status { margin: .45rem 0 0; color: var(--ink-2); font-size: .88rem; }
.share-field { width: min(26rem, 100%); margin-top: .45rem; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: .9rem; }
@media (pointer: coarse) { .share-row a, .share-row button { width: 2.75rem; height: 2.75rem; } }
@media (max-width: 30rem) { .share-label { flex-basis: 100%; margin: 0 0 .15rem; } }

@media (max-width: 760px) {
  .step, .step.right { margin: 0 auto 92vh; width: calc(100vw - 32px); font-size: .98rem; padding: 16px 16px 18px; }
  .step:first-child { margin-top: 52vh; }
  .hero h1 { font-size: 2.2rem; }
  .step h2 { font-size: 1.45rem; }
  #taie .panel { padding: 14px; }
  .to-top { right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); }
  table.churches { font-size: .88rem; }
}
html { scroll-behavior: auto; }
html:not(.js) #scene-fallback { display: block; }
html:not(.js) #scene, html:not(.js) #taie, html:not(.js) #labels { display: none; }

/* ---------- reading rail (article part only; pairs with body.rail-on in app.js) ---------- */
.rail { display: none; }
@media (min-width: 88rem) {
  html:not(.js) .rail, body.rail-on .rail {
    display: flex; flex-direction: column; gap: .55rem;
    position: fixed; right: 1.1rem; top: 50%; transform: translateY(-50%); z-index: 30;
  }
  .rail a { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; min-height: 1.4rem; text-decoration: none; color: var(--ink-2); font-size: .78rem; }
  .rail a span { opacity: 0; transition: opacity .2s; background: var(--paper); padding: .1rem .35rem; border-radius: 4px; white-space: nowrap; }
  .rail a:hover span, .rail a:focus-visible span { opacity: 1; }
  .rail a i { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); transition: transform .2s, background .2s; }
  .rail a[aria-current="true"] i { background: var(--accent); transform: scale(1.45); }
}
@media print { .rail { display: none; } }

/* where we are: locator map and key */
.locator { display: block; width: 100%; height: auto; margin: 4px 0 12px; }
.locator .sea { fill: #1d2c33; }
.locator .land { fill: #3a342a; stroke: #6b604d; stroke-width: .5; }
.locator .land.ro { fill: #5a5040; }
.locator .river { fill: none; stroke: #6fa3bd; stroke-width: 1.4; }
.locator .frame, .locator .zoom { fill: none; stroke: var(--glass-ink-2); stroke-width: .8; }
.locator .leader { fill: none; stroke: var(--glass-ink-2); stroke-width: .5; stroke-dasharray: 2 2; }
.locator .town { fill: var(--glass-ink); }
.locator .site { fill: var(--blade); stroke: #fff; stroke-width: 1; }
.locator .site-ring { fill: none; stroke: var(--blade); stroke-width: 1.5; }
.locator .scale { stroke: var(--glass-ink); stroke-width: 1.5; }
.locator .lab { font: 9px var(--font-mono); fill: var(--glass-ink); }
.locator .big { font-size: 11px; letter-spacing: .12em; fill: var(--glass-ink-2); }
.locator .sea-lab { fill: #9cc3d6; font-style: italic; }
.locator .river-lab { fill: #9cc3d6; }
.locator .site-lab { font-weight: 700; fill: var(--glass-accent); }
.key { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font: .8rem var(--font-mono); color: var(--glass-ink-2); }
.key li { display: flex; align-items: center; gap: 8px; }
.k { width: 22px; height: 12px; flex: none; border-radius: 2px; }
.k-scan { background: linear-gradient(90deg, #8a7a5e, #c9b99a, #7c8a8e); }
.k-cut { background: #7e96ad; }
.k-line { height: 0; border-top: 2px solid var(--blade); border-radius: 0; }

/* you are here */
#minimap { position: fixed; left: 16px; bottom: 16px; z-index: 15; width: 150px; margin: 0; background: var(--glass); border: 1px solid var(--glass-rule); border-radius: 10px; padding: 6px; opacity: 0; transition: opacity .4s; pointer-events: none; }
.scene-ready #minimap { opacity: 1; }
body.paper-on #minimap, .exploring #minimap, .no-webgl #minimap { opacity: 0; }
.mm-box { position: relative; }
.mm-box img { width: 100%; height: auto; display: block; }
.mm-over { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mm-dot { fill: var(--glass-ink); }
.mm-t { font: 700 20px var(--font-mono); fill: var(--glass-ink); paint-order: stroke; stroke: rgba(10,9,7,.8); stroke-width: 4px; }
.mm-me { fill: var(--blade); stroke: #fff; stroke-width: 2.5; }
.mm-eye { fill: #fff; }
.mm-ray { stroke: var(--blade); stroke-width: 3; stroke-dasharray: 6 5; }
.mm-n, .mm-scale { fill: none; stroke: var(--glass-ink); stroke-width: 3; }
#minimap figcaption { font: .62rem/1.25 var(--font-mono); color: var(--glass-ink-2); margin-top: 4px; }
@media (max-width: 760px) {
  #minimap { left: auto; right: 8px; top: calc(var(--bar-h) + 8px); bottom: auto; width: 92px; padding: 4px; }
  #minimap figcaption { display: none; }
  .mm-t { font-size: 26px; }
}
/* feedback round: open on the headline, shorter gaps, counter, readable plan on phones */
.step { margin-bottom: 72vh; }
.step:first-child { margin-top: 14vh; }
.step .count { float: right; font: .72rem var(--font-mono); color: var(--glass-ink-2); margin: 0 0 0 10px; }
.hero .facts-line { font: 600 .85rem var(--font-mono); color: var(--glass-ink); border-left: 3px solid var(--blade); padding-left: 10px; margin-top: 12px; }
.mm-key { list-style: none; margin: 5px 0 0; padding: 0; display: grid; gap: 3px; font: .6rem var(--font-mono); color: var(--glass-ink-2); }
.mm-key li { display: flex; align-items: center; gap: 5px; }
.mm-key .k { width: 14px; height: 8px; }
@media (max-width: 760px) {
  .step, .step.right { margin-bottom: 78vh; }
  .step:first-child { margin-top: 44vh; }
  #minimap { width: 118px; }
  .mm-key { display: none; }
}
@media (min-width: 761px) { #minimap { left: auto; right: 16px; bottom: 76px; } }
@media (min-width: 761px) { body.card-right #minimap { right: auto; left: 16px; bottom: 16px; } }
.k-void { background: var(--sky); border: 1px solid var(--glass-rule); }
.steps-list { margin: 1rem 0 1rem 1.2rem; display: grid; gap: .5rem; }
