:root {
  --bg: #080b0a;
  --bg-soft: #0d1210;
  --panel: rgba(17, 23, 20, 0.88);
  --panel-solid: #111714;
  --panel-raised: #151d19;
  --text: #eef3e8;
  --muted: #9ba99f;
  --faint: #66736b;
  --line: rgba(220, 235, 222, 0.13);
  --line-strong: rgba(220, 235, 222, 0.24);
  --accent: #c8f36f;
  --accent-strong: #d9ff8c;
  --accent-soft: rgba(200, 243, 111, 0.12);
  --cyan: #8ed8cc;
  --warm: #e8bd72;
  --danger: #ff9a8f;
  --success: #9be59f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --max: 1180px;
  --header-height: 76px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 15% -10%, rgba(142, 216, 204, 0.09), transparent 34rem),
    radial-gradient(circle at 88% 8%, rgba(200, 243, 111, 0.08), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration-color: rgba(200, 243, 111, 0.5);
  text-underline-offset: 0.2em;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

::selection {
  background: rgba(200, 243, 111, 0.28);
  color: var(--text);
}

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

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

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 1rem;
  top: 1rem;
  transform: translateY(-180%);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #0a0d0b;
  font-weight: 800;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  height: var(--header-height);
  border-bottom: 1px solid transparent;
  background: rgba(8, 11, 10, 0.72);
  backdrop-filter: blur(18px);
  transition: border-color 180ms ease, background 180ms ease;
}

.site-header.is-scrolled {
  border-color: var(--line);
  background: rgba(8, 11, 10, 0.9);
}

.header-inner {
  width: min(calc(100% - 2rem), var(--max));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  /* The same mark as the favicon and the Telegram group photo, drawn once in mark.svg. */
  background: url("mark.svg") center / cover no-repeat;
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-name {
  font-size: 0.79rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-tag {
  margin-top: 0.28rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.site-nav a {
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--text);
}

.site-nav .nav-commons {
  margin-left: 0.3rem;
  border: 1px solid rgba(200, 243, 111, 0.32);
  color: var(--accent-strong);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle-lines,
.nav-toggle-lines::before,
.nav-toggle-lines::after {
  width: 18px;
  height: 1px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.nav-toggle-lines {
  position: relative;
}

.nav-toggle-lines::before,
.nav-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-lines::before {
  top: -6px;
}

.nav-toggle-lines::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::after {
  top: 0;
  transform: rotate(-45deg);
}

main {
  overflow: clip;
}

.wrap {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

.narrow {
  width: min(calc(100% - 2rem), 820px);
  margin-inline: auto;
}

.section {
  position: relative;
  padding: clamp(4.5rem, 8vw, 8rem) 0;
}

.section.compact {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.section-rule {
  border-top: 1px solid var(--line);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.8rem;
  height: 1px;
  background: currentColor;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(3.1rem, 8.5vw, 7.7rem);
  font-weight: 760;
}

h2 {
  font-size: clamp(2.15rem, 5vw, 4.6rem);
  font-weight: 720;
}

h3 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 720;
}

h4 {
  font-size: 1rem;
  font-weight: 780;
  letter-spacing: -0.01em;
}

.display-serif {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.lede {
  max-width: 760px;
  margin: 1.5rem 0 0;
  color: #c6d0c8;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.6;
}

.copy {
  color: #bac5bd;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.86rem;
}

.mono {
  font-family: var(--font-mono);
}

.kicker-number {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.hero {
  position: relative;
  min-height: calc(100svh - var(--header-height));
  display: grid;
  align-items: center;
  padding: clamp(4rem, 7vw, 7rem) 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 7rem);
}

.hero h1 .accent-word {
  color: var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
}

.hero-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.72rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 780;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(200, 243, 111, 0.52);
  color: var(--text);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #0b100c;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.025);
}

.button.danger {
  border-color: rgba(255, 154, 143, 0.35);
  color: var(--danger);
}

.button.small-button {
  min-height: 38px;
  padding: 0.5rem 0.8rem;
  font-size: 0.76rem;
}

.button[disabled] {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.hero-visual {
  position: relative;
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    rgba(13, 18, 16, 0.58);
  background-size: 32px 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-visual::before {
  content: "Probability field / branching model";
  position: absolute;
  z-index: 2;
  left: 1.2rem;
  top: 1rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#horizon-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.visual-readout {
  position: absolute;
  z-index: 3;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.readout-cell {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 11, 10, 0.72);
  backdrop-filter: blur(12px);
}

.readout-label {
  display: block;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.readout-value {
  display: block;
  margin-top: 0.35rem;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.hero-note {
  max-width: 640px;
  margin-top: 2rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(200, 243, 111, 0.35);
  color: var(--muted);
  font-size: 0.78rem;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.62fr);
  align-items: end;
  gap: 2rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.section-heading.single {
  display: block;
  max-width: 850px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 1rem;
}

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

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

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

.card {
  position: relative;
  padding: clamp(1.25rem, 2.4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

.card.accent-card {
  border-color: rgba(200, 243, 111, 0.26);
  background: linear-gradient(145deg, rgba(200, 243, 111, 0.09), rgba(17, 23, 20, 0.82) 52%);
}

.card h3,
.card h4 {
  margin-bottom: 0.8rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.card-index {
  display: inline-block;
  margin-bottom: 1.2rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.pillar {
  min-height: 240px;
}

.pillar::after {
  content: "";
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 8px;
  height: 8px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(200, 243, 111, 0.05), 0 0 0 11px rgba(200, 243, 111, 0.025);
}

.process-line {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  counter-reset: process;
}

.process-step {
  position: relative;
  padding: 1.5rem 1.2rem 1.5rem 0;
  border-top: 1px solid var(--line-strong);
  counter-increment: process;
}

.process-step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.process-step::before {
  content: "0" counter(process);
  display: block;
  margin-bottom: 1rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.process-step h3 {
  margin-bottom: 0.65rem;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.process-step p {
  margin: 0;
  padding-right: 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.statement {
  position: relative;
  padding: clamp(2rem, 5vw, 4.5rem);
  border: 1px solid rgba(200, 243, 111, 0.24);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 85% 20%, rgba(142, 216, 204, 0.1), transparent 20rem),
    linear-gradient(145deg, rgba(200, 243, 111, 0.075), rgba(17, 23, 20, 0.82));
  overflow: hidden;
}

.statement::after {
  content: "P( future | evidence )";
  position: absolute;
  right: 2rem;
  bottom: 1.2rem;
  color: rgba(200, 243, 111, 0.18);
  font-family: var(--font-mono);
  font-size: clamp(1rem, 4vw, 3rem);
  white-space: nowrap;
}

.statement blockquote {
  position: relative;
  z-index: 1;
  max-width: 850px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4.4vw, 4rem);
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.statement cite {
  display: block;
  margin-top: 1.5rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-hero {
  padding: clamp(5rem, 9vw, 9rem) 0 clamp(3rem, 6vw, 6rem);
}

.page-hero h1 {
  max-width: 1000px;
  font-size: clamp(3.2rem, 8vw, 7rem);
}

.page-hero .lede {
  max-width: 830px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.3rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breadcrumb a {
  text-decoration: none;
}

.breadcrumb span:last-child {
  color: var(--accent);
}

.prose {
  color: #c3cdc5;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose h2 {
  margin-top: 3.5rem;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
}

.prose h3 {
  margin-top: 2.2rem;
}

.prose p,
.prose li {
  max-width: 760px;
}

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

.prose strong {
  color: var(--text);
}

.prose code,
.formula {
  padding: 0.15em 0.38em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.callout {
  margin: 2rem 0;
  padding: 1.2rem 1.4rem;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(200, 243, 111, 0.065);
  color: #c7d2ca;
}

.callout.warning {
  border-left-color: var(--warm);
  background: rgba(232, 189, 114, 0.065);
}

.callout.danger-callout {
  border-left-color: var(--danger);
  background: rgba(255, 154, 143, 0.06);
}

.callout p:last-child {
  margin-bottom: 0;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.sticky-aside {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
}

.aside-nav {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 23, 20, 0.55);
}

.aside-nav h2 {
  margin-bottom: 1rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aside-nav a {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.83rem;
  text-decoration: none;
}

.aside-nav a:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.article-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.article-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.article-number {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.article-item h3 {
  margin-bottom: 0.55rem;
  font-size: 1.2rem;
}

.article-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.triad .card {
  min-height: 260px;
}

.triad-symbol {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  margin-bottom: 2rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.canon-intro {
  max-width: 820px;
  margin-bottom: 3rem;
}

.canon-book {
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 23, 20, 0.64);
  overflow: hidden;
}

.canon-book[open] {
  border-color: rgba(200, 243, 111, 0.24);
}

.canon-book summary {
  position: relative;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1.3rem 1.4rem;
  cursor: pointer;
  list-style: none;
}

.canon-book summary::-webkit-details-marker {
  display: none;
}

.book-number {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.book-title {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: -0.025em;
}

.book-toggle {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
}

.book-toggle::before {
  content: "+";
}

.canon-book[open] .book-toggle::before {
  content: "-";
}

.verses {
  margin: 0;
  padding: 0 1.4rem 1.6rem 6.3rem;
  list-style: none;
  counter-reset: verse;
}

.verses li {
  position: relative;
  max-width: 800px;
  padding: 0.7rem 0 0.7rem 2.2rem;
  color: #ced6cf;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.55;
  counter-increment: verse;
}

.verses li::before {
  content: counter(verse);
  position: absolute;
  left: 0;
  top: 0.92rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

.commentary-note {
  margin: 0 1.4rem 1.5rem 6.3rem;
  padding: 1rem 1.2rem;
  border-left: 1px solid var(--cyan);
  color: var(--muted);
  font-size: 0.85rem;
}

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

.liturgy {
  min-height: 300px;
}

.liturgy-text {
  margin-top: 1.6rem;
  color: #d3dbd4;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.75;
  white-space: pre-line;
}

.method-steps {
  display: grid;
  gap: 1rem;
  counter-reset: method;
}

.method-step {
  position: relative;
  padding: 1.6rem 1.5rem 1.6rem 5.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  counter-increment: method;
}

.method-step::before {
  content: counter(method, decimal-leading-zero);
  position: absolute;
  left: 1.5rem;
  top: 1.65rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.method-step h3 {
  margin-bottom: 0.55rem;
  font-size: 1.25rem;
}

.method-step p {
  margin: 0;
  color: var(--muted);
}

.form-shell {
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(17, 23, 20, 0.78);
  box-shadow: var(--shadow);
}

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

.field {
  display: grid;
  gap: 0.45rem;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  color: #d7ded8;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.field-hint {
  color: var(--faint);
  font-size: 0.72rem;
}

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 0.72rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(8, 11, 10, 0.72);
  color: var(--text);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(200, 243, 111, 0.72);
  box-shadow: 0 0 0 3px rgba(200, 243, 111, 0.08);
}

input::placeholder,
textarea::placeholder {
  color: #59645d;
}

input[type="range"] {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--accent);
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 0.8rem;
  align-items: center;
}

.range-value {
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-align: right;
}

.checkbox-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin-top: 0.18rem;
  accent-color: var(--accent);
}

.checkbox-row label {
  color: var(--muted);
  font-size: 0.79rem;
}

.form-status {
  display: none;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.form-status.is-visible {
  display: block;
}

.form-status.success {
  border-color: rgba(155, 229, 159, 0.3);
  background: rgba(155, 229, 159, 0.06);
  color: var(--success);
}

.form-status.error {
  border-color: rgba(255, 154, 143, 0.3);
  background: rgba(255, 154, 143, 0.06);
  color: var(--danger);
}

.lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 1rem;
  align-items: start;
}

.result-panel {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  padding: 1.5rem;
  border: 1px solid rgba(200, 243, 111, 0.25);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(200, 243, 111, 0.08), rgba(17, 23, 20, 0.92));
}

.result-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-probability {
  margin: 0.4rem 0 0;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: clamp(3rem, 8vw, 5.4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.07em;
}

.result-secondary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
  margin: 1.2rem 0;
}

.result-chip {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 11, 10, 0.45);
}

.result-chip span {
  display: block;
}

.result-chip .chip-label {
  color: var(--faint);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.result-chip .chip-value {
  margin-top: 0.3rem;
  color: #dfe6df;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.result-explain {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.ledger-shell {
  margin-top: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 23, 20, 0.6);
  overflow: hidden;
}

.ledger-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.ledger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

td {
  color: #bdc8c0;
  font-size: 0.8rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty-row td {
  padding: 2rem;
  color: var(--faint);
  text-align: center;
}

.resolve-actions {
  display: flex;
  gap: 0.35rem;
}

.resolve-button {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
}

.resolve-button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.score-summary {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

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

.schedule-phase {
  padding: 1.3rem;
  border-top: 1px solid var(--line-strong);
}

.schedule-phase .phase-days {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.schedule-phase h3 {
  margin: 0.65rem 0;
  font-size: 1.15rem;
}

.schedule-phase p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.commons-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.funding-panel {
  padding: clamp(1.4rem, 4vw, 2.5rem);
  border: 1px solid rgba(200, 243, 111, 0.26);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 85% 10%, rgba(142, 216, 204, 0.12), transparent 18rem),
    rgba(17, 23, 20, 0.84);
  box-shadow: var(--shadow);
}

.funding-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mode-badge {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.funding-total {
  margin: 1.2rem 0 0;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.065em;
}

.funding-caption {
  margin: 0.5rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.progress-shell {
  position: relative;
  padding: 1.2rem 0 2rem;
}

.progress-track {
  position: relative;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 11, 10, 0.75);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--accent));
  box-shadow: 0 0 24px rgba(200, 243, 111, 0.22);
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 0.65rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.progress-marker {
  position: absolute;
  top: 0.9rem;
  width: 1px;
  height: 18px;
  background: rgba(238, 243, 232, 0.2);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.preset-button {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
}

.preset-button:hover,
.preset-button.is-selected {
  border-color: rgba(200, 243, 111, 0.5);
  background: var(--accent-soft);
  color: var(--text);
}

.amount-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}

.currency-input {
  position: relative;
}

.currency-input::before {
  content: "$";
  position: absolute;
  z-index: 1;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  font-family: var(--font-mono);
}

.currency-input input {
  padding-left: 1.8rem;
}

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

.milestone-card {
  min-height: 190px;
}

.milestone-amount {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.milestone-card h3 {
  margin: 0.8rem 0 0.65rem;
  font-size: 1.2rem;
}

.allocation-bar {
  display: grid;
  grid-template-columns: 40fr 25fr 20fr 15fr;
  height: 16px;
  margin: 1.5rem 0 1rem;
  border-radius: 999px;
  overflow: hidden;
}

.allocation-bar span:nth-child(1) {
  background: var(--accent);
}

.allocation-bar span:nth-child(2) {
  background: var(--cyan);
}

.allocation-bar span:nth-child(3) {
  background: var(--warm);
}

.allocation-bar span:nth-child(4) {
  background: #8f9b92;
}

.allocation-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem 1.2rem;
}

.legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  color: var(--muted);
  font-size: 0.78rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  margin-top: 0.38rem;
  border-radius: 50%;
  background: currentColor;
}

.demo-reset-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.8rem;
}

.demo-reset-row [hidden] {
  display: none;
}

.request-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.request-item {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 11, 10, 0.45);
}

.request-item strong {
  display: block;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.request-item span {
  color: var(--muted);
  font-size: 0.74rem;
}

.modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: none;
  place-items: center;
  padding: 1rem;
}

.modal.is-open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(8px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  max-height: calc(100svh - 2rem);
  overflow-y: auto;
  padding: clamp(1.3rem, 4vw, 2.2rem);
  border: 1px solid rgba(200, 243, 111, 0.26);
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

.modal-head {
  padding-right: 3rem;
  margin-bottom: 1.4rem;
}

.modal-head h2 {
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.modal-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.source-list {
  display: grid;
  gap: 1rem;
}

.source-item {
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 23, 20, 0.55);
}

.source-item h3 {
  margin-bottom: 0.55rem;
  font-size: 1.08rem;
}

.source-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.source-meta {
  display: block;
  margin-top: 0.7rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  overflow-wrap: anywhere;
}

.site-footer {
  padding: 3.5rem 0 2rem;
  border-top: 1px solid var(--line);
  background: rgba(8, 11, 10, 0.7);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) repeat(2, minmax(150px, 0.45fr));
  gap: 2rem;
}

.footer-statement {
  max-width: 500px;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-column h2 {
  margin-bottom: 0.8rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-column a {
  display: block;
  padding: 0.26rem 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
}

.footer-column a:hover {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 650ms ease, transform 650ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .site-nav a {
    padding-inline: 0.55rem;
    font-size: 0.76rem;
  }

  .hero-grid,
  .commons-hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 420px;
  }

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

  .process-line {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .process-step {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
  }

  .process-step:not(:last-child)::after {
    display: none;
  }

  .lab-layout {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }

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

@media (max-width: 860px) {
  :root {
    --header-height: 68px;
  }

  body {
    font-size: 16px;
  }

  .brand-tag {
    display: none;
  }

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

  .site-nav {
    position: fixed;
    top: var(--header-height);
    right: 1rem;
    left: 1rem;
    display: none;
    align-items: stretch;
    flex-direction: column;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(13, 18, 16, 0.98);
    box-shadow: var(--shadow);
  }

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

  .site-nav a {
    padding: 0.8rem 0.9rem;
    font-size: 0.86rem;
  }

  .site-nav .nav-commons {
    margin: 0.25rem 0 0;
  }

  .section-heading,
  .split-layout {
    grid-template-columns: 1fr;
  }

  .sticky-aside {
    position: static;
  }

  .aside-nav {
    display: none;
  }

  .grid-3,
  .triad,
  .schedule-grid {
    grid-template-columns: 1fr;
  }

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

  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .wrap,
  .narrow,
  .header-inner {
    width: min(calc(100% - 1.2rem), var(--max));
  }

  .hero {
    min-height: auto;
  }

  .hero-visual {
    min-height: 360px;
  }

  .visual-readout {
    grid-template-columns: 1fr;
  }

  .readout-cell:nth-child(2),
  .readout-cell:nth-child(3) {
    display: none;
  }

  .grid-2,
  .grid-4,
  .liturgy-grid,
  .form-grid,
  .milestone-grid,
  .allocation-legend {
    grid-template-columns: 1fr;
  }

  .process-line {
    grid-template-columns: 1fr;
  }

  .article-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .canon-book summary {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    padding: 1rem;
  }

  .verses {
    padding: 0 1rem 1.2rem;
  }

  .commentary-note {
    margin: 0 1rem 1.2rem;
  }

  .method-step {
    padding: 1.3rem 1.1rem 1.3rem 3.8rem;
  }

  .method-step::before {
    left: 1.1rem;
    top: 1.38rem;
  }

  .amount-row {
    grid-template-columns: 1fr;
  }

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

  .footer-grid > :first-child {
    grid-column: auto;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .modal {
    padding: 0.5rem;
  }

  .modal-dialog {
    max-height: calc(100svh - 1rem);
    border-radius: var(--radius);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  :root {
    color-scheme: light;
  }

  /* Sections that were never scrolled into view are still at opacity 0,
     which is what made printed and saved PDFs come out blank. */
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .site-header,
  .site-footer,
  .hero-visual,
  .button,
  .aside-nav,
  .modal {
    display: none !important;
  }

  .section,
  .page-hero {
    padding: 1rem 0;
  }

  .card,
  .canon-book,
  .form-shell,
  .ledger-shell {
    border-color: #bbb;
    background: #fff;
    box-shadow: none;
  }

  h1,
  h2,
  h3,
  h4,
  .prose,
  .copy,
  .muted,
  .verses li {
    color: #111;
  }

  .canon-book {
    break-inside: avoid;
  }

  .canon-book:not([open]) > *:not(summary) {
    display: block;
  }
}
