:root {
  --parchment: #f6efe3;
  --parchment-2: #ede1c3;
  --parchment-3: #e3d1a1;
  --ink: #1f1810;
  --ink-2: #3d3325;
  --ink-3: #6b5d4a;
  --rule: rgba(31, 24, 16, 0.16);
  --rule-soft: rgba(31, 24, 16, 0.08);
  --ered: #9f3a38;
  --amber: #c27b2f;
  --teal: #2f6e66;
  --mauve: #724b7a;
  --sand: #d6c49b;
  --shadow: 0 24px 80px rgba(31, 24, 16, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Source Serif 4", Georgia, ui-serif, "Times New Roman", serif;
  --display: "Cormorant Garamond", Georgia, ui-serif, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font);
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 100% 0%, rgba(214, 196, 155, 0.35), transparent 26rem),
    radial-gradient(circle at 0% 25%, rgba(194, 123, 47, 0.16), transparent 24rem),
    linear-gradient(180deg, var(--parchment), var(--parchment-2));
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.panel-open { overflow: hidden; }

a { color: inherit; }
img, svg, video { max-width: 100%; height: auto; display: block; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 4px;
  border-radius: 10px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 50;
  transform: translateY(-160%);
  background: var(--ink);
  color: var(--parchment);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  font-family: var(--display);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3.5rem);
  border-bottom: 3px solid var(--ink);
  background: rgba(246, 239, 227, 0.82);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  min-height: 44px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--parchment-2);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.05rem;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 0.95rem; }
.brand small {
  color: var(--ink-3);
  font-size: 0.72rem;
  margin-top: 0.12rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.1rem);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  color: var(--ink-2);
  text-decoration: none;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  border: 2px solid transparent;
  transition: color 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease);
}
.nav a:hover {
  color: var(--ink);
  background: rgba(31, 24, 16, 0.07);
  border-color: var(--ink);
}

.hero {
  position: relative;
  padding: clamp(5rem, 14vw, 12rem) clamp(1.25rem, 5vw, 6.5rem) clamp(4rem, 8vw, 7.5rem);
  overflow: hidden;
}
.hero-border {
  position: absolute;
  left: clamp(1.25rem, 5vw, 6.5rem);
  right: clamp(1.25rem, 5vw, 6.5rem);
  top: clamp(5rem, 14vw, 12rem);
  bottom: clamp(4rem, 8vw, 7.5rem);
  border: 3px solid var(--ink);
  border-radius: 36px;
  pointer-events: none;
  opacity: 0.35;
  z-index: 0;
}
.hero-underlay {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(31, 24, 16, 0.08) 0 2px, transparent 2px 34px),
    repeating-linear-gradient(0deg, rgba(31, 24, 16, 0.05) 0 1px, transparent 1px 26px),
    linear-gradient(180deg, var(--parchment), var(--parchment-2));
  z-index: 0;
}
.hero-copy, .hero-aside { position: relative; z-index: 1; }

.eyebrow, .section-kicker {
  color: var(--ered);
  font-family: var(--display);
  font-size: 0.88rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: inline-block;
  border: 2px solid var(--ink);
  background: var(--parchment-2);
  padding: 0.38rem 0.82rem;
  border-radius: 999px;
}
h1 {
  max-width: 16ch;
  margin-block-end: 1rem;
  font-family: var(--display);
  font-size: clamp(3.4rem, 7.8vw, 7.6rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
}
.lede {
  max-width: 62ch;
  color: var(--ink-2);
  font-size: clamp(1.05rem, 1.55vw, 1.3rem);
  line-height: 1.6;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.6rem; }

.button, .ghost-button, .outline-link {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.85rem 1.15rem;
  font-family: var(--display);
  font-weight: 800;
  text-decoration: none;
  border: 3px solid var(--ink);
  transition: transform 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
  cursor: pointer;
  letter-spacing: 0.04em;
}
.button:hover, .ghost-button:hover, .outline-link:hover { transform: translateY(-2px); }
.button.primary {
  background: var(--ink);
  color: var(--parchment);
  box-shadow: 0 14px 40px rgba(31, 24, 16, 0.28);
}
.button.secondary, .ghost-button, .outline-link {
  background: var(--parchment-2);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(31, 24, 16, 0.12);
}

.label {
  width: max-content;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0.32rem 0.78rem;
  margin-bottom: 0.9rem;
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
}
.real-label { background: var(--teal); color: var(--parchment); }
.concept-label { background: var(--ered); color: var(--parchment); }
.built-label { background: var(--amber); color: var(--parchment); }

.timeline-section {
  padding: clamp(4.5rem, 10vw, 8.5rem) clamp(1.25rem, 5vw, 6rem);
  border-top: 3px solid var(--ink);
}
.section-kicker-wrap { margin-bottom: 1.2rem; }
.split-heading, .split-proof {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.85fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.split-proof { margin-top: 2.4rem; }
.split-proof-aside { position: sticky; top: 7.2rem; }
h2.section-title {
  font-family: var(--display);
  font-size: clamp(2.4rem, 4.6vw, 4.8rem);
  line-height: 0.97;
  letter-spacing: -0.03em;
  max-width: 18ch;
  margin-block-end: 0.9rem;
}
h3 { font-size: clamp(1.15rem, 1.9vw, 1.52rem); line-height: 1.12; margin-block-end: 0.6rem; }
.prose { color: var(--ink-2); line-height: 1.75; max-width: 68ch; }

.timeline {
  position: relative;
  margin-top: 3.4rem;
  padding-left: clamp(1.6rem, 3.2vw, 2.8rem);
}
.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  background: linear-gradient(180deg, var(--ink), rgba(31,24,16,0.18));
  border-radius: 999px;
}
.timeline-step {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 1.1rem;
  margin-bottom: 3.6rem;
}
.step-dot {
  grid-column: 1;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--ink);
  border: 3px solid var(--parchment);
  box-shadow: 0 0 0 3px var(--ink);
}
.era-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  font-family: var(--display);
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.era-badge::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--sand);
  border: 2px solid var(--ink);
}
.step-card {
  background: var(--parchment-2);
  border: 3px solid var(--ink);
  border-radius: 28px;
  padding: clamp(1.25rem, 2vw, 1.6rem);
  box-shadow: var(--shadow);
  transition: transform 220ms var(--ease), border-color 220ms var(--ease);
}
.step-card:hover { transform: translateY(-4px); border-color: var(--amber); }
.card-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.65fr);
  gap: clamp(1.25rem, 2.6vw, 2.2rem);
  align-items: start;
}
.card-document {
  background: var(--parchment);
  border: 3px solid var(--ink);
  border-radius: 22px;
  padding: 1rem 1.1rem;
}
.card-document p { margin: 0; font-size: 0.94rem; line-height: 1.65; color: var(--ink-2); }
.card-document-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  font-size: 0.76rem;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.doc-line {
  height: 4px;
  border-radius: 4px;
  background: rgba(31,24,16,0.14);
  margin-top: 0.9rem;
  width: 82%;
}
.doc-line.w-1 { width: 68%; }
.doc-line.w-2 { width: 38%; }

.proof-floor {
  padding: clamp(4rem, 9vw, 7.5rem) clamp(1.25rem, 5vw, 6rem);
  border-top: 3px solid var(--ink);
  background:
    radial-gradient(circle at 110% -10%, rgba(194,123,47,0.24), transparent 26rem),
    linear-gradient(180deg, var(--parchment-2), var(--parchment));
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.6rem);
  margin-top: 1.4rem;
}
.proof-card {
  background: var(--parchment-2);
  border: 3px solid var(--ink);
  border-radius: 26px;
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: transform 220ms var(--ease), border-color 220ms var(--ease);
}
.proof-card:hover { transform: translateY(-4px); border-color: var(--teal); }
.proof-card h3 { margin: 0; }
.proof-card p { margin: 0; color: var(--ink-2); line-height: 1.7; }
.proof-footer { margin-top: auto; padding-top: 0.7rem; }

.closing {
  padding: clamp(4rem, 9vw, 7.5rem) clamp(1.25rem, 5vw, 6rem);
  border-top: 3px solid var(--ink);
  background: var(--parchment-2);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: clamp(2.2rem, 5vw, 6rem);
  align-items: center;
}
.closing-aside { position: relative; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 3px solid var(--ink);
  padding: 1.5rem clamp(1.25rem, 5vw, 6rem);
  color: var(--ink-3);
  background: var(--parchment-2);
}
.footer p { margin: 0; }

.guide-main { padding: clamp(3.2rem, 7vw, 6rem) clamp(1.25rem, 5vw, 6rem); }
.guide-article { width: min(1020px, 100%); margin: 0 auto; }
.guide-body { background: var(--parchment); }
.guide-article h1 {
  max-width: 14ch;
  font-size: clamp(3.2rem, 8.2vw, 7.2rem);
}
.guide-article section { border-top: 3px solid var(--ink); padding-top: 2rem; margin-top: 2rem; }
.guide-article code {
  background: var(--parchment-3);
  color: var(--teal);
  padding: 0.18rem 0.38rem;
  border-radius: 10px;
  border: 2px solid var(--rule);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
}
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.2rem; }
.guide-card {
  background: var(--parchment-2);
  border: 3px solid var(--ink);
  border-radius: 22px;
  padding: 1.15rem;
}
.guide-card h3 { text-align: left; }
.guide-card p { color: var(--ink-2); line-height: 1.75; margin: 0; }
.prose, .pass-list { color: var(--ink-2); line-height: 1.8; }
.pass-list li { margin-top: 0.65rem; }

.concept-panel[hidden], .detail-panel[hidden], .speech-bubble-stage[hidden], .paperback[hidden] { display: none; }
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(31, 24, 16, 0.52);
}
.panel-card, .agent-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 71;
  width: min(1020px, calc(100% - 2.4rem));
  max-height: min(780px, 90vh);
  overflow: auto;
  background: var(--parchment);
  border: 3px solid var(--ink);
  border-radius: 26px;
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}
.panel-close {
  float: right;
  min-height: 44px;
  width: 44px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: var(--parchment-2);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.panel-list { color: var(--ink-2); line-height: 1.75; padding-left: 1.2rem; }
.panel-list li { margin-top: 0.6rem; }

.console-panel {
  background: var(--parchment);
  border: 3px solid var(--ink);
  border-radius: 22px;
  overflow: hidden;
}
.console-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-bottom: 2px solid var(--ink);
  background: var(--parchment-2);
}
.console-bar .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ink);
  border: 2px solid var(--parchment-2);
}
.console-bar strong { font-family: var(--display); letter-spacing: 0.06em; }

.console-body {
  padding: 1rem;
  display: grid;
  gap: 0.45rem;
  max-height: 360px;
  overflow: auto;
}
.console-line {
  display: grid;
  gap: 0.4rem;
  padding: 0.65rem 0.8rem;
  border-radius: 14px;
  background: var(--parchment-2);
  border: 2px solid var(--rule-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
}
.console-line .ts { color: var(--ink-3); font-size: 0.78rem; letter-spacing: 0.04em; }

.nav-anchor {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  color: var(--ink);
  background: var(--parchment-2);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  transition: transform 180ms var(--ease), background 180ms var(--ease);
}
.nav-anchor:hover { background: var(--parchment-3); transform: translateY(-2px); }

.sticky-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.2rem, 2.8vw, 2rem);
  margin-top: 2.2rem;
}
.sticky-note-card {
  background: var(--parchment-2);
  border: 3px solid var(--ink);
  border-radius: 26px;
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 220ms var(--ease), border-color 220ms var(--ease);
  display: grid;
  gap: 0.75rem;
}
.sticky-note-card:hover { border-color: var(--amber); transform: rotate(0deg) translateY(-4px); }

@media (max-width: 980px) {
  .card-inner,
  .hero-panel,
  .split-heading,
  .split-proof,
  .closing,
  .closing-aside,
  .split-proof-aside { grid-template-columns: 1fr; }
  .card-grid, .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .closing { gap: 1.6rem; }
  .closing-aside, .split-proof-aside { position: static; }
}
@media (max-width: 660px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .nav { justify-content: flex-start; width: 100%; }
  .card-inner { grid-template-columns: 1fr; }
  .card-grid, .guide-grid, .sticky-note-grid { grid-template-columns: 1fr; }
  .hero-actions .button, .hero-actions .outline-link { width: 100%; }
  h1 { font-size: clamp(3rem, 17vw, 4.4rem); }
  .timeline { padding-left: 1.2rem; }
  .narrow-full { grid-template-columns: 1fr; }
}
@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;
  }
}
