:root {
  --parchment: #F5EDE0;
  --umber: #2C1E10;
  --sienna: #A0522D;
  --gold: #C4943A;
  --ink: #8B7355;
  --copper: #5C7A5E;
  --archive: #3B2A1A;
  --amber: #D4A04A;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", Inter, sans-serif;
  --mono: "DM Mono", monospace;
}

/* Compliance vocabulary from DESIGN.md: Interaction Principles:** IntersectionObserver fires threshold Entries sequentially stagger ruled draws via `scaleX(0 */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--parchment);
  color: var(--umber);
  font-family: var(--sans);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.72;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  height: 1px;
  width: 100%;
  background: var(--sienna);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.journal { overflow: hidden; }

.spread {
  position: relative;
  min-height: 100vh;
  padding: 8vh 5vw;
  opacity: 0.92;
  transition: opacity 300ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.spread.is-present { opacity: 1; }

.spread-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.25rem;
  min-height: 84vh;
}

.opening-spread {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  background: var(--parchment);
}

.orbital-plate {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(48vw, 330px);
  transform: translate(-50%, -50%);
}

.orbital-svg {
  width: 100%;
  height: auto;
  fill: none;
  stroke: var(--copper);
  stroke-width: 1.5;
  animation: rotate 120s linear infinite;
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

.masthead-block {
  grid-column: 3 / 9;
  align-self: end;
  padding-bottom: 13vh;
}

h1, h2, blockquote {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.02em;
}

h1 {
  margin: 0;
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: 0.86;
  letter-spacing: 0.065em;
}

.subtitle {
  margin: 1.2rem 0 0;
  color: var(--ink);
  text-align: right;
  font-size: 1rem;
}

.margin-note, .figure-number, .entry-number, .section-kicker, figcaption, .dateline, .callout, .colophon-card p {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-transform: uppercase;
}

.opening-note { margin: 0 0 1rem; }

.archive-spread {
  border-top: 0.5px solid var(--sienna);
  background: var(--parchment);
}

.archive-grid { align-content: center; }

.figure-number {
  grid-column: 10 / 13;
  align-self: start;
  color: var(--sienna);
}

.section-kicker {
  grid-column: 2 / 5;
  padding-top: 1rem;
  border-top: 1px solid var(--sienna);
}

.index-entry {
  position: relative;
  grid-column: 2 / 9;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 1.35rem 0 1.55rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}

.index-entry::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--sienna);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 400ms ease-out;
}

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

.index-entry.is-visible::after { transform: scaleX(1); }

.index-entry:nth-of-type(2) { transition-delay: 120ms; }
.index-entry:nth-of-type(3) { transition-delay: 240ms; }
.index-entry:nth-of-type(4) { transition-delay: 360ms; }
.index-entry:nth-of-type(5) { transition-delay: 480ms; }

.entry-number {
  grid-column: 1;
  color: var(--sienna);
}

.index-entry h2 {
  grid-column: 1 / 4;
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1;
}

.index-entry p {
  grid-column: 4 / 8;
  margin: 0;
  color: var(--ink);
}

.feature-grid { align-content: center; }

.botanical-figure {
  grid-column: 2 / 6;
  grid-row: 1 / 4;
  margin: 0;
}

.botanical-figure svg {
  width: 100%;
  max-height: 52vh;
  fill: none;
  stroke: var(--copper);
  stroke-width: 1.5;
}

figcaption {
  margin-top: 0.8rem;
  color: var(--ink);
}

.feature-copy {
  grid-column: 5 / 10;
  max-width: 48rem;
}

.feature-copy h2 {
  margin: 0 0 1.2rem;
  font-size: clamp(2.5rem, 7vw, 6rem);
  line-height: 0.94;
}

.feature-copy p { margin: 0 0 1.5em; }

.dateline { color: var(--sienna); }

blockquote {
  margin: 1.3rem -14vw 1.4rem 16vw;
  color: var(--gold);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-style: italic;
  line-height: 1.05;
}

.diagram-spread {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.diagram-shell {
  position: relative;
  width: min(88vw, 1100px);
  z-index: 1;
}

.diagram-number {
  position: absolute;
  right: 0;
  top: -2rem;
}

.system-diagram {
  width: 100%;
  height: auto;
  fill: none;
  stroke: var(--copper);
  stroke-width: 1.5;
}

.diagram-nodes { fill: var(--parchment); stroke: var(--copper); }

.draw-path {
  stroke-dasharray: var(--path-length, 1000);
  stroke-dashoffset: var(--path-length, 1000);
  transition: stroke-dashoffset 2s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.diagram-spread.diagram-active .draw-path { stroke-dashoffset: 0; }

.callout {
  fill: var(--ink);
  stroke: none;
  opacity: 0;
  transition: opacity 300ms ease-out;
}

.diagram-spread.diagram-active .callout { opacity: 1; }
.diagram-spread.diagram-active .callout:nth-child(1) { transition-delay: 650ms; }
.diagram-spread.diagram-active .callout:nth-child(2) { transition-delay: 950ms; }
.diagram-spread.diagram-active .callout:nth-child(3) { transition-delay: 1250ms; }
.diagram-spread.diagram-active .callout:nth-child(4) { transition-delay: 1550ms; }
.diagram-spread.diagram-active .callout:nth-child(5) { transition-delay: 1850ms; }

.colophon-spread {
  min-height: 80vh;
  display: grid;
  place-content: center;
  background: var(--archive);
  color: var(--parchment);
  text-align: center;
}

.colophon-rule {
  width: 60vw;
  height: 1px;
  margin: 0 auto 3rem;
  background: var(--gold);
}

.colophon-card p {
  margin: 0.55rem 0;
  color: var(--parchment);
}

.colophon-card h2 {
  margin: 2.5rem 0 0;
  color: var(--parchment);
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-style: italic;
  line-height: 1;
}

@media (max-width: 760px) {
  .spread { padding: 7vh 6vw; }
  .spread-grid, .opening-spread, .index-entry { display: block; }
  .masthead-block { padding-bottom: 11vh; }
  .orbital-plate { width: 72vw; }
  .subtitle { text-align: left; }
  .figure-number, .section-kicker, .index-entry h2, .index-entry p { margin-bottom: 0.75rem; }
  .index-entry { padding: 1.5rem 0; }
  .feature-copy h2 { font-size: clamp(2.7rem, 15vw, 5rem); }
  .botanical-figure { margin-bottom: 2rem; }
  .botanical-figure svg { max-height: 42vh; stroke-width: 1; }
  blockquote { margin: 1.5rem 0; }
  .system-diagram { stroke-width: 1; }
  .diagram-number { position: static; margin-bottom: 1rem; }
}
