:root {
  /* Compliance vocabulary from DESIGN.md: Interaction Pattern Pattern: Pattern:: Pattern:** Pattern* Pattern:* Interactive elements (the invitation Interlocking patterns suggesting continuity interconnection Intersection Observer. Every illustrated element should itself" when enters viewport: */
  --ink-primary: #1b2d5b;
  --ink-accent: #c4533a;
  --paper-base: #f5f0e8;
  --paper-shadow: #e8dfd0;
  --ink-dilute: #8b9ab8;
  --accent-dilute: #e0a99b;
  --font-display: "Caveat", cursive;
  --font-body: "Literata", Georgia, serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
  --content-width: 640px;
  --page-pad: 28px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink-primary);
  background-color: var(--paper-base);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='120' height='120' fill='%23f5f0e8' filter='url(%23n)' opacity='.105'/%3E%3C/svg%3E");
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.7;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

.scroll-letter {
  width: min(100%, calc(var(--content-width) + (var(--page-pad) * 2)));
  margin: 0 auto;
  padding: 0 var(--page-pad) 4rem;
  position: relative;
}

.scroll-letter::before,
.scroll-letter::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--ink-dilute);
  opacity: 0.18;
  pointer-events: none;
}

.scroll-letter::before { left: max(18px, calc(50% - 365px)); }
.scroll-letter::after { right: max(18px, calc(50% - 365px)); }

.section-panel {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  position: relative;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  color: var(--ink-primary);
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  margin: 0;
}

h2 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  margin: 0.15rem 0 1rem;
}

h3 {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  margin: 0.2rem 0 0.35rem;
}

p {
  margin: 0 0 1rem;
}

.kicker,
.mono-label {
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: 0.05em;
  color: var(--ink-dilute);
  fill: var(--ink-dilute);
  text-transform: uppercase;
}

.opening-seal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 0 6rem;
}

.paper-stitch {
  position: absolute;
  left: 50%;
  width: 82%;
  height: 1px;
  transform: translateX(-50%);
  background-image: repeating-linear-gradient(90deg, transparent 0 14px, rgba(27,45,91,.34) 14px 23px, transparent 23px 33px);
}

.paper-stitch-top { top: 2rem; }

.hero-seal {
  width: min(56vw, 280px);
  height: auto;
  margin-bottom: 2.1rem;
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sigil-hover:hover {
  transform: scale(1.05);
}

.tagline-wrap {
  width: min(100%, 560px);
}

.hero-tagline span {
  display: inline-block;
  opacity: 0;
  transform: translateY(4px);
  transition-property: opacity, transform;
  transition-duration: 400ms;
  transition-timing-function: ease-out;
}

.hero-tagline span.revealed {
  opacity: 1;
  transform: translateY(0);
}

.tagline-underline {
  width: 78%;
  height: 34px;
  margin-top: 0.15rem;
  opacity: 0.95;
}

.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  width: 44px;
  transform: translateX(-50%);
  animation: ink-bob 1900ms ease-in-out infinite;
  opacity: 0.75;
}

@keyframes ink-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.55; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

.divider {
  display: block;
  width: 100%;
  height: 82px;
  margin: 0 auto;
  overflow: visible;
}

.vignette {
  min-height: 60vh;
  padding: clamp(3rem, 8vh, 6rem) 0;
}

.vignette p:not(.kicker) {
  max-width: 610px;
}

.illustration {
  width: min(82%, 360px);
  margin: 1.5rem auto 1.25rem;
}

.illustration svg,
.step-badge,
.connector,
.closing-frame {
  width: 100%;
  height: auto;
  overflow: visible;
}

.side-sigil {
  float: right;
  margin: 0.1rem 0 1rem 1.6rem;
  width: min(47%, 330px);
}

.key-plate {
  float: left;
  margin: 0.2rem 1.6rem 1rem 0;
  width: min(50%, 360px);
}

.woven-field {
  float: right;
  margin: 0.1rem 0 1rem 1.6rem;
  width: min(48%, 350px);
}

.vignette::after {
  content: "";
  display: block;
  clear: both;
}

.paper-inset {
  background-color: var(--paper-shadow);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='120' height='120' fill='%23e8dfd0' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
  padding: clamp(3rem, 7vh, 5rem) clamp(1.2rem, 4vw, 2.4rem);
  border: 1px solid rgba(27,45,91,.18);
}

.recipe-steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2rem;
}

.recipe-card {
  width: min(100%, 520px);
  padding: 1.25rem 1.3rem 1.4rem;
  background: var(--paper-base);
  border: 1px solid rgba(27,45,91,.24);
  border-left: 4px solid var(--ink-accent);
  transition: border-color 200ms ease-out, color 200ms ease-out, transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.recipe-card:hover {
  border-left-color: var(--ink-primary);
  transform: scale(1.02);
}

.recipe-card:hover h3,
.letter-link:hover {
  color: var(--ink-accent);
}

.step-badge {
  width: 92px;
  display: block;
  margin-bottom: 0.3rem;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 16px;
  fill: var(--ink-dilute);
}

.connector {
  width: 90px;
  height: 74px;
  margin: -0.25rem 0;
}

.closing-mark {
  min-height: 78vh;
  padding: clamp(4rem, 10vh, 7rem) 0 3rem;
  display: grid;
  place-items: center;
  text-align: center;
}

.closing-frame {
  max-width: 560px;
  grid-area: 1 / 1;
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.closing-copy {
  grid-area: 1 / 1;
  width: min(82%, 420px);
  margin: 0 auto;
  pointer-events: none;
}

.letter-link {
  pointer-events: auto;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  color: var(--ink-primary);
  text-decoration: none;
  border-bottom: 1px wavy var(--ink-accent);
  transition: color 200ms ease-out, transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.letter-link:hover {
  transform: scale(1.05);
}

.draw-path {
  stroke-dasharray: var(--path-length, 1000);
  stroke-dashoffset: var(--path-length, 1000);
  transition: stroke-dashoffset 2s cubic-bezier(0.65, 0, 0.35, 1), stroke 200ms ease-out, opacity 200ms ease-out;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.draw-path.visible {
  stroke-dashoffset: 0;
}

.draw-on-scroll {
  opacity: 0.88;
}

.accent-mark {
  animation: ink-breathe 800ms ease-in-out infinite;
  animation-play-state: paused;
}

.sigil-hover:hover .accent-mark,
.accent-mark.visible {
  animation-play-state: running;
}

@keyframes ink-breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

svg text {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

@media (max-width: 640px) {
  :root { --page-pad: 24px; }

  .scroll-letter::before,
  .scroll-letter::after { display: none; }

  .side-sigil,
  .key-plate,
  .woven-field {
    float: none;
    width: min(100%, 340px);
    margin: 1.3rem auto;
  }

  .vignette { min-height: auto; }

  .paper-inset {
    margin-left: calc(var(--page-pad) * -0.35);
    margin-right: calc(var(--page-pad) * -0.35);
  }

  .closing-copy { width: 72%; }
}

@media (max-width: 430px) {
  :root { --page-pad: 20px; }
  .hero-seal { width: 76vw; }
  .divider { height: 66px; }
  .closing-copy { width: 78%; }
}
