/* ============================================================
   archetype.boo  ·  A Cottagecore Digital Herbarium
   Palette: Candy Meadow
   Required: #FF8A5C #7B6B5D #FFF8F0 #4ECDC4 #3B2F2F #E8E0D8 #A8B5A2 #2D5016
   Extended: #FF6B9D #FFD93D #6C5CE7

   Fonts loaded from "Lora" and Josefin Sans and Caveat via (Google Fonts).
   Scroll animations use IntersectionObserver. and requestAnimationFrame.
   ============================================================ */

/* -- Palette CSS variables --------------------------------- */
:root {
  --linen:        #FFF8F0;
  --ruled:        #E8E0D8;
  --ink:          #3B2F2F;
  --muted:        #7B6B5D;
  --sage:         #A8B5A2;
  --forest:       #2D5016;
  --bubblegum:    #FF6B9D;
  --spearmint:    #4ECDC4;
  --buttercup:    #FFD93D;
  --bluebell:     #6C5CE7;
  --tangerine:    #FF8A5C;

  --col-max:      680px;
  --col-pad:      80px;

  --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-soft:    cubic-bezier(0.25, 0.1, 0.25, 1);

  --font-display: 'Josefin Sans', 'Futura', 'Century Gothic', sans-serif;
  --font-body:    'Lora', Georgia, 'Times New Roman', serif;
  --font-hand:    'Caveat', 'Bradley Hand', cursive;
  --font-meta:    'Inter', 'Helvetica Neue', sans-serif;
}

/* -- Reset -------------------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 18px;
  /* no scroll-snap per DESIGN.md */
}

body {
  background-color: var(--linen);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.8;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* -- Fixed linen texture (warm off-white with faint weave) -- */
.linen-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.055;
  background-image:
    repeating-linear-gradient(0deg,  transparent 0, transparent 2px, rgba(123, 107, 93, 0.3) 2px, rgba(123, 107, 93, 0.3) 3px),
    repeating-linear-gradient(90deg, transparent 0, transparent 2px, rgba(123, 107, 93, 0.2) 2px, rgba(123, 107, 93, 0.2) 3px);
}

/* -- Fixed mountain silhouette background (3 layers) -------- */
.mountain-back {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  overflow: hidden;
}

.mountain-back svg {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ============================================================
   Vine progress indicator  (left edge, desktop)
   ============================================================ */
.vine-progress {
  position: fixed;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 100;
  pointer-events: none;
}

.vine-progress .vine-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.vine-progress .vine-trunk-bg,
.vine-progress .vine-trunk-fg {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vine-progress .vine-trunk-bg {
  stroke: var(--forest);
  stroke-width: 1.5;
  opacity: 0.15;
}

.vine-progress .vine-trunk-fg {
  stroke: var(--forest);
  stroke-width: 2;
  opacity: 0.75;
  /* stroke-dashoffset animated from script.js */
}

.vine-progress .vine-node {
  transform-box: fill-box;
  transform-origin: center center;
  opacity: 0.25;
  transition: opacity 0.5s var(--ease-soft);
}

.vine-progress .vine-node.active {
  opacity: 1;
}

.vine-progress .vine-leaf {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scale(0) rotate(-8deg);
  opacity: 0;
  transition:
    transform 0.75s var(--ease-elastic),
    opacity 0.4s var(--ease-soft);
}

.vine-progress .vine-leaf.active {
  transform: scale(1) rotate(-8deg);
  opacity: 0.9;
}

.vine-progress .vine-leaf.right {
  transform-origin: 50% 100%;
  transform: scale(0) rotate(8deg);
}
.vine-progress .vine-leaf.right.active {
  transform: scale(1) rotate(8deg);
}

.vine-progress .vine-flower {
  transform-box: fill-box;
  transform-origin: center center;
  transform: scale(0);
  opacity: 0;
  transition:
    transform 0.9s var(--ease-elastic),
    opacity 0.5s var(--ease-soft);
}

.vine-progress .vine-flower.active {
  transform: scale(1);
  opacity: 1;
}

.vine-progress .vine-label {
  position: absolute;
  left: 54px;
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.4s var(--ease-soft), transform 0.5s var(--ease-elastic);
  transform-origin: left center;
}

.vine-progress .vine-label.active {
  opacity: 0.8;
  transform: translateX(0);
}

/* -- Simple mobile progress bar (below-768px fallback) ------ */
.mobile-progress {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(168, 181, 162, 0.25);
  z-index: 100;
}

.mobile-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--forest);
  transition: width 0.15s linear;
}

/* ============================================================
   Section skeleton
   ============================================================ */
.scroll-ribbon {
  position: relative;
  z-index: 2;
}

.journal-entry {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 120px 20px 60px;
}

.entry-content {
  max-width: var(--col-max);
  width: 100%;
  margin: 0 auto;
  padding: 48px 40px;
  position: relative;
}

/* Vine divider between sections */
.vine-divider {
  position: absolute;
  left: 50%;
  bottom: -20px;
  transform: translateX(-50%);
  width: 260px;
  height: 40px;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 40'><path d='M0,20 C40,10 70,30 110,20 C140,12 150,28 180,22 C210,16 230,24 260,20' fill='none' stroke='%232D5016' stroke-width='1.3' opacity='0.55'/><circle cx='130' cy='20' r='3.4' fill='%23FF8A5C' opacity='0.8'/><circle cx='90' cy='18' r='2' fill='%234ECDC4' opacity='0.8'/><circle cx='170' cy='22' r='2' fill='%23FFD93D' opacity='0.8'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.8;
}

/* ============================================================
   1. COVER
   ============================================================ */
.entry-cover {
  min-height: 100vh;
  padding-top: 80px;
}

.entry-cover .entry-content {
  text-align: center;
  padding: 80px 40px;
}

.cover-mountain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cover-mountain svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  display: block;
}

.cover-content {
  position: relative;
  z-index: 2;
}

.specimen-pin {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 4px 4px, var(--ruled), var(--muted));
  box-shadow: 0 1px 3px rgba(59, 47, 47, 0.3);
  z-index: 3;
}

.specimen-pin-tl { top: 20px; left: 20px; }
.specimen-pin-tr { top: 20px; right: 20px; }

.botanical-border {
  height: 40px;
  position: relative;
  margin-bottom: 36px;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.8s var(--ease-soft) 0.1s, transform 0.8s var(--ease-elastic) 0.1s;
}

.visible .botanical-border {
  opacity: 1;
  transform: scale(1);
}

.bottom-border {
  margin-bottom: 0;
  margin-top: 36px;
}

.cover-date {
  font-family: var(--font-meta);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}

.cover-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5.5vw, 4.2rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
  line-height: 1.1;
  margin-bottom: 28px;
}

.cover-title-line {
  display: block;
}

.cover-title .char {
  display: inline-block;
  transform: translateY(30px) scale(0.5);
  opacity: 0;
  transition: transform 0.8s var(--ease-elastic), opacity 0.5s var(--ease-soft);
}

.cover-title .char.animate-in {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.cover-divider {
  width: 220px;
  height: 30px;
  margin: 0 auto 28px;
  position: relative;
}

.cover-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--muted);
  opacity: 0.45;
}

.cover-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tangerine);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px var(--linen), 0 0 0 4px var(--muted);
}

.cover-subtitle {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 40px;
}

.cover-specimen {
  margin: 20px auto 28px;
  display: flex;
  justify-content: center;
}

.cover-signature {
  font-family: var(--font-hand);
  color: var(--muted);
  font-size: 1.4rem;
  margin-top: 20px;
  transform: rotate(-2deg);
  display: inline-block;
}

.scroll-cue {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.8s var(--ease-soft) 1.2s;
  pointer-events: none;
}

.entry-cover.visible .scroll-cue {
  opacity: 0.75;
}

.scroll-cue-label {
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: var(--muted);
  transform: rotate(-2deg);
}

.scroll-cue-arrow {
  font-size: 1.2rem;
  color: var(--forest);
  animation: gentleBounce 2.6s var(--ease-soft) infinite;
}

/* ============================================================
   Entry headers and titles (shared)
   ============================================================ */
.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ruled);
}

.entry-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tangerine);
}

.entry-date-label {
  font-family: var(--font-hand);
  font-size: 1.05rem;
  color: var(--muted);
}

.entry-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
  line-height: 1.15;
  margin-bottom: 6px;
}

.entry-common-name {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 40px;
}

/* ============================================================
   Journal text
   ============================================================ */
.journal-text {
  margin-bottom: 40px;
}

.journal-text p {
  margin-bottom: 1.1em;
  text-indent: 1.5em;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.8;
}

.journal-text p:first-child {
  text-indent: 0;
}

.journal-text p::first-letter {
  font-size: 1.35em;
  color: var(--forest);
  font-weight: 500;
}

/* ============================================================
   Annotations (handwritten marginalia)
   ============================================================ */
.annotation {
  position: absolute;
  max-width: 180px;
  font-family: var(--font-hand);
  z-index: 4;
}

.annotation-right {
  right: -70px;
  top: var(--ann-top, 30%);
  transform: rotate(-3deg);
}

.annotation-left {
  left: -70px;
  top: var(--ann-top, 30%);
  transform: rotate(-2deg);
  text-align: right;
}

.annotation-text {
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.4;
  display: block;
  position: relative;
}

.annotation-text::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--spearmint);
  opacity: 0.6;
  border-radius: 1px;
}

.annotation-left .annotation-text::before {
  left: auto;
  right: -16px;
  background: var(--tangerine);
}

/* ============================================================
   Specimen gallery (Meadow)
   ============================================================ */
.specimen-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px 32px;
  margin: 40px 0 48px;
}

.specimen-card {
  position: relative;
  padding: 16px 12px 40px;
  text-align: center;
  opacity: 0;
  transform: scale(0.3) translateY(20px);
  transition:
    transform 0.8s var(--ease-elastic),
    opacity 0.5s var(--ease-soft);
}

.specimen-card.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.specimen-card[data-stagger="0"].visible { transition-delay: 0ms,   0ms; }
.specimen-card[data-stagger="1"].visible { transition-delay: 120ms, 120ms; }
.specimen-card[data-stagger="2"].visible { transition-delay: 240ms, 240ms; }
.specimen-card[data-stagger="3"].visible { transition-delay: 360ms, 360ms; }
.specimen-card[data-stagger="4"].visible { transition-delay: 480ms, 480ms; }
.specimen-card[data-stagger="5"].visible { transition-delay: 600ms, 600ms; }

.specimen-display {
  text-align: center;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 180px;
}

.specimen-display svg {
  max-height: 200px;
  width: auto;
  transition: transform 0.5s var(--ease-elastic);
}

.specimen-card:hover .specimen-display svg {
  transform: scale(1.08) rotate(-1.5deg);
}

.specimen-caption {
  display: block;
  margin-top: 10px;
  position: relative;
}

.caveat-label {
  display: block;
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--ink);
  line-height: 1.1;
  position: relative;
  z-index: 1;
}

.latin-label {
  display: block;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.caption-underline {
  position: absolute;
  left: 50%;
  top: 1.35rem;
  transform: translateX(-50%);
  width: 80px;
  height: 6px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  opacity: 0.85;
  z-index: 0;
}

.caption-underline-pink   { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 6'><path d='M0,3 C10,1 20,5 30,3 C40,1 50,5 60,3 C70,1 75,5 80,3' fill='none' stroke='%23FF6B9D' stroke-width='2' stroke-linecap='round'/></svg>"); }
.caption-underline-purple { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 6'><path d='M0,3 C10,1 20,5 30,3 C40,1 50,5 60,3 C70,1 75,5 80,3' fill='none' stroke='%236C5CE7' stroke-width='2' stroke-linecap='round'/></svg>"); }
.caption-underline-coral  { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 6'><path d='M0,3 C10,1 20,5 30,3 C40,1 50,5 60,3 C70,1 75,5 80,3' fill='none' stroke='%23FF8A5C' stroke-width='2' stroke-linecap='round'/></svg>"); }
.caption-underline-mint   { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 6'><path d='M0,3 C10,1 20,5 30,3 C40,1 50,5 60,3 C70,1 75,5 80,3' fill='none' stroke='%234ECDC4' stroke-width='2' stroke-linecap='round'/></svg>"); }
.caption-underline-yellow { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 6'><path d='M0,3 C10,1 20,5 30,3 C40,1 50,5 60,3 C70,1 75,5 80,3' fill='none' stroke='%23FFD93D' stroke-width='2' stroke-linecap='round'/></svg>"); }

/* ============================================================
   Pull-quote index cards (Field Notes)
   ============================================================ */
.pullquote-card {
  position: relative;
  max-width: 520px;
  margin: 40px auto 40px;
  padding: 36px 32px 30px;
  background: var(--linen);
  border: 1px solid var(--ruled);
  box-shadow:
    0 2px 0 rgba(59, 47, 47, 0.04),
    0 8px 22px rgba(59, 47, 47, 0.10);
  transform: translateY(40px) rotate(5deg);
  opacity: 0;
  transition:
    transform 0.7s var(--ease-elastic),
    opacity 0.5s var(--ease-soft);
}

.journal-entry.visible .pullquote-card-1 {
  opacity: 1;
  transform: translateY(0) rotate(3deg);
}

.journal-entry.visible .pullquote-card-2 {
  opacity: 1;
  transform: translateY(0) rotate(-2.5deg);
  transition-delay: 120ms;
}

.pullquote-card::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 1px dashed rgba(168, 181, 162, 0.5);
  pointer-events: none;
}

.pullquote-pin {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 5px 5px, var(--bubblegum), #c85580);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.22);
  transform: translateX(-50%);
  z-index: 2;
}

.pullquote-pin-alt {
  background: radial-gradient(circle at 5px 5px, var(--spearmint), #2fa99e);
}

.pullquote-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.85;
}

.pullquote-corner-tl {
  top: 6px; left: 6px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'><g fill='none' stroke='%23A8B5A2' stroke-width='1.3' stroke-linecap='round'><path d='M2,2 C8,6 12,12 14,20'/><path d='M2,2 C6,8 12,12 20,14'/><ellipse cx='10' cy='10' rx='2.2' ry='4' transform='rotate(-45 10 10)' fill='%23A8B5A2' opacity='0.45'/></g></svg>");
}
.pullquote-corner-tr {
  top: 6px; right: 6px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'><g fill='none' stroke='%23A8B5A2' stroke-width='1.3' stroke-linecap='round'><path d='M26,2 C20,6 16,12 14,20'/><path d='M26,2 C22,8 16,12 8,14'/><ellipse cx='18' cy='10' rx='2.2' ry='4' transform='rotate(45 18 10)' fill='%23A8B5A2' opacity='0.45'/></g></svg>");
}
.pullquote-corner-bl {
  bottom: 6px; left: 6px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'><g fill='none' stroke='%23A8B5A2' stroke-width='1.3' stroke-linecap='round'><path d='M2,26 C8,22 12,16 14,8'/><path d='M2,26 C6,20 12,16 20,14'/><ellipse cx='10' cy='18' rx='2.2' ry='4' transform='rotate(45 10 18)' fill='%23A8B5A2' opacity='0.45'/></g></svg>");
}
.pullquote-corner-br {
  bottom: 6px; right: 6px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'><g fill='none' stroke='%23A8B5A2' stroke-width='1.3' stroke-linecap='round'><path d='M26,26 C20,22 16,16 14,8'/><path d='M26,26 C22,20 16,16 8,14'/><ellipse cx='18' cy='18' rx='2.2' ry='4' transform='rotate(-45 18 18)' fill='%23A8B5A2' opacity='0.45'/></g></svg>");
}

.pullquote-text {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 500;
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--ink);
  text-align: center;
  margin-bottom: 16px;
}

.pullquote-attribution {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: var(--muted);
  text-align: center;
  transform: rotate(-1.5deg);
}

/* ============================================================
   4. SUMMIT
   ============================================================ */
.entry-summit {
  min-height: 110vh;
  overflow: hidden;
}

.summit-parallax {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.85;
}

.summit-parallax svg {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 140%;
  height: 100%;
  transform: translateX(-50%);
  display: block;
  will-change: transform;
}

.entry-summit .entry-content {
  position: relative;
  z-index: 2;
  background: rgba(255, 248, 240, 0.82);
  backdrop-filter: blur(1px);
  border-radius: 4px;
}

.altitude-list {
  margin: 32px 0 40px;
  padding: 24px 28px;
  border-top: 1px solid var(--ruled);
  border-bottom: 1px solid var(--ruled);
  background: rgba(232, 224, 216, 0.35);
}

.altitude-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(168, 181, 162, 0.45);
}

.altitude-row:last-child {
  border-bottom: none;
}

.altitude-number {
  flex: 0 0 80px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--forest);
}

.altitude-note {
  font-family: var(--font-hand);
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.35;
}

/* ============================================================
   5. PRESSED PAGE (closing)
   ============================================================ */
.entry-pressed {
  min-height: 100vh;
  padding-top: 60px;
  padding-bottom: 140px;
}

.torn-edge {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  height: 20px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 20' preserveAspectRatio='none'><path d='M0,0 L1000,0 L1000,8 C970,12 950,4 920,10 C890,16 860,6 830,11 C800,16 770,8 740,14 C710,18 680,10 650,15 C620,20 590,10 560,14 C530,18 500,8 470,13 C440,18 410,10 380,15 C350,20 320,10 290,13 C260,16 230,8 200,14 C170,20 140,10 110,15 C80,20 50,10 20,14 L0,12 Z' fill='%23FFF8F0' stroke='%237B6B5D' stroke-width='0.8' opacity='0.7'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: 0.7;
  z-index: 3;
}

.notebook-page {
  background: var(--linen);
  border: 1px solid var(--ruled);
  padding: 60px 48px 72px;
  position: relative;
  text-align: center;
  box-shadow:
    0 4px 0 var(--ruled),
    0 10px 30px rgba(59, 47, 47, 0.08);
}

.ruled-lines {
  position: absolute;
  inset: 40px 24px;
  z-index: 0;
  opacity: 0.45;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 27px,
    var(--ruled) 27px,
    var(--ruled) 28px
  );
  pointer-events: none;
}

.notebook-page > * {
  position: relative;
  z-index: 1;
}

.closing-ornament {
  margin: 0 auto 28px;
  display: flex;
  justify-content: center;
}

.closing-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 4px;
}

.closing-subtitle {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  color: var(--muted);
  margin-bottom: 28px;
  transform: rotate(-1.5deg);
  display: inline-block;
}

.closing-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.8;
  max-width: 520px;
  margin: 0 auto 20px;
}

.closing-divider {
  width: 260px;
  height: 20px;
  margin: 28px auto 20px;
  position: relative;
}

.closing-attribution {
  font-family: var(--font-meta);
  font-weight: 300;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
}

.closing-attribution strong {
  font-weight: 500;
  color: var(--forest);
}

.closing-imprint {
  font-family: var(--font-hand);
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 40px;
}

.scattered-specimens {
  margin-top: 24px;
  opacity: 0.55;
  display: flex;
  justify-content: center;
}

/* ============================================================
   Scroll entrance animations (elastic)
   ============================================================ */
.journal-entry .entry-content {
  opacity: 0;
  transform: translateY(48px);
  transition:
    opacity 0.8s var(--ease-soft),
    transform 0.85s var(--ease-elastic);
}

.journal-entry.visible .entry-content {
  opacity: 1;
  transform: translateY(0);
}

.journal-entry .journal-text {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-soft) 0.25s, transform 0.7s var(--ease-soft) 0.25s;
}

.journal-entry.visible .journal-text {
  opacity: 1;
  transform: translateY(0);
}

.journal-entry .annotation {
  opacity: 0;
  transform-origin: center;
  transition: opacity 0.7s var(--ease-soft) 0.55s;
}

.journal-entry.visible .annotation {
  opacity: 0.95;
}

.journal-entry .altitude-row {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s var(--ease-soft), transform 0.6s var(--ease-elastic);
}

.journal-entry.visible .altitude-row {
  opacity: 1;
  transform: translateX(0);
}

.journal-entry.visible .altitude-row:nth-child(1) { transition-delay: 0.15s; }
.journal-entry.visible .altitude-row:nth-child(2) { transition-delay: 0.28s; }
.journal-entry.visible .altitude-row:nth-child(3) { transition-delay: 0.41s; }
.journal-entry.visible .altitude-row:nth-child(4) { transition-delay: 0.54s; }
.journal-entry.visible .altitude-row:nth-child(5) { transition-delay: 0.67s; }

/* ============================================================
   @keyframes (elastic bounces for ornaments, idle pulses)
   ============================================================ */
@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

@keyframes elasticPop {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.12); opacity: 1; }
  80%  { transform: scale(0.96); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes floatLazy {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-4px) rotate(1deg); }
}

@keyframes paperSettle {
  0%   { transform: translateY(-20px) rotate(-5deg); opacity: 0; }
  60%  { transform: translateY(4px)   rotate(3.5deg); opacity: 1; }
  100% { transform: translateY(0)      rotate(3deg); opacity: 1; }
}

.scroll-cue-arrow { will-change: transform; }

/* Specimen hover micro-float on the cover */
.entry-cover .cover-specimen svg {
  animation: floatLazy 6s ease-in-out infinite;
  will-change: transform;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .annotation-right { right: -20px; max-width: 150px; }
  .annotation-left  { left:  -20px; max-width: 150px; }
}

@media (max-width: 768px) {
  .vine-progress { display: none; }
  .mobile-progress { display: block; }

  .entry-content { padding: 36px 20px; }
  .cover-title { font-size: 2.1rem; }
  .entry-title { font-size: 1.8rem; }

  .specimen-gallery {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .annotation,
  .annotation-left,
  .annotation-right {
    position: relative;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    max-width: 100%;
    margin: 20px 0;
    transform: rotate(-1.5deg);
    padding: 10px 14px;
    background: rgba(232, 224, 216, 0.35);
    border-radius: 4px;
    text-align: left;
  }

  .annotation-text::before {
    left: -10px;
    right: auto;
  }

  .pullquote-card {
    padding: 28px 22px 24px;
  }

  .pullquote-text {
    font-size: 1.05rem;
  }

  .notebook-page {
    padding: 40px 24px 56px;
  }

  .altitude-row {
    flex-wrap: wrap;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  html { font-size: 16px; }
  .cover-title { font-size: 1.75rem; }
  .entry-title { font-size: 1.55rem; }
  .entry-content { padding: 30px 16px; }
  .cover-date { font-size: 0.65rem; letter-spacing: 0.18em; }
}
