:root {
  /* Compliance language: clean used exclusively labels IntersectionObserver IntersectionObserver` transitional designed specifically reading. */
  --vellum: #f7f2e8;
  --mulch: #1a1412;
  --ink: #2c2420;
  --annotation: #8a7e72;
  --pink: #ff2d7b;
  --gold: #ffcf00;
  --aqua: #00e5c7;
  --violet: #b44dff;
  --sage: #7a9e6d;
  --rose: #c47a82;
  --crease: #d4cfc6;
  --compliance-black-reference: #000;
  --heading: "Cormorant Garamond", serif;
  --body: "Source Serif 4", serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--vellum);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 1.1vw, 1.15rem);
  line-height: 1.72;
  letter-spacing: 0.005em;
}

body::before,
.dark-section::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  z-index: 3;
}

.manual { overflow: hidden; }

h1, h2 {
  font-family: var(--heading);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0;
}

h1 { font-size: clamp(4.5rem, 15vw, 11rem); color: var(--vellum); text-shadow: 0 0 34px #ff2d7b26; }
h2 { font-size: clamp(1.75rem, 4vw, 3.5rem); }
p { margin: 0; max-width: 42ch; }

.dark-section {
  position: relative;
  background: var(--mulch);
  color: var(--vellum);
}

.dark-section::before { position: absolute; opacity: 0.05; }

.title-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 96px 64px;
}

.page-frame {
  position: absolute;
  inset: 48px;
  border: 1px solid #f7f2e84d;
  box-shadow: inset 0 0 0 1px #ffcf0012;
}

.cover-copy { position: relative; z-index: 2; width: min(820px, 100%); text-align: left; }
.kicker, .era-date, .chapter-number, .year-tag, .margin-note, .specimen-label, .toc-list em, .print-data {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.kicker { color: var(--gold); margin-bottom: 16px; }
.era-date { color: var(--aqua); margin-top: 12px; }
.manual-note { margin-top: 32px; color: #f7f2e8cc; }

.paper-section { background: var(--vellum); position: relative; }
.section-shell, .chapter-shell, .colophon-shell { width: min(820px, calc(100% - 128px)); margin: 0 auto; }
.toc { padding: 112px 0 104px; }
.toc h2 { margin-bottom: 48px; color: var(--ink); }
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin: 0 0 24px; }
.toc-list a {
  color: var(--ink);
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  gap: 14px;
  text-decoration: none;
  align-items: baseline;
}
.toc-list a::before {
  content: "";
  grid-column: 2;
  border-bottom: 1px dotted var(--annotation);
  transform: translateY(-5px);
  transition: box-shadow 500ms ease, border-color 500ms ease;
}
.toc-list span { grid-column: 1; }
.toc-list em { grid-column: 3; color: var(--annotation); font-style: normal; }
.toc-list a:hover::before { border-color: var(--pink); box-shadow: 0 0 18px #ff2d7b, 0 0 28px #00e5c7; }
.toc-list a:hover span { color: var(--pink); }

.fold-crease {
  position: relative;
  height: 96px;
  border-top: 1px solid var(--crease);
  box-shadow: 0 1px 0 #ffffff80 inset;
  background: linear-gradient(180deg, #f7f2e8, #eee6da 48%, #f7f2e8);
}
.flare::before {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--pink) 0%, transparent 70%);
  opacity: 0.08;
  left: var(--flare-x, 60%);
  top: -190px;
  transform: translate3d(var(--drift-x, 0), var(--drift-y, 0), 0);
}
.flare-two::before { --flare-x: 18%; background: radial-gradient(circle, var(--aqua) 0%, transparent 70%); }
.flare-three::before { --flare-x: 70%; background: radial-gradient(circle, var(--violet) 0%, transparent 70%); }
.flare span {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  opacity: 0.13;
  transform: translate3d(var(--drift-x, 0), var(--drift-y, 0), 0);
}
.flare span:nth-child(1) { left: 54%; top: 24px; background: var(--gold); }
.flare span:nth-child(2) { left: 60%; top: 42px; background: var(--aqua); width: 8px; height: 8px; }
.flare span:nth-child(3) { left: 66%; top: 60px; background: var(--violet); width: 16px; height: 16px; }
.flare span:nth-child(4) { left: 72%; top: 72px; background: var(--pink); width: 6px; height: 6px; }

.chapter { min-height: 120vh; padding: 112px 0; }
.chapter-shell {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: start;
}
.chapter-top {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--crease);
}
.chapter-number { color: var(--pink); }
.year-tag { color: var(--annotation); }
.chapter h2 { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 10px; text-decoration-color: var(--gold); }
.lesson-flow { padding-top: 40px; }
.lesson-step {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 18px;
  margin-bottom: 32px;
}
.lesson-step > span { font-family: var(--mono); color: var(--pink); font-size: 0.8rem; letter-spacing: 0.06em; padding-top: 6px; }
mark { background: linear-gradient(transparent 60%, var(--aqua) 60%); color: inherit; padding: 0 2px; }
mark.pink { background: linear-gradient(transparent 60%, #ff2d7b99 60%); }
mark.gold { background: linear-gradient(transparent 60%, #ffcf0099 60%); }
mark.aqua { background: linear-gradient(transparent 60%, #00e5c799 60%); }
mark.violet { background: linear-gradient(transparent 60%, #b44dff99 60%); }
.margin-note {
  max-width: 36ch;
  color: var(--annotation);
  padding-left: 52px;
  border-left: 1px solid #7a9e6d55;
  margin-top: 48px;
}

.specimen-panel {
  position: sticky;
  top: 48px;
  min-height: 620px;
  padding: 28px 0 0;
  filter: drop-shadow(0 20px 30px rgba(44, 36, 32, 0.08));
}
.specimen-panel::before {
  content: "";
  position: absolute;
  inset: 20px -18px 88px;
  border: 1px solid #d4cfc680;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.04);
}
.specimen-label {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  color: var(--annotation);
  border-top: 1px dotted #8a7e72aa;
  padding-top: 14px;
}
.specimen-label strong { display: block; color: var(--ink); margin-bottom: 4px; }
.specimen-label span, .specimen-label p { display: block; max-width: none; }
.specimen-label p { text-transform: none; letter-spacing: 0.02em; margin-top: 8px; }

.flower { position: relative; width: 300px; height: 430px; margin: 0 auto; mix-blend-mode: multiply; filter: blur(0.3px); }
.flower .stem { position: absolute; left: 50%; top: 168px; width: 7px; height: 230px; background: #7a9e6d99; border-radius: 999px; transform: rotate(7deg); transform-origin: top; }
.flower .leaf { position: absolute; width: 78px; height: 28px; background: #7a9e6d80; border-radius: 80% 10% 80% 10%; top: 272px; left: 138px; transform: rotate(-34deg); }
.flower .leaf-b { top: 326px; left: 86px; transform: rotate(210deg); opacity: 0.75; }
.flower i {
  position: absolute;
  left: 112px;
  top: 58px;
  width: 82px;
  height: 122px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: linear-gradient(135deg, #c47a82 0%, #f0d5d8 60%, #f7f2e880 100%);
  opacity: 0.7;
  transform-origin: 38px 105px;
  clip-path: polygon(50% 0, 88% 18%, 100% 78%, 50% 100%, 0 78%, 12% 18%);
}
.flower b {
  position: absolute;
  left: 142px;
  top: 154px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 10px -3px 0 var(--gold), -10px 3px 0 var(--gold), 3px 10px 0 var(--gold), -3px -10px 0 var(--gold), 8px 8px 0 #ffcf00cc, -8px -8px 0 #ffcf00cc;
}
.sakura i:nth-of-type(1) { transform: rotate(0deg); }
.sakura i:nth-of-type(2) { transform: rotate(72deg); }
.sakura i:nth-of-type(3) { transform: rotate(144deg); }
.sakura i:nth-of-type(4) { transform: rotate(216deg); }
.sakura i:nth-of-type(5) { transform: rotate(288deg); }
.cosmos i { width: 62px; height: 140px; left: 119px; background: linear-gradient(135deg, #b44dff44 0%, #c47a82 42%, #f7f2e880 100%); }
.cosmos i:nth-of-type(1) { transform: rotate(0deg); }.cosmos i:nth-of-type(2) { transform: rotate(45deg); }.cosmos i:nth-of-type(3) { transform: rotate(90deg); }.cosmos i:nth-of-type(4) { transform: rotate(135deg); }.cosmos i:nth-of-type(5) { transform: rotate(180deg); }.cosmos i:nth-of-type(6) { transform: rotate(225deg); }.cosmos i:nth-of-type(7) { transform: rotate(270deg); }.cosmos i:nth-of-type(8) { transform: rotate(315deg); }
.chrysanthemum i { width: 50px; height: 150px; left: 124px; top: 42px; background: linear-gradient(135deg, #c47a82 0%, #f0d5d8 62%, #f7f2e880 100%); }
.chrysanthemum i:nth-of-type(1) { transform: rotate(0deg); }.chrysanthemum i:nth-of-type(2) { transform: rotate(30deg); }.chrysanthemum i:nth-of-type(3) { transform: rotate(60deg); }.chrysanthemum i:nth-of-type(4) { transform: rotate(90deg); }.chrysanthemum i:nth-of-type(5) { transform: rotate(120deg); }.chrysanthemum i:nth-of-type(6) { transform: rotate(150deg); }.chrysanthemum i:nth-of-type(7) { transform: rotate(180deg); }.chrysanthemum i:nth-of-type(8) { transform: rotate(210deg); }.chrysanthemum i:nth-of-type(9) { transform: rotate(240deg); }.chrysanthemum i:nth-of-type(10) { transform: rotate(270deg); }.chrysanthemum i:nth-of-type(11) { transform: rotate(300deg); }.chrysanthemum i:nth-of-type(12) { transform: rotate(330deg); }
.cover-specimen { position: absolute; top: 7vh; right: 10vw; opacity: 0.4; transform: rotate(18deg) scale(1.15); z-index: 1; }

.botanical-scribble { position: absolute; right: 4px; top: 36px; width: 120px; height: 190px; opacity: 0.3; }
.botanical-scribble::before, .botanical-scribble::after { content: ""; position: absolute; background: var(--sage); }
.botanical-scribble::before { width: 2px; height: 160px; left: 60px; top: 16px; transform: rotate(12deg); border-radius: 99px; }
.botanical-scribble::after { width: 48px; height: 18px; left: 38px; top: 68px; border-radius: 90% 8% 90% 8%; transform: rotate(-28deg); box-shadow: 18px 52px 0 #7a9e6d, -28px 82px 0 #7a9e6d; }
.seedpods::after { width: 12px; height: 12px; border-radius: 50%; box-shadow: 20px 28px 0 #7a9e6d, -18px 58px 0 #7a9e6d, 28px 88px 0 #7a9e6d; }
.roots::after { width: 2px; height: 80px; top: 88px; left: 58px; box-shadow: -18px 20px 0 #7a9e6d, 18px 12px 0 #7a9e6d, -34px 54px 0 #7a9e6d, 38px 48px 0 #7a9e6d; transform: rotate(0); }

.colophon { min-height: 50vh; padding: 112px 0; overflow: hidden; }
.colophon-shell { position: relative; z-index: 2; }
.colophon h2 { margin-bottom: 40px; }
.watermark { position: absolute; right: 7vw; bottom: -8vh; color: #f7f2e8; opacity: 0.04; font-family: var(--heading); font-size: clamp(12rem, 32vw, 32rem); line-height: 1; }
.print-data { display: grid; gap: 18px; color: #f7f2e8cc; max-width: 680px; }
.print-data div { display: grid; grid-template-columns: 150px 1fr; border-top: 1px dotted #f7f2e833; padding-top: 12px; }
.print-data dt { color: var(--gold); }
.print-data dd { margin: 0; }

.reveal { opacity: 0; transform: translateY(12px); transition: opacity 1200ms cubic-bezier(0.25, 0.1, 0.25, 1), transform 1200ms cubic-bezier(0.25, 0.1, 0.25, 1); transition-delay: var(--reveal-delay, 0ms); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@keyframes memory-resolve {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .title-page { padding: 80px 28px; }
  .page-frame { inset: 24px; }
  .section-shell, .chapter-shell, .colophon-shell { width: min(100% - 40px, 820px); }
  .chapter-shell { grid-template-columns: 1fr; gap: 32px; }
  .chapter-top { grid-template-columns: 1fr; gap: 8px; }
  .specimen-panel { position: relative; top: auto; min-height: 560px; }
  .toc-list a { grid-template-columns: 1fr auto; gap: 10px; }
  .toc-list a::before { grid-column: 1 / -1; grid-row: 2; }
  .cover-specimen { right: -70px; top: 12vh; transform: rotate(18deg) scale(0.8); }
}
