/* =====================================================================
   base.css  —  global styles: variables, reset, layout, buttons
   ===================================================================== */

:root {
  /* ---- Theme colours (chaho to badal lena) ---- */
  --bg-1: #1a0b2e;        /* deep purple */
  --bg-2: #2d0a3e;        /* darker magenta */
  --bg-3: #3b0d4d;
  --pink: #ff5c8a;
  --pink-soft: #ff9bbd;
  --gold: #ffd36e;
  --white: #fff7fb;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);

  /* ---- Fonts ---- */
  --font-body: "Poppins", system-ui, sans-serif;
  --font-script: "Dancing Script", cursive;
  --font-fancy: "Great Vibes", cursive;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;   /* mobile blue flash har jagah se off */
}

button:focus { outline: none; }

/* global utility (har page pe) */
.is-hidden { display: none !important; }

/* =====================================================================
   BLACKOUT  —  flatline beep par screen aaram se deep black (light off),
   beep ke baad smooth se khul jaye (light on). Sab ke upar.
   ===================================================================== */
#blackout {
  position: fixed;
  inset: 0;
  z-index: 9000;              /* confetti/music toggle sab ke upar */
  background: #000;           /* deep black */
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.3s cubic-bezier(0.4, 0, 0.2, 1);  /* smooth off/on */
}
#blackout.on { opacity: 1; }

/* =====================================================================
   TIME LOCK  —  unlock waqt se pehle "wait" screen (sab ke upar)
   ===================================================================== */
#lockscreen {
  position: fixed;
  inset: 0;
  z-index: 10001;             /* PIN/preloader sab ke upar */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px 18px;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  transition: opacity 0.6s ease;
}
#lockscreen.hide { opacity: 0; pointer-events: none; }
.lk-emoji {
  font-size: 3.2rem;
  filter: drop-shadow(0 8px 20px rgba(255, 92, 138, 0.5));
  animation: plBeat 1.6s ease-in-out infinite;
}
.lk-title {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: clamp(1.15rem, 5vw, 1.5rem);
  color: #fff;
  max-width: 420px;
  line-height: 1.35;
}
.lk-name {
  font-family: "Pacifico", cursive;
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  color: var(--pink-soft);
  text-shadow: 0 2px 18px rgba(255, 92, 138, 0.45);
  margin-bottom: 4px;
}
.lk-timer {
  display: flex;
  gap: 10px;
  margin: 6px 0 4px;
}
.lk-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 62px;
  padding: 12px 8px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.lk-box span {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: clamp(1.5rem, 7vw, 2.1rem);
  color: #fff;
  line-height: 1;
}
.lk-box small {
  margin-top: 6px;
  font-family: "Poppins", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--pink-soft);
  opacity: 0.85;
}
.lk-note {
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  font-size: 0.95rem;
  color: #fff;
  opacity: 0.8;
  margin-top: 4px;
}

/* =====================================================================
   PIN LOCK (sabse pehle — maze ke liye 😜)
   ===================================================================== */
#pinlock {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px 16px;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  transition: opacity 0.5s ease;
}
#pinlock.hide { opacity: 0; pointer-events: none; }

.pin-emoji { font-size: 2.6rem; }
.pin-q {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: clamp(1.1rem, 4.5vw, 1.5rem);
  color: #fff;
  text-align: center;
  max-width: 420px;
  line-height: 1.35;
}
.pin-dots { display: flex; gap: 16px; margin: 6px 0 2px; }
.pin-dots span {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--pink-soft);
  background: transparent;
  transition: background 0.2s ease, transform 0.2s ease;
}
.pin-dots span.filled { background: var(--pink); transform: scale(1.1); }

.pin-msg {
  font-family: "Fredoka", sans-serif;
  font-size: 0.95rem;
  color: #ff7b7b;
  min-height: 1.2em;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 14px;
  margin-top: 6px;
}
.pin-pad button {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: #fff;
  font-family: "Fredoka", sans-serif;
  font-size: 1.5rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, background 0.2s ease;
}
.pin-pad button:hover  { background: rgba(255,255,255,0.14); }
.pin-pad button:active { transform: scale(0.92); }
.pin-pad .pin-empty { background: transparent; border: none; cursor: default; }
.pin-pad .pin-back  { font-size: 1.3rem; }

.pin-shake { animation: pinShake 0.4s ease; }
@keyframes pinShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-7px); }
  80% { transform: translateX(7px); }
}

/* =====================================================================
   PRELOADER (sirf index — first open par sab load ho tab heart aaye)
   ===================================================================== */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  transition: opacity 0.6s ease;
}
#preloader.hide { opacity: 0; pointer-events: none; }
.pl-heart {
  font-size: 3.4rem;
  filter: drop-shadow(0 4px 16px rgba(255, 92, 138, 0.6));
  animation: plBeat 1.2s ease-in-out infinite;
}
.pl-text {
  font-family: "Fredoka", sans-serif;
  color: #fff;
  opacity: 0.9;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
}
.pl-bar {
  width: min(260px, 70vw);
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
.pl-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--gold));
  transition: width 0.3s ease;
}
.pl-pct {
  font-family: "Fredoka", sans-serif;
  color: var(--pink-soft);
  font-size: 0.95rem;
}
@keyframes plBeat {
  0%, 100% { transform: scale(1); }
  25%      { transform: scale(1.15); }
  40%      { transform: scale(1); }
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--white);
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  background-attachment: fixed;
  overflow: hidden;              /* ek screen at a time */
  min-height: 100vh;
  min-height: 100dvh;            /* iOS/Android: address bar se content na kate */
  position: relative;
  -webkit-text-size-adjust: 100%;   /* iPhone text auto-zoom off */
  text-size-adjust: 100%;
}

/* ---- Background canvases (hearts + confetti) ---- */
#hearts-canvas,
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#hearts-canvas   { z-index: 0; }
#confetti-canvas { z-index: 5; }

/* =====================================================================
   SCREENS  —  full-screen panels, ek time par ek visible
   ===================================================================== */
#experience {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;                /* mobile browsers ki asli visible height */
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;

  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.98);
  transition: opacity 0.8s ease, transform 0.8s ease, visibility 0.8s;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ---- Shared headings ---- */
.section-heading {
  font-family: var(--font-script);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  color: var(--gold);
  margin-bottom: 6px;
  text-shadow: 0 2px 20px rgba(255, 211, 110, 0.35);
}

.section-tag {
  font-weight: 300;
  opacity: 0.8;
  margin-bottom: 28px;
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
}

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn-open,
.btn-next,
.btn-restart {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  color: var(--white);
  border: none;
  cursor: pointer;
  display: inline-block;        /* <a> ko button jaisa */
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), #c3379b);
  box-shadow: 0 8px 26px rgba(255, 92, 138, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  margin-top: 28px;
}

.btn-open  { font-size: 1.1rem; padding: 16px 40px; }

.btn-open:hover,
.btn-next:hover,
.btn-restart:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 34px rgba(255, 92, 138, 0.6);
  filter: brightness(1.08);
}

.btn-open:active,
.btn-next:active,
.btn-restart:active {
  transform: translateY(0) scale(0.98);
}

.btn-restart {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: none;
}

/* =====================================================================
   BUTTON TIMER LOCK  (data-lock="N") — 🔒 + seconds, phir 🔓
   ===================================================================== */
.btn-next.bt-locked,
.btn-open.bt-locked,
.btn-restart.bt-locked {
  pointer-events: none;                 /* click/navigation band */
  cursor: default;
  background: linear-gradient(135deg, #7c4a66, #5f3a6b);  /* muted */
  box-shadow: none;
  filter: saturate(0.7);
  padding-top: 10px;
  padding-bottom: 10px;
}
.btn-next.bt-locked:hover,
.btn-open.bt-locked:hover,
.btn-restart.bt-locked:hover {
  transform: none;
  box-shadow: none;
  filter: saturate(0.7);
}
.bt-lockwrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  gap: 3px;
}
.bt-secs {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: 0.5px;
}
.bt-ico { font-size: 1.05rem; line-height: 1; }
.bt-ico.bt-open { font-size: 1.4rem; animation: btPop 0.55s ease; }

/* keep-mode: text rehta hai, aage 🔒 + seconds inline */
.btn-next.bt-locked.bt-keep,
.btn-open.bt-locked.bt-keep,
.btn-restart.bt-locked.bt-keep {
  background: linear-gradient(135deg, var(--pink), #c3379b);  /* normal pink rakho */
  filter: none;
  opacity: 0.9;
}
.bt-suffix {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 9px;
  padding-left: 9px;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}
.bt-suffix .bt-secs { font-size: 1rem; min-width: 1.4em; text-align: center; }
.bt-suffix .bt-ico  { font-size: 1rem; }
@keyframes btPop {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); }
}

/* =====================================================================
   MUSIC TOGGLE
   ===================================================================== */
.music-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);   /* Safari/iOS */
  backdrop-filter: blur(8px);
  color: var(--white);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, background 0.25s ease;
}
.music-toggle:hover { transform: scale(1.1); background: rgba(255,255,255,0.15); }
.music-toggle.playing .music-icon { animation: spin 3s linear infinite; }

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

/* ---- Reusable fade-up entrance for content ---- */
.screen.active .intro-content   > *,
.screen.active .reveal-content  > *,
.screen.active .memories-content > *,
.screen.active .letter-content  > *,
.screen.active .reasons-content > *,
.screen.active .ending-content  > * {
  animation: fadeUp 0.9s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Thoda stagger (har next element thoda late aaye) */
.screen.active > * > *:nth-child(2) { animation-delay: 0.12s; }
.screen.active > * > *:nth-child(3) { animation-delay: 0.24s; }
.screen.active > * > *:nth-child(4) { animation-delay: 0.36s; }
.screen.active > * > *:nth-child(5) { animation-delay: 0.48s; }

/* ---- Respect reduced-motion users ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
