@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=Caveat:wght@500;700&display=swap');

:root{
  --pink:#ff6fa5;
  --pink-deep:#ff2d7a;
  --gold:#ffd166;
  --cream:#fff6ef;
  --purple:#7c5cff;
  --ink:#2b1830;
}

*{margin:0;padding:0;box-sizing:border-box;}

html{scroll-behavior:smooth;}

body{
  font-family:'Bricolage Grotesque',sans-serif;
  background:linear-gradient(180deg,#2b1830 0%,#3a1e42 40%,#20101f 100%);
  color:var(--cream);
  overflow-x:hidden;
  min-height:100vh;
}

/* ===================== GIFT INTRO ===================== */
#gift-intro{
  position:fixed;
  top:0;
  left:0;
  /* pakai unit viewport murni, bukan inset:0 — supaya lebar & tinggi overlay
     selalu ikut layar yang benar-benar terlihat, bukan ikut lebar dokumen */
  width:100vw;
  height:100vh;
  height:100dvh; /* dvh = tinggi area terlihat, sudah dikurangi address bar HP */
  z-index:100;
  display:grid;
  place-items:center;
  align-content:center;
  /* sengaja tanpa gap seragam: pita kado menjulur ~22px ke atas, jadi jarak
     atas & bawah diatur manual lewat margin supaya terlihat seimbang */
  gap:0;
  padding:1.5rem 1.1rem;
  overflow:hidden;
  background:radial-gradient(circle at 50% 30%, #4a2455 0%, #241128 70%);
  transition:opacity .9s ease, visibility .9s ease;
}

#gift-intro.hidden{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

/* kunci scroll selama intro kado terbuka (body saja kurang andal di HP) */
html.intro-open,
html.intro-open body{
  overflow:hidden;
  overscroll-behavior:none;
}

#gift-intro h1{
  font-family:'Caveat',cursive;
  font-size:clamp(1.6rem,5vw,3rem);
  color:var(--gold);
  margin:0 0 2.6rem;   /* ~22px di antaranya termakan pita kado */
  text-align:center;
  max-width:22ch;      /* paksa membungkus, jangan melebar keluar layar */
  line-height:1.2;
  text-wrap:balance;
}

.gift-box{
  position:relative;
  width:180px;
  height:150px;
  cursor:pointer;
  animation:float 3s ease-in-out infinite;
}

@keyframes float{
  0%,100%{transform:translateY(0);}
  50%{transform:translateY(-12px);}
}

.gift-base{
  position:absolute;
  bottom:0;
  width:100%;
  height:100px;
  background:linear-gradient(135deg,var(--pink-deep),var(--pink));
  border-radius:8px;
  box-shadow:0 20px 50px rgba(0,0,0,.5);
}

.gift-lid{
  position:absolute;
  top:20px;
  width:100%;
  height:36px;
  background:linear-gradient(135deg,#ff4e97,#ff81b3);
  border-radius:8px;
  transition:transform .6s cubic-bezier(.6,-0.28,.74,.05), opacity .6s ease;
  transform-origin:top;
  z-index:3;
}

.gift-ribbon-v{
  position:absolute;
  left:50%;
  top:0;
  width:22px;
  height:100%;
  transform:translateX(-50%);
  background:var(--gold);
  z-index:2;
}

.gift-ribbon-h{
  position:absolute;
  top:36px;
  left:0;
  width:100%;
  height:22px;
  background:var(--gold);
  z-index:2;
}

.gift-bow{
  position:absolute;
  top:-22px;
  left:50%;
  transform:translateX(-50%);
  width:56px;
  height:36px;
  z-index:4;
}
.gift-bow::before,.gift-bow::after{
  content:'';
  position:absolute;
  width:26px;
  height:26px;
  background:var(--gold);
  border-radius:50% 50% 50% 0;
  top:0;
}
.gift-bow::before{left:0;transform:rotate(45deg);}
.gift-bow::after{right:0;transform:rotate(-45deg) scaleX(-1);border-radius:50% 50% 50% 0;}

.gift-box.opened .gift-lid{
  transform:translateY(-90px) rotate(-25deg);
  opacity:0;
}

.gift-box.opened{animation:none;}

.gift-hint{
  margin:1.1rem 0 0;
  font-size:.95rem;
  color:#e9c9ff;
  letter-spacing:.03em;
  text-align:center;
  animation:pulse 1.8s ease-in-out infinite;
}

@keyframes pulse{
  0%,100%{opacity:.5;}
  50%{opacity:1;}
}

.sparkle{
  position:absolute;
  border-radius:50%;
  background:var(--gold);
  pointer-events:none;
  animation:sparkle-pop .8s ease-out forwards;
}
@keyframes sparkle-pop{
  0%{transform:scale(0) translate(0,0);opacity:1;}
  100%{transform:scale(1) translate(var(--tx),var(--ty));opacity:0;}
}

/* ===================== CONFETTI ===================== */
#confetti-canvas{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:60;
}

/* ===================== MAIN CONTENT ===================== */
main{
  position:relative;
  z-index:1;
}

.section{
  padding:5rem 1.5rem;
  max-width:1100px;
  margin:0 auto;
  position:relative;
}

/* HERO */
#hero{
  /* dibatasi supaya di layar yang sangat tinggi tidak jadi ruang kosong besar */
  min-height:100vh;
  min-height:min(100svh,860px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding-top:3rem;
}

.hero-badge{
  font-size:.85rem;
  letter-spacing:.25em;
  text-transform:uppercase;
  color:var(--gold);
  margin-bottom:1rem;
}

.hero-title{
  font-size:clamp(2.4rem,8vw,5.2rem);
  font-weight:800;
  line-height:1.05;
  background:linear-gradient(90deg,var(--pink) 0%,var(--gold) 50%,var(--purple) 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  margin-bottom:.6rem;
}

.hero-name{
  font-family:'Caveat',cursive;
  font-size:clamp(3rem,10vw,6rem);
  color:#fff;
  margin:.4rem 0 1.2rem;
  text-shadow:0 0 30px rgba(255,111,165,.5);
}

.hero-sub{
  max-width:520px;
  color:#e6d3ee;
  font-size:1.05rem;
  line-height:1.6;
  margin-bottom:2rem;
}

.age-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:110px;
  height:110px;
  border-radius:50%;
  background:conic-gradient(from 0deg,var(--pink),var(--gold),var(--purple),var(--pink));
  margin-bottom:2rem;
  animation:spin-slow 8s linear infinite;
}
.age-badge span{
  width:96px;
  height:96px;
  border-radius:50%;
  background:#2b1830;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  animation:spin-slow-reverse 8s linear infinite;
}
.age-badge b{font-size:2rem;color:#fff;}
.age-badge small{font-size:.65rem;letter-spacing:.1em;color:var(--gold);}

@keyframes spin-slow{to{transform:rotate(360deg);}}
@keyframes spin-slow-reverse{to{transform:rotate(-360deg);}}

.scroll-cue{
  margin-top:1.5rem;
  font-size:.8rem;
  color:#c9a8d8;
  letter-spacing:.15em;
  text-transform:uppercase;
  animation:bounce-y 2s ease-in-out infinite;
}
@keyframes bounce-y{
  0%,100%{transform:translateY(0);}
  50%{transform:translateY(8px);}
}

/* SECTION HEADINGS */
.section-title{
  font-size:clamp(1.8rem,4vw,2.6rem);
  font-weight:800;
  text-align:center;
  margin-bottom:.6rem;
  color:#fff;
}
.section-title span{
  background:linear-gradient(90deg,var(--pink),var(--gold));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.section-sub{
  text-align:center;
  color:#c9a8d8;
  max-width:480px;
  margin:0 auto 3rem;
  font-size:.95rem;
}

/* ===================== TILT STACK CAROUSEL ===================== */
#carousel{
  position:relative;
}

.carousel-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0;
  position:relative;
  height:420px;
  perspective:1200px;
  /* kartu yang disembunyikan di-translateX(±600px); tanpa clip ini dokumen
     jadi jauh lebih lebar dari layar HP dan bikin overflow horizontal */
  overflow:hidden;
}

.carousel-track{
  position:relative;
  width:100%;
  max-width:900px;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}

.carousel-card{
  position:absolute;
  width:220px;
  height:300px;
  border-radius:18px;
  overflow:hidden;
  background:#1c0f22;
  box-shadow:0 25px 50px rgba(0,0,0,.55);
  transition:transform .55s cubic-bezier(.22,1,.36,1), opacity .55s ease, filter .55s ease;
  cursor:pointer;
}

.carousel-card img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.carousel-card::after{
  content:'';
  position:absolute;
  inset:0;
  border-radius:18px;
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.08);
}

.carousel-controls{
  display:flex;
  justify-content:center;
  gap:1.2rem;
  margin-top:2rem;
}

.carousel-btn{
  width:46px;
  height:46px;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.06);
  color:#fff;
  font-size:1.1rem;
  cursor:pointer;
  transition:background .25s ease, transform .25s ease;
  display:flex;
  align-items:center;
  justify-content:center;
}
.carousel-btn:hover{background:var(--pink-deep);transform:scale(1.08);}

.carousel-dots{
  display:flex;
  gap:.4rem;
  align-items:center;
  justify-content:center;
  margin-top:1.2rem;
}
.dot{
  width:7px;height:7px;border-radius:50%;
  background:rgba(255,255,255,.25);
  transition:all .3s ease;
}
.dot.active{
  width:22px;
  background:var(--gold);
}

/* ===================== LETTER / KADO CARD ===================== */
#letter{
  display:flex;
  justify-content:center;
}

.envelope{
  position:relative;
  width:100%;
  max-width:560px;
  background:linear-gradient(160deg,#3a1e42,#2b1830);
  border-radius:20px;
  padding:2.6rem 2rem;
  box-shadow:0 30px 60px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.06);
  text-align:center;
}

.envelope-seal{
  width:54px;height:54px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--pink),var(--pink-deep));
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 1.2rem;
  font-size:1.4rem;
  box-shadow:0 8px 20px rgba(255,45,122,.4);
}

.envelope p{
  font-size:1.05rem;
  line-height:1.85;
  color:#f0dff5;
  font-family:'Caveat',cursive;
  font-size:1.5rem;
}

.envelope p + p{margin-top:1rem;}

.signature{
  margin-top:1.6rem;
  font-family:'Caveat',cursive;
  font-size:1.8rem;
  color:var(--gold);
}

/* ===================== WISH / CAKE ===================== */
#wish{
  text-align:center;
}

.cake-wrap{
  position:relative;
  display:inline-block;
  margin-bottom:1.6rem;
  cursor:pointer;
}

.cake{
  font-size:5.5rem;
  filter:drop-shadow(0 15px 25px rgba(0,0,0,.4));
  user-select:none;
}

.candle-flame{
  position:absolute;
  top:6px;
  left:50%;
  transform:translateX(-50%);
  font-size:1.4rem;
  animation:flicker 1s ease-in-out infinite alternate;
  transition:opacity .4s ease;
}
@keyframes flicker{
  0%{transform:translateX(-50%) scale(1) rotate(-2deg);}
  100%{transform:translateX(-50%) scale(1.15) rotate(2deg);}
}
.cake-wrap.blown .candle-flame{opacity:0;}

.wish-hint{
  color:#c9a8d8;
  font-size:.9rem;
  margin-bottom:1.5rem;
}

.wish-result{
  font-family:'Caveat',cursive;
  font-size:1.8rem;
  color:var(--gold);
  min-height:2.4rem;
  opacity:0;
  transition:opacity .5s ease;
}
.wish-result.show{opacity:1;}

/* ===================== FOOTER ===================== */
footer{
  text-align:center;
  padding:3rem 1.5rem 2.5rem;
  color:#a983bc;
  font-size:.85rem;
}
footer .heart{color:var(--pink);}

/* balloons */
.balloon{
  position:fixed;
  bottom:-120px;
  font-size:2.4rem;
  pointer-events:none;
  z-index:2;
  animation:rise linear forwards;
  opacity:.85;
}
@keyframes rise{
  to{transform:translateY(-115vh) translateX(var(--drift));opacity:0;}
}

/* ===================== RESPONSIVE ===================== */
@media (max-width:900px){
  .section{padding:4rem 1.25rem;}
  .carousel-wrap{height:380px;}
  .carousel-card{width:190px;height:260px;}
}

@media (max-width:640px){
  .section{padding:2.6rem 1.1rem;}

  /* kotak kado tetap ukuran penuh di HP supaya komposisi mengisi layar
     dan ruang kosong atas/bawah terasa lebih rapat */
  #gift-intro h1{font-size:1.75rem;margin-bottom:2.3rem;}
  .gift-hint{font-size:.9rem;margin-top:.9rem;}

  /* di HP hero cukup setinggi layar terlihat, dibatasi agar tidak kebanyakan ruang kosong */
  #hero{min-height:100vh;min-height:min(100svh,700px);padding-top:2rem;}
  .hero-badge{font-size:.7rem;letter-spacing:.18em;}
  .hero-sub{font-size:.95rem;padding:0 .5rem;}
  .age-badge{width:92px;height:92px;margin-bottom:1.5rem;}
  .age-badge span{width:80px;height:80px;}
  .age-badge b{font-size:1.6rem;}

  .section-title{font-size:1.6rem;}
  .section-sub{font-size:.88rem;margin-bottom:2.2rem;padding:0 .5rem;}

  .carousel-wrap{height:300px;}
  .carousel-card{width:150px;height:205px;border-radius:14px;}
  .carousel-controls{gap:1rem;margin-top:1.5rem;}
  .carousel-btn{width:42px;height:42px;font-size:1rem;}
  .carousel-dots{margin-top:1rem;}

  .envelope{padding:1.8rem 1.3rem;border-radius:16px;}
  .envelope-seal{width:46px;height:46px;font-size:1.2rem;}
  .envelope p{font-size:1.25rem;line-height:1.7;}
  .signature{font-size:1.5rem;}

  .cake{font-size:4.2rem;}
  .candle-flame{font-size:1.1rem;}
  .wish-hint{font-size:.82rem;padding:0 .5rem;}
  .wish-result{font-size:1.5rem;padding:0 .5rem;}

  footer{font-size:.78rem;padding:2.4rem 1.2rem 2rem;}

  .balloon{font-size:1.8rem !important;}
}

@media (max-width:400px){
  #gift-intro h1{font-size:1.5rem;margin-bottom:2.1rem;}
  .gift-box{width:150px;height:125px;}
  .hero-title{font-size:2.1rem;}
  .hero-name{font-size:2.6rem;}
  .carousel-card{width:130px;height:178px;}
  .carousel-wrap{height:260px;}
  .envelope p{font-size:1.15rem;}
}

@media (max-height:700px) and (max-width:640px){
  #hero{min-height:auto;padding:5rem 0 2.5rem;}
}

/* avoid hover-stuck states on touch devices */
@media (hover:none){
  .carousel-btn:hover{background:rgba(255,255,255,.06);transform:none;}
}
