:root{--crimson:#9B1D30;--cream:#F7ECD4;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
*{box-sizing:border-box;margin:0}
body{min-height:100vh;background:#fff;color:var(--ink);font-family:'Gaegu','Comic Sans MS',cursive;overflow-x:hidden}
section{min-height:clamp(640px,100vh,900px);display:flex;align-items:center;justify-content:center;padding:24px}
#s1{background:#9B1D30;color:#F7ECD4;flex-direction:column;text-align:center;cursor:pointer;gap:0}
h1{font-family:'Lora',Georgia,serif;font-weight:400;letter-spacing:.06em;font-size:clamp(1.9rem,8vw,3.6rem);line-height:1.1}
.sub{font-family:'Caveat','Gaegu',cursive;font-style:italic;color:#F7ECD4;font-size:clamp(1.8rem,7vw,3rem);margin-top:2px}
.stage{position:relative;width:min(84vw,430px);margin-top:clamp(10px,4vh,36px)}
#env{width:100%;display:block;transform:rotate(-6deg);animation:boing 1.8s ease-in-out infinite;transform-origin:center bottom;filter:drop-shadow(0 10px 14px rgba(0,0,0,.35))}
@keyframes boing{0%{transform:rotate(-6deg) scale(1)}15%{transform:rotate(-6deg) scale(1.14,.9)}35%{transform:rotate(-6deg) scale(.92,1.1)}55%{transform:rotate(-6deg) scale(1.07,.96)}75%{transform:rotate(-6deg) scale(.98,1.02)}100%{transform:rotate(-6deg) scale(1)}}
#env.pop{animation:pop .6s ease forwards}
@keyframes pop{0%{transform:rotate(-6deg) scale(1)}40%{transform:rotate(-6deg) scale(1.3)}100%{transform:rotate(-6deg) scale(0);opacity:0}}
.hint{position:absolute;right:-2%;bottom:-62px;display:flex;align-items:flex-end;gap:6px;color:#F7ECD4;font-weight:700;font-size:clamp(1rem,4vw,1.35rem);line-height:1.15;text-align:center}
.hint svg{width:58px;height:58px;flex:0 0 auto;animation:wob 1.4s ease-in-out infinite}
@keyframes wob{50%{transform:translate(-3px,-5px)}}
#s2{display:none;flex-direction:column;gap:clamp(22px,5vw,40px);background:#F7ECD4;color:#9B1D30;padding:48px clamp(24px,7vw,120px) 64px}
.row{max-width:none;display:flex;align-items:center;justify-content:center;gap:clamp(4px,1.5vw,20px);width:auto}
.row .pic{width:min(42vw,340px);flex:0 0 auto}
.txt{flex:0 1 auto;text-align:center}
#s2.open{display:flex}
@keyframes fl{from{opacity:0;transform:translateX(-30px)}to{opacity:1;transform:none}}
@keyframes fr{from{opacity:0;transform:translateX(30px)}to{opacity:1;transform:none}}
@keyframes fu{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:none}}
.txt h2{font-family:'Gaegu',cursive;font-weight:700;letter-spacing:.04em;line-height:1;font-size:clamp(1.3rem,5.5vw,2.4rem);color:#9B1D30;margin-bottom:0}
.txt p{font-weight:400;line-height:1.5;font-size:clamp(1.05rem,4vw,1.5rem)}
.letter{width:100%;max-width:none;color:#9B1D30;font-family:'Gaegu','Comic Sans MS',cursive;padding:0 clamp(4px,3vw,16px);line-height:1.5;font-size:clamp(1.15rem,4.4vw,1.5rem)}
.letter p{margin-bottom:1em}
.letter .sig{text-align:right;margin:1.4em 0 0}


/* ===== Responsive ===== */
/* HP kecil (target 360px) */
@media (max-width:480px){
  section{min-height:600px;padding:20px}
  h1{font-size:clamp(1.5rem,7.6vw,2.2rem)}
  .sub{font-size:clamp(1.5rem,7vw,2rem)}
  .stage{width:76vw;margin-top:10px;margin-bottom:56px}
  .hint{bottom:-54px;font-size:1rem}
  .hint svg{width:44px;height:44px}
  #s2{padding:36px 18px 48px;gap:24px}
  .row{gap:10px}
  .row .pic{width:36vw}
  .txt h2{font-size:clamp(1.15rem,6.2vw,1.6rem)}
  .letter{font-size:1.05rem;line-height:1.55;padding:0}
}
/* Tablet (target 768px) */
@media (min-width:481px) and (max-width:1023px){
  .stage{width:min(62vw,430px)}
  #s2{padding:56px 48px 64px}
  .row .pic{width:min(36vw,300px)}
  .txt h2{font-size:clamp(1.8rem,5vw,2.6rem)}
  .letter{max-width:720px;margin:0 auto;font-size:1.3rem}
}
/* Desktop (target 1024px ke atas) */
@media (min-width:1024px){
  .stage{width:min(40vw,430px)}
  #s2{padding:72px 120px 80px}
  .row .pic{width:340px}
  .txt h2{font-size:clamp(2.2rem,3.6vw,3rem)}
  .letter{max-width:820px;margin:0 auto;font-size:1.5rem}
}

/* ===== Efek muncul (fade) + typewriter + drip antar section ===== */
body{--dh:max(140px,9.72vw)}
.js .fx{opacity:0;transform:translateY(24px);transition:opacity .9s ease var(--d,0s),transform .9s ease var(--d,0s)}
.js .fx-l{transform:translateX(-60px)}
.js .fx-r{transform:translateX(60px)}
.js .fx.in{opacity:1;transform:none}
.js .w{opacity:0;transition:opacity .3s ease}
.js .w.on{opacity:1}
#s2{position:relative}
.drip{position:absolute;top:-1px;left:0;right:0;height:var(--dh);overflow:hidden;pointer-events:none}
.drip svg{display:block;width:100%;height:100%}
.js .drip svg{transform:scaleY(.15);transform-origin:top;transition:transform 1.6s cubic-bezier(.25,1.35,.5,1)}
.js .drip.in svg{transform:none}
#s2{padding-top:calc(var(--dh) + 16px)}
@media (prefers-reduced-motion:reduce){.js .fx,.js .w,.js .drip svg{transition:none;opacity:1;transform:none}}



/* ===== Mobile: foto di atas, tulisan di bawahnya ===== */
@media (max-width:600px){
  .row{flex-direction:column;gap:14px}
  .row .pic{width:62vw}
  .txt h2{font-size:clamp(1.4rem,7.4vw,1.9rem)}
}

/* ===== Revisi: spasi baris, foto mantul ===== */
.txt h2{line-height:1.3}
.pic{transform-origin:50% 100%}

/* ============================================================
   REVISI: tiap section = 1 layar penuh di HP, tablet, laptop
   ============================================================ */
html{scroll-snap-type:y proximity}
section,.pg{scroll-snap-align:start}
#s1,#s2{--dh:max(clamp(88px,11svh,150px),9.72vw)} /* 9.72vw = tinggi asli eskrim di layar lebar, supaya tidak terpotong */
section{min-height:100vh;min-height:100svh;padding:24px}

/* Section 2 = dua halaman penuh: (1) foto + judul, (2) surat */
#s2{display:none;padding:0;gap:0;min-height:0}
#s2.open{display:block}
.pg{min-height:100vh;min-height:100svh;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:clamp(16px,3svh,36px);padding:48px clamp(20px,6vw,120px)}
.pg1{padding-top:calc(var(--dh) + 16px)}
.pg2{padding-top:56px;padding-bottom:56px}
/* Tablet & desktop: surat sedikit lebih naik (ubah 12svh untuk atur seberapa naik) */

.row{flex-direction:row;width:100%;justify-content:center;gap:clamp(20px,5vw,80px)}
.row .pic{width:min(40vw,420px,50svh)}
.txt{max-width:min(46vw,560px)}

/* Layar potret (HP & tablet berdiri): foto di atas, judul di bawah, ukuran mengikuti tinggi layar */
@media (orientation:portrait){
  .row{flex-direction:column;gap:clamp(12px,2.5svh,28px)}
  .row .pic{width:min(66vw,36svh)}
  .txt{max-width:100%}
}

/* Surat: font lebih besar */
.letter{max-width:860px;margin:0 auto;padding:0;line-height:1.5;font-size:1.2rem}
@media (min-width:481px){.letter{font-size:clamp(1.45rem,2.6vw,1.75rem)}}

/* Judul ulang tahun */
.txt .hb{position:relative;display:flex;flex-direction:column;align-items:center;text-align:center;
  letter-spacing:0;line-height:1;padding:.5rem 1.6rem}
.hb::before,.hb::after{content:"";position:absolute;background:center/contain no-repeat;pointer-events:none}
.hb::before{top:0;right:0;width:1.7rem;height:1.7rem;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l2.6 8.4L23 12l-8.4 2.6L12 23l-2.6-8.4L1 12l8.4-2.6z' fill='%23c2455b'/%3E%3C/svg%3E")}
.hb::after{bottom:.6rem;left:0;width:1.2rem;height:1.2rem;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l2.6 8.4L23 12l-8.4 2.6L12 23l-2.6-8.4L1 12l8.4-2.6z' fill='%23d4697b'/%3E%3C/svg%3E")}
.hb-a{font-family:'Caveat','Gaegu',cursive;font-weight:500;font-size:clamp(2.2rem,9vw,3.6rem);color:#c2455b;transform:rotate(-4deg);margin-bottom:-.15em}
.hb-b{font-family:'Lora',Georgia,serif;font-weight:500;font-size:clamp(4.4rem,26vw,8rem);line-height:.95;color:#F7ECD4;
  padding:0 .14em;text-shadow:0 3px 0 rgba(60,8,16,.35);
  background:linear-gradient(to top,transparent 8%,#9B1D30 8% 42%,transparent 42%)}
.hb-c{font-weight:700;font-size:clamp(1.3rem,6vw,2.2rem);letter-spacing:.16em;color:#9B1D30;margin-top:.3em}
.hb-d{font-weight:700;font-size:clamp(1.9rem,8.6vw,3.3rem);letter-spacing:.04em;color:#c2455b;margin-top:.1em}

/* Foto: memantul hanya saat disentuh */
.pic{cursor:pointer;-webkit-tap-highlight-color:transparent}
.pic:focus-visible{outline:3px solid #9B1D30;outline-offset:6px}
.pic.bounce{animation:tuing .95s ease-out 1}
@keyframes tuing{0%{transform:translateY(0) scale(1,1)}
  16%{transform:translateY(0) scale(1.07,.9)}
  42%{transform:translateY(-28px) scale(.96,1.05)}
  66%{transform:translateY(0) scale(1.04,.96)}
  82%{transform:translateY(-7px) scale(1,1)}
  100%{transform:translateY(0) scale(1,1)}}
@media (prefers-reduced-motion:reduce){.pic.bounce{animation:none}}


/* Partikel saat amplop disentuh */
.burst{position:fixed;inset:0;pointer-events:none;z-index:30;overflow:hidden}
.bp{position:absolute;display:block;will-change:transform,opacity}
.bp svg{width:100%;height:100%;display:block;overflow:visible}

/* ============================================================
   REVISI: foto & judul dikecilkan, surat mengintip di layar pertama
   (atur tinggi foto: angka svh di .row .pic; atur ukuran judul: .hb-a sampai .hb-d)
   ============================================================ */
.pg1{min-height:0;justify-content:flex-start;padding-bottom:20px;gap:0}
.pg2{min-height:100vh;min-height:100svh;justify-content:flex-start;padding-top:14px;padding-bottom:110px}
.row .pic{width:min(30vw,260px,30svh)}
.row{gap:clamp(14px,3.5vw,48px)}
.hb-a{font-size:clamp(1.6rem,6vw,2.6rem)}
.hb-b{font-size:clamp(3rem,17vw,5.2rem)}
.hb-c{font-size:clamp(1rem,4.2vw,1.6rem)}
.hb-d{font-size:clamp(1.4rem,6vw,2.3rem)}
.txt .hb{padding:.3rem 1.3rem}
@media (orientation:portrait){
  .row{gap:clamp(8px,1.6svh,16px)}
  .row .pic{width:min(40vw,20svh)}
}

/* ===== Foto tanpa bingkai, dekat dengan judul ===== */
.pic img{display:block;width:100%;aspect-ratio:1/1;object-fit:contain}
.row{gap:clamp(6px,1.5vw,20px)}
.txt .hb{padding:.2rem 1rem}
@media (orientation:portrait){
  .row{gap:clamp(2px,.6svh,8px)}
}

/* ===== Pemutar musik (kiri bawah) ===== */
.player{position:fixed;left:14px;bottom:calc(14px + env(safe-area-inset-bottom,0px));z-index:5;display:flex;align-items:center;gap:12px;
  padding:8px 10px 8px 8px;border-radius:999px;background:#6e1020;border:1px solid rgba(247,236,212,.28);
  box-shadow:0 8px 22px rgba(0,0,0,.3);color:#F7ECD4;font-family:'Gaegu','Comic Sans MS',cursive}
.player .disc{width:44px;height:44px;flex:0 0 auto;border-radius:50%;
  background:radial-gradient(circle,#F7ECD4 0 9%,#c2455b 10% 21%,#1a0a0d 22% 100%);
  box-shadow:inset 0 0 0 3px #3a0a12,0 0 0 1px rgba(247,236,212,.2);animation:spin 4s linear infinite;animation-play-state:paused}
.player.playing .disc{animation-play-state:running}
@keyframes spin{to{transform:rotate(360deg)}}
.player .meta{min-width:62px;line-height:1.05}
.player .ttl{font-weight:700;font-size:1.2rem;white-space:nowrap}
.player .art{font-size:.95rem;white-space:nowrap;color:#e8a9b3;letter-spacing:.05em}
.player .eq{display:flex;align-items:flex-end;gap:3px;height:22px}
.player .eq i{display:block;width:4px;height:8px;border-radius:2px;background:#e8a9b3;animation:eq .9s ease-in-out infinite alternate;animation-play-state:paused}
.player .eq i:nth-child(2){height:14px;animation-delay:-.3s}
.player .eq i:nth-child(3){height:10px;animation-delay:-.6s}
.player .eq i:nth-child(4){height:6px;animation-delay:-.15s}
.player.playing .eq i{animation-play-state:running}
@keyframes eq{from{transform:scaleY(.45);transform-origin:bottom}to{transform:scaleY(1.5);transform-origin:bottom}}
.player .pbtn{width:40px;height:40px;flex:0 0 auto;border:0;border-radius:50%;background:#e8a9b3;display:grid;place-items:center;cursor:pointer;padding:0}
.player .pbtn:focus-visible{outline:3px solid #F7ECD4;outline-offset:2px}
.player .pbtn svg{width:20px;height:20px;fill:#6e1020}
.player .i-play{display:block}.player .i-pause{display:none}
.player.playing .i-play{display:none}.player.playing .i-pause{display:block}
@media (max-width:480px){
  .player{left:10px;gap:8px;padding:6px 8px 6px 6px}
  .player .disc{width:36px;height:36px}
  .player .meta{min-width:46px}
  .player .ttl{font-size:1.05rem}.player .art{font-size:.85rem}
  .player .pbtn{width:34px;height:34px}.player .pbtn svg{width:17px;height:17px}
}
@media (prefers-reduced-motion:reduce){.player .disc,.player .eq i{animation:none}}

/* Pemutar: muncul sendiri saat halaman dibuka (tidak lewat observer fade) */
.player{animation:playerIn .8s ease .5s both}
@keyframes playerIn{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.player{animation:none}}

.player .pmin{width:28px;height:28px;flex:0 0 auto;border:0;border-radius:50%;background:rgba(247,236,212,.16);display:grid;place-items:center;cursor:pointer;padding:0}
.player .pmin svg{width:16px;height:16px;fill:none;stroke:#F7ECD4;stroke-width:2.6;stroke-linecap:round}
.player .pmin:focus-visible,.player .disc:focus-visible{outline:3px solid #F7ECD4;outline-offset:2px}
.player.mini{padding:6px;gap:0}
.player.mini .meta,.player.mini .eq,.player.mini .pbtn,.player.mini .pmin{display:none}
.player.mini .disc{cursor:pointer}
@media (max-width:480px){.player .pmin{width:26px;height:26px}.player.mini{padding:5px}}

/* ===== Surat: rata kanan-kiri, awal paragraf menjorok, kata asing italic ===== */
.letter p{text-align:justify;text-justify:inter-word;text-indent:2em;margin-bottom:.5em;hyphens:auto;-webkit-hyphens:auto;overflow-wrap:break-word}
.letter p.greet{text-indent:0;margin-bottom:.9em}
.letter p.gap{margin-top:1.3em}
.letter em{font-style:italic}
