:root {
  --vellum: #E7DDC7;
  --moss: #4F6041;
  --clay: #A48768;
  --umber: #2E2A22;
  --lichen: #B7B9A1;
  --sage: #879678;
  --beeswax: #D2B36C;
  --light-x: 50%;
  --light-y: 20%;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--umber);
  background:
    radial-gradient(circle at 15% 10%, rgba(210, 179, 108, .18), transparent 28rem),
    radial-gradient(circle at 80% 30%, rgba(79, 96, 65, .16), transparent 34rem),
    linear-gradient(135deg, #b7b9a1 0%, #879678 42%, #4f6041 100%);
  font-family: "Cormorant Garamond", Cormorant, Garamond, Georgia, serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    repeating-linear-gradient(0deg, rgba(46,42,34,.04) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(90deg, rgba(231,221,199,.06) 0 1px, transparent 1px 9px);
  mix-blend-mode: multiply;
}

.folio {
  position: relative;
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 68px) 10vh;
}

.opening-sheet {
  position: relative;
  min-height: 100vh;
  margin: 0 auto 5vh;
  padding: clamp(30px, 6vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  isolation: isolate;
  background:
    radial-gradient(circle at var(--light-x) var(--light-y), rgba(255,255,246,.54), transparent 22rem),
    linear-gradient(180deg, rgba(231,221,199,.98), rgba(231,221,199,.9)),
    var(--vellum);
  border-radius: 0 0 32px 32px;
  box-shadow: inset 0 0 72px rgba(46,42,34,.16), inset 0 -18px 42px rgba(164,135,104,.14), 0 26px 70px rgba(46,42,34,.35);
  transform-origin: 92% 8%;
  transition: transform 1100ms cubic-bezier(.2,.75,.18,1), box-shadow 1100ms ease;
}

.folio.opened .opening-sheet {
  transform: perspective(1400px) rotateX(3.5deg) rotateZ(-.35deg) translateY(-1.5vh);
  box-shadow: inset 0 0 72px rgba(46,42,34,.16), 0 38px 100px rgba(46,42,34,.42);
}

.opening-sheet::before, .paper-page::before, .closing-card::before, .note-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(46,42,34,.12) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(255,255,245,.26) 0 1px, transparent 1.5px);
  background-size: 23px 19px, 31px 29px;
  opacity: .32;
  mix-blend-mode: multiply;
}

.paper-light {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--light-x) var(--light-y), rgba(255,255,236,.48), transparent 28rem);
  z-index: -1;
}

.corner-lift {
  position: absolute;
  right: 0;
  top: 0;
  width: 170px;
  height: 170px;
  border-radius: 0 0 0 100%;
  background: linear-gradient(135deg, rgba(255,255,245,.72), rgba(164,135,104,.12) 52%, rgba(46,42,34,.18));
  box-shadow: -18px 18px 36px rgba(46,42,34,.16);
  transform-origin: 100% 0;
  transition: transform 900ms cubic-bezier(.2,.75,.18,1);
}

.folio.opened .corner-lift { transform: rotate(-13deg) translate(-8px, 8px); }

.folio-date, .kicker, .rail a, figcaption, .rice-tab, .pebble, .pebble-button, .leaf-tab, .note-card b {
  font-family: Spectral, "Space Grotesk", Inter, Georgia, serif;
  font-variant-caps: small-caps;
  letter-spacing: .08em;
}

h1, h2 {
  font-family: "EB Garamond", Garamond, Georgia, serif;
  font-weight: 600;
  margin: 0;
  letter-spacing: -.035em;
}

h1 {
  font-size: clamp(5rem, 18vw, 18rem);
  line-height: .78;
  color: rgba(46,42,34,.88);
  text-shadow: 0 1px 0 rgba(255,255,245,.55), 0 -1px 0 rgba(46,42,34,.18), 8px 12px 30px rgba(79,96,65,.15);
  filter: drop-shadow(0 14px 12px rgba(46,42,34,.12));
}

h2 { font-size: clamp(3rem, 7vw, 7.2rem); line-height: .88; }

p { font-size: clamp(1.2rem, 1.6vw, 1.72rem); line-height: 1.46; }

.opening-note { max-width: 560px; font-style: italic; color: var(--moss); }

.pressed {
  position: absolute;
  right: clamp(14px, 9vw, 150px);
  top: clamp(70px, 17vh, 170px);
  width: clamp(180px, 28vw, 420px);
  z-index: 2;
  opacity: .74;
  transform: rotate(-17deg);
  filter: drop-shadow(24px 28px 18px rgba(46,42,34,.22));
}

.botanical path { fill: none; stroke: var(--moss); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: stroke 700ms ease, opacity 700ms ease; }
.inked path { stroke: var(--umber); opacity: 1; }

.leaf-shadow {
  position: absolute;
  right: 10%;
  top: 25%;
  width: 34vw;
  height: 26vw;
  border-radius: 48% 52% 43% 57%;
  background: rgba(79,96,65,.13);
  filter: blur(30px);
  transform: rotate(-18deg);
}

.hand-lens { transition: transform 650ms cubic-bezier(.2,.75,.18,1), box-shadow 650ms ease, filter 650ms ease; }
.hand-lens:hover { transform: scale(1.05); box-shadow: 0 28px 58px rgba(46,42,34,.25); filter: saturate(1.04); }

button { color: var(--umber); cursor: pointer; }

.pebble-button, .leaf-tab {
  align-self: flex-start;
  border: 0;
  margin-top: 3vh;
  padding: 18px 30px;
  border-radius: 999px 52% 999px 48%;
  background: radial-gradient(circle at 36% 24%, #e7ddc7, #d2b36c 46%, #a48768 100%);
  box-shadow: inset 5px 7px 16px rgba(255,255,245,.34), inset -8px -10px 18px rgba(46,42,34,.16), 0 16px 34px rgba(46,42,34,.24);
}

.rail {
  position: sticky;
  top: 7vh;
  z-index: 8;
  width: 118px;
  margin-left: clamp(0px, 1vw, 24px);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgba(231,221,199,.72);
  border: 1px solid rgba(46,42,34,.14);
  border-radius: 70px;
  box-shadow: inset 0 0 22px rgba(255,255,245,.28), 0 18px 42px rgba(46,42,34,.22);
}

.rail a {
  color: var(--moss);
  text-decoration: none;
  writing-mode: vertical-rl;
  font-size: .82rem;
}

.wax-seal, .beeswax-seal {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 28%, #d2b36c, #a48768 80%);
  color: var(--umber);
  box-shadow: inset 4px 5px 10px rgba(255,255,245,.28), inset -6px -7px 12px rgba(46,42,34,.22), 0 9px 18px rgba(46,42,34,.2);
}

.wax-seal { width: 58px; height: 58px; border-radius: 48% 52% 45% 55%; font-family: Spectral, serif; }

.chapter {
  min-height: 92vh;
  position: relative;
}

.paper-page, .closing-card {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: clamp(14px, 2vw, 32px);
  margin: -6vh 0 12vh clamp(96px, 13vw, 180px);
  padding: clamp(28px, 5vw, 74px);
  background: linear-gradient(145deg, rgba(231,221,199,.97), rgba(183,185,161,.58));
  border: 1px solid rgba(46,42,34,.16);
  border-radius: 28px 12px 34px 18px;
  box-shadow: inset 0 0 60px rgba(255,255,245,.22), inset 0 -20px 45px rgba(164,135,104,.11), 0 28px 78px rgba(46,42,34,.28);
}

.soft-name .prose { grid-column: 2 / span 3; align-self: center; }
.soft-name .specimen-card { grid-column: 5 / span 2; align-self: center; }
.rain .note-card { grid-column: 1 / span 2; align-self: start; }
.rain .prose { grid-column: 3 / span 3; align-self: center; }
.rain .fern { grid-column: 6 / span 2; align-self: end; width: 100%; }
.listener .specimen-plate { grid-column: 1 / span 3; }
.listener .prose { grid-column: 4 / span 3; align-self: center; }
.closing-card .prose { grid-column: 2 / span 4; align-self: center; }

.prose { position: relative; z-index: 2; }
.kicker { color: var(--clay); font-size: .9rem; margin-bottom: 1rem; }

.chapter-label {
  position: absolute;
  top: -26px;
  left: clamp(26px, 6vw, 80px);
  z-index: 3;
  padding: 13px 24px;
  border-radius: 18px 16px 20px 14px;
}

.clay-plaque {
  font-family: Spectral, Georgia, serif;
  background: linear-gradient(145deg, #a48768, #879678);
  color: #e7ddc7;
  box-shadow: inset 5px 5px 12px rgba(255,255,245,.18), inset -5px -7px 13px rgba(46,42,34,.24), 0 18px 30px rgba(46,42,34,.22);
}

.sheet-overlap::before {
  content: "";
  position: absolute;
  inset: -28px -34px;
  z-index: -1;
  border-radius: 14px 26px 18px 22px;
  background: rgba(231,221,199,.48);
  box-shadow: 0 16px 32px rgba(46,42,34,.15);
  transform: rotate(-1.2deg);
}

.specimen-card, .specimen-plate, .note-card {
  position: relative;
  margin: 0;
  padding: 24px;
  background: rgba(231,221,199,.68);
  border: 1px solid rgba(46,42,34,.14);
  border-radius: 22px 14px 26px 16px;
  box-shadow: inset 0 0 28px rgba(255,255,245,.28), 0 18px 44px rgba(46,42,34,.18);
}

.specimen-card svg, .specimen-plate svg { width: 100%; min-height: 220px; }
figcaption { color: var(--moss); font-size: .86rem; line-height: 1.4; }

.rice-tab {
  position: absolute;
  right: 9%;
  bottom: 11%;
  padding: 12px 18px;
  background: rgba(183,185,161,.78);
  border-radius: 8px;
  transform: rotate(4deg);
  box-shadow: 0 10px 20px rgba(46,42,34,.15);
}

.breath-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  width: min(720px, 72vw);
  margin: 0 0 12vh auto;
  color: var(--vellum);
}
.breath-divider span { height: 1px; background: rgba(231,221,199,.55); }

.inset-note { transform: rotate(-2.3deg); color: var(--moss); }
.specimen-strip { grid-column: 3 / span 3; display: flex; gap: 16px; align-self: end; }
.pebble {
  border: 0;
  padding: 16px 22px;
  border-radius: 48% 52% 50% 46%;
  background: radial-gradient(circle at 35% 25%, #b7b9a1, #879678 56%, #4f6041);
  color: #e7ddc7;
  box-shadow: inset 5px 6px 13px rgba(255,255,245,.2), inset -7px -8px 14px rgba(46,42,34,.22), 0 14px 27px rgba(46,42,34,.2);
}

.root-lines {
  position: absolute;
  inset: 18% 8% auto auto;
  width: 34%;
  height: 42%;
  opacity: .28;
  background:
    linear-gradient(22deg, transparent 48%, var(--moss) 49% 50%, transparent 51%),
    linear-gradient(154deg, transparent 48%, var(--moss) 49% 50%, transparent 51%),
    linear-gradient(92deg, transparent 48%, var(--moss) 49% 50%, transparent 51%);
}

.closing-card {
  min-height: 72vh;
  margin-bottom: 0;
  background: linear-gradient(145deg, rgba(164,135,104,.78), rgba(231,221,199,.9) 42%, rgba(183,185,161,.72));
}

.beeswax-seal { grid-column: 1; width: 120px; height: 120px; border-radius: 48% 52% 43% 57%; align-self: center; font-size: 2rem; }
.final-line { font-style: italic; color: var(--moss); }
.leaf-tab { grid-column: 6 / span 2; align-self: end; justify-self: start; background: radial-gradient(circle at 30% 28%, #d2b36c, #879678 70%); }

@media (max-width: 850px) {
  .folio { padding: 0 14px 8vh; }
  .rail { position: relative; top: auto; width: auto; flex-direction: row; margin: 2vh 0 7vh; border-radius: 24px; }
  .rail a { writing-mode: horizontal-tb; }
  .paper-page, .closing-card { margin-left: 0; grid-template-columns: 1fr; }
  .soft-name .prose, .soft-name .specimen-card, .rain .note-card, .rain .prose, .rain .fern, .listener .specimen-plate, .listener .prose, .closing-card .prose, .beeswax-seal, .leaf-tab, .specimen-strip { grid-column: 1; }
  h1 { overflow-wrap: anywhere; }
}
