@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=DM+Sans:wght@400;500;600&family=Patrick+Hand&display=swap');

:root{
  --pink:#e994a9;
  --deep-pink:#d86f8d;
  --blush:#fbe8eb;
  --cream:#fffaf5;
  --paper:#fffdf9;
  --ink:#4d3f48;
  --muted:#9a7f88;
  --green:#7ca477;
  --shadow:rgba(100,67,76,.16);
}

*{box-sizing:border-box}
html,body{margin:0;min-height:100%;}

body{
  min-height:100vh;
  color:var(--ink);
  overflow-x:hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(246,182,194,.42) 0 2px, transparent 3px),
    radial-gradient(circle at 83% 18%, rgba(139,173,130,.28) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 82%, rgba(246,182,194,.35) 0 3px, transparent 4px),
    linear-gradient(135deg,#fffaf8 0%,#fdecef 48%,#f8f5ed 100%);
  font-family:'DM Sans',sans-serif;
}

body:before, body:after{
  content:"";
  position:fixed;
  width:280px;height:280px;
  border-radius:50%;
  filter:blur(35px);
  opacity:.35;
  z-index:-1;
}
body:before{background:#f7b6c5;left:-110px;top:18%}
body:after{background:#b9d0a9;right:-100px;bottom:8%}

.sakura{
  position:fixed;
  inset:0;
  z-index:20;
  pointer-events:none;
  overflow:hidden;
}
.sakura-petal{
  position:absolute;
  top:-40px;
  width:14px;
  height:14px;
  background:
    radial-gradient(circle at 30% 30%, #ffe4ec 0 28%, transparent 30%),
    radial-gradient(circle at 70% 30%, #ffd0de 0 28%, transparent 30%),
    radial-gradient(circle at 50% 70%, #f7b6c8 0 34%, transparent 36%),
    radial-gradient(circle at 50% 45%, #ffc2d4 0 22%, transparent 24%);
  border-radius:60% 40% 60% 40%;
  opacity:.85;
  will-change:transform, opacity;
  animation-name:sakuraFall, sakuraSway;
  animation-timing-function:linear, ease-in-out;
  animation-iteration-count:infinite;
}
.sakura-petal:before{
  content:"";
  position:absolute;
  inset:18%;
  border-radius:50%;
  background:rgba(255,255,255,.35);
}
@keyframes sakuraFall{
  0%{transform:translate3d(0,-10vh,0) rotate(0deg);opacity:0}
  8%{opacity:.9}
  90%{opacity:.75}
  100%{transform:translate3d(var(--drift),110vh,0) rotate(720deg);opacity:0}
}
@keyframes sakuraSway{
  0%,100%{margin-left:0}
  25%{margin-left:12px}
  50%{margin-left:-8px}
  75%{margin-left:16px}
}

@media (prefers-reduced-motion: reduce){
  .sakura{display:none}
}

.scene{
  width:min(1440px,96vw);
  min-height:100vh;
  margin:auto;
  display:grid;
  grid-template-columns:240px minmax(540px,760px) 260px;
  gap:24px;
  align-items:center;
  justify-content:center;
  padding:38px 10px;
}

.diary-wrap{width:100%;position:relative}

.top-note{
  display:flex;
  justify-content:space-between;
  padding:0 20px 12px;
  color:#a07b86;
  font-size:13px;
  letter-spacing:.08em;
  text-transform:lowercase;
}

.book{
  position:relative;
  width:100%;
  min-height:680px;
  perspective:1800px;
  filter:drop-shadow(0 24px 22px var(--shadow));
}

.book:before{
  content:"";
  position:absolute;
  inset:8px 8px 0 8px;
  background:#d9a9ad;
  border-radius:9px 18px 18px 9px;
  transform:translate(8px,8px);
  box-shadow:inset -7px 0 0 rgba(124,82,93,.1);
}

.book-spine{
  position:absolute;
  left:0;top:0;bottom:0;
  width:25px;
  z-index:5;
  border-radius:10px 0 0 10px;
  background:linear-gradient(90deg,#c8788f,#edb0bd 55%,#d38a9b);
  box-shadow:inset -3px 0 4px rgba(110,62,77,.18);
}

.paper{
  position:absolute;
  inset:0;
  z-index:3;
  transform-origin:left center;
  transition:transform .72s cubic-bezier(.72,-.05,.2,1);
  background:
    linear-gradient(90deg,rgba(225,180,186,.42) 0,transparent 7px),
    repeating-linear-gradient(to bottom, transparent 0,transparent 31px,rgba(209,165,173,.14) 32px),
    var(--paper);
  border-radius:10px 18px 18px 10px;
  border:1px solid rgba(180,127,141,.2);
  overflow:hidden;
}

.paper-inner{height:100%;min-height:680px;position:relative;padding:48px 70px 55px 72px}

.paper:after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(105deg,rgba(255,255,255,.55),transparent 20%,transparent 82%,rgba(226,194,196,.18));
}

.paper-back{
  z-index:1;
  transform:translate(12px,12px);
  background:#fff8f2;
  border:1px solid rgba(184,134,145,.22);
}

.paper.turn{
  transform:rotateY(-178deg);
  box-shadow:0 10px 20px rgba(80,40,55,.08);
}

.page-corner{
  position:absolute;
  right:0;top:0;
  width:70px;height:70px;
  background:linear-gradient(135deg,transparent 49%,#f5e3df 50%);
  opacity:.75;
}

.flower-bookmark{
  position:absolute;
  top:-10px;
  right:32px;
  z-index:9;
  width:44px;height:210px;
  transform:rotate(3deg);
  filter:drop-shadow(0 5px 3px rgba(100,60,70,.14));
  opacity:.85;
}
.bookmark-stem{
  position:absolute;left:20px;top:35px;
  width:4px;height:165px;border-radius:10px;
  background:linear-gradient(#6e9b65,#4e8152);
  opacity:.75;
}
.bookmark-flower{
  position:absolute;top:0;left:2px;
  font-size:40px;color:rgba(233,135,160,.78);
  font-family:serif;
  text-shadow:0 2px rgba(247,192,203,.45);
}

.page-content{position:relative;z-index:2;height:100%}
.tiny-label{
  margin:0 0 3px;
  color:#b88a96;
  font-size:12px;
  letter-spacing:.3em;
}
h1{
  margin:0;
  color:#ce7088;
  font-family:'Caveat',cursive;
  font-size:78px;
  line-height:.95;
  font-weight:600;
}
.subtitle{
  max-width:470px;
  margin:12px 0 30px;
  color:#8e747d;
  font-family:'Caveat',cursive;
  font-size:25px;
  line-height:1.05;
}
.date-line{
  display:flex;align-items:center;gap:14px;
  width:max-content;
  padding:7px 14px;
  border-radius:30px;
  background:#fce8ec;
  color:#ad7181;
  font-size:11px;
  letter-spacing:.16em;
}
.date-line input{
  width:105px;border:0;outline:0;background:transparent;
  color:#8e6670;
  font-family:'Caveat',cursive;font-size:20px;
}
.writing-area{
  min-height:305px;
  margin-top:26px;
  padding:4px 5px 10px 0;
  outline:none;
  color:#554650;
  font-family:'Patrick Hand','Caveat',cursive;
  font-size:24px;
  line-height:1.55;
}
.writing-area p{margin:0 0 11px}
[contenteditable="true"]:focus{
  outline:1px dashed rgba(216,111,141,.32);
  outline-offset:5px;
  border-radius:4px;
}
.signature{
  position:absolute;
  right:18px;
  bottom:8px;
  color:#cb7890;
  font-family:'Caveat',cursive;
  font-size:28px;
  transform:rotate(-4deg);
}

.controls{
  display:flex;justify-content:center;align-items:center;
  gap:22px;margin-top:18px;
}
.round-btn{
  width:42px;height:42px;border:0;border-radius:50%;
  background:#fffaf7;color:#c8788d;
  box-shadow:0 6px 15px rgba(120,70,84,.12);
  cursor:pointer;font-size:22px;
  transition:.2s;
}
.round-btn:hover{transform:translateY(-2px);background:#fbe3e8}
.round-btn:disabled{opacity:.35;cursor:not-allowed;transform:none}
.dots{display:flex;gap:7px}
.dot{
  width:7px;height:7px;border-radius:50%;
  background:#dec1c7;transition:.2s;
}
.dot.active{width:22px;border-radius:20px;background:#d98299}

.hint{
  text-align:center;
  margin:10px 0 0;
  font-size:11px;
  color:#a68b92;
  letter-spacing:.03em;
}

.side-art{height:680px;position:relative;pointer-events:none}
.left-art{
  display:block;
}
.left-art .flower{
  position:absolute;
  object-fit:contain;
  mix-blend-mode:multiply;
  pointer-events:none;
  user-select:none;
}
.left-art .flower-main{
  width:230px;
  top:8%;
  left:8%;
  opacity:.55;
  filter:saturate(.88) contrast(.94) brightness(1.06);
  transform:rotate(-12deg);
  animation:flowerDrift 7.5s ease-in-out infinite;
}
.left-art .flower-soft{
  width:170px;
  bottom:18%;
  left:-6%;
  opacity:.32;
  filter:saturate(.75) contrast(.9) brightness(1.1) blur(.3px);
  transform:rotate(18deg) scaleX(-1);
  animation:flowerDrift 9s ease-in-out infinite reverse;
}
.left-art .flower-tiny{
  width:110px;
  top:42%;
  right:-4%;
  opacity:.22;
  filter:saturate(.7) contrast(.88) brightness(1.12) blur(.6px);
  transform:rotate(8deg);
  animation:flowerDrift 8.2s ease-in-out infinite;
  animation-delay:-2s;
}
@keyframes flowerDrift{
  0%,100%{translate:0 0}
  50%{translate:0 -10px}
}
.right-art .art-card{
  position:absolute;right:-4px;top:2%;
  width:200px;height:auto;
  background:transparent;
  transform:rotate(4deg);
  filter:drop-shadow(0 10px 14px rgba(120,70,84,.1));
  animation:flowerDrift 8s ease-in-out infinite;
}
.right-art .art-card img{
  width:100%;height:auto;display:block;
  object-fit:contain;
}
.mini-balloons{
  position:absolute;right:-10px;bottom:2%;
  width:230px;height:auto;
  opacity:.92;
  transform:rotate(-3deg);
  filter:drop-shadow(0 12px 16px rgba(120,70,84,.12));
  animation:flowerDrift 9.5s ease-in-out infinite reverse;
}
.mini-balloons img{
  width:100%;height:auto;display:block;
  object-fit:contain;
}

.sparkles:before,.sparkles:after{
  content:"✦   ·   ♡   ·   ✦";
  position:fixed;z-index:0;
  color:rgba(205,125,145,.35);
  font-size:18px;letter-spacing:20px;
}
.sparkles:before{top:7%;left:7%;transform:rotate(-8deg)}
.sparkles:after{right:6%;bottom:7%;transform:rotate(10deg)}

.page-content.is-album{
  display:flex;
  flex-direction:column;
  height:100%;
  min-height:560px;
}
.album-title{
  margin:0 0 8px;
  color:#ce7088;
  font-family:'Caveat',cursive;
  font-size:42px;
  font-weight:600;
  line-height:1;
}
.photo-stage{
  position:relative;
  flex:1;
  min-height:480px;
  margin-top:8px;
}
.polaroid{
  position:absolute;
  margin:0;
  padding:10px 10px 28px;
  background:#fffdfb;
  border:1px solid rgba(180,127,141,.18);
  box-shadow:0 10px 18px rgba(100,60,70,.14);
  width:46%;
}
.polaroid img{
  display:block;
  width:100%;
  height:210px;
  object-fit:cover;
  background:#f3e6e8;
}
.polaroid figcaption{
  margin-top:8px;
  text-align:center;
  color:#c57d90;
  font-family:'Caveat',cursive;
  font-size:22px;
  outline:none;
}
.scatter-a{top:2%;left:2%;width:48%;transform:rotate(-7deg);z-index:2}
.scatter-b{top:42%;right:0;width:50%;transform:rotate(6deg);z-index:3}
.scatter-c{top:6%;right:2%;width:47%;transform:rotate(8deg);z-index:2}
.scatter-d{top:46%;left:0;width:52%;transform:rotate(-5deg);z-index:3}
.scatter-e{top:0;left:18%;width:54%;transform:rotate(-3deg);z-index:2}
.scatter-f{top:48%;left:8%;width:46%;transform:rotate(9deg);z-index:3}
.scatter-g{top:8%;left:-2%;width:49%;transform:rotate(4deg);z-index:3}
.scatter-h{top:40%;right:-2%;width:51%;transform:rotate(-8deg);z-index:2}
.scatter-i{top:4%;right:10%;width:45%;transform:rotate(-10deg);z-index:2}
.scatter-j{top:44%;left:14%;width:50%;transform:rotate(5deg);z-index:3}

.tape{
  position:absolute;
  width:56px;height:18px;
  background:linear-gradient(180deg,rgba(255,236,214,.82),rgba(247,214,180,.72));
  box-shadow:0 1px 2px rgba(120,80,60,.12);
  z-index:5;
}
.tape-1{top:8%;left:36%;transform:rotate(-12deg)}
.tape-2{bottom:18%;right:22%;transform:rotate(18deg)}
.sticker{
  position:absolute;
  right:6%;top:36%;
  color:#e987a0;
  font-size:28px;
  opacity:.7;
  transform:rotate(12deg);
  z-index:4;
}

@media(max-width:1050px){
  .scene{grid-template-columns:1fr;max-width:760px}
  .side-art{display:none}
}
@media(max-width:650px){
  .scene{width:100%;padding:20px 10px}
  .book{min-height:600px}
  .paper-inner{min-height:600px;padding:42px 38px 45px 44px}
  h1{font-size:60px}
  .subtitle{font-size:21px}
  .writing-area{font-size:21px;min-height:280px}
  .flower-bookmark{right:20px}
  .photo-stage{min-height:420px}
  .polaroid img{height:170px}
  .album-title{font-size:34px}
}
