:root {
  --thorn: #5A1712;
  --persimmon: #E85D3F;
  --honey: #F6B85A;
  --cream: #FFF1D6;
  --leaf: #10251A;
  --apricot: #FFD2A6;
  --rose: #8B2F45;
  --title: "Libre Baskerville", Georgia, serif;
  --ui: "Manrope", Arial, sans-serif;
  --accent: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--cream);
  background: var(--leaf);
  font-family: var(--ui);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background:
    radial-gradient(circle at var(--mx, 74%) var(--my, 28%), rgba(246, 184, 90, .18), transparent 17rem),
    linear-gradient(90deg, rgba(16, 37, 26, .88), transparent 28%, transparent 82%, rgba(90, 23, 18, .35));
  mix-blend-mode: screen;
}

.chapter-rail {
  position: fixed;
  z-index: 50;
  left: 0;
  top: 0;
  bottom: 0;
  width: 82px;
  padding: 22px 12px;
  background: linear-gradient(180deg, rgba(90, 23, 18, .92), rgba(16, 37, 26, .78));
  border-right: 1px solid rgba(255, 241, 214, .24);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  box-shadow: 10px 0 40px rgba(16, 37, 26, .55);
}

.rail-rec, .status-line {
  font: 800 10px/1 var(--ui);
  letter-spacing: .18em;
  text-transform: uppercase;
}

.rail-rec { writing-mode: vertical-rl; color: var(--apricot); display: flex; gap: 8px; align-items: center; }
.rail-rec span, .rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--persimmon);
  box-shadow: 0 0 16px var(--persimmon);
  animation: recBlink 1.15s steps(2, end) infinite;
  display: inline-block;
}

.chapter-mark {
  color: rgba(255, 241, 214, .66);
  text-decoration: none;
  writing-mode: vertical-rl;
  min-height: 108px;
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 10px/1 var(--ui);
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: color .25s ease, transform .25s ease;
}

.chapter-mark em { color: var(--honey); font-style: normal; }
.chapter-mark:hover, .chapter-mark.is-active { color: var(--cream); transform: translateX(4px); }
.chapter-icon { width: 12px; height: 12px; display: inline-block; position: relative; }
.chapter-icon.bud { border-radius: 80% 0 80% 0; background: var(--apricot); transform: rotate(45deg); }
.chapter-icon.thorn { clip-path: polygon(50% 0, 100% 100%, 0 70%); background: var(--persimmon); }
.chapter-icon.flower { border-radius: 50%; background: radial-gradient(circle, var(--honey) 22%, var(--persimmon) 24% 45%, transparent 46%); }
.chapter-icon.sun { border-radius: 50%; background: var(--honey); box-shadow: 0 0 18px var(--honey); }
.chapter-mark:hover .chapter-icon { animation: budPop .45s ease both; }

.tap-label {
  margin-top: auto;
  padding: 8px 5px;
  border: 1px solid rgba(255, 241, 214, .35);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(232, 93, 63, .22);
  writing-mode: vertical-rl;
  font: 800 10px/1 var(--ui);
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}

.greenhouse { margin-left: 82px; }
.scene {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 6vw;
  isolation: isolate;
  background:
    radial-gradient(circle at 80% 18%, rgba(246, 184, 90, .18), transparent 22rem),
    radial-gradient(circle at 24% 82%, rgba(139, 47, 69, .28), transparent 28rem),
    linear-gradient(135deg, var(--leaf), #07130d 62%, var(--thorn));
}

.scene-cold { background: radial-gradient(circle at 65% 30%, rgba(255, 210, 166, .12), transparent 18rem), linear-gradient(160deg, #07130d, var(--leaf) 54%, var(--thorn)); }
.scene-thorns { background: radial-gradient(circle at 72% 42%, rgba(232, 93, 63, .22), transparent 24rem), linear-gradient(120deg, var(--leaf), var(--thorn)); }
.scene-bloom { background: radial-gradient(circle at 54% 42%, rgba(255, 210, 166, .46), transparent 28rem), linear-gradient(140deg, var(--leaf), #4a241b 65%, var(--rose)); }
.scene-sunset { background: radial-gradient(circle at 48% 52%, rgba(246, 184, 90, .56), transparent 30rem), linear-gradient(135deg, var(--thorn), var(--rose) 44%, var(--leaf)); }

.webcam-frame {
  position: relative;
  width: min(1060px, 86vw);
  min-height: min(720px, 78vh);
  border: 1px solid rgba(255, 241, 214, .36);
  border-radius: 34px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 241, 214, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 241, 214, .04) 1px, transparent 1px),
    radial-gradient(circle at 50% 42%, rgba(255, 210, 166, .12), transparent 20rem),
    rgba(16, 37, 26, .78);
  background-size: 100% 48px, 48px 100%, auto, auto;
  box-shadow: inset 0 0 80px rgba(16, 37, 26, .82), 0 28px 80px rgba(0, 0, 0, .4);
}

.webcam-frame::before, .webcam-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.webcam-frame::before { background: radial-gradient(ellipse at center, transparent 35%, rgba(16, 37, 26, .64)); z-index: 2; }
.webcam-frame::after { background: repeating-linear-gradient(0deg, rgba(255, 241, 214, .025), rgba(255, 241, 214, .025) 1px, transparent 1px, transparent 7px); z-index: 12; }

.camera-ui { position: absolute; z-index: 15; width: 58px; height: 58px; border-color: var(--cream); opacity: .78; transition: transform .3s ease; }
.top-left { top: 28px; left: 28px; border-top: 2px solid; border-left: 2px solid; }
.top-right { top: 28px; right: 28px; border-top: 2px solid; border-right: 2px solid; }
.bottom-left { bottom: 28px; left: 28px; border-bottom: 2px solid; border-left: 2px solid; }
.bottom-right { bottom: 28px; right: 28px; border-bottom: 2px solid; border-right: 2px solid; }
.focus-target:hover .camera-ui { transform: translate(var(--snap-x, 0), var(--snap-y, 0)); }

.lens-halo {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 184, 90, .18), transparent 58%);
  filter: blur(6px);
  z-index: 1;
  animation: haloBreathe 6s ease-in-out infinite;
}
.lens-halo.hot { background: radial-gradient(circle, rgba(232, 93, 63, .24), transparent 58%); }
.lens-halo.apricot { background: radial-gradient(circle, rgba(255, 210, 166, .42), transparent 62%); }
.lens-halo.final { background: radial-gradient(circle, rgba(246, 184, 90, .68), rgba(232, 93, 63, .18) 45%, transparent 68%); }

.title-plate, .final-declaration {
  position: absolute;
  z-index: 8;
  left: 12%;
  right: 10%;
  top: 28%;
  transform: rotate(-1deg);
}
.status-line { color: var(--apricot); display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
h1, h2 { font-family: var(--title); margin: 0; letter-spacing: -.05em; text-wrap: balance; }
h1 {
  font-size: clamp(4rem, 11vw, 10.5rem);
  line-height: .82;
  text-shadow: 0 12px 30px rgba(90, 23, 18, .58);
  filter: blur(5px);
  opacity: .72;
  animation: reluctantFocus 2.8s ease forwards .25s;
}
h1 i { color: var(--persimmon); font-style: italic; }
h2 { font-size: clamp(2.6rem, 6vw, 6.8rem); line-height: .9; }
.subtitle, .caption-plate p {
  max-width: 560px;
  color: rgba(255, 241, 214, .82);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.65;
}

.leaf {
  position: absolute;
  z-index: 10;
  width: 260px;
  height: 120px;
  border-radius: 100% 0 100% 0;
  background: radial-gradient(circle at 28% 42%, rgba(255, 210, 166, .14), transparent 9px), linear-gradient(135deg, #1f4b2f, var(--leaf) 68%);
  box-shadow: inset -18px -12px 22px rgba(0, 0, 0, .28), 0 18px 40px rgba(0, 0, 0, .34);
  transform-origin: 12% 90%;
  transition: transform .55s cubic-bezier(.2, .9, .2, 1);
}
.leaf::after { content: ""; position: absolute; left: 16%; right: 8%; top: 48%; height: 1px; background: rgba(255, 241, 214, .22); transform: rotate(-8deg); }
.leaf-a { left: -44px; top: 110px; transform: rotate(26deg); }
.leaf-b { right: -52px; top: 198px; transform: rotate(205deg) scale(1.18); }
.leaf-c { left: 34%; bottom: -35px; transform: rotate(-20deg) scale(1.34); }
.focus-target:hover .leaf-a { transform: rotate(21deg) translate(-8px, -6px); }
.focus-target:hover .leaf-b { transform: rotate(211deg) translate(10px, -4px) scale(1.18); }
.focus-target:hover .leaf-c { transform: rotate(-15deg) translate(0, 12px) scale(1.34); }

.vines span, .vine-quote, .thorn-field i {
  position: absolute;
  z-index: 6;
  background: var(--leaf);
  box-shadow: 0 0 0 1px rgba(255, 241, 214, .05);
}
.vines span { width: 10px; height: 72%; border-radius: 99px; top: -12%; transform: rotate(var(--r)); left: var(--l); }
.vines span:nth-child(1) { --l: 16%; --r: 13deg; }
.vines span:nth-child(2) { --l: 64%; --r: -9deg; }
.vines span:nth-child(3) { --l: 82%; --r: 18deg; }

.paper-tag, .plant-stake, .clipped-phrase {
  position: absolute;
  z-index: 14;
  padding: 12px 16px;
  color: var(--thorn);
  background: rgba(255, 241, 214, .86);
  border: 1px solid rgba(90, 23, 18, .24);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .24);
  font: 600 1rem/1.2 var(--accent);
}
.tag-cold { right: 10%; bottom: 14%; transform: rotate(6deg); }
.tag-sunset { right: 9%; top: 16%; transform: rotate(8deg); }
.dew-drop {
  position: absolute;
  z-index: 15;
  right: 23%;
  bottom: 30%;
  width: 58px;
  height: 72px;
  border-radius: 60% 60% 60% 10%;
  transform: rotate(45deg);
  background: radial-gradient(circle at 32% 30%, #FFFFFF, rgba(255, 210, 166, .5) 28%, rgba(255, 241, 214, .12));
  border: 1px solid rgba(255, 241, 214, .56);
  animation: dewSlide 7s ease-in-out infinite;
}
.dew-drop::after { content: attr(data-word); transform: rotate(-45deg); position: absolute; inset: 18px 9px; color: var(--leaf); font: 800 11px var(--ui); }

.condensation i, .sun-dust i { position: absolute; z-index: 13; border-radius: 50%; background: rgba(255, 241, 214, .34); }
.condensation i:nth-child(1) { width: 4px; height: 36px; left: 20%; top: 14%; }
.condensation i:nth-child(2) { width: 5px; height: 48px; left: 73%; top: 18%; }
.condensation i:nth-child(3) { width: 3px; height: 30px; left: 84%; top: 52%; }
.condensation i:nth-child(4) { width: 6px; height: 6px; left: 38%; top: 20%; }
.condensation i:nth-child(5) { width: 7px; height: 7px; left: 57%; top: 73%; }

.caption-plate {
  position: absolute;
  z-index: 10;
  max-width: 660px;
  padding: 36px;
  color: var(--cream);
  background: linear-gradient(135deg, rgba(255, 241, 214, .16), rgba(90, 23, 18, .45));
  border: 1px solid rgba(255, 241, 214, .28);
  border-radius: 26px;
  backdrop-filter: blur(14px);
}
.caption-plate.tilted { left: 15%; top: 18%; transform: rotate(-3deg); }
.bloom-note { right: 10%; bottom: 13%; transform: rotate(2deg); }
.botanical-tag { color: var(--honey); font: 600 1.15rem var(--accent); }

.red-ribbon {
  position: absolute;
  z-index: 13;
  padding: 10px 42px;
  color: var(--cream);
  background: var(--persimmon);
  font: 800 .8rem var(--ui);
  letter-spacing: .18em;
  box-shadow: 0 12px 28px rgba(90, 23, 18, .45);
}
.ribbon-one { top: 20%; right: -18px; transform: rotate(10deg); }
.ribbon-two { left: 8%; bottom: 20%; transform: rotate(-8deg); background: var(--rose); }
.thorn-field i { width: 18px; height: 180px; border-radius: 99px; transform: rotate(var(--tr)); left: var(--tl); top: var(--tt); }
.thorn-field i::after { content: ""; position: absolute; top: 38%; left: 5px; border-left: 18px solid var(--persimmon); border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.thorn-field i:nth-child(1) { --tl: 8%; --tt: 12%; --tr: -25deg; }
.thorn-field i:nth-child(2) { --tl: 30%; --tt: 62%; --tr: 65deg; }
.thorn-field i:nth-child(3) { --tl: 48%; --tt: 2%; --tr: 12deg; }
.thorn-field i:nth-child(4) { --tl: 76%; --tt: 54%; --tr: -54deg; }
.thorn-field i:nth-child(5) { --tl: 90%; --tt: 6%; --tr: 24deg; }
.thorn-field i:nth-child(6) { --tl: 12%; --tt: 74%; --tr: 84deg; }
.vine-quote { width: 150px; height: 220px; border-radius: 50%; background: transparent; border: 10px solid var(--leaf); border-right-color: transparent; }
.vine-quote.left { left: 7%; top: 9%; transform: rotate(25deg); }
.vine-quote.right { right: 9%; bottom: 12%; transform: rotate(205deg); }
.phrase-one { right: 18%; top: 48%; transform: rotate(5deg); }
.phrase-two { left: 22%; bottom: 12%; transform: rotate(-4deg); }

.flower, .open-bloom {
  position: absolute;
  z-index: 9;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--thorn) 0 12%, var(--persimmon) 13% 20%, transparent 21%), conic-gradient(from 20deg, var(--apricot), var(--honey), var(--rose), var(--apricot), var(--persimmon), var(--apricot));
  filter: drop-shadow(0 20px 36px rgba(90, 23, 18, .36));
  transform: scale(.2) rotate(20deg);
  opacity: .35;
  transition: transform .9s cubic-bezier(.2, .9, .2, 1), opacity .9s ease;
}
.flower::before, .open-bloom::before { content: ""; position: absolute; inset: 20%; border-radius: 50%; background: radial-gradient(circle, var(--honey), var(--persimmon)); }
.flower-one { left: 8%; top: 18%; }
.flower-two { left: 30%; bottom: 10%; width: 150px; height: 150px; }
.flower-three { right: 17%; top: 18%; width: 130px; height: 130px; }
.scene-bloom.is-open .flower, .focus-target:hover .flower { transform: scale(1) rotate(0deg); opacity: .95; }
.plant-stake { left: 14%; bottom: 20%; transform: rotate(-9deg); }
.stem-meter { position: absolute; z-index: 14; right: 13%; top: 14%; display: flex; align-items: end; gap: 6px; }
.stem-meter b { width: 8px; height: calc(26px + var(--h) * 1px); border-radius: 99px 99px 0 0; background: var(--honey); box-shadow: 0 0 14px var(--honey); }
.stem-meter b:nth-child(1) { --h: 4; } .stem-meter b:nth-child(2) { --h: 18; } .stem-meter b:nth-child(3) { --h: 36; } .stem-meter b:nth-child(4) { --h: 58; }
.sun-dust i { width: 5px; height: 5px; left: var(--x); top: var(--y); animation: dustFloat 5s ease-in-out infinite; }
.sun-dust i:nth-child(1) { --x: 12%; --y: 28%; } .sun-dust i:nth-child(2) { --x: 22%; --y: 62%; } .sun-dust i:nth-child(3) { --x: 40%; --y: 18%; } .sun-dust i:nth-child(4) { --x: 58%; --y: 35%; } .sun-dust i:nth-child(5) { --x: 70%; --y: 72%; } .sun-dust i:nth-child(6) { --x: 83%; --y: 23%; } .sun-dust i:nth-child(7) { --x: 90%; --y: 58%; }

.final-declaration { top: 20%; left: 9%; right: 8%; transform: none; }
.final-declaration h2 { font-size: clamp(3.5rem, 8.2vw, 9.8rem); color: var(--cream); text-shadow: 0 20px 45px rgba(90, 23, 18, .52); }
.open-bloom { transform: scale(1) rotate(0); opacity: .9; }
.mega-one { width: 390px; height: 390px; right: -100px; bottom: -90px; }
.mega-two { width: 260px; height: 260px; left: -60px; top: 18%; filter: blur(.4px) drop-shadow(0 20px 36px rgba(90, 23, 18, .36)); }

.cursor-firefly {
  position: fixed;
  z-index: 60;
  width: 12px;
  height: 12px;
  border: 1px solid var(--cream);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  box-shadow: 0 0 18px var(--honey);
  transition: opacity .2s ease;
}

@keyframes recBlink { 50% { opacity: .25; } }
@keyframes reluctantFocus { to { filter: blur(0); opacity: 1; } }
@keyframes haloBreathe { 50% { transform: scale(1.08); opacity: .7; } }
@keyframes budPop { 50% { transform: scale(1.6) rotate(20deg); } }
@keyframes dewSlide { 0%, 100% { transform: translateY(-8px) rotate(45deg); } 50% { transform: translateY(18px) rotate(45deg); } }
@keyframes dustFloat { 50% { transform: translate(14px, -18px); opacity: .35; } }

@media (max-width: 760px) {
  .chapter-rail { width: 100%; height: 62px; right: 0; bottom: auto; flex-direction: row; padding: 8px 12px; }
  .rail-rec, .chapter-mark, .tap-label { writing-mode: horizontal-tb; min-height: auto; }
  .chapter-mark { font-size: 9px; gap: 5px; }
  .greenhouse { margin-left: 0; padding-top: 62px; }
  .scene { padding: 24px; }
  .webcam-frame { width: 100%; min-height: 74vh; border-radius: 22px; }
  .title-plate, .final-declaration { left: 8%; right: 8%; top: 25%; }
  .caption-plate { left: 7% !important; right: 7% !important; padding: 24px; }
  .leaf { width: 180px; height: 86px; }
  .tap-label { margin-left: auto; margin-top: 0; }
}
