/* LeafPulse website, version B: "little garden" hero. Hand-drawn SVG scene, no photos.
   Day = Sage Studio greens; night = "Night Garden" (fireflies, moon, lantern). */

:root {
  --sky1: #8CC8EA; --sky2: #CDEBF3; --sky3: #FFF1D2;
  --ink: #163222; --ink-soft: #3F5A48; --accent: #2F6A34;
  --pill: #14231A; --pill-ink: #F4F8EE;
  --glass: rgba(255, 255, 255, .55); --glass-line: rgba(255, 255, 255, .85);
  --haze: rgba(255, 253, 244, .78);
  --paper: #FFFDF6; --paper-ink: #3B3A32;
  --twine: #A88B62;
  --ease: cubic-bezier(.45, 0, .55, 1);
}
:root[data-theme="dark"] {
  --sky1: #1B2754; --sky2: #3B4879; --sky3: #6F6B94;
  --ink: #EEF4E8; --ink-soft: #C5D2C2; --accent: #A6DE86;
  --pill: #EAF3DF; --pill-ink: #14231A;
  --glass: rgba(20, 30, 48, .5); --glass-line: rgba(255, 255, 255, .16);
  --haze: rgba(14, 22, 44, .62);
  --paper: #F2EDE0; --paper-ink: #3B3A32;
  --twine: #CDB58C;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--sky2);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--pill); color: var(--pill-ink); padding: 8px 12px; border-radius: 10px; z-index: 20; }
.skip:focus { left: 12px; }

/* ---------- header ---------- */
.site-header { position: absolute; inset: 0 0 auto 0; z-index: 10; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 4vw, 56px); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: Fredoka, Manrope, sans-serif; font-weight: 600; font-size: 22px; color: var(--ink); text-decoration: none; }
.brand svg { width: 24px; height: 24px; color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--glass-line); background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.icon-btn svg { width: 18px; height: 18px; grid-area: 1 / 1; transition: opacity .6s var(--ease), transform .6s var(--ease); }
.icon-btn .sun { opacity: 0; transform: rotate(-60deg); }
[data-theme="dark"] .icon-btn .moon { opacity: 0; transform: rotate(60deg); }
[data-theme="dark"] .icon-btn .sun { opacity: 1; transform: none; }

.pill {
  display: inline-flex; align-items: center; gap: 10px; border-radius: 999px; text-decoration: none;
  background: var(--pill); color: var(--pill-ink); font-weight: 700; font-size: 14px; padding: 10px 18px;
  border: 1px solid transparent; transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.pill-sm { padding: 9px 16px; font-size: 13px; }
.pill:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20, 35, 26, .22); }
.pill-ghost { background: var(--glass); color: var(--ink); border-color: var(--glass-line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pill svg { width: 20px; height: 20px; flex: none; }
.store { padding: 9px 18px 9px 14px; line-height: 1.1; cursor: default; }
.store span { display: flex; flex-direction: column; font-size: 15px; }
.store small { font-size: 10.5px; font-weight: 600; opacity: .75; }

/* ---------- hero layout ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; background: linear-gradient(var(--sky1), var(--sky2)); }
.scene-wrap { position: absolute; inset: 0; }
#scene { display: block; width: 100%; height: 100%; }
.scene-wrap::after { /* soft paper grain, so the vectors read as painted */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .09; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

.copy {
  position: relative; z-index: 5; width: min(540px, 46vw);
  margin-left: clamp(20px, 6vw, 110px); padding-top: clamp(96px, 15vh, 150px);
}
.copy::before { /* gentle haze so text stays readable over the scene */
  content: ""; position: absolute; z-index: -1; left: -70px; right: -90px; top: 60px; bottom: -40px;
  background: radial-gradient(closest-side, var(--haze), transparent); filter: blur(6px); pointer-events: none;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); background: var(--glass); border: 1px solid var(--glass-line);
  padding: 6px 12px 6px 9px; border-radius: 999px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.eyebrow svg { width: 14px; height: 14px; }
h1 {
  font-family: Fredoka, Manrope, sans-serif; font-weight: 600; letter-spacing: -.01em;
  font-size: clamp(40px, 5.3vw, 70px); line-height: 1.02; margin: 16px 0 14px; color: var(--ink);
  text-wrap: balance;
}
.hl {
  color: var(--accent); white-space: nowrap; padding-bottom: .12em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9 C40 3 70 12 104 7 S170 3 197 8' fill='none' stroke='%23F2B33D' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") bottom / 100% .26em no-repeat;
}
.lede { font-size: clamp(15px, 1.25vw, 17px); line-height: 1.55; color: var(--ink-soft); max-width: 30em; margin: 0 0 20px; font-weight: 500; }
.store-row { display: flex; flex-wrap: wrap; gap: 10px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin: 14px 0 0; }
.meta i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; }

/* ---------- polaroid snapshots ---------- */
.snaps { position: relative; display: flex; gap: 18px; margin-top: 26px; padding-top: 10px; width: max-content; }
.twine { position: absolute; left: -16px; right: -16px; top: 0; width: calc(100% + 32px); height: 26px; overflow: visible; }
.twine path { fill: none; stroke: var(--twine); stroke-width: 1.6; stroke-dasharray: 5 2; }
.snap {
  position: relative; margin: 0; width: 104px; padding: 7px 7px 4px; background: var(--paper); border-radius: 3px;
  box-shadow: 0 10px 22px rgba(30, 45, 30, .2), 0 1px 0 rgba(0, 0, 0, .05);
  transform-origin: 50% -6px; animation: hang 6s var(--ease) infinite alternate;
  transition: scale .5s var(--ease);
}
.snap:nth-child(2) { --r: -6deg; margin-top: 8px; }
.snap:nth-child(3) { --r: 4deg; margin-top: 14px; animation-delay: -2s; }
.snap:nth-child(4) { --r: -3deg; margin-top: 8px; animation-delay: -4s; }
.snap:hover { scale: 1.12; z-index: 2; }
.snap svg { display: block; width: 100%; height: auto; border-radius: 1px; }
.snap figcaption { font-family: Caveat, cursive; font-weight: 700; font-size: 18px; color: var(--paper-ink); text-align: center; line-height: 1.2; padding-top: 2px; }
.peg { position: absolute; top: -12px; left: 50%; width: 10px; height: 22px; margin-left: -5px; border-radius: 3px; background: linear-gradient(90deg, #C99B6A, #EBC394 45%, #B8854F); box-shadow: 0 2px 3px rgba(0, 0, 0, .2); z-index: 1; }
@keyframes hang { from { rotate: calc(var(--r, 0deg) - 2deg); } to { rotate: calc(var(--r, 0deg) + 2deg); } }

/* ---------- scene: theming ---------- */
.st1 { stop-color: var(--sky1); } .st2 { stop-color: var(--sky2); } .st3 { stop-color: var(--sky3); }
#scene stop { transition: stop-color 1.4s var(--ease); }
.day-only { transition: opacity 1.4s var(--ease); }
.night-only { opacity: 0; transition: opacity 1.4s var(--ease); }
[data-theme="dark"] .day-only { opacity: 0; }
[data-theme="dark"] .night-only { opacity: 1; }
.veil { opacity: 0; mix-blend-mode: multiply; transition: opacity 1.4s var(--ease); }
[data-theme="dark"] .veil { opacity: .62; }
[data-theme="dark"] .clouds { opacity: .5; }
.clouds { transition: opacity 1.4s var(--ease); }

/* ---------- scene: motion (all calm, ease-in-out) ---------- */
.drift { animation: drift linear infinite; }
.c1 { animation-duration: 170s; animation-delay: -30s; }
.c2 { animation-duration: 210s; animation-delay: -150s; }
.c3 { animation-duration: 190s; animation-delay: -70s; }
.c4 { animation-duration: 250s; animation-delay: -190s; }
.c5 { animation-duration: 230s; animation-delay: -10s; }
@keyframes drift { from { transform: translateX(-520px); } to { transform: translateX(1900px); } }

.rays { transform-box: fill-box; transform-origin: 50% 50%; animation: spin 140s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.birds { animation: fly 70s linear infinite; animation-delay: -20s; }
@keyframes fly { from { transform: translate(-200px, 0); } to { transform: translate(1900px, -60px); } }
.bird path { transform-box: fill-box; transform-origin: 50% 100%; animation: flapBird .5s var(--ease) infinite alternate; }
.b2 path { animation-delay: -.2s; } .b3 path { animation-delay: -.35s; }
@keyframes flapBird { to { transform: scaleY(-.6); } }

.sway, .sway-slow, .sway-tree, .flower { transform-box: fill-box; transform-origin: 50% 100%; }
.sway { animation: sway 5s var(--ease) infinite alternate; }
.sway:nth-of-type(2n) { animation-duration: 6.2s; animation-delay: -2s; }
.sway:nth-of-type(3n) { animation-duration: 5.6s; animation-delay: -3.4s; }
.sway-slow { animation: swaySlow 7s var(--ease) infinite alternate; }
.r2 { animation-delay: -3s; }
.sway-tree { animation: swayTree 9s var(--ease) infinite alternate; }
.flower { animation: sway 4.6s var(--ease) infinite alternate; }
@keyframes sway { from { transform: rotate(-2.6deg); } to { transform: rotate(2.6deg); } }
@keyframes swaySlow { from { transform: rotate(-1.4deg); } to { transform: rotate(1.4deg); } }
@keyframes swayTree { from { transform: rotate(-.6deg); } to { transform: rotate(.6deg); } }

.swing { transform-box: fill-box; transform-origin: 50% 0; animation: swing 4.4s var(--ease) infinite alternate; }
@keyframes swing { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }

.shimmer path { animation: shimmer 5s var(--ease) infinite alternate; }
@keyframes shimmer { from { transform: translateX(-14px); opacity: .25; } to { transform: translateX(14px); opacity: .7; } }

.lids { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); animation: blink 5.5s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(0); } 95.5% { transform: scaleY(1); } }
.croak { transform-box: fill-box; transform-origin: 50% 0; transform: scale(0); }
#frog.croaking .croak { animation: croak .5s var(--ease) 3 alternate; }
@keyframes croak { from { transform: scale(.2); } to { transform: scale(1.35); } }
#frog { cursor: pointer; }
.frog-hop { transform-box: fill-box; transform-origin: 50% 100%; }
#frog.hop .frog-hop { animation: hop .9s var(--ease); }
@keyframes hop { 0%, 100% { transform: none; } 40% { transform: translateY(-26px) scale(.96, 1.06); } 70% { transform: translateY(0) scale(1.06, .94); } }

.snail path:first-child { animation: none; }
.lady { animation: ladyWalk 9s var(--ease) infinite alternate; }
@keyframes ladyWalk { from { transform: translate(0, 0); } to { transform: translate(-6px, 34px); } }

.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.6s var(--ease) infinite alternate; }
@keyframes flicker { from { transform: scale(.9, .92); } to { transform: scale(1.05, 1.1); } }

/* pothos vines hang from the planter and sway like curtains */
.vine { transform-box: fill-box; transform-origin: 50% 0; animation: vine 6s var(--ease) infinite alternate; }
@keyframes vine { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }

/* bees + butterflies */
.bwing { transform-box: fill-box; transform-origin: 50% 100%; animation: buzz .07s linear infinite alternate; }
@keyframes buzz { to { transform: scaleY(.45); } }
.wing { transform-box: fill-box; animation: flap .24s var(--ease) infinite alternate; }
.wl { transform-origin: 100% 50%; } .wr { transform-origin: 0 50%; }
.bfly.rest .wing { animation-duration: 1.4s; }
@keyframes flap { to { transform: scaleX(.22); } }
.dwing { transform-box: fill-box; transform-origin: 50% 100%; animation: dwing .05s linear infinite alternate; }
@keyframes dwing { to { transform: scaleY(.6); opacity: .5; } }
.koi-tail { transform-box: fill-box; transform-origin: 100% 50%; animation: tail .6s var(--ease) infinite alternate; }
@keyframes tail { from { transform: skewY(-14deg); } to { transform: skewY(14deg); } }
.star { animation: twinkle 3s var(--ease) infinite alternate; }
@keyframes twinkle { from { opacity: .25; } to { opacity: 1; } }
.zz { font-family: Caveat, cursive; font-weight: 700; font-size: 18px; fill: #EEF4E8; }

/* watering can + seedling */
#can { cursor: pointer; transform-box: fill-box; transform-origin: 30% 80%; transition: transform .7s var(--ease); outline: none; }
#can:hover { transform: rotate(-4deg); }
#can.pour { transform: rotate(32deg); }
#can:focus-visible path:nth-of-type(5) { stroke: #F2B33D; stroke-width: 3; }
.sp-stem, .sp-l1, .sp-l2, .sp-fl { transform-box: fill-box; transition: transform 1.1s var(--ease); }
.sp-stem { transform-origin: 50% 100%; transform: scaleY(.42); }
.sp-l1 { transform-origin: 50% 100%; transform: translateY(5px) scale(.7); }
.sp-l2 { transform-origin: 50% 100%; transform: scale(0); }
.sp-fl { transform-origin: 50% 100%; transform: scale(0); }
[data-stage="1"] .sp-stem { transform: scaleY(.72); }
[data-stage="1"] .sp-l1 { transform: none; }
[data-stage="1"] .sp-l2 { transform: translateY(8px) scale(.45); }
[data-stage="2"] .sp-stem, [data-stage="3"] .sp-stem { transform: none; }
[data-stage="2"] .sp-l1, [data-stage="3"] .sp-l1, [data-stage="2"] .sp-l2, [data-stage="3"] .sp-l2 { transform: none; }
[data-stage="2"] .sp-fl { transform: translateY(6px) scale(.3); }
[data-stage="3"] .sp-fl { transform: none; }
.sparkle path { animation: pop 1s var(--ease) forwards; }
@keyframes pop { from { opacity: 1; stroke-dashoffset: 14; } to { opacity: 0; stroke-dashoffset: -14; } }

/* doodle hints */
.hint text { font-family: Caveat, cursive; font-weight: 700; font-size: 26px; fill: var(--ink); }
.hint path { stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hint { transition: opacity 1s var(--ease); }
.hint.done { opacity: 0; }

/* ---------- small screens: copy on top, scene below ---------- */
@media (max-width: 860px) {
  .hero { display: flex; flex-direction: column; min-height: 0; }
  .copy { width: auto; margin: 0; padding: 84px 16px 4px; }
  .copy::before { left: -20px; right: -20px; top: 40px; }
  h1 { font-size: clamp(36px, 10vw, 52px); }
  .snaps { gap: 12px; margin-top: 22px; }
  .snap { width: 92px; }
  .scene-wrap { position: relative; inset: auto; height: clamp(420px, 66vh, 620px); margin-top: -40px;
    -webkit-mask-image: linear-gradient(transparent, #000 70px); mask-image: linear-gradient(transparent, #000 70px); }
}
@media (max-width: 380px) { .snap { width: 84px; } .snaps { gap: 10px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* sleepy "z z" over dozing flowers (opacity driven by garden.js) */
.snooze text { font-family: Caveat, cursive; font-weight: 700; fill: #EEF0FF; }
.snooze { animation: snooze 3.2s var(--ease) infinite alternate; }
@keyframes snooze { from { transform: translate(0, 2px); } to { transform: translate(3px, -5px); } }
