﻿:root {
  --paper: #fbf6ea;
  --paper-deep: #f1e7d5;
  --ink: #2c2a27;
  --muted: #756f66;
  --line: #ded2bf;
  --accent: #9b5f3d;
  --accent-soft: #ead8c8;
  --serif: "Lora", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.82;
  text-rendering: optimizeLegibility;
  animation: pageFade 520ms ease-out both;
}

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: 3px;
  background: transparent;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 120ms linear;
}

.site-header,
main,
.site-footer {
  width: min(100% - 40px, 760px);
  margin-inline: auto;
}

.site-header {
  padding: clamp(72px, 12vw, 132px) 0 52px;
  text-align: center;
}

.eyebrow,
.reading-time,
.page-marker,
.toc,
.page-nav,
.site-footer {
  font-family: var(--sans);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(2.45rem, 8vw, 5.6rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.subtitle {
  max-width: 660px;
  margin: 28px auto 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.08rem, 2vw, 1.34rem);
  line-height: 1.75;
}

.reading-time {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.91rem;
}

.toc {
  margin: 0 0 72px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.toc h2 {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toc ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: grid;
  grid-template-columns: 3ch 1fr;
  gap: 16px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
  text-decoration: none;
  transition: color 180ms ease, transform 180ms ease;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: #aaa092;
  font-size: 0.78rem;
  font-weight: 700;
}

.toc a:hover,
.toc a:focus,
.toc a.active {
  color: var(--accent);
}

.toc a:hover,
.toc a:focus {
  transform: translateX(3px);
}

.essay {
  padding-bottom: 44px;
}

.page-marker {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 38px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.45;
  text-transform: uppercase;
}

.essay p {
  margin: 0 0 1.52em;
  font-size: clamp(1.13rem, 2.2vw, 1.32rem);
  letter-spacing: -0.012em;
}

.essay p:first-of-type::first-letter {
  float: left;
  margin: 0.12em 0.11em 0 0;
  color: var(--accent);
  font-size: 4.95em;
  line-height: 0.76;
  font-weight: 600;
}

.essay p:nth-of-type(8n + 1) {
  padding-top: 0.9em;
  border-top: 1px solid rgba(222, 210, 191, 0.58);
}

.essay p:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 72px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.nav-link {
  display: block;
  color: var(--accent);
  text-decoration: none;
}

.nav-link span {
  display: inline-block;
  border-bottom: 1px solid currentColor;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-link strong {
  display: block;
  margin-top: 9px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
}

.nav-link:last-child {
  text-align: right;
}

.nav-link.disabled {
  color: #aaa092;
  pointer-events: none;
}

.nav-link.disabled strong {
  color: var(--muted);
}

.back-to-top {
  position: fixed;
  right: clamp(18px, 4vw, 36px);
  bottom: clamp(18px, 4vw, 36px);
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 246, 234, 0.88);
  color: var(--accent);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 1.15rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms ease, border-color 220ms ease;
  backdrop-filter: blur(8px);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus {
  border-color: var(--accent);
}

.site-footer {
  padding: 44px 0 54px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@keyframes pageFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 28px, 760px);
  }

  .site-header {
    padding-top: 64px;
    text-align: left;
  }

  h1 {
    letter-spacing: -0.045em;
  }

  .toc {
    margin-bottom: 52px;
  }

  .toc a {
    grid-template-columns: 3ch 1fr;
    gap: 12px;
    font-size: 0.95rem;
  }

  .page-marker {
    display: grid;
    gap: 8px;
  }

  .essay p {
    font-size: 1.08rem;
    line-height: 1.84;
  }

  .essay p:first-of-type::first-letter {
    font-size: 4.15em;
  }

  .page-nav {
    grid-template-columns: 1fr;
  }

  .nav-link:last-child {
    text-align: left;
  }
}

@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;
  }
}

.hero-illustration {
  width: min(100%, 760px);
  margin: 46px auto 0;
}

.hero-illustration svg,
.text-divider svg {
  display: block;
  width: 100%;
  height: auto;
}

.hero-illustration svg {
  max-height: 320px;
}

.hero-illustration .svg-horizon,
.hero-illustration .svg-branch,
.hero-illustration .svg-fire path:last-child,
.hero-illustration .svg-fire path:nth-child(2),
.hero-illustration .svg-constellation path,
.text-divider path {
  fill: none;
  stroke: var(--line);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-illustration .svg-branch {
  stroke: #cdbda5;
  stroke-width: 1.8;
  opacity: 0.72;
}

.hero-illustration .svg-stars,
.hero-illustration .svg-constellation circle,
.text-divider circle {
  fill: var(--accent);
  opacity: 0.5;
}

.hero-illustration .svg-constellation path {
  stroke: var(--accent-soft);
  stroke-width: 1.4;
}

.hero-illustration .svg-people {
  fill: var(--ink);
  opacity: 0.82;
}

.hero-illustration .svg-fire path:first-child {
  fill: var(--accent);
  opacity: 0.78;
}

.hero-illustration .svg-fire path:nth-child(2) {
  stroke: var(--accent);
  opacity: 0.55;
}

.text-divider {
  width: min(68%, 420px);
  margin: 2.8rem auto 3.2rem;
  opacity: 0.86;
}

.text-divider path {
  stroke: var(--accent-soft);
  stroke-width: 2;
}

.text-divider path:first-child {
  stroke: var(--accent);
  opacity: 0.42;
}

@media (max-width: 640px) {
  .hero-illustration {
    margin-top: 34px;
  }

  .hero-illustration svg {
    max-height: none;
  }

  .text-divider {
    width: min(86%, 360px);
    margin: 2.2rem auto 2.6rem;
  }
}

.hero-illustration .svg-river {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.42;
}

.hero-illustration .svg-moon {
  fill: var(--accent-soft);
  opacity: 0.78;
}

.hero-illustration .svg-symbol-ring,
.hero-illustration .svg-marks,
.hero-illustration .svg-speech {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-illustration .svg-symbol-ring {
  stroke: var(--line);
  opacity: 0.7;
}

.hero-illustration .svg-marks circle {
  fill: var(--accent);
  stroke: none;
  opacity: 0.46;
}

.hero-illustration .svg-marks path:last-child {
  stroke: var(--accent-soft);
  stroke-width: 1.4;
}

.hero-illustration .svg-speech {
  stroke: var(--accent);
  opacity: 0.34;
}

.theme-illustration .svg-symbol-ring,
.theme-illustration .svg-marks {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
}

.theme-illustration .svg-symbol-ring {
  stroke: var(--line);
  opacity: 0.72;
}

.theme-illustration .svg-marks path:first-child {
  stroke: var(--accent);
  opacity: 0.34;
}

.hero-illustration .svg-bridge,
.hero-illustration .svg-shared-symbols {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-illustration .svg-bridge {
  stroke: var(--line);
  opacity: 0.82;
}

.hero-illustration .svg-shared-symbols circle:first-child {
  fill: none;
  stroke: var(--accent);
  opacity: 0.42;
}

.hero-illustration .svg-shared-symbols circle:not(:first-child) {
  fill: var(--accent);
  stroke: none;
  opacity: 0.48;
}

.hero-illustration .svg-shared-symbols path {
  stroke: var(--accent);
  opacity: 0.36;
}

.hero-illustration .svg-city-wall,
.hero-illustration .svg-roads,
.hero-illustration .svg-crown,
.hero-illustration .svg-ledger {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-illustration .svg-city-wall {
  stroke: var(--line);
  opacity: 0.88;
}

.hero-illustration .svg-roads {
  stroke: var(--accent);
  opacity: 0.28;
}

.hero-illustration .svg-crown {
  stroke: var(--accent);
  opacity: 0.44;
}

.hero-illustration .svg-ledger {
  stroke: var(--accent-soft);
  opacity: 0.78;
}

.hero-illustration .svg-arches,
.hero-illustration .svg-sacred-lines {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-illustration .svg-arches {
  stroke: var(--line);
  opacity: 0.86;
}

.hero-illustration .svg-sacred-lines {
  stroke: var(--accent);
  opacity: 0.36;
}

.hero-illustration .svg-sacred-lines path:first-child {
  opacity: 0.62;
}

.hero-illustration .svg-light-rays,
.hero-illustration .svg-reason-tools,
.hero-illustration .svg-shadow {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-illustration .svg-light-rays {
  stroke: var(--accent);
  opacity: 0.42;
}

.hero-illustration .svg-light-rays circle {
  fill: var(--accent-soft);
  stroke: var(--accent);
  opacity: 0.68;
}

.hero-illustration .svg-reason-tools {
  stroke: var(--line);
  opacity: 0.86;
}

.hero-illustration .svg-shadow {
  stroke: var(--ink);
  opacity: 0.16;
}

.hero-illustration .svg-body-outline,
.hero-illustration .svg-neural,
.hero-illustration .svg-hands,
.hero-illustration .svg-pulse {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-illustration .svg-body-outline {
  stroke: var(--line);
  opacity: 0.9;
}

.hero-illustration .svg-neural {
  stroke: var(--accent);
  opacity: 0.44;
}

.hero-illustration .svg-neural circle {
  fill: var(--accent);
  stroke: none;
  opacity: 0.58;
}

.hero-illustration .svg-hands {
  stroke: var(--ink);
  opacity: 0.28;
}

.hero-illustration .svg-pulse {
  stroke: var(--accent-soft);
  opacity: 0.72;
}

.hero-illustration .svg-skyline,
.hero-illustration .svg-gear,
.hero-illustration .svg-signal,
.hero-illustration .svg-empty-human {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-illustration .svg-skyline {
  stroke: var(--line);
  opacity: 0.9;
}

.hero-illustration .svg-gear {
  stroke: var(--accent);
  opacity: 0.38;
}

.hero-illustration .svg-signal {
  stroke: var(--accent-soft);
  opacity: 0.72;
}

.hero-illustration .svg-empty-human {
  stroke: var(--ink);
  opacity: 0.34;
}

.hero-illustration .svg-earth-globe,
.hero-illustration .svg-cracks,
.hero-illustration .svg-tree,
.hero-illustration .svg-waves,
.hero-illustration .svg-small-city {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-illustration .svg-earth-globe {
  stroke: var(--line);
  opacity: 0.9;
}

.hero-illustration .svg-cracks {
  stroke: var(--accent);
  opacity: 0.45;
}

.hero-illustration .svg-tree {
  stroke: var(--ink);
  opacity: 0.28;
}

.hero-illustration .svg-waves {
  stroke: var(--accent);
  opacity: 0.34;
}

.hero-illustration .svg-small-city {
  stroke: var(--line);
  opacity: 0.82;
}

.hero-illustration .svg-machine-frame,
.hero-illustration .svg-eye,
.hero-illustration .svg-human-mirror,
.hero-illustration .svg-data-web,
.hero-illustration .svg-data-lines,
.hero-illustration .svg-code {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-illustration .svg-machine-frame {
  stroke: var(--line);
  opacity: 0.9;
}

.hero-illustration .svg-eye,
.hero-illustration .svg-data-lines {
  stroke: var(--accent);
  opacity: 0.42;
}

.hero-illustration .svg-eye circle,
.hero-illustration .svg-data-web circle {
  fill: var(--accent);
  stroke: none;
  opacity: 0.52;
}

.hero-illustration .svg-human-mirror {
  stroke: var(--ink);
  opacity: 0.32;
}

.hero-illustration .svg-data-web,
.hero-illustration .svg-code {
  stroke: var(--accent-soft);
  opacity: 0.74;
}

.hero-illustration .svg-broken-circle,
.hero-illustration .svg-roots {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-illustration .svg-broken-circle {
  stroke: var(--line);
  opacity: 0.9;
}

.hero-illustration .svg-roots {
  stroke: var(--accent);
  opacity: 0.35;
}

.hero-illustration .svg-small-stars {
  fill: var(--accent);
  opacity: 0.44;
}
