/* ═══════════════════════════════════════
   Naila Ramadhani — 18th Birthday
   style.css  |  Poppins edition
═══════════════════════════════════════ */

:root {
  --bg:    #06070f;
  --bg2:   #0a0c18;
  --gold:  #c9a760;
  --gold2: #e8d49a;
  --cream: #f0e4d0;
  --muted: #54506a;
  --fp:    'Poppins', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; border: none; background: none; }

/* ── SCROLLER ──────────────────────── */
#scroller {
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
::-webkit-scrollbar { display: none; }

/* ── BASE SLIDE ────────────────────── */
.slide {
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

/* ══════════════════════════════════════
   INTRO
══════════════════════════════════════ */
.intro-slide {
  background: #04050d;
  flex-direction: column;
  justify-content: flex-end;
}

/* Gradient that blends photo area into text area — always 52% of screen height */
.intro-slide::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 52%;
  background: linear-gradient(to top, rgba(4,5,13,1) 50%, rgba(4,5,13,0.7) 75%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

#stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Polaroid Photo Cards ── */
.polar-area {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 63%;
  z-index: 1;
  pointer-events: none;
}

/* .pw  → handles position + entrance (opacity + scale)  */
/* .pw-float → handles continuous float (translateY only, no conflict) */
/* .pcard → rotation + visual styling */

.pw { position: absolute; opacity: 0; }

/* Entrance animation — scale up from slightly small */
@keyframes polarIn {
  from { opacity: 0; transform: scale(0.72); }
  to   { opacity: 1; transform: scale(1); }
}

/* Continuous float — lives on .pw-float, separate element from .pw */
@keyframes floatUD {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

/* ─ Position each card ─ */
/* TOP-LEFT: age 6 */
.pw-1 { top: 7%; left: -6px; animation: polarIn 0.6s cubic-bezier(0.22,1,0.36,1) 0.5s forwards; }
.pw-1 .pw-float { animation: floatUD 4.2s ease-in-out 1.3s infinite; }
.pw-1 .pcard { transform: rotate(-13deg); }

/* TOP-RIGHT: age 3 */
.pw-2 { top: 4%; right: -6px; animation: polarIn 0.6s cubic-bezier(0.22,1,0.36,1) 0.85s forwards; }
.pw-2 .pw-float { animation: floatUD 3.8s ease-in-out 1.7s infinite; }
.pw-2 .pcard { transform: rotate(11deg); }

/* CENTER HERO: age 18 — centered with margin trick */
.pw-3 {
  top: 28%;
  left: 50%;
  margin-left: -58px;   /* half of hero card width (116px) */
  animation: polarIn 0.7s cubic-bezier(0.22,1,0.36,1) 1.2s forwards;
  z-index: 2; /* on top of corner cards */
}
.pw-3 .pw-float { animation: floatUD 5s ease-in-out 2.1s infinite; }
.pw-3 .pcard { transform: rotate(-3deg); }

/* BOTTOM-LEFT: age 12 */
.pw-4 { bottom: 4%; left: -6px; animation: polarIn 0.6s cubic-bezier(0.22,1,0.36,1) 1.55s forwards; }
.pw-4 .pw-float { animation: floatUD 4.6s ease-in-out 2.5s infinite; }
.pw-4 .pcard { transform: rotate(-10deg); }

/* BOTTOM-RIGHT: age 15 */
.pw-5 { bottom: 2%; right: -6px; animation: polarIn 0.6s cubic-bezier(0.22,1,0.36,1) 1.9s forwards; }
.pw-5 .pw-float { animation: floatUD 4s ease-in-out 2.9s infinite; }
.pw-5 .pcard { transform: rotate(12deg); }

/* ─ Polaroid card visual ─ */
.pcard {
  background: #fff;
  padding: 7px 7px 22px;
  box-shadow:
    0 12px 40px rgba(0,0,0,0.6),
    0 2px 8px rgba(0,0,0,0.35),
    inset 0 0 0 0.5px rgba(0,0,0,0.06);
  width: 82px;
}

/* Hero card is bigger */
.pcard-hero {
  width: 116px;
  padding: 9px 9px 28px;
  box-shadow:
    0 16px 50px rgba(0,0,0,0.7),
    0 4px 12px rgba(0,0,0,0.4),
    0 0 0 1px rgba(201,167,96,0.25);
}

.pcard img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  background: #eee;
}

.pcard span {
  display: block;
  text-align: center;
  font-family: var(--fp);
  font-size: 8px;
  font-weight: 500;
  color: #666;
  margin-top: 4px;
  letter-spacing: 0.06em;
}

.pcard-hero span {
  font-size: 9px;
  color: #888;
}

/* ── Intro text box ── */
.intro-box {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  padding: 20px 32px 38px;
  width: 100%;
}

.i-label {
  font-family: var(--fp);
  font-weight: 300;
  font-style: italic;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0;
  animation: aFadeUp 0.8s ease 3.0s forwards;
}

.i-name {
  font-family: var(--fp);
  font-size: clamp(22px, 6.5vw, 38px);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  line-height: 1.2;
  opacity: 0;
  animation: aFadeUp 0.9s ease 3.2s forwards;
  text-shadow: 0 0 40px rgba(201,167,96,0.35);
}

.i-date {
  font-family: var(--fp);
  font-weight: 300;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.18em;
  opacity: 0;
  animation: aFadeUp 0.8s ease 3.5s forwards;
}

.i-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  opacity: 0;
  animation: aFadeUp 0.8s ease 3.7s forwards;
}
.ib-turns, .ib-today {
  font-family: var(--fp);
  font-weight: 300;
  font-size: 13px;
  color: var(--muted);
}
.ib-num {
  font-family: var(--fp);
  font-weight: 700;
  font-size: clamp(44px, 14vw, 64px);
  color: var(--cream);
  line-height: 1;
  text-shadow: 0 0 30px rgba(240,228,208,0.25);
}

.i-down {
  margin-top: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid rgba(201,167,96,0.35) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  opacity: 0;
  animation: aFadeUp 0.8s ease 4.1s forwards;
  transition: background 0.2s;
}
.i-down:hover { background: rgba(201,167,96,0.1); }

/* ══════════════════════════════════════
   NUMBER-ONLY SLIDES
══════════════════════════════════════ */
.num-only { background: var(--bg); }

.num-hero {
  font-family: var(--fp);
  font-weight: 700;
  font-size: min(68vw, 68dvh);
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(201,167,96,0.18);
  line-height: 0.9;
  user-select: none;
  opacity: 0;
  transform: perspective(600px) rotateX(70deg) scale(0.75);
  filter: drop-shadow(0 0 0px rgba(201,167,96,0));
}

.slide.in-view .num-hero {
  opacity: 1;
  transform: perspective(600px) rotateX(0deg) scale(1);
  -webkit-text-stroke: 1.5px rgba(201,167,96,0.45);
  filter: drop-shadow(0 0 35px rgba(201,167,96,0.2));
  transition:
    opacity 0.55s ease,
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    -webkit-text-stroke 0.7s ease,
    filter 1.2s ease;
}

/* ══════════════════════════════════════
   SLIDE BOX
══════════════════════════════════════ */
.slide-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
  width: 100%;
  padding: 24px 32px;
  text-align: center;
  max-width: 440px;
  margin: 0 auto;
}

/* ══════════════════════════════════════
   AGE 0 — TEXT SLIDE
══════════════════════════════════════ */
.n-display {
  font-family: var(--fp);
  font-weight: 700;
  font-size: clamp(80px, 30vw, 150px);
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(201,167,96,0.35);
  line-height: 1;
  opacity: 0;
  transform: translateY(28px);
}
.slide.in-view .n-display {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.txt-block {
  opacity: 0;
  transform: translateY(16px);
}
.slide.in-view .txt-block {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease 0.4s, transform 0.8s ease 0.4s;
}

.t-main {
  font-family: var(--fp);
  font-weight: 500;
  font-size: clamp(13px, 3.8vw, 17px);
  color: var(--gold2);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.t-sub {
  font-family: var(--fp);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(24px, 7vw, 36px);
  color: var(--cream);
  line-height: 1.3;
}

/* ══════════════════════════════════════
   PHOTO SLIDES
══════════════════════════════════════ */
.photo-slide { background: var(--bg2); }

.n-label {
  font-family: var(--fp);
  font-weight: 700;
  font-size: clamp(42px, 16vw, 80px);
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(201,167,96,0.28);
  line-height: 1;
  opacity: 0;
  transform: translateY(-18px);
}
.slide.in-view .n-label {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.q-text {
  font-family: var(--fp);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(15px, 4.2vw, 19px);
  color: var(--gold2);
  line-height: 1.4;
  opacity: 0;
  transform: translateY(10px);
}
.slide.in-view .q-text {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease 0.18s, transform 0.7s ease 0.18s;
}

/* Photo frame */
.pic-frame {
  width: min(62vw, 260px);
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  overflow: visible;
  border: 1px solid rgba(201,167,96,0.28);
  position: relative;
  background: #0f0e18;
  box-shadow: 0 12px 50px rgba(0,0,0,0.55);
}

.pic-frame > img,
.pic-frame > .pic-ph {
  border-radius: 3px;
  overflow: hidden;
}

/* clip-path reveal on the inner img/ph wrapper */
.pic-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg2);
  z-index: 1;
  transform-origin: bottom;
  transition: none;
}
.slide.in-view .pic-frame::before {
  transform: scaleY(0);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}

.pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 3px;
}

.pic-ph {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  background: #100f1c;
  position: absolute;
  inset: 0;
  border-radius: 3px;
}
.pic-ph span { font-size: 30px; }
.pic-ph small {
  font-family: var(--fp);
  font-size: 11px;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ══════════════════════════════════════
   FINALE — AGE 18
══════════════════════════════════════ */
.finale-slide { background: #05060e; }

#particleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.finale-box {
  gap: 12px;
  padding: 16px 32px 20px;
  position: relative;
  z-index: 1;
}

.finale-num {
  font-family: var(--fp);
  font-weight: 700;
  font-size: clamp(56px, 20vw, 100px);
  color: var(--gold);
  line-height: 1;
  opacity: 0;
  transform: scale(0.6);
  filter: drop-shadow(0 0 0px rgba(201,167,96,0));
}
.slide.in-view .finale-num {
  opacity: 1;
  transform: scale(1);
  filter: drop-shadow(0 0 50px rgba(201,167,96,0.55));
  transition: opacity 1s ease, transform 1s cubic-bezier(0.22, 1.2, 0.36, 1), filter 1.5s ease;
}

.finale-pic-frame {
  width: min(55vw, 200px);
  aspect-ratio: 3 / 4;
  border: 1.5px solid rgba(201,167,96,0.45);
  box-shadow:
    0 0 0 5px rgba(201,167,96,0.06),
    0 20px 60px rgba(0,0,0,0.6),
    0 0 80px rgba(201,167,96,0.07);
  overflow: visible;
}

.finale-pic { filter: brightness(0.97) contrast(1.04); }

/* ── Cake Badge ── */
.cake-badge {
  position: absolute;
  bottom: -16px;
  right: -16px;
  width: 44px;
  height: 44px;
  background: #06070f;
  border: 1.5px solid rgba(201,167,96,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 10;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5), 0 0 20px rgba(201,167,96,0.15);
  animation: cakePulse 2.5s ease-in-out 1.5s infinite;
}

@keyframes cakePulse {
  0%, 100% { transform: scale(1) rotate(0deg); box-shadow: 0 4px 18px rgba(0,0,0,0.5), 0 0 20px rgba(201,167,96,0.15); }
  40%       { transform: scale(1.12) rotate(-5deg); box-shadow: 0 6px 24px rgba(0,0,0,0.5), 0 0 30px rgba(201,167,96,0.3); }
  60%       { transform: scale(1.12) rotate(5deg); }
}

.finale-msg {
  opacity: 0;
  transform: translateY(18px);
}
.slide.in-view .finale-msg {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.9s ease 0.7s, transform 0.9s ease 0.7s;
}

.finale-msg p {
  font-family: var(--fp);
  font-weight: 300;
  font-size: clamp(14px, 4vw, 17px);
  color: rgba(240,228,208,0.82);
  line-height: 1.8;
}

.f-gap { height: 8px; }

.f-line {
  width: 36px;
  height: 1px;
  background: rgba(201,167,96,0.4);
  margin: 14px auto;
}

.f-hb {
  font-weight: 400 !important;
  font-size: clamp(13px, 3.5vw, 15px) !important;
  color: var(--gold2) !important;
  letter-spacing: 0.1em;
}

.f-name {
  font-weight: 700 !important;
  font-size: clamp(16px, 5vw, 21px) !important;
  color: var(--gold) !important;
  filter: drop-shadow(0 0 10px rgba(201,167,96,0.4));
}

/* ══════════════════════════════════════
   MUSIC PLAYER
══════════════════════════════════════ */
.music-player {
  position: fixed;
  bottom: 22px;
  left: 16px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(6,7,15,0.9);
  border: 1px solid rgba(201,167,96,0.22);
  border-radius: 50px;
  padding: 7px 12px 7px 9px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-width: 210px;
  transform: translateY(90px);
  opacity: 0;
  transition: transform 0.65s cubic-bezier(0.16,1,0.3,1), opacity 0.65s ease;
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}
.music-player.show { transform: translateY(0); opacity: 1; }

.vinyl { font-size: 18px; min-width: 24px; text-align: center; line-height: 1; }
.vinyl.spinning { animation: spin 5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.player-info { display: flex; flex-direction: column; overflow: hidden; flex: 1; min-width: 0; }
.p-title {
  font-family: var(--fp);
  font-weight: 500;
  font-style: italic;
  font-size: 10px;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-artist {
  font-family: var(--fp);
  font-weight: 300;
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-btn {
  background: var(--gold) !important;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 10px;
  color: #06070f;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2px;
  transition: background 0.2s, transform 0.15s;
}
.p-btn:active { transform: scale(0.88); }

/* ══════════════════════════════════════
   AGE INDICATOR
══════════════════════════════════════ */
.age-indicator {
  position: fixed;
  top: 18px;
  right: 16px;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.age-indicator.show { opacity: 1; }
#ageNum {
  font-family: var(--fp);
  font-weight: 600;
  font-size: 11px;
  color: rgba(201,167,96,0.4);
  letter-spacing: 0.12em;
}

/* ══════════════════════════════════════
   PROGRESS BAR
══════════════════════════════════════ */
.progress-track {
  position: fixed;
  right: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: rgba(201,167,96,0.07);
  z-index: 999;
  pointer-events: none;
}
.progress-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(to bottom, rgba(201,167,96,0.25), rgba(201,167,96,0.8));
  transition: height 0.12s ease;
}

/* ══════════════════════════════════════
   KEYFRAMES
══════════════════════════════════════ */
@keyframes aFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
