:root {
  /* Compliance language: IntersectionObserver at `threshold: 0.3` watches each `.folio-plate` and adds `.is-visible` class when 30% enters viewport. IntersectionObserver. This **scale-hover** scale-hove pattern applied to scroll progression rather than mouse interaction. Source Serif 4 have a calligraphic quality that suits botanical nomenclature. Source Serif 4 italic. Source Serif 4" (Google Fonts */
  --pressed-fern: #2D4A3E;
  --aged-vellum: #F5EDDA;
  --dried-rose: #9C6B5A;
  --ink-walnut: #3B2F28;
  --pollen-gold: #D4B87A;
  --dust-mote: #E8DFC8;
  --ease-folio: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--aged-vellum);
  scroll-snap-type: y proximity;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink-walnut);
  background:
    radial-gradient(circle at 18% 12%, rgba(212, 184, 122, 0.20), transparent 31rem),
    radial-gradient(circle at 85% 48%, rgba(156, 107, 90, 0.10), transparent 28rem),
    linear-gradient(90deg, rgba(45, 74, 62, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(45, 74, 62, 0.03) 1px, transparent 1px),
    var(--aged-vellum);
  background-size: auto, auto, 96px 96px, 96px 96px, auto;
  font-family: "Source Serif 4", Georgia, serif;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

body::before {
  background:
    repeating-linear-gradient(90deg, rgba(59, 47, 40, 0.025) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(0deg, rgba(232, 223, 200, 0.12) 0 2px, transparent 2px 7px);
  opacity: 0.42;
  mix-blend-mode: multiply;
}

body::after {
  box-shadow: inset 0 0 14vw rgba(59, 47, 40, 0.16);
}

.grain-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.58;
  mix-blend-mode: multiply;
  image-rendering: pixelated;
}

.herbarium-folio {
  position: relative;
  z-index: 1;
}

.folio-plate {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 5rem) 1.35rem;
  overflow: hidden;
  scroll-snap-align: center;
  isolation: isolate;
}

.folio-plate::before {
  content: attr(data-specimen);
  position: absolute;
  top: clamp(1.2rem, 3vw, 2.6rem);
  right: clamp(1.2rem, 4vw, 4rem);
  font-family: "DM Mono", monospace;
  font-size: clamp(4rem, 17vw, 13rem);
  line-height: 1;
  color: var(--pressed-fern);
  opacity: 0.035;
  letter-spacing: -0.08em;
  z-index: -1;
}

.folio-plate::after {
  content: "";
  position: absolute;
  inset: clamp(1rem, 3vw, 2rem);
  border: 1px solid rgba(45, 74, 62, 0.13);
  box-shadow:
    inset 0 0 0 9px rgba(245, 237, 218, 0.34),
    0 25px 60px rgba(59, 47, 40, 0.08);
  pointer-events: none;
  z-index: -1;
}

.depth-layer {
  position: absolute;
  inset: 0;
}

.grid-rules {
  background:
    linear-gradient(rgba(45, 74, 62, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 74, 62, 0.046) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.72;
  transform: translateY(var(--grid-shift, 0px));
}

.watermark-illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(var(--mark-shift, 0px));
  opacity: 1;
}

.watermark-svg {
  width: min(74vw, 620px);
  height: min(82vh, 820px);
  fill: none;
  stroke: var(--pressed-fern);
  stroke-width: 1.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.12;
}

.content {
  position: relative;
  inset: auto;
  z-index: 3;
  width: min(720px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(1.2rem, 4vw, 3.2rem);
  background: rgba(245, 237, 218, 0.58);
  border: 1px solid rgba(212, 184, 122, 0.42);
  box-shadow:
    0 1px 0 rgba(245, 237, 218, 0.96) inset,
    0 22px 42px rgba(59, 47, 40, 0.055);
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  transition: opacity 900ms var(--ease-folio), transform 900ms var(--ease-folio);
}

.folio-plate.is-visible .content {
  opacity: 1;
  transform: scale(1) translateY(var(--content-shift, 0px));
}

h1,
.specimen-name {
  font-family: "Zilla Slab", Rockwell, serif;
  color: var(--pressed-fern);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.specimen-name {
  max-width: 14ch;
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.12;
}

.specimen-label {
  margin-bottom: 1.1rem;
  color: var(--dried-rose);
  font-family: "DM Mono", monospace;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.15em;
  line-height: 1.65;
  text-transform: uppercase;
}

.field-notes,
.hero-subtitle {
  max-width: 52ch;
  margin: clamp(1rem, 2vh, 1.4rem) auto 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  font-weight: 400;
  line-height: 1.72;
  letter-spacing: 0.005em;
}

.hero-subtitle {
  font-style: italic;
  font-weight: 300;
  opacity: 0;
  animation: subtitle-fade 1400ms var(--ease-folio) 1500ms forwards;
}

.botanical-illustration {
  order: -1;
  width: min(54vw, 295px);
  height: min(32vh, 310px);
  margin-bottom: clamp(1rem, 3vh, 2rem);
  fill: none;
  stroke: var(--pressed-fern);
  stroke-width: 1.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 600ms ease, transform 400ms var(--ease-folio), opacity 600ms ease;
  transform-origin: center;
  opacity: 0.95;
}

.botanical-illustration:hover,
.folio-plate:hover .botanical-illustration {
  stroke: var(--dried-rose);
  transform: scale(1.04);
}

.hero-content {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.hero-content .specimen-label {
  color: var(--pollen-gold);
}

.hero-plate .watermark-svg {
  width: min(85vw, 760px);
  opacity: 0.12;
}

.closing-plate .content {
  border-color: rgba(156, 107, 90, 0.30);
}

.folio-rule {
  height: 0;
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.folio-rule svg {
  width: 40vw;
  min-width: 190px;
  max-width: 420px;
  height: 24px;
  margin-top: -12px;
  fill: none;
  stroke: var(--dried-rose);
  stroke-width: 1.1;
  stroke-linecap: round;
  opacity: 0.66;
}

.svg-defs {
  position: absolute;
  overflow: hidden;
}

@keyframes subtitle-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes folio-enter {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 720px) {
  .folio-plate {
    padding: 1rem;
  }

  .content {
    width: min(680px, 94vw);
    max-height: 84vh;
    padding: 1.35rem;
  }

  .botanical-illustration {
    width: min(70vw, 260px);
    height: min(32vh, 280px);
  }

  .watermark-svg {
    width: 92vw;
  }
}
