:root {
  --bg: #fafaf7;
  --bg-soft: #f3f2ec;
  --ink: #0a0a0a;
  --ink-2: #2a2a2a;
  --ink-3: #5e5e5e;
  --ink-4: #9a9a96;
  --rule: #c8c6bd;
  --rule-faint: #e4e2d8;
  --accent: #1a1f60;
  --accent-2: #b14a2c;
  --accent-soft: #e6e8f2;
  --accent-2-soft: #f3e6df;
  --code-bg: #ece9df;
  --measure: 44rem;
  --ring-opacity: 0.04;
  --grain-opacity: 0.055;
  --paper-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 12px 32px -16px rgba(40,30,20,0.08);
}
html[data-theme="dark"] {
  --bg: #0d0d0c;
  --bg-soft: #15151a;
  --ink: #f1efe8;
  --ink-2: #d1cfc7;
  --ink-3: #88857a;
  --ink-4: #4a4a44;
  --rule: #2a2a26;
  --rule-faint: #1c1c1a;
  --accent: #8a93d4;
  --accent-2: #d68363;
  --accent-soft: #1a1f3c;
  --accent-2-soft: #3a261d;
  --code-bg: #1c1c1a;
  --ring-opacity: 0.06;
  --grain-opacity: 0.035;
  --paper-shadow: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
  overflow-x: hidden;
  transition: background 0.35s, color 0.35s;
}

::selection { background: var(--accent); color: var(--bg); }

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--ink-4);
  padding-bottom: 0px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
a:hover { color: var(--accent); border-color: var(--accent); }

em { font-style: italic; }
strong { font-weight: 600; color: var(--ink); }

code, .mono, kbd, samp {
  font-family: 'JetBrains Mono', 'Courier Prime', 'Courier New', monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: -0.01em;
}
.mono-plain {
  font-family: 'JetBrains Mono', 'Courier Prime', 'Courier New', monospace;
  background: none;
  padding: 0;
  border-radius: 0;
}

.view { display: none; min-height: 100vh; flex-direction: column; }
html[data-view="home"] #view-home,
html[data-view="nb1"]  #view-nb1,
html[data-view="nb2"]  #view-nb2 { display: flex; animation: viewFade 0.45s ease both; }

@keyframes viewFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-view] .view { animation: none; }
}

/* Encrypted-content loading state (briefly visible while decrypting). */
.nb1-loading {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
}
.nb1-loading-inner { display: flex; align-items: center; gap: 10px; }
.nb1-loading-dots { display: inline-flex; gap: 3px; }
.nb1-loading-dots span {
  width: 4px; height: 4px; border-radius: 50%; background: var(--ink-4);
  animation: dotBlink 1.1s ease-in-out infinite;
}
.nb1-loading-dots span:nth-child(2) { animation-delay: 0.18s; }
.nb1-loading-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes dotBlink {
  0%, 80%, 100% { opacity: 0.2; }
  40%           { opacity: 1; }
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg);
  border-bottom: 1px solid var(--rule-faint);
  position: relative;
  z-index: 50;
}
.topbar.sticky {
  position: sticky; top: 0;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.topbar .mark { color: var(--ink); font-weight: 700; border-bottom: none; letter-spacing: 0.14em; }
.topbar .mark.is-link:hover { color: var(--accent); }
.topbar nav { display: flex; gap: 22px; }
.topbar nav a {
  color: var(--ink-3); border-bottom: none;
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 10.5px;
}
.topbar nav a:hover { color: var(--accent); }
.topbar .right { display: flex; align-items: center; gap: 16px; }
.topbar .meta { color: var(--ink-4); }

.theme-toggle {
  background: transparent; border: 1px solid var(--rule);
  color: var(--ink-3); font-family: inherit; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 10px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  border-radius: 0;
  transition: all 0.15s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }

.translate-wrap { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.translate-wrap label {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-4);
}
/* Reserve the dropdown's footprint so first paint doesn't shift when GT loads. */
.translate-wrap > div[id^="google_translate_element"] { min-width: 86px; min-height: 22px; }
.goog-te-combo {
  background: transparent; border: 1px solid var(--rule);
  color: var(--ink-3); font-family: inherit; font-size: 10px;
  padding: 4px 6px;
}
.goog-logo-link, .goog-te-gadget span { display: none !important; }
.goog-te-gadget { color: transparent !important; font-size: 0 !important; }
body { top: 0 !important; }

.reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

.home main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.home .content { max-width: 640px; width: 100%; }
.home .greeting {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.home h1 {
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-weight: 500; font-size: clamp(42px, 6vw, 68px);
  line-height: 1.04; letter-spacing: -0.012em;
  margin-bottom: 28px;
}
.home h1 .accent { color: var(--accent); font-style: italic; }
.home .prose p { font-size: 19px; line-height: 1.6; color: var(--ink-2); margin-bottom: 1em; }
.home .prose a { color: var(--ink); border-bottom: 1px solid var(--accent); }
.home .prose a:hover { color: var(--accent); }
.home .now {
  margin-top: 32px;
  display: grid; grid-template-columns: 100px 1fr; gap: 4px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.04em; color: var(--ink-3);
  padding-top: 22px; border-top: 1px solid var(--rule-faint);
}
.home .now .k { color: var(--ink-4); text-transform: uppercase; }
.home .now .v a { color: var(--ink-2); border-bottom: 1px dotted var(--ink-4); }
.home .now .v a:hover { color: var(--accent); border-color: var(--accent); }
.home footer {
  padding: 18px 28px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-4); border-top: 1px solid var(--rule-faint);
}
.home footer a { color: var(--ink-3); border-bottom: none; }
.home footer a:hover { color: var(--accent); }
.home footer .contacts { display: flex; gap: 18px; }

.masthead { padding: 44px 28px 32px; max-width: 980px; margin: 0 auto; width: 100%; }
.masthead .top-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 22px; padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-faint);
}
.masthead h1 {
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-weight: 500; font-size: clamp(38px, 5.4vw, 62px);
  line-height: 1.05; letter-spacing: -0.012em; margin-bottom: 16px;
}
.masthead h1 em { color: var(--accent); font-style: italic; }
.masthead .deck {
  font-family: 'EB Garamond', serif; font-style: italic;
  font-size: clamp(20px, 2.1vw, 25px);
  line-height: 1.4; color: var(--ink-2);
  max-width: 660px; margin-bottom: 18px;
}
.masthead .standfirst {
  font-size: 19px; line-height: 1.55; color: var(--ink-2);
  max-width: 680px; margin-bottom: 18px;
}
.masthead .byline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 18px;
}
.masthead .byline > div {
  padding: 8px 0; border-bottom: 1px solid var(--rule-faint);
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.masthead .byline > div:last-child { border-bottom: none; }
.masthead .byline .label { color: var(--ink-4); letter-spacing: 0.12em; min-width: 92px; display: inline-block; }
.masthead .byline strong {
  color: var(--ink); font-weight: 600;
  text-transform: none; letter-spacing: 0;
  font-family: 'EB Garamond', serif; font-size: 16px;
}

section { padding: 16px 28px 48px; max-width: 980px; margin: 0 auto; width: 100%; }
.section-mark {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 12px; border-bottom: 1px solid var(--rule-faint);
  margin-bottom: 26px;
  flex-wrap: wrap; gap: 8px; font-weight: 700;
}
.section-mark .num {
  color: var(--accent); margin-right: 6px;
  background: var(--accent-soft); padding: 2px 7px; border-radius: 2px;
}

.col { display: block; }
.col .main { min-width: 0; max-width: 720px; margin: 0 auto; }
.col .main .prose { max-width: 720px; }

.prose p { font-size: 19px; line-height: 1.65; margin-bottom: 1em; color: var(--ink-2); }
.prose p strong { color: var(--ink); font-weight: 600; }
.prose p em { color: var(--ink-2); font-style: italic; }

.prose .lede {
  font-size: 22px; line-height: 1.5;
  color: var(--ink); font-style: italic;
  margin-bottom: 1.1em;
}

.prose .sub, .prose h3.sub {
  font-family: 'EB Garamond', serif;
  font-weight: 600; font-style: italic;
  font-size: 24px; color: var(--ink);
  margin: 1.6em 0 0.5em; line-height: 1.3;
}
.prose .sub::before {
  content: "§"; color: var(--accent); margin-right: 8px;
  font-family: 'JetBrains Mono', monospace; font-style: normal;
  font-size: 17px;
}

.prose .minor, .prose h4.minor {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin: 1.8em 0 0.6em; font-weight: 700;
}

.prose .glossary {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; line-height: 1.6; color: var(--ink-3);
  margin-top: 1.5em; padding: 16px 18px;
  background: var(--bg-soft); border-left: 2px solid var(--accent);
}
.prose .glossary strong {
  color: var(--accent);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  display: block; margin-bottom: 8px;
}
.prose .glossary em { color: var(--ink-2); font-style: normal; font-weight: 600; font-family: 'EB Garamond', serif; font-size: 15px; }

.prose .pull { margin: 1.6em 0; padding: 0 0 0 20px; border-left: 2px solid var(--accent); }
.prose .pull blockquote {
  font-family: 'EB Garamond', serif;
  font-style: italic; font-size: 23px;
  line-height: 1.4; color: var(--ink);
}

.smallcaps { font-variant: small-caps; letter-spacing: 0.04em; font-weight: 600; }
.accent-text { color: var(--accent); }

.triad {
  display: grid; grid-template-columns: 36px 1fr 200px;
  gap: 18px; padding: 18px 0;
  border-bottom: 1px solid var(--rule-faint);
  align-items: baseline;
}
.triad .roman {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--accent); font-weight: 700;
  letter-spacing: 0.06em;
}
.triad .name {
  font-family: 'EB Garamond', serif; font-weight: 600;
  font-size: 19px; color: var(--ink);
}
.triad .desc {
  font-family: 'EB Garamond', serif;
  font-size: 17px; line-height: 1.5;
  color: var(--ink-2); margin-top: 3px;
}
.triad .organism {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3); line-height: 1.5;
}
.triad .organism strong { color: var(--ink-2); font-weight: 600; }
.triad:first-of-type { border-top: 1px solid var(--rule-faint); }
@media (max-width: 720px) {
  .triad { grid-template-columns: 24px 1fr; gap: 8px; }
  .triad .organism { grid-column: 2; padding-top: 6px; }
  .triad .name { grid-column: 2; }
  .triad .desc { grid-column: 2; }
}

.ledger details { border-bottom: 1px solid var(--rule-faint); padding: 4px 0; }
.ledger details:last-of-type { border-bottom: none; }
.ledger details summary {
  cursor: pointer; padding: 12px 0; list-style: none;
  display: grid; grid-template-columns: 40px 1fr 24px;
  gap: 12px; align-items: baseline; transition: color 0.15s;
}
.ledger details summary::-webkit-details-marker { display: none; }
.ledger details summary:hover { color: var(--accent); }
.ledger details summary:hover .summary-meta::before { color: var(--accent); }
.ledger details summary .summary-meta::before {
  content: "+"; color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px; line-height: 1;
  transition: transform 0.2s ease, color 0.15s;
  display: inline-block;
}
.ledger details[open] summary .summary-meta::before { content: "−"; color: var(--accent); }
.ledger details summary .roman {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
}
.ledger details summary .summary-title {
  font-family: 'EB Garamond', serif; font-style: italic;
  font-size: 20px; color: var(--ink); line-height: 1.3;
}
.ledger details summary .summary-meta { text-align: right; }
.ledger details .body { padding: 4px 0 18px 52px; }
.ledger details .body p {
  font-size: 18px; line-height: 1.65;
  color: var(--ink-2); margin-bottom: 0.9em;
}
.ledger details .body strong { color: var(--ink); font-weight: 600; }
.ledger details .body em { color: var(--ink-2); font-style: italic; }
@media (max-width: 720px) {
  .ledger details summary { grid-template-columns: 28px 1fr 18px; gap: 8px; }
  .ledger details .body { padding-left: 0; }
}

.nb-footer {
  padding: 32px 28px 22px;
  max-width: 980px; margin: 40px auto 0;
  border-top: 1px solid var(--rule);
}
.nb-footer .colophon {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 32px; margin-bottom: 24px;
}
.nb-footer .colophon .lead {
  font-family: 'EB Garamond', serif;
  font-size: 18px; line-height: 1.5;
  color: var(--ink-2); margin-bottom: 6px;
}
.nb-footer .colophon .lead em { color: var(--accent); font-style: italic; font-weight: 500; }
.nb-footer .colophon p {
  font-size: 14.5px; line-height: 1.55;
  color: var(--ink-3); margin-bottom: 8px;
}
.nb-footer .colophon h5 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink); margin-bottom: 8px; font-weight: 700;
}
.nb-footer .colophon ul { list-style: none; }
.nb-footer .colophon ul li {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; line-height: 1.7; color: var(--ink-3);
}
.nb-footer .colophon ul a { color: var(--ink-3); border-bottom: 1px dotted var(--ink-4); }
.nb-footer .colophon ul a:hover { color: var(--accent); border-color: var(--accent); }
.nb-footer .endplate {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 14px; border-top: 1px solid var(--rule-faint);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-4); flex-wrap: wrap; gap: 10px;
}
.nb-footer .endplate a { color: var(--ink-3); border-bottom: none; }
.nb-footer .endplate a:hover { color: var(--accent); }
@media (max-width: 720px) { .nb-footer .colophon { grid-template-columns: 1fr; } }

.nb2 .nb-footer {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--rule-faint); margin-top: 36px;
  padding: 18px 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-4);
}
.nb2 .nb-footer a { color: var(--ink-3); border-bottom: none; }
.nb2 .nb-footer a:hover { color: var(--accent); }
.nb2 .nb-footer .contacts { display: flex; gap: 18px; }

.section-head {
  margin-bottom: 18px; padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-faint);
}
.section-head .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--accent);
  letter-spacing: 0.08em; font-weight: 700;
  background: var(--accent-soft); padding: 2px 6px;
  border-radius: 2px; margin-right: 8px;
}
.section-head h2 {
  display: inline; font-family: 'EB Garamond', serif;
  font-weight: 500; font-size: 26px;
  letter-spacing: -0.005em;
}
.section-head .blurb {
  font-family: 'EB Garamond', serif; font-style: italic;
  font-size: 15px; color: var(--ink-3); margin-top: 4px;
}
.nb2 .picks { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.nb2 .pick {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px;
  padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule-faint);
  align-items: baseline;
}
.nb2 .pick:nth-child(odd) { padding-right: 24px; }
.nb2 .pick:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--rule-faint); }
.nb2 .pick .idx {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--accent); font-weight: 700;
}
.nb2 .pick .name {
  font-family: 'EB Garamond', serif; font-weight: 600;
  font-size: 16px; color: var(--ink); display: block; margin-bottom: 2px;
}
.nb2 .pick .qual {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; color: var(--ink-4);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-left: 6px; font-weight: 400;
}
.nb2 .pick .note {
  font-family: 'EB Garamond', serif;
  font-size: 14.5px; line-height: 1.5; color: var(--ink-2);
}
@media (max-width: 720px) {
  .nb2 .picks { grid-template-columns: 1fr; }
  .nb2 .pick:nth-child(even) { padding-left: 0; border-left: none; }
}

.nb2 .placeholder-note {
  font-family: 'EB Garamond', serif;
  font-size: 16px; line-height: 1.55;
  color: var(--ink-2); padding: 16px 18px;
  border-left: 2px solid var(--accent);
  background: var(--bg-soft);
}
.nb2 .placeholder-note em { color: var(--accent); font-style: italic; }

.pullquote { margin: 28px auto; padding: 0 28px; max-width: 760px; }
.pullquote p {
  font-family: 'EB Garamond', serif;
  font-style: italic; font-size: 22px;
  line-height: 1.4; color: var(--ink); text-align: center;
}
.pullquote .attr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--ink-4);
  letter-spacing: 0.1em; text-align: center; margin-top: 8px;
}

.ascii-rule {
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-4); font-size: 12px;
  text-align: center; margin: 14px 0 18px; user-select: none;
}

.chip {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 2px 7px; border-radius: 2px;
  font-weight: 700; vertical-align: middle;
}

.read-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 100%;
  transform: scaleX(0); transform-origin: left center;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  z-index: 100; pointer-events: none; will-change: transform;
  transition: none;
}

.grain {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: var(--grain-opacity); mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.15  0 0 0 0 0.13  0 0 0 0 0.10  0 0 0 0.7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
html[data-theme="dark"] .grain { mix-blend-mode: screen; }

.home-rings { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.home-rings svg {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(140vh, 140vw); height: min(140vh, 140vw);
  opacity: var(--ring-opacity);
  animation: rings-drift 80s linear infinite;
}
.home-rings circle { fill: none; stroke: var(--ink); stroke-width: 0.5; }
@keyframes rings-drift {
  0%   { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) { .home-rings svg { animation: none; } }
.home main { position: relative; z-index: 2; }
.home header.topbar { position: relative; z-index: 3; }
.home footer { position: relative; z-index: 3; }

.home-spot {
  position: absolute; pointer-events: none;
  top: 0; left: 0;
  width: 600px; height: 600px;
  transform: translate(-300px, -300px);
  background: radial-gradient(circle at center,
              rgba(26, 31, 96, 0.05) 0%,
              rgba(26, 31, 96, 0.02) 30%,
              transparent 60%);
  z-index: 1; opacity: 0;
  transition: opacity 0.4s ease; will-change: transform;
}
html[data-theme="dark"] .home-spot {
  background: radial-gradient(circle at center,
              rgba(138, 147, 212, 0.06) 0%,
              rgba(138, 147, 212, 0.02) 30%,
              transparent 60%);
}
.home.has-spot .home-spot { opacity: 1; }
@media (hover: none) { .home-spot { display: none; } }

.monogram {
  display: inline-flex; align-items: center; gap: 9px;
  border-bottom: none !important; line-height: 1;
}
.monogram-glyph {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-family: 'EB Garamond', serif;
  font-style: italic; font-weight: 600;
  font-size: 15px; letter-spacing: -0.02em;
  border-radius: 2px;
  transition: all 0.2s ease;
  position: relative;
}
.monogram-glyph::before {
  content: ''; position: absolute; inset: -3px;
  border: 1px solid var(--accent); border-radius: 3px;
  opacity: 0; transition: opacity 0.2s ease;
}
.monogram:hover .monogram-glyph { color: var(--accent); border-color: var(--accent); }
.monogram:hover .monogram-glyph::before { opacity: 0.5; }
.monogram-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.14em;
  font-weight: 700; color: var(--ink);
}
.monogram:hover .monogram-text { color: var(--accent); }

.scrubber {
  position: fixed; right: 18px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px;
  z-index: 40; opacity: 0;
  transition: opacity 0.3s ease;
}
.scrubber.visible { opacity: 1; }
.scrubber a {
  display: flex; align-items: center; gap: 10px;
  border: none; text-decoration: none;
  color: var(--ink-4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  transition: color 0.2s ease;
}
.scrubber a .dot-mark {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-4);
  transition: all 0.2s ease; flex-shrink: 0;
}
.scrubber a .label {
  opacity: 0; transform: translateX(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
.scrubber a:hover { color: var(--accent); }
.scrubber a:hover .dot-mark { background: var(--accent); transform: scale(1.4); }
.scrubber a:hover .label { opacity: 1; transform: translateX(0); }
.scrubber a.active .dot-mark {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.scrubber a.active { color: var(--accent); }
@media (max-width: 1180px) { .scrubber { display: none; } }

.prose p a, .ledger details .body p a { position: relative; }

.prose .pull { position: relative; }
.prose .pull::before {
  content: '\201C';
  position: absolute; left: -8px; top: -22px;
  font-family: 'EB Garamond', serif;
  font-size: 80px; line-height: 1;
  color: var(--accent); opacity: 0.2;
  pointer-events: none; user-select: none;
}

.home h1 .accent { position: relative; display: inline-block; }
.home h1 .accent::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--accent);
  opacity: 0.3; transform-origin: left;
  animation: underline-draw 1.6s 0.4s cubic-bezier(0.65, 0, 0.35, 1) both;
}
@keyframes underline-draw {
  0%   { transform: scaleX(0); opacity: 0; }
  100% { transform: scaleX(1); opacity: 0.3; }
}

.now-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: #2da25c;
  margin-right: 6px; vertical-align: middle;
  animation: dot-pulse 2.4s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

.theme-toggle {
  width: 32px; height: 32px;
  padding: 0; justify-content: center;
  border-radius: 50%; flex-shrink: 0;
}
.theme-toggle .label { display: none; }
.theme-toggle .dot {
  background: transparent;
  border: 1.5px solid var(--ink);
  width: 12px; height: 12px;
  position: relative; overflow: hidden;
}
.theme-toggle .dot::before {
  content: ''; position: absolute; inset: 0;
  background: var(--ink);
  transform: translateX(-50%);
  transition: transform 0.3s ease;
}
html[data-theme="dark"] .theme-toggle .dot::before { transform: translateX(50%); }
.theme-toggle:hover .dot { border-color: var(--accent); }
.theme-toggle:hover .dot::before { background: var(--accent); }

.topbar { position: sticky; top: 0; transition: box-shadow 0.3s ease, background 0.3s ease; }
.topbar.sticky-shadow { box-shadow: 0 4px 18px -12px rgba(0,0,0,0.18), 0 1px 0 var(--rule-faint); }
html[data-theme="dark"] .topbar.sticky-shadow { box-shadow: 0 4px 22px -14px rgba(0,0,0,0.6), 0 1px 0 var(--rule-faint); }

.nav-toggle {
  display: none; background: transparent;
  border: 1px solid var(--rule); color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 6px 9px; cursor: pointer;
  align-items: center; gap: 6px;
}
.nav-toggle:hover { color: var(--ink); border-color: var(--ink); }
.nav-toggle .bars { display: inline-flex; flex-direction: column; gap: 2px; }
.nav-toggle .bars span { display: block; width: 12px; height: 1.5px; background: currentColor; }

.home h1 em { font-style: italic; font-weight: 500; }

@media (max-width: 960px) {
  .topbar nav { gap: 16px; font-size: 10px; }
  .home h1 { font-size: clamp(36px, 7vw, 56px); }
  .masthead h1 { font-size: clamp(32px, 6vw, 52px); }
}

@media (max-width: 720px) {
  body { font-size: 17px; }
  .topbar { padding: 11px 16px; gap: 8px; flex-wrap: nowrap; }
  .topbar .right { gap: 10px; }
  .topbar .meta { display: none; }
  .topbar nav {
    position: fixed;
    top: 48px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule-faint);
    padding: 0 16px;
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s;
    z-index: 49;
  }
  .topbar nav.open {
    max-height: 460px;
    padding: 6px 16px 14px;
    box-shadow: 0 8px 24px -12px rgba(0,0,0,0.12);
  }
  .topbar nav a {
    padding: 11px 0;
    border-bottom: 1px solid var(--rule-faint);
    font-size: 11px;
  }
  .topbar nav a:last-child { border-bottom: none; }
  .nav-toggle { display: inline-flex; }
  .monogram-text { font-size: 10px; letter-spacing: 0.1em; }
  .monogram-glyph { width: 22px; height: 22px; font-size: 13px; }
  .translate-wrap label { display: none; }

  .home main { padding: 28px 18px 32px; }
  .home .greeting { margin-bottom: 14px; font-size: 11px; }
  .home h1 {
    font-size: clamp(34px, 9vw, 48px);
    line-height: 1.08; margin-bottom: 22px;
  }
  .home .prose p { font-size: 17px; line-height: 1.6; }
  .home .now {
    grid-template-columns: 78px 1fr;
    gap: 3px 12px; font-size: 10.5px;
    margin-top: 24px; padding-top: 18px;
  }
  .home footer {
    padding: 14px 18px;
    flex-direction: column; gap: 8px;
    align-items: flex-start; font-size: 9.5px;
  }
  .home footer .contacts { gap: 12px; flex-wrap: wrap; }

  .masthead { padding: 24px 18px 18px; }
  .masthead .top-meta {
    font-size: 10px;
    margin-bottom: 16px; padding-bottom: 10px;
    flex-wrap: wrap; gap: 4px;
  }
  .masthead h1 {
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1.08; margin-bottom: 12px;
  }
  .masthead .standfirst { font-size: 17px; }
  .masthead .deck { font-size: 18px; }
  .masthead .byline { font-size: 10.5px; }
  .masthead .byline .label { min-width: 78px; }
  .masthead .byline strong { font-size: 15px; }
  .masthead .byline > div { padding: 7px 0; gap: 10px; }

  section { padding: 8px 18px 28px; }
  .section-mark {
    font-size: 10.5px; letter-spacing: 0.06em;
    gap: 6px; flex-direction: column;
    align-items: flex-start;
  }
  .section-mark > span:last-child {
    font-weight: 400; color: var(--ink-4); font-size: 9.5px;
  }

  .prose p, .ledger details .body p { font-size: 17px; line-height: 1.6; }
  .prose .lede { font-size: 19px; line-height: 1.5; }
  .prose .sub, .prose h3.sub { font-size: 20px; }
  .prose .minor, .prose h4.minor { font-size: 10px; }
  .prose .pull { padding-left: 16px; }
  .prose .pull blockquote { font-size: 19px; }
  .prose .pull::before { font-size: 56px; left: -4px; top: -16px; }
  .prose .glossary { font-size: 12px; padding: 14px; }

  .triad { padding: 14px 0; gap: 6px; }
  .triad .name { font-size: 17px; }
  .triad .desc { font-size: 15px; }
  .triad .organism { font-size: 10px; padding-top: 8px; }

  .ledger details summary {
    padding: 14px 0;
    grid-template-columns: 22px 1fr 18px; gap: 8px;
  }
  .ledger details summary .roman { font-size: 9.5px; }
  .ledger details summary .summary-title { font-size: 17px; line-height: 1.3; }
  .ledger details .body { padding: 2px 0 14px 0; }
  .ledger details .body p { font-size: 16px; }

  .nb-footer { padding: 24px 18px 18px; margin-top: 28px; }
  .nb-footer .colophon { grid-template-columns: 1fr; gap: 20px; margin-bottom: 20px; }
  .nb-footer .colophon .lead { font-size: 17px; }
  .nb-footer .endplate {
    flex-direction: column; gap: 8px;
    align-items: flex-start; font-size: 9.5px;
  }

  .nb2 .picks { grid-template-columns: 1fr; }
  .nb2 .pick {
    padding: 12px 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
  }
  .nb2 .pick .name { font-size: 16px; }
  .nb2 .pick .note { font-size: 14.5px; }
  .nb2 .pick .qual { display: block; margin-left: 0; margin-top: 2px; }
  .nb2 .placeholder-note { font-size: 15px; padding: 14px; }

  .section-head h2 { font-size: 22px; }
  .section-head .blurb { font-size: 13.5px; }

  .pullquote { padding: 0 18px; margin: 24px auto; }
  .pullquote p { font-size: 17px; }

  .nb2 .nb-footer {
    flex-direction: column; gap: 10px;
    align-items: flex-start;
  }

  .grain { opacity: calc(var(--grain-opacity) * 0.6); }
  .home-rings svg { width: 200vw; height: 200vw; }
}

@media (max-width: 400px) {
  .topbar { padding: 10px 14px; }
  .home main { padding: 20px 14px 24px; }
  .home h1 { font-size: 30px; }
  section { padding: 6px 14px 24px; }
  .masthead { padding: 20px 14px 16px; }
  .masthead h1 { font-size: 26px; }
  .nb-footer { padding: 20px 14px 14px; }
}

/* ==================== password gate ==================== */
.gate {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9999;
  padding: 20px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.gate.active { display: flex; opacity: 1; }
.gate-card {
  background: var(--bg);
  border: 1px solid var(--ink-4);
  padding: 36px 32px 28px;
  max-width: 420px; width: 100%;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  margin: auto;
  transform: translateY(8px) scale(0.985);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.32s ease;
}
.gate.active .gate-card { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .gate, .gate-card { transition: none; }
}
.gate-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.gate-title {
  font-size: 26px;
  line-height: 1.2;
  margin-bottom: 10px;
  color: var(--ink);
}
.gate-blurb {
  font-size: 15px;
  color: var(--ink-2);
  margin-bottom: 22px;
  line-height: 1.5;
}
.gate-input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--ink-4);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  padding: 12px 14px;
  outline: none;
  letter-spacing: 0.02em;
  transition: border-color 0.15s;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.gate-input:focus { border-color: var(--accent); }
.gate-input.shake {
  animation: gateShake 0.4s;
  border-color: var(--accent-2);
}
@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.gate-row {
  display: flex; gap: 10px;
  margin-top: 16px;
  align-items: center; justify-content: flex-end;
  flex-wrap: wrap;
}
.gate-btn {
  background: var(--ink);
  color: var(--bg);
  border: none;
  padding: 10px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  min-height: 40px;
}
.gate-btn:hover { opacity: 0.82; }
.gate-btn.ghost {
  background: transparent;
  color: var(--ink-3);
}
.gate-err {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-top: 12px;
  min-height: 14px;
  opacity: 0;
  transition: opacity 0.2s;
}
.gate-err.visible { opacity: 1; }
@media (max-width: 480px) {
  .gate { padding: 14px; }
  .gate-card { padding: 28px 22px 22px; }
  .gate-title { font-size: 22px; }
  .gate-blurb { font-size: 14px; margin-bottom: 18px; }
}

