/* ==========================================================================
   Antirrhetikos (Evagrius Ponticus) — Desert Codex × Cognitive Architecture
   Local WOFF2 typography (full Romanian coverage: ă â î ș ț – − · „ ” ’)
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/fraunces-normal-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/fraunces-normal-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/fraunces-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/fraunces-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(fonts/source-serif-4-normal-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(fonts/source-serif-4-normal-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url(fonts/source-serif-4-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2212;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url(fonts/source-serif-4-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF;
}
@font-face {
  font-family: "Plex Sans";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(fonts/IBMPlexSans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex Sans";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(fonts/IBMPlexSans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/IBMPlexMono-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/IBMPlexMono-400-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/IBMPlexMono-600-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/IBMPlexMono-600-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   Theme Tokens — Light: Kellia Papyrus & Limestone | Dark: Desert Vigil
   ========================================================================== */
:root,
[data-theme="light"] {
  --bg: #F4EFE4;
  --bg-elev: #EAE1CF;
  --bg-paper: #FAF6EE;
  --fg: #1E1814;
  --fg-2: #3D322A;
  --mut: #5E5044;
  --acc: #A8281C;
  --acc-soft: rgba(168, 40, 28, 0.10);
  --acc-ink: #FAF6EE;
  --ochre: #8A5A19;
  --ochre-soft: rgba(138, 90, 25, 0.12);
  --indigo: #2B4257;
  --indigo-soft: rgba(43, 66, 87, 0.12);
  --line: rgba(30, 24, 20, 0.16);
  --line-soft: rgba(30, 24, 20, 0.09);
  --line-rubric: rgba(168, 40, 28, 0.36);
  --to-top-bg: #F4EFE4;
  --to-top-fg: #1E1814;
  --grain-op: 0.025;

  /* 8-Logismoi Manuscript Pigment System */
  --p-gastrimargia: #B35A38;
  --p-porneia: #9E3342;
  --p-philargyria: #9A6B1A;
  --p-lype: #3B5875;
  --p-orge: #A8281C;
  --p-akedia: #4E613C;
  --p-kenodoxia: #6D456E;
  --p-hyperephania: #524339;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ui: "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, Menlo, monospace;

  --bar-h: 44px;
  --prose: 40rem;
  --stage: 64rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101218;
    --bg-elev: #171A23;
    --bg-paper: #1C202B;
    --fg: #ECE4D6;
    --fg-2: #C8BEB0;
    --mut: #9A9082;
    --acc: #E35D4B;
    --acc-soft: rgba(227, 93, 75, 0.15);
    --acc-ink: #101218;
    --ochre: #D9A452;
    --ochre-soft: rgba(217, 164, 82, 0.14);
    --indigo: #7BA3C9;
    --indigo-soft: rgba(123, 163, 201, 0.16);
    --line: rgba(236, 228, 214, 0.16);
    --line-soft: rgba(236, 228, 214, 0.09);
    --line-rubric: rgba(227, 93, 75, 0.42);
    --to-top-bg: #101218;
    --to-top-fg: #ECE4D6;
    --grain-op: 0.03;

    --p-gastrimargia: #DF8460;
    --p-porneia: #DC6A7A;
    --p-philargyria: #D9AA4E;
    --p-lype: #7DA1C4;
    --p-orge: #E35D4B;
    --p-akedia: #92A87A;
    --p-kenodoxia: #B184B3;
    --p-hyperephania: #B09E91;

    color-scheme: dark;
  }
}

[data-theme="dark"] {
  --bg: #101218;
  --bg-elev: #171A23;
  --bg-paper: #1C202B;
  --fg: #ECE4D6;
  --fg-2: #C8BEB0;
  --mut: #9A9082;
  --acc: #E35D4B;
  --acc-soft: rgba(227, 93, 75, 0.15);
  --acc-ink: #101218;
  --ochre: #D9A452;
  --ochre-soft: rgba(217, 164, 82, 0.14);
  --indigo: #7BA3C9;
  --indigo-soft: rgba(123, 163, 201, 0.16);
  --line: rgba(236, 228, 214, 0.16);
  --line-soft: rgba(236, 228, 214, 0.09);
  --line-rubric: rgba(227, 93, 75, 0.42);
  --to-top-bg: #101218;
  --to-top-fg: #ECE4D6;
  --grain-op: 0.03;

  --p-gastrimargia: #DF8460;
  --p-porneia: #DC6A7A;
  --p-philargyria: #D9AA4E;
  --p-lype: #7DA1C4;
  --p-orge: #E35D4B;
  --p-akedia: #92A87A;
  --p-kenodoxia: #B184B3;
  --p-hyperephania: #B09E91;

  color-scheme: dark;
}

/* ==========================================================================
   Base Reset & Manuscript Surface
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.68;
  min-height: 100vh;
  overflow-x: clip;
  position: relative;
}

/* Subtle procedural limestone / papyrus grain — local SVG, zero scroll cost */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain-op);
  background-image: url("grain.svg");
}

main, header, footer, nav { position: relative; z-index: 1; }

a {
  color: var(--acc);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--bg-paper);
  color: var(--fg);
  padding: 0.6rem 1rem;
  border: 1px solid var(--acc);
  font-family: var(--ui);
  font-size: 0.9rem;
  text-decoration: none;
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Sticky Topbar (44px + safe-area-inset-top) & Scroll Progress Hairline
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: calc(var(--bar-h) + var(--browser-safe-top, env(safe-area-inset-top)));
  padding: var(--browser-safe-top, env(safe-area-inset-top)) 1rem 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  font: 500 0.875rem/1 var(--ui);
}

.topbar-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--acc);
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

.home {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  flex: none;
  padding: 0.25rem 0;
}
.home:hover { color: var(--acc); }
.codex-glyph { flex: none; display: block; }

.topnav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-width: 0;
  margin-left: 0.5rem;
}
.topnav::-webkit-scrollbar { display: none; }

.topnav a {
  color: var(--mut);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.55rem 0.55rem;
  font-size: 0.84rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.topnav a:hover,
.topnav a:focus-visible { color: var(--fg); }
.topnav a[aria-current="true"] {
  color: var(--fg);
  border-bottom-color: var(--acc);
}

.spacer { flex: 1 1 auto; }

.chip {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  flex: none;
  padding: 0.34rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--acc); color: var(--acc); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.icon-btn:hover { border-color: var(--acc); color: var(--acc); }
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }

@media (pointer: coarse) {
  .icon-btn { width: 40px; height: 40px; }
}

/* ==========================================================================
   Reading Rail (Right Gutter, outside 64rem column, >= 1180px)
   ========================================================================== */
.rail { display: none; }
@media (min-width: 1180px) {
  .rail {
    --col: 64rem;
    --gut: 1.25rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50%;
    left: calc(50% + var(--col) / 2 + var(--gut));
    transform: translateY(-50%);
    z-index: 40;
    margin: 0;
    padding: 0.4rem 0;
    max-height: calc(100vh - 7rem);
  }
  .rail::before {
    content: "";
    position: absolute;
    left: calc(0.875rem - 0.5px);
    top: 1.1rem;
    bottom: 1.1rem;
    width: 1px;
    background: var(--line);
  }
  .rail-dot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    text-decoration: none;
    border-radius: 50%;
  }
  .rail-dot .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mut);
    box-shadow: 0 0 0 3px var(--bg);
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    flex: none;
  }
  .rail-dot:hover .dot,
  .rail-dot:focus-visible .dot {
    background: var(--acc);
    transform: scale(1.25);
  }
  .rail-dot[aria-current="true"] .dot {
    background: var(--acc);
    transform: scale(1.45);
    box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px color-mix(in srgb, var(--acc) 38%, transparent);
  }
  .rail-dot:focus-visible { outline: 2px solid var(--acc); outline-offset: -1px; }
  .rail-label {
    position: absolute;
    right: calc(100% + 0.35rem);
    top: 50%;
    transform: translate(6px, -50%);
    padding: 0.24rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 0.4rem;
    background: var(--bg-paper);
    color: var(--fg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
    font-family: var(--ui);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
  }
  .rail-dot:hover .rail-label,
  .rail-dot:focus-visible .rail-label {
    opacity: 1;
    transform: translate(0, -50%);
  }
}
@media (min-width: 1420px) {
  .rail-label {
    right: auto;
    left: calc(100% + 0.2rem);
    max-width: calc(50vw - var(--col) / 2 - var(--gut) - 3.25rem);
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.1rem 0.25rem;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--mut);
    transform: translate(-4px, -50%);
  }
  .rail-dot:hover .rail-label,
  .rail-dot:focus-visible .rail-label { color: var(--acc); }
}

/* ==========================================================================
   Layout Containers & Editorial Rhythm
   ========================================================================== */
.section {
  padding: 4.5rem 1.25rem;
  scroll-margin-top: calc(var(--bar-h) + var(--browser-safe-top, env(safe-area-inset-top)) + 16px);
}
.section + .section {
  border-top: 1px solid var(--line-soft);
}
.section-band {
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-band + .section { border-top: none; }

.prose {
  max-width: var(--prose);
  margin-inline: auto;
}
.stage {
  max-width: var(--stage);
  margin-inline: auto;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ochre);
  margin: 0 0 0.75rem;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  color: var(--fg);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: 2.75rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}
h2 {
  font-size: 1.85rem;
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin-bottom: 0.85rem;
}
h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.deck {
  font-size: 1.2rem;
  line-height: 1.58;
  color: var(--fg-2);
  margin: 0 0 1.75rem;
}

.prose p { margin: 0 0 1.25rem; color: var(--fg-2); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--fg); font-weight: 600; }

.section-head {
  max-width: var(--prose);
  margin: 0 auto 2.25rem;
}
.section-head p {
  margin: 0;
  color: var(--fg-2);
}

.mono {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Section 1: Hero & Above-the-Fold Live Folio Interceptor
   ========================================================================== */
.hero {
  padding-top: 2.75rem;
  padding-bottom: 3.5rem;
}
.hero-head {
  max-width: 52rem;
  margin: 0 auto 2rem;
  text-align: left;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--mut);
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}
.hero-stats strong { color: var(--fg); font-weight: 600; }

.interceptor {
  max-width: var(--stage);
  margin: 0 auto;
}
.interceptor-prompt {
  font-family: var(--ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mut);
  margin: 0 0 0.65rem;
  letter-spacing: 0.01em;
}
.trigger-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}
.trigger-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  font-family: var(--ui);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--fg-2);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.trigger-tab:hover { border-color: var(--acc); color: var(--fg); }
.trigger-tab[aria-pressed="true"] {
  background: var(--bg-paper);
  border-color: var(--acc);
  color: var(--fg);
  box-shadow: inset 0 -2px 0 var(--acc);
}
.pigment-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}

/* Illuminated Active Folio — double-ruled rubric border */
.folio {
  background: var(--bg-paper);
  border: 1px solid var(--line-rubric);
  outline: 1px solid var(--line-rubric);
  outline-offset: -4px;
  padding: 1.75rem 2rem;
}
.folio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
.folio-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--mut);
  margin-bottom: 0.7rem;
  font-variant-numeric: tabular-nums;
}
.folio-ref {
  font-weight: 600;
  color: var(--fg);
  padding: 0.12rem 0.4rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.folio-trigger {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.58;
  color: var(--fg);
  margin: 0 0 0.7rem;
}
.folio-modern {
  font-family: var(--ui);
  font-size: 0.85rem;
  line-height: 1.48;
  color: var(--mut);
  margin: 0;
}

.folio-strike {
  border-left: 3px solid var(--acc);
  padding-left: 1.35rem;
}
.rubric-label {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--acc);
  margin: 0 0 0.55rem;
}
.folio-quote {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.24rem;
  line-height: 1.42;
  color: var(--acc);
  margin: 0 0 0.6rem;
}
.folio-cite {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 0.65rem;
}
.folio-note {
  font-family: var(--serif);
  font-size: 0.96rem;
  line-height: 1.52;
  color: var(--fg-2);
  margin: 0;
}
.folio-foot {
  margin-top: 1.35rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.folio-jump {
  font-family: var(--ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--acc);
  background: transparent;
  border: 1px solid var(--line-rubric);
  padding: 0.45rem 0.85rem;
  min-height: 38px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}
.folio-jump:hover { background: var(--acc-soft); }
.folio-greek {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--mut);
}

/* ==========================================================================
   Compact Share Row (CORE.md standing rule)
   ========================================================================== */
.share-wrap {
  max-width: var(--stage);
  margin: 1.5rem auto 0;
}
.share {
  --sr-line: var(--line);
  --sr-ink: var(--fg-2);
  --sr-acc: var(--acc);
  --sr-ok: var(--mut);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.8rem;
}
.share-label {
  font-family: var(--ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--mut);
  margin: 0;
}
.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--sr-line);
  background: transparent;
  color: var(--sr-ink);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, color 0.15s;
}
.share-btn:hover,
.share-btn:focus-visible {
  border-color: var(--sr-acc);
  color: var(--sr-acc);
}
.share-btn svg { width: 17px; height: 17px; display: block; }
.share-status {
  font-family: var(--ui);
  font-size: 0.8rem;
  color: var(--sr-ok);
  min-height: 1.2em;
}
@media (pointer: coarse) {
  .share-btn { width: 44px; height: 44px; }
}

/* ==========================================================================
   Section 2: Dialogismos vs Antirrhesis Interactive Loop Simulator
   ========================================================================== */
.sim-stage {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
}
.sim-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 1rem;
}
.sim-seeds,
.sim-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  font-family: var(--ui);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--fg); }
.btn[aria-pressed="true"] {
  background: var(--bg-paper);
  border-color: var(--fg);
  box-shadow: inset 0 -2px 0 var(--fg);
}
.btn-debate {
  border-color: var(--indigo);
  color: var(--indigo);
  background: var(--indigo-soft);
}
.btn-debate:hover,
.btn-debate[aria-pressed="true"] {
  background: var(--indigo);
  color: var(--bg-paper);
}
.btn-strike {
  border-color: var(--acc);
  color: var(--acc);
  background: var(--acc-soft);
}
.btn-strike:hover,
.btn-strike[aria-pressed="true"] {
  background: var(--acc);
  color: var(--acc-ink);
}
.btn-reset {
  background: transparent;
  color: var(--mut);
  border-style: dashed;
}
.btn-reset:hover { color: var(--fg); border-color: var(--fg); }

.sim-canvas {
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  padding: 0.5rem;
}
.sim-svg {
  display: block;
  width: 100%;
  height: auto;
}
.sim-branch {
  transition: opacity 0.35s ease;
}
.sim-slash {
  transition: opacity 0.25s ease, stroke-dashoffset 0.35s ease;
}
.sim-status {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--mut);
}
.sim-status-text {
  font-family: var(--serif);
  font-size: 0.96rem;
  color: var(--fg-2);
}

/* Comparison table (3-stage model & cognitive science) */
.ledger-table-wrap {
  max-width: var(--stage);
  margin: 2.25rem auto 0;
  overflow-x: auto;
}
.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
}
.ledger-table th,
.ledger-table td {
  text-align: left;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.ledger-table thead th {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mut);
  border-bottom: 2px solid var(--line);
}
.ledger-table td:first-child { font-weight: 600; color: var(--fg); }

/* ==========================================================================
   Section 3: Architecture — Desert Codex Wheel + In-Place Readout + Arsenal
   ========================================================================== */
.wheel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 2.5rem;
  align-items: start;
}
.wheel-col {
  position: relative;
}
.wheel-svg {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin: 0 auto;
}
.wheel-sector {
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  outline: none;
}
.wheel-sector:focus-visible path.sector-arc {
  stroke-width: 10;
}
.wheel-sector .sector-fill {
  transition: fill-opacity 0.2s;
}
.wheel-sector:hover .sector-fill,
.wheel-sector.is-active .sector-fill {
  fill-opacity: 0.36;
}
.wheel-hint {
  text-align: center;
  font-family: var(--ui);
  font-size: 0.82rem;
  color: var(--mut);
  margin: 0.5rem 0 0;
}
.wheel-reset-row {
  display: flex;
  justify-content: center;
  margin-top: 0.65rem;
}

.readout {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ochre);
  padding: 1.5rem 1.65rem;
  min-height: 22rem;
}
.readout-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.readout-book {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mut);
}
.readout-count {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.readout h3 {
  font-size: 1.5rem;
  margin-bottom: 0.2rem;
}
.readout-greek {
  font-family: var(--serif);
  font-style: italic;
  color: var(--mut);
  font-size: 0.98rem;
  margin: 0 0 0.85rem;
}
.readout-desc {
  font-size: 0.98rem;
  line-height: 1.56;
  color: var(--fg-2);
  margin: 0 0 1rem;
}
.readout-sample {
  border-left: 2px solid var(--acc);
  padding: 0.65rem 0 0.65rem 1rem;
  margin: 0 0 1.15rem;
  background: var(--bg);
}
.readout-sample-ref {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--mut);
  margin: 0 0 0.3rem;
}
.readout-sample-trig {
  font-size: 0.92rem;
  line-height: 1.48;
  color: var(--fg);
  margin: 0 0 0.45rem;
}
.readout-sample-verse {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.38;
  color: var(--acc);
  margin: 0;
}
.readout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Biblical Arsenal Bars */
.arsenal {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.arsenal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.1rem;
}
.arsenal-head h3 { font-size: 1.25rem; }
.arsenal-head p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--mut);
}
.arsenal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 2.25rem;
}
.arsenal-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 3.2rem;
  align-items: center;
  gap: 0.75rem;
}
.arsenal-name {
  font-family: var(--ui);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arsenal-track {
  height: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  position: relative;
}
.arsenal-fill {
  height: 100%;
  background: var(--acc);
}
.arsenal-val {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mut);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Section 4: Diagnostic Field Manual (Search, Filter, Split Ledger)
   ========================================================================== */
.shared-banner {
  background: var(--acc-soft);
  border: 1px solid var(--line-rubric);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--ui);
  font-size: 0.9rem;
  color: var(--fg);
}

.manual-console {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
}
.manual-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.9rem;
}
.manual-search-wrap {
  flex: 1 1 16rem;
  position: relative;
}
.manual-search {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  font-family: var(--ui);
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.manual-search::placeholder { color: var(--mut); }
.manual-search:focus { border-color: var(--acc); outline: 2px solid var(--acc); outline-offset: -1px; }

.filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.35rem 0.7rem;
  font-family: var(--ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-2);
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.filter-btn:hover { border-color: var(--fg); color: var(--fg); }
.filter-btn[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.filter-btn[aria-pressed="true"] .pigment-dot {
  box-shadow: 0 0 0 1.5px var(--bg);
}

.manual-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.65rem 0;
  border-bottom: 2px solid var(--line);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--mut);
}

.manual-ledger {
  list-style: none;
  margin: 0;
  padding: 0;
}
.entry-row {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  margin-bottom: 0.75rem;
}
.entry-id {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--mut);
}
.entry-num {
  font-weight: 600;
  color: var(--fg);
  padding: 0.1rem 0.4rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.entry-tag {
  font-family: var(--ui);
  font-size: 0.78rem;
  color: var(--mut);
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--line-soft);
  background: var(--bg-paper);
}
.entry-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
.entry-trigger {
  font-size: 1.03rem;
  line-height: 1.58;
  color: var(--fg);
  margin: 0 0 0.5rem;
}
.entry-modern {
  font-family: var(--ui);
  font-size: 0.84rem;
  line-height: 1.48;
  color: var(--mut);
  margin: 0;
}
.entry-counter {
  border-left: 2px solid var(--acc);
  padding-left: 1.15rem;
}
.entry-verse {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.14rem;
  line-height: 1.42;
  color: var(--acc);
  margin: 0 0 0.4rem;
}
.entry-cite {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 0.45rem;
}
.entry-mech {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--fg-2);
  margin: 0;
}
.entry-share-btn {
  font-family: var(--ui);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--mut);
  background: transparent;
  border: 1px solid transparent;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  border-radius: 2px;
}
.entry-share-btn:hover { color: var(--acc); border-color: var(--line); }

.manual-empty {
  padding: 2.25rem 1rem;
  text-align: center;
  color: var(--mut);
  font-family: var(--ui);
  border-bottom: 1px solid var(--line);
}
.manual-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

/* ==========================================================================
   Section 5: 8 -> 7 Genealogy (Alluvial SVG Desktop + Lineage Bands Mobile)
   ========================================================================== */
.alluvial-stage {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.alluvial-svg {
  display: block;
  width: 100%;
  height: auto;
}
.alluvial-ribbon {
  fill: none;
  transition: opacity 0.2s;
}
.alluvial-node {
  cursor: pointer;
  transition: opacity 0.2s;
  outline: none;
}
.alluvial-stage.has-focus .alluvial-ribbon:not(.is-hi),
.alluvial-stage.has-focus .alluvial-node:not(.is-hi) {
  opacity: 0.16;
}
.alluvial-explain {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  font-size: 0.96rem;
  color: var(--fg-2);
}
.alluvial-explain strong { color: var(--fg); }

/* Mobile vertical 3-stage lineage (shown < 720px) */
.alluvial-mobile { display: none; }

/* ==========================================================================
   Section 6: Survival Timeline (6-stop Horizontal Desktop / Vertical Mobile)
   ========================================================================== */
.timeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.15rem;
  position: relative;
  padding-top: 1.5rem;
  margin-bottom: 2.5rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  top: 0.55rem;
  height: 1px;
  background: var(--ochre);
}
.t-stop {
  position: relative;
  padding-top: 0.45rem;
}
.t-stop::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1.2rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--ochre);
}
.t-stop.is-key::before {
  background: var(--acc);
  border-color: var(--acc);
}
.t-year {
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ochre);
  margin: 0 0 0.35rem;
  font-variant-numeric: tabular-nums;
}
.t-stop.is-key .t-year { color: var(--acc); }
.t-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.28;
  color: var(--fg);
  margin: 0 0 0.4rem;
}
.t-body {
  font-size: 0.88rem;
  line-height: 1.48;
  color: var(--fg-2);
  margin: 0;
}

.ro-note {
  max-width: var(--prose);
  margin: 2rem auto 0;
  padding: 1.25rem 1.4rem;
  background: var(--bg-paper);
  border-left: 3px solid var(--ochre);
  border-top: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.ro-note h3 { font-size: 1.12rem; margin-bottom: 0.45rem; }
.ro-note p { font-size: 0.98rem; margin: 0; color: var(--fg-2); }

/* ==========================================================================
   Section 7: Sources, Limits & Canonical Footer
   ========================================================================== */
.limits-box {
  max-width: var(--prose);
  margin: 0 auto 2.25rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--ochre);
  background: var(--bg-paper);
}
.limits-box h3 {
  font-size: 1.15rem;
  color: var(--ochre);
  margin-bottom: 0.65rem;
}
.limits-box ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--fg-2);
  font-size: 0.98rem;
}
.limits-box li + li { margin-top: 0.5rem; }

.sources-list {
  max-width: var(--prose);
  margin: 0 auto;
  list-style: none;
  padding: 0;
}
.sources-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--fg-2);
}
.sources-list strong { color: var(--fg); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.25rem 3rem;
  font-family: var(--ui);
  font-size: 0.85rem;
  color: var(--mut);
}
.site-footer-inner {
  max-width: var(--stage);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.5rem;
}
.site-footer a { color: var(--fg-2); }
.site-footer a:hover { color: var(--acc); }

/* ==========================================================================
   Responsive Breakpoints (860px, 720px, 400px / 320px)
   ========================================================================== */
@media (max-width: 960px) {
  .timeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 2rem;
  }
  .timeline::before { display: none; }
  .t-stop::before { top: -0.6rem; }
}

@media (max-width: 860px) {
  .folio-grid,
  .wheel-layout,
  .entry-body,
  .arsenal-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
  .folio { padding: 1.25rem 1.15rem; }
  .folio-strike {
    border-left: none;
    border-top: 2px solid var(--acc);
    padding-left: 0;
    padding-top: 1rem;
  }
  .readout { min-height: auto; }
}

@media (max-width: 760px) {
  body { font-size: 1.05rem; line-height: 1.62; }
  h1 { font-size: 2.1rem; line-height: 1.12; }
  h2 { font-size: 1.48rem; line-height: 1.22; }
  .deck { font-size: 1.06rem; }
  .section { padding: 3rem 1rem; }
  .hero { padding-top: 1.75rem; }
  .topbar { padding-inline: 0.75rem; gap: 0.35rem; }
  .topnav { margin-left: 0.25rem; }
  .topnav a { padding: 0.55rem 0.42rem; font-size: 0.8rem; }
}

@media (max-width: 720px) {
  .topnav { display: none; }
  .alluvial-desktop { display: none; }
  .alluvial-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }
  .lineage-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--ochre);
    background: var(--bg);
    font-size: 0.92rem;
  }
  .lineage-chain {
    font-family: var(--ui);
    font-weight: 600;
    color: var(--fg);
  }
  .lineage-note {
    font-size: 0.86rem;
    color: var(--mut);
    margin: 0;
  }
  .timeline {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 0;
    padding-left: 1.35rem;
    border-left: 1px solid var(--ochre);
    gap: 1.4rem;
  }
  .t-stop { padding-top: 0; }
  .t-stop::before {
    left: -1.68rem;
    top: 0.22rem;
  }
}

@media (max-width: 400px) {
  h1 { font-size: 1.75rem; line-height: 1.15; }
  .arsenal-row { grid-template-columns: 6rem minmax(0, 1fr) 2.6rem; gap: 0.5rem; }
  .sim-stage, .alluvial-stage { padding: 1rem; }
}

/* ==========================================================================
   Reduced Motion & Print
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .topbar, .rail, .share-wrap, .sim-bar, .manual-console, .manual-more-wrap { display: none !important; }
  body { background: #fff; color: #000; }
}
