@font-face {
  font-family: "Garden Sans";
  src: url("assets/fonts/manrope-cyrillic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Garden Serif";
  src: url("assets/fonts/literata-cyrillic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal italic;
  font-display: swap;
}

:root {
  --paper: #fff9ea;
  --paper-raised: #fffdf5;
  --paper-warm: #f6e8c8;
  --ink: #23382b;
  --ink-muted: #526458;
  --ink-faint: #718074;
  --accent: #376b45;
  --accent-active: #285637;
  --on-accent: #fffdf5;
  --line: #c9cbb6;
  --line-strong: #8f9987;
  --sun: #efbb50;
  --sky: #dcefe2;
  --petal: #e56c4a;
  --soil: #9b6a49;
  --water: #77b7b7;
  --shadow: rgb(58 62 47 / .15);
  --shadow-strong: rgb(44 49 37 / .24);
  --wash: rgb(255 253 245 / .78);
  --wash-solid: rgb(255 253 245 / .94);
  --focus: #174c2b;
  --error: #a23c2b;
  --selection: #c8dfa9;
  --font-sans: "Garden Sans", system-ui, sans-serif;
  --font-serif: "Garden Serif", Georgia, serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --radius: .55rem;
  --nav-height: 4.5rem;
  --copy-width: min(35rem, 38vw);
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 20rem;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(.98rem, .35vw + .9rem, 1.12rem);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--selection); color: var(--ink); }

a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .2em; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: .18rem solid var(--focus);
  outline-offset: .25rem;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: .75rem;
  left: .75rem;
  padding: .7rem 1rem;
  transform: translateY(-180%);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  transition: transform .18s var(--ease);
}

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

.site-nav {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 clamp(1.2rem, 4vw, 4.75rem);
  background: linear-gradient(to bottom, var(--paper-raised), transparent);
  pointer-events: none;
}

.site-nav a { pointer-events: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -.02em;
}

.brand svg {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.nav-links { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.5rem); }
.nav-links a { font-size: .82rem; font-weight: 650; text-decoration: none; }
.nav-links a:not(.nav-cta) { border-bottom: 1px solid transparent; }
.nav-links a:not(.nav-cta):hover { border-color: currentColor; }

.nav-cta {
  min-height: 2.65rem;
  display: inline-flex;
  align-items: center;
  padding: .55rem .95rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  transition: background .22s var(--ease), color .22s var(--ease), transform .22s var(--ease);
}

.nav-cta:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }

.story-rail {
  position: fixed;
  z-index: 45;
  right: clamp(1rem, 2.5vw, 2.75rem);
  top: 50%;
  display: grid;
  justify-items: center;
  gap: .65rem;
  transform: translateY(-50%);
  color: var(--ink-muted);
  font-size: .68rem;
  font-style: normal;
  letter-spacing: .08em;
}

.rail-line { position: relative; width: 1px; height: 9rem; background: var(--line); overflow: hidden; }
.rail-fill { position: absolute; inset: 0; background: var(--accent); transform: scaleY(0); transform-origin: top; }
.rail-count { writing-mode: vertical-rl; display: flex; gap: .2rem; }
.rail-count b { color: var(--ink); font-style: normal; }
.rail-count i { font-style: normal; }

.scene {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(80% 62% at 68% 22%, var(--paper-raised) 0 20%, transparent 68%),
    linear-gradient(to bottom, var(--paper) 0 42%, var(--sky) 72%, var(--paper-warm));
}

#garden-canvas { display: block; width: 100%; height: 100%; }

.scene-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(125% 96% at 52% 42%, transparent 44%, var(--shadow) 120%);
  opacity: .38;
}

.paper-grain {
  position: absolute;
  z-index: 60;
  inset: 0;
  pointer-events: none;
  opacity: .075;
  background-image:
    radial-gradient(circle at 18% 22%, var(--ink) 0 .5px, transparent .7px),
    radial-gradient(circle at 72% 63%, var(--ink) 0 .5px, transparent .7px);
  background-size: 7px 9px, 11px 13px;
  transform: rotate(.001deg);
}

.bee-cursor {
  position: fixed;
  z-index: 70;
  width: 1.9rem;
  height: 1.4rem;
  left: 0;
  top: 0;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-4rem, -4rem, 0);
}

.bee-body {
  position: absolute;
  inset: .38rem .2rem .2rem;
  border: 1px solid var(--ink);
  border-radius: 48% 55% 50% 48%;
  background: repeating-linear-gradient(90deg, var(--sun) 0 .34rem, var(--ink) .35rem .5rem);
}

.bee-wing { position: absolute; top: 0; width: .8rem; height: .62rem; border: 1px solid var(--ink); border-radius: 70% 30% 70% 30%; background: var(--wash); }
.bee-wing-a { left: .25rem; transform: rotate(-20deg); }
.bee-wing-b { right: .25rem; transform: scaleX(-1) rotate(-20deg); }

main { position: relative; z-index: 10; }

.chapter {
  position: relative;
  min-height: 135svh;
  padding: var(--nav-height) clamp(1.25rem, 7vw, 7rem) 18svh;
  display: grid;
  align-items: start;
  pointer-events: none;
}

.chapter::before { content: ""; min-height: 16svh; }
.chapter-copy {
  width: var(--copy-width);
  position: sticky;
  top: 17svh;
  isolation: isolate;
  pointer-events: auto;
}
.chapter-copy-left { justify-self: start; }
.chapter-copy-right { justify-self: end; }
.chapter-copy-center { justify-self: center; width: min(48rem, 72vw); text-align: center; top: 12svh; }

.chapter-copy > * {
  opacity: 0;
  transform: translate3d(0, 1.1rem, 0);
  transition: opacity .48s var(--ease), transform .6s var(--ease), filter .6s var(--ease);
}

.chapter.is-active .chapter-copy > * { opacity: 1; transform: translate3d(0, 0, 0); }
.chapter.is-retiring .chapter-copy > * { opacity: 0; transform: translate3d(0, 8vh, 0) scale(.98); filter: blur(18px); }
.chapter-copy > :nth-child(2) { transition-delay: 60ms; }
.chapter-copy > :nth-child(3) { transition-delay: 120ms; }
.chapter-copy > :nth-child(4) { transition-delay: 180ms; }

.chapter-hero { min-height: 145svh; }
.chapter-hero .chapter-copy { top: 17svh; }
.chapter-hero .chapter-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -2.5rem -5rem -3rem -2.5rem;
  pointer-events: none;
  background: linear-gradient(90deg, var(--paper-raised) 0 63%, transparent 100%);
  filter: blur(.01px);
}
.chapter-final { min-height: 150svh; padding-bottom: 6rem; }

.eyebrow {
  margin: 0 0 1rem;
  color: var(--ink-muted);
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .13em;
  line-height: 1.3;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  font-weight: 720;
  letter-spacing: -.055em;
  line-height: .98;
  text-wrap: balance;
}

h1 { max-width: 13ch; font-size: clamp(3.2rem, 5.8vw, 6.8rem); }
h2 { font-size: clamp(2.5rem, 4.4vw, 5.5rem); }
h1 + p, h2 + p { margin-top: 1.55rem; }
h1 em, h2 em { font-family: var(--font-serif); font-weight: 500; color: var(--accent); }

p { max-width: 37rem; }
.lead { max-width: 31rem; font-size: clamp(1.05rem, .45vw + .95rem, 1.32rem); color: var(--ink-muted); }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.9rem; }
.button {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: .72rem 1.15rem;
  color: var(--ink);
  background: var(--paper-raised);
  cursor: pointer;
  font-weight: 720;
  text-decoration: none;
  transition: transform .22s var(--ease), background .22s var(--ease), color .22s var(--ease), box-shadow .22s var(--ease);
}

.button:hover { transform: translateY(-2px); box-shadow: 0 .42rem 1rem var(--shadow); }
.button:active { transform: translateY(0); box-shadow: none; }
.button-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button-primary:hover { background: var(--accent-active); }
.button-quiet { background: transparent; }

.scroll-cue { margin-top: clamp(3rem, 8vh, 6.5rem); color: var(--ink-muted); font-size: .78rem; font-weight: 650; }
.scroll-cue span { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-right: .35rem; border: 1px solid var(--line-strong); border-radius: 50%; }

.paper-note, .form-sheet {
  padding: clamp(1.35rem, 2.6vw, 2.5rem);
  background: var(--wash-solid);
  border: 1px solid var(--line);
  box-shadow: .6rem .8rem 2rem var(--shadow);
  transform: rotate(-.45deg);
}

.paper-note blockquote {
  margin: 0 0 1.6rem;
  padding: 0 0 1.1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 1.1vw, 1.55rem);
  font-style: italic;
}

.small-steps { counter-reset: step; display: grid; gap: .7rem; margin: 1.6rem 0 0; padding: 0; list-style: none; }
.small-steps li { display: grid; grid-template-columns: 7.2rem 1fr; gap: 1rem; border-top: 1px solid var(--line); padding-top: .65rem; }
.small-steps span { font-weight: 720; }
.small-steps small { color: var(--ink-muted); }

.margin-note { max-width: 24rem; margin-top: 2rem; padding-left: 1rem; border-left: .15rem solid var(--accent); color: var(--ink-muted); font-family: var(--font-serif); font-style: italic; }

.care-list { margin: 1.7rem 0 0; }
.care-list div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: .62rem 0; border-top: 1px solid var(--line); }
.care-list dt { font-weight: 750; }
.care-list dd { margin: 0; color: var(--ink-muted); }

.chapter-wide .chapter-copy { padding-top: 1rem; }
.chapter-wide h2 { font-size: clamp(3rem, 6vw, 7.4rem); }
.chapter-wide p:not(.eyebrow) { margin-inline: auto; }

.works-copy { top: 10svh; }
.work-list { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-top: 1.4rem; }
.work-fruit {
  min-height: 5.3rem;
  display: grid;
  align-content: center;
  gap: .2rem;
  padding: .75rem .9rem;
  border: 1px solid var(--line-strong);
  border-radius: 42% 48% 44% 46% / 46% 41% 52% 43%;
  background: var(--paper-raised);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform .28s var(--ease), background .28s var(--ease), box-shadow .28s var(--ease);
}
.work-fruit:nth-child(even) { border-radius: 47% 43% 50% 42% / 42% 49% 44% 52%; }
.work-fruit:hover, .work-fruit:focus-visible { transform: translateY(-.22rem) rotate(-.5deg); background: var(--paper-warm); box-shadow: 0 .5rem 1.1rem var(--shadow); }
.work-fruit span { font-weight: 760; line-height: 1.2; }
.work-fruit small { color: var(--ink-muted); }

.form-sheet { width: min(38rem, 43vw); top: 6svh; transform: rotate(.35deg); background: var(--paper-raised); }
.form-sheet h2 { font-size: clamp(2.6rem, 4vw, 4.8rem); }
form { margin-top: 1.5rem; }
.field { display: grid; gap: .4rem; margin-bottom: 1rem; }
.field label { font-size: .8rem; font-weight: 760; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: .78rem .85rem;
  background: var(--paper-raised);
  color: var(--ink);
  resize: vertical;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 .18rem var(--selection); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field-hint, .field-error { min-height: 1em; font-size: .7rem; line-height: 1.35; }
.field-hint { color: var(--ink-muted); }
.field-error { color: var(--error); }
.submit-button { width: 100%; margin-top: .35rem; }
.form-status { min-height: 1.4em; margin: .7rem 0 0; color: var(--accent); font-size: .78rem; font-weight: 700; }
.privacy-note { margin: .35rem 0 0; color: var(--ink-muted); font-size: .68rem; }

.site-footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.3rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: .72rem; }

.case-dialog {
  width: min(38rem, calc(100vw - 2rem));
  max-height: min(42rem, calc(100svh - 2rem));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) * 1.5);
  padding: clamp(1.4rem, 3vw, 2.5rem);
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: 0 1.25rem 4rem var(--shadow-strong);
}
.case-dialog::backdrop { background: var(--shadow-strong); }
.case-dialog h2 { margin-bottom: 1.3rem; font-size: clamp(2rem, 4vw, 3.6rem); }
.case-dialog h3 { margin: 1.2rem 0 .35rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.case-dialog p { color: var(--ink-muted); }
.dialog-close { position: absolute; right: 1rem; top: 1rem; width: 2.75rem; height: 2.75rem; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; font-size: 1.5rem; }
.dialog-done { margin-top: 1.2rem; }

.no-js .scene, .no-js .story-rail { display: none; }
.no-js .chapter { min-height: auto; padding-block: 5rem; background: var(--paper); }
.no-js .chapter-copy { position: relative; top: auto; }
.no-js .chapter-copy > * { opacity: 1; transform: none; }
.no-js-poster { position: relative; z-index: 5; max-width: 32rem; margin: 6rem auto 1rem; padding: 1rem; }
.no-js-poster img { display: block; width: 100%; height: auto; }

@media (pointer: fine) {
  .js .bee-cursor { opacity: 1; }
}

@media (min-width: 821px) {
  .chapter:not(.chapter-hero) .chapter-copy-left:not(.paper-note)::before,
  .chapter .chapter-copy-right:not(.paper-note):not(.form-sheet)::before,
  .chapter .chapter-copy-center::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -2rem -4rem -2.4rem;
    pointer-events: none;
  }

  .chapter:not(.chapter-hero) .chapter-copy-left:not(.paper-note)::before {
    background: linear-gradient(90deg, var(--wash-solid) 0 68%, transparent 100%);
  }

  .chapter .chapter-copy-right:not(.paper-note):not(.form-sheet)::before {
    background: linear-gradient(270deg, var(--wash-solid) 0 68%, transparent 100%);
  }

  .chapter .chapter-copy-center::before {
    inset-inline: -7rem;
    background: radial-gradient(ellipse at center, var(--wash-solid) 0 58%, transparent 100%);
  }
}

@media (max-width: 820px) {
  :root { --nav-height: 3.8rem; --copy-width: min(100%, 31rem); }
  .site-nav { padding-inline: 1rem; }
  .brand svg { width: 1.75rem; height: 1.75rem; }
  .nav-links > a:not(.nav-cta) { display: none; }
  .nav-cta { min-height: 2.5rem; padding-inline: .78rem; }
  .story-rail { right: .55rem; }
  .rail-line { height: 5rem; }
  .rail-count { display: none; }
  .chapter {
    min-height: 138svh;
    padding: var(--nav-height) 1.2rem 14svh;
    align-items: start;
  }
  .chapter::before { min-height: 46svh; }
  .chapter-copy, .chapter-hero .chapter-copy, .works-copy, .form-sheet {
    width: min(100%, 31rem);
    top: auto;
    position: relative;
    justify-self: start;
  }
  .chapter:not(.chapter-hero) .chapter-copy:not(.paper-note):not(.form-sheet)::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -1.2rem -1.2rem -1.4rem;
    pointer-events: none;
    background: linear-gradient(
      to bottom,
      transparent,
      var(--wash-solid) 1.15rem,
      var(--wash-solid) calc(100% - 1.35rem),
      transparent
    );
  }
  .chapter-copy-right { justify-self: end; }
  .chapter-copy-center { width: 100%; text-align: left; }
  .chapter-hero { min-height: 146svh; padding-top: 15svh; }
  .chapter-hero::before { display: none; }
  .chapter-hero .chapter-copy { max-width: 29rem; margin-top: 0; }
  .chapter-hero .chapter-copy::before {
    inset: -1.4rem -1rem -2rem;
    background: linear-gradient(to bottom, var(--paper-raised) 0 76%, transparent 100%);
  }
  .chapter-works { min-height: 168svh; }
  .chapter-final { min-height: max(192svh, 64rem); }
  .chapter-final::before { min-height: 38svh; }
  .chapter-wide::before, .chapter-works::before { min-height: 43svh; }
  h1 { font-size: clamp(3rem, 14vw, 4.5rem); }
  h2, .chapter-wide h2 { font-size: clamp(2.6rem, 12vw, 4rem); }
  .lead { max-width: 27rem; }
  .paper-note, .form-sheet { padding: 1.25rem; transform: none; }
  .paper-note { margin-top: -8svh; }
  .form-sheet { box-shadow: 0 .8rem 2rem var(--shadow); }
  .work-list { grid-template-columns: 1fr 1fr; }
  .site-footer { flex-direction: column; }
  .paper-grain { opacity: .045; }
}

@media (max-width: 420px) {
  body { font-size: .98rem; }
  .chapter { padding-inline: 1rem; }
  .chapter:not(.chapter-hero) .chapter-copy:not(.paper-note):not(.form-sheet)::before { inset-inline: -1rem; }
  .chapter::before { min-height: 47svh; }
  .chapter-wide::before, .chapter-works::before { min-height: 44svh; }
  .chapter-final::before { min-height: 38svh; }
  .chapter-hero .lead { color: var(--ink-muted); }
  .work-list { grid-template-columns: 1fr; }
  .work-fruit { min-height: 4.4rem; border-radius: var(--radius); }
  .actions { display: grid; grid-template-columns: 1fr; }
  .button { width: 100%; }
  .scroll-cue { margin-top: 2.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .chapter-copy > *, .chapter.is-retiring .chapter-copy > * { opacity: 1; transform: none; filter: none; }
  .bee-cursor { display: none; }
}

@media (prefers-contrast: more) {
  :root { --line: var(--ink-muted); --line-strong: var(--ink); }
  .scene-atmosphere, .paper-grain { display: none; }
}

@media print {
  .scene, .site-nav, .story-rail { display: none; }
  .chapter { min-height: auto; break-inside: avoid; padding: 2rem 0; }
  .chapter-copy { position: static; width: 100%; }
  .chapter-copy > * { opacity: 1; transform: none; }
}
