:root {
  color-scheme: light;
  --ink: #475448;
  --muted-ink: #73816f;
  --cream: #fff9e9;
  --paper: #fffdf2;
  --green: #96bb78;
  --green-dark: #5f8158;
  --sage: #dce9c7;
  --yellow: #f0cc68;
  --blue: #a9d3dc;
  --pink: #eaa99c;
  --soil: #ad7957;
  --outline: #536557;
  --shadow: rgba(60, 73, 54, 0.16);
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  color: var(--ink);
  background: #dce9c9;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button { color: inherit; font: inherit; }

button:focus-visible {
  outline: 3px solid rgba(80, 124, 116, .5);
  outline-offset: 5px;
}

.sky-wash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 8%, rgba(255,255,255,.7), transparent 30%),
    radial-gradient(circle at 86% 34%, rgba(250,239,174,.42), transparent 26%),
    linear-gradient(155deg, #d5e9d4 0%, #eaf0ce 52%, #cbdcbf 100%);
}

.sky-wash::after, .paper-grain::after, .book-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .15;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.52'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.app { position: relative; min-height: 100svh; }

.cover-screen {
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: max(28px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
  transition: opacity .35s ease, transform .55s ease;
}

.cover-screen.is-opening { opacity: 0; transform: scale(1.035); pointer-events: none; }
.cover-screen.is-hidden { display: none; }

.eyebrow {
  margin: 0;
  color: #62765f;
  font-size: 13px;
  letter-spacing: .22em;
}

.book-cover {
  width: min(78vw, 330px);
  aspect-ratio: 3 / 4.18;
  position: relative;
  isolation: isolate;
  border: 1.5px solid #71825f;
  border-radius: 8px 18px 18px 7px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  color: #4b604e;
  background:
    linear-gradient(90deg, rgba(73,94,65,.16), transparent 8%, transparent 92%, rgba(255,255,255,.35)),
    #f8e8a7;
  box-shadow: -8px 10px 0 #81946e, -12px 15px 28px rgba(50,69,49,.25), inset 0 0 0 7px rgba(255,255,255,.25);
  transform: perspective(900px) rotateY(5deg) rotateZ(-1.2deg);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease;
}

.book-cover:hover { transform: perspective(900px) rotateY(1deg) rotateZ(.3deg) translateY(-5px); box-shadow: -5px 12px 0 #81946e, -11px 20px 32px rgba(50,69,49,.22), inset 0 0 0 7px rgba(255,255,255,.25); }
.book-cover:active { transform: perspective(900px) rotateY(1deg) scale(.985); }

.cover-edge { position: absolute; z-index: 3; left: 12px; top: 0; bottom: 0; width: 2px; background: rgba(91,112,78,.26); box-shadow: 3px 0 rgba(255,255,255,.25); }
.cover-sun { position: absolute; width: 50px; height: 50px; right: 25px; top: 26px; border: 2px solid #d5a954; border-radius: 50%; opacity: .56; box-shadow: inset 0 0 0 8px rgba(250,209,96,.16); }
.cover-art { position: absolute; inset: 0; }
.cover-art svg { width: 100%; height: 100%; overflow: visible; }
.cover-vine { fill: none; stroke: #6f9061; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.cover-vine.thin { stroke-width: 3; }
.cover-leaves { fill: #8fb276; stroke: #657d5e; stroke-width: 2; stroke-linejoin: round; }
.cover-flowers { fill: #f6c6a1; stroke: #a97062; stroke-width: 1.5; }
.cover-flowers .heart { fill: #eabf5d; }
.cover-copy { position: absolute; inset: 27% 14% auto; display: flex; flex-direction: column; align-items: center; }
.cover-kicker { font-family: ui-sans-serif, system-ui, sans-serif; font-size: 7px; letter-spacing: .23em; opacity: .65; }
.cover-copy strong { margin-top: 13px; font-size: clamp(32px, 10vw, 46px); letter-spacing: .15em; font-weight: 600; text-indent: .15em; text-shadow: 0 1px rgba(255,255,255,.7); }
.cover-rule { width: 44px; height: 5px; margin: 17px 0 14px; border-top: 1px solid #81906c; border-bottom: 1px solid #81906c; }
.cover-subtitle { font-size: 12px; letter-spacing: .12em; }
.open-hint { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .13em; opacity: .76; }
.open-hint i { width: 22px; height: 12px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); animation: hint 2s ease-in-out infinite; }
@keyframes hint { 50% { transform: rotate(45deg) translate(3px,3px); opacity: .35; } }

.book-screen { min-height: 100svh; padding: max(15px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)); opacity: 0; transform: scale(.96); transition: opacity .55s ease, transform .7s cubic-bezier(.2,.75,.2,1); }
.book-screen[aria-hidden="true"] { display: none; }
.book-screen.is-visible { opacity: 1; transform: scale(1); }
.book-screen.is-closing { opacity: 0; transform: scale(.965); }

.book-toolbar { width: min(100%, 980px); margin: 0 auto 12px; display: flex; align-items: end; justify-content: space-between; padding: 0 5px; }
.book-toolbar h1 { margin: 1px 0 0; font-weight: 500; font-size: 25px; letter-spacing: .14em; }
.page-mark { font: 700 8px/1.4 ui-sans-serif, system-ui, sans-serif; letter-spacing: .24em; color: #809277; }
.close-book { display: flex; align-items: center; gap: 6px; border: 0; border-radius: 99px; padding: 8px 12px; background: rgba(255,255,255,.45); cursor: pointer; font-size: 12px; letter-spacing: .08em; }
.close-book svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.story-book { width: min(100%, 980px); margin: 0 auto; position: relative; perspective: 1200px; filter: drop-shadow(0 18px 18px rgba(64,75,55,.18)); }
.page-stack { position: absolute; inset: 9px -3px -7px; border-radius: 10px 10px 17px 17px; background: #dad4b8; border: 1px solid #b9b49f; transform: rotate(.2deg); box-shadow: 0 4px #eee8cf, 0 7px #bcb59a; }
.spread { position: relative; aspect-ratio: 1 / 1.22; max-height: calc(100svh - 145px); min-height: 500px; overflow: hidden; border: 1px solid #cec8ad; border-radius: 9px 9px 15px 15px; background: var(--paper); transform-origin: center bottom; animation: bookOpen .85s cubic-bezier(.2,.8,.2,1) both; box-shadow: inset 0 0 35px rgba(106,95,65,.1); }
@keyframes bookOpen { from { transform: rotateX(24deg) scaleY(.86); opacity: 0; } to { transform: rotateX(0) scaleY(1); opacity: 1; } }
.paper-grain { position: absolute; inset: 0; z-index: 20; pointer-events: none; opacity: .5; }
.book-seam { position: absolute; left: 49.5%; top: 0; bottom: 0; z-index: 21; width: 2.2%; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(76,69,51,.12) 35%, rgba(255,255,255,.66) 54%, transparent); opacity: .45; }

.garden-page { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(#f9f3da 0 35%, #e5edcb 68%, #d0dfa9 100%); }
.wash { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .38; }
.wash-one { width: 65%; height: 25%; left: -8%; top: 10%; background: #b8d7d5; transform: rotate(-5deg); }
.wash-two { width: 48%; height: 19%; right: -5%; top: 22%; background: #f4d88b; transform: rotate(9deg); opacity: .25; }
.garden-note { position: absolute; z-index: 2; top: 7%; left: 56%; margin: 0; color: #6e7a6a; font-size: clamp(12px, 3.1vw, 16px); line-height: 1.9; letter-spacing: .09em; transform: rotate(1deg); }

.grass-layer { position: absolute; left: -5%; width: 110%; background: #b8d290; border: 1.8px solid #79936b; }
.grass-back { z-index: 2; height: 48%; bottom: -10%; border-radius: 50% 50% 0 0 / 17% 18% 0 0; transform: rotate(-1.5deg); box-shadow: inset 0 12px rgba(255,255,255,.14); }
.grass-front { z-index: 7; height: 16%; bottom: -8%; border-radius: 55% 55% 0 0 / 40% 40% 0 0; background: #9fc27a; opacity: .87; }
.grass-back::before, .grass-front::before { content: ""; position: absolute; inset: 0; opacity: .16; background-image: radial-gradient(#4e714c .7px, transparent .7px); background-size: 9px 8px; }

.interactive, .tree, .wildflower, .plant-bed, .watering-can { border: 0; padding: 0; background: transparent; cursor: pointer; touch-action: manipulation; }
.tree { position: absolute; z-index: 5; left: 1.5%; bottom: 25%; width: 39%; transform-origin: 50% 91%; filter: drop-shadow(0 8px 3px rgba(51,76,46,.13)); }
.tree svg { display: block; width: 100%; overflow: visible; }
.tree-shadow { fill: rgba(77,100,57,.2); }
.tree-trunk { fill: #ba895f; stroke: var(--outline); stroke-width: 3; stroke-linejoin: round; }
.tree-line, .tree-vein { fill: none; stroke: #71815b; stroke-width: 2; stroke-linecap: round; opacity: .55; }
.tree-crown.back { fill: #91bd77; stroke: var(--outline); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.tree-crown.front { fill: none; stroke: #6f9766; stroke-width: 2.2; stroke-linecap: round; }
.tree.is-wiggling { animation: treeWiggle .9s ease-in-out; }
@keyframes treeWiggle { 20% { transform: rotate(-3deg); } 40% { transform: rotate(2.5deg); } 60% { transform: rotate(-1.5deg); } 80% { transform: rotate(.8deg); } }

.wildflowers { position: absolute; z-index: 9; bottom: 9%; left: 5%; width: 34%; height: 24%; pointer-events: none; }
.wildflower { position: absolute; bottom: 0; width: 30%; pointer-events: auto; transform-origin: 50% 90%; filter: drop-shadow(0 4px 2px rgba(54,72,46,.12)); }
.wildflower svg { display: block; width: 100%; overflow: visible; }
.wildflower .stem { fill: none; stroke: #66865b; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.wildflower .bloom { stroke: #736f55; stroke-width: 1.4; stroke-linejoin: round; }
.flower-a { left: 5%; width: 32%; }.flower-a .bloom { fill: #efcb65; }.flower-a .bloom circle { fill: #ac774d; }
.flower-b { left: 33%; width: 29%; transform: scale(.86); }.flower-b .bloom { fill: #a9ced7; }.flower-b .bloom circle { fill: #e7c166; }
.flower-c { left: 61%; width: 32%; transform: scale(.94); }.flower-c .bloom { fill: #e9a7a1; }.flower-c .bloom circle { fill: #edc964; }
.wildflower.is-dancing { animation: flowerDance .8s ease-in-out; }
@keyframes flowerDance { 20% { transform: rotate(-8deg) scale(.95); } 45% { transform: rotate(7deg) scale(1.02); } 70% { transform: rotate(-4deg); } }

.plant-bed { position: absolute; z-index: 8; left: 35%; bottom: 8%; width: 42%; height: 29%; }
.soil-rim { position: absolute; left: 0; right: 0; bottom: 8%; height: 43%; border-radius: 50%; background: #d49a6b; border: 2px solid #735f4e; transform: rotate(-2deg); box-shadow: 0 8px 0 rgba(94,112,62,.1); }
.soil { position: absolute; left: 5%; right: 5%; bottom: 12%; height: 35%; border-radius: 50%; background: #a76e4e; border: 2px solid #735746; overflow: hidden; transform: rotate(-2deg); box-shadow: inset 0 8px 8px rgba(89,48,35,.14); }
.soil i { position: absolute; width: 4px; height: 3px; border-radius: 50%; background: #79513f; opacity: .65; }
.soil i:nth-child(1){left:20%;top:44%}.soil i:nth-child(2){left:40%;top:20%}.soil i:nth-child(3){left:63%;top:57%}.soil i:nth-child(4){left:76%;top:28%}.soil i:nth-child(5){left:34%;top:70%}
.bed-label { position: absolute; left: 50%; bottom: -3%; transform: translateX(-50%); width: max-content; max-width: 100%; padding: 5px 10px; border-radius: 99px; background: rgba(255,253,235,.78); color: #716b55; font-size: clamp(9px, 2.5vw, 12px); letter-spacing: .05em; transition: opacity .25s ease; }
.plant { position: absolute; z-index: 2; left: 50%; bottom: 34%; width: 36%; height: 65%; transform: translateX(-50%); pointer-events: none; }
.seed-shape { position: absolute; left: 50%; bottom: 4%; width: 17px; height: 22px; border: 2px solid #5f5143; border-radius: 65% 35% 58% 42%; background: #d8b06a; transform: translateX(-50%) rotate(22deg) scale(0); }
.sprout-stem { position: absolute; left: calc(50% - 2px); bottom: 8%; width: 4px; height: 55%; border-radius: 50%; background: #688c59; transform: scaleY(0); transform-origin: bottom; }
.sprout-leaf { position: absolute; bottom: 33%; width: 34%; height: 22%; border: 2px solid #597856; background: #91bd72; opacity: 0; }
.sprout-leaf.left { right: 50%; border-radius: 80% 10% 75% 20%; transform: rotate(25deg); transform-origin: right bottom; }
.sprout-leaf.right { left: 50%; bottom: 46%; border-radius: 10% 80% 20% 75%; transform: rotate(-22deg); transform-origin: left bottom; }
.grown-flower { position: absolute; left: 50%; top: -2%; width: 52px; height: 52px; transform: translateX(-50%) scale(0); }
.grown-flower i, .grown-flower b { position: absolute; left: 50%; top: 50%; display: block; }
.grown-flower i { width: 19px; height: 27px; margin: -24px 0 0 -9.5px; border: 1.8px solid #7d6b58; border-radius: 55% 55% 45% 45%; background: #f3b7a6; transform-origin: 50% 24px; }
.grown-flower i:nth-child(2){transform:rotate(72deg)}.grown-flower i:nth-child(3){transform:rotate(144deg)}.grown-flower i:nth-child(4){transform:rotate(216deg)}.grown-flower i:nth-child(5){transform:rotate(288deg)}
.grown-flower b { width: 18px; height: 18px; margin: -9px; border: 1.8px solid #7d6b58; border-radius: 50%; background: #efca61; }
.plant-bed[data-stage="seed"] .seed-shape { animation: seedPop .7s cubic-bezier(.2,1.5,.4,1) forwards; }
.plant-bed[data-stage="sprout"] .seed-shape { transform: translateX(-50%) rotate(22deg) scale(.75); }
.plant-bed[data-stage="sprout"] .sprout-stem { animation: growStem .65s ease-out forwards; }
.plant-bed[data-stage="sprout"] .sprout-leaf { animation: leafOpen .5s .35s ease-out forwards; }
.plant-bed[data-stage="flower"] .seed-shape { transform: translateX(-50%) rotate(22deg) scale(.65); }
.plant-bed[data-stage="flower"] .sprout-stem { transform: scaleY(1); }
.plant-bed[data-stage="flower"] .sprout-leaf { opacity: 1; }
.plant-bed[data-stage="flower"] .grown-flower { animation: bloom .8s cubic-bezier(.2,1.35,.35,1) forwards; }
@keyframes seedPop { 0% { transform: translate(-50%, 18px) rotate(22deg) scale(0); } 65% { transform: translate(-50%,-8px) rotate(8deg) scale(1.12); } 100% { transform: translateX(-50%) rotate(22deg) scale(1); } }
@keyframes growStem { from { transform: scaleY(.08); } to { transform: scaleY(1); } }
@keyframes leafOpen { from { opacity: 0; scale: .2; } to { opacity: 1; scale: 1; } }
@keyframes bloom { from { transform: translateX(-50%) scale(0) rotate(-20deg); } to { transform: translateX(-50%) scale(1) rotate(0); } }

.watering-can { position: absolute; z-index: 11; right: 2%; bottom: 7%; width: 25%; transform-origin: 70% 80%; filter: drop-shadow(0 6px 3px rgba(56,72,56,.14)); transition: transform .3s ease, filter .3s ease; }
.watering-can svg { width: 100%; display: block; overflow: visible; }
.can-shadow { fill: rgba(66,86,56,.18); }.can-body,.can-top { fill: #9ec8cb; stroke: #526c68; stroke-width: 2.5; stroke-linejoin: round; }.can-top { fill:#c4e0d9}.can-handle { fill:none;stroke:#526c68;stroke-width:10;stroke-linecap:round}.can-spout,.can-rose {fill:#a7ced0;stroke:#526c68;stroke-width:2.5;stroke-linejoin:round}.can-mark{fill:#f0c768;stroke:#6b7761;stroke-width:2}
.watering-can.is-selected { transform: translateY(-10px) rotate(-8deg); filter: drop-shadow(0 9px 5px rgba(56,72,56,.18)) drop-shadow(0 0 8px rgba(244,211,106,.7)); }
.watering-can.is-pouring { animation: pour .9s ease-in-out; }
@keyframes pour { 35%,65% { transform: translate(-20%, -32%) rotate(-32deg); } }
.tool-tag { display: inline-block; margin-top: -4px; padding: 4px 9px; border-radius: 99px; background: rgba(255,253,235,.8); font-size: clamp(9px,2.5vw,12px); letter-spacing: .08em; }

.chair { position: absolute; z-index: 6; right: 4%; bottom: 24%; width: 24%; filter: drop-shadow(0 7px 3px rgba(56,71,48,.12)); }
.chair svg { display:block;width:100%;overflow:visible}.chair-shadow{fill:rgba(65,85,51,.2)}.chair .wood{fill:#b9825d;stroke:#695b49;stroke-width:2.7;stroke-linejoin:round}.chair .wood.light{fill:#c99368}.chair .wood.line{fill:none;stroke:#88654e;stroke-width:2;stroke-linecap:round}.chair .wood.seat{fill:#bd875f}

.water-drops { position: absolute; z-index: 15; left: 55%; bottom: 29%; width: 22%; height: 29%; pointer-events: none; display: none; }
.water-drops.is-raining { display: block; }
.water-drops i { position: absolute; top: 0; width: 10px; height: 15px; border: 1.5px solid #4d868d; border-radius: 60% 40% 62% 38%; background: #a8dae0; opacity: 0; transform: rotate(20deg); animation: drop .8s ease-in infinite; }
.water-drops i:nth-child(1){left:5%;animation-delay:.05s}.water-drops i:nth-child(2){left:28%;animation-delay:.25s}.water-drops i:nth-child(3){left:50%;animation-delay:.12s}.water-drops i:nth-child(4){left:70%;animation-delay:.38s}.water-drops i:nth-child(5){left:88%;animation-delay:.2s}
@keyframes drop { 0%{opacity:0;transform:translateY(-10px) rotate(20deg) scale(.6)}20%{opacity:1}85%{opacity:.8}100%{opacity:0;transform:translateY(105px) rotate(20deg) scale(1)} }

.butterfly { position:absolute;z-index:10;left:46%;top:25%;width:24px;height:20px;animation:fly 7s ease-in-out infinite;opacity:.8}.butterfly i{position:absolute;top:1px;width:12px;height:15px;border:1.5px solid #82735b;background:#efc484}.butterfly i:first-child{left:0;border-radius:70% 30% 60% 40%;transform:rotate(20deg);animation:wingL .5s ease-in-out infinite alternate}.butterfly i:nth-child(2){right:0;border-radius:30% 70% 40% 60%;transform:rotate(-20deg);animation:wingR .5s ease-in-out infinite alternate}.butterfly b{position:absolute;left:11px;top:5px;width:3px;height:12px;border-radius:50%;background:#6d6657}
@keyframes fly{50%{transform:translate(16px,-10px) rotate(5deg)}}@keyframes wingL{to{transform:rotateY(55deg) rotate(20deg)}}@keyframes wingR{to{transform:rotateY(55deg) rotate(-20deg)}}
.page-number { position:absolute;z-index:9;bottom:2%;left:50%;transform:translateX(-50%);font-size:10px;color:#798070;letter-spacing:.12em;}

.guide { width: min(92%, 470px); min-height: 43px; margin: 15px auto 0; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 9px 16px; border: 1px solid rgba(101,122,87,.24); border-radius: 99px; background: rgba(255,255,255,.45); box-shadow: 0 4px 15px rgba(66,81,57,.05); transition: opacity .3s ease; }
.guide p { margin: 0; font-size: 12px; letter-spacing: .08em; text-align: center; }
.guide-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #dfaa69; box-shadow: 0 0 0 3px rgba(223,170,105,.2); }

@media (min-width: 700px) {
  .book-screen { padding-top: 25px; }
  .spread { aspect-ratio: 1.58 / 1; min-height: 0; height: min(72vh, 680px); }
  .garden-note { left: 63%; top: 8%; }
  .tree { left: 5%; bottom: 17%; width: 27%; }
  .wildflowers { left: 25%; bottom: 8%; width: 23%; height: 27%; }
  .plant-bed { left: 43%; bottom: 5%; width: 30%; height: 35%; }
  .watering-can { right: 2%; bottom: 5%; width: 18%; }
  .chair { right: 12%; bottom: 29%; width: 14%; }
  .grass-back { height: 51%; bottom: -17%; }
  .grass-front { bottom: -10%; }
  .book-seam { display: block; }
}

@media (max-height: 690px) and (max-width: 699px) {
  .spread { min-height: 460px; }
  .guide { margin-top: 10px; }
  .book-toolbar { margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
