/* ============================================================
   Cricel's Birthday — Stylesheet
   Palette: rose / blush / gold on a deep wine background
   Type: Dancing Script (accents) + Nunito (reading) + Poppins (UI)
   ============================================================ */

:root {
  /* --- Color tokens --- */
  --bg-deep:    #1A0A12;
  --bg-mid:     #2B0F1E;
  --bg-mid-2:   #3A1526;
  --rose:       #FF5C8D;
  --rose-bright:#FF7FA6;
  --rose-soft:  #FFAFC9;
  --blush:      #FFE1EC;
  --gold:       #FFC857;
  --gold-soft:  #FFE3A0;
  --cream:      #FFF6F8;
  --ink:        #2B0F1E;

  /* --- Type --- */
  --font-script: 'Dancing Script', cursive;
  --font-body:   'Nunito', sans-serif;
  --font-ui:     'Poppins', sans-serif;

  /* --- Layout --- */
  --max-w: 1120px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--cream);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Floating ambient particles
   ============================================================ */
#particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: float-up linear infinite;
  will-change: transform, opacity;
}
@keyframes float-up {
  0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.85; }
  90%  { opacity: 0.5; }
  100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* ============================================================
   Shared section chrome
   ============================================================ */
section, header, footer { position: relative; z-index: 1; }

.section-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--rose-bright);
  margin-bottom: 12px;
  font-weight: 600;
  text-align: center;
}
.section-title {
  font-family: var(--font-script);
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  color: var(--gold);
  margin-bottom: 10px;
  text-shadow: 0 0 30px rgba(255, 200, 87, 0.35);
  text-align: center;
  font-weight: 700;
}
.divider {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--rose), transparent);
  margin: 20px auto 40px;
}

/* ============================================================
   HERO
   ============================================================ */
#hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 20px 64px;
  text-align: center;
}
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 55%, rgba(255, 92, 141, 0.22) 0%, transparent 68%);
  pointer-events: none;
  z-index: -1;
}

.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--rose), var(--rose-bright));
  color: white;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 18px;
  border-radius: 20px;
  margin-bottom: 26px;
  box-shadow: 0 4px 20px rgba(255, 92, 141, 0.35);
  animation: pulse-badge 2.4s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 4px 20px rgba(255,92,141,0.35), 0 0 0 0 rgba(255,92,141,0.4); }
  50%      { box-shadow: 0 4px 20px rgba(255,92,141,0.35), 0 0 0 10px rgba(255,92,141,0); }
}

.photo-wrapper {
  position: relative;
  width: min(230px, 56vw);
  height: min(230px, 56vw);
  margin: 0 auto 30px;
}
.photo-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(var(--gold), var(--rose), #fff, var(--rose-soft), var(--gold));
  animation: spin-ring 7s linear infinite;
}
@keyframes spin-ring { to { transform: rotate(360deg); } }
.photo-ring-inner {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--bg-deep);
}
.photo-img {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 32%;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  z-index: 2;
  border: 3px solid var(--bg-deep);
}

.hero-title {
  font-family: var(--font-script);
  font-size: clamp(3.2rem, 11vw, 6.4rem);
  font-weight: 700;
  line-height: 1.05;
  background: linear-gradient(120deg, var(--gold) 0%, var(--rose) 45%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
  background-size: 220%;
  animation: shimmer 5s linear infinite;
}
@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}
.hero-subtitle {
  font-family: var(--font-script);
  font-size: clamp(1.5rem, 4.6vw, 2.5rem);
  color: var(--rose-soft);
  margin-bottom: 30px;
  font-weight: 600;
}

/* --- Countdown / celebration widget --- */
#bday-status {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.status-label {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--rose-soft);
  margin-bottom: 10px;
  font-weight: 600;
}
.countdown-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: nowrap;
}
.countdown-unit {
  background: rgba(255, 225, 236, 0.08);
  border: 1px solid rgba(255, 175, 201, 0.25);
  border-radius: 14px;
  padding: 10px 6px;
  min-width: 62px;
  backdrop-filter: blur(6px);
}
.countdown-num {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(1.3rem, 5vw, 1.9rem);
  color: var(--gold);
  display: block;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown-unit-label {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rose-soft);
  margin-top: 4px;
  display: block;
}

.celebrate-badge {
  font-family: var(--font-script);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  color: var(--gold);
  text-shadow: 0 0 30px rgba(255,200,87,0.6);
  animation: celebrate-pop 1.6s ease-in-out infinite;
}
@keyframes celebrate-pop {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}
.celebrate-sub {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--rose-soft);
  margin-top: 8px;
}

/* ============================================================
   LIFE IN NUMBERS
   ============================================================ */
#life {
  padding: 70px 20px 60px;
  background: linear-gradient(180deg, transparent, var(--bg-mid) 18%, var(--bg-mid) 82%, transparent);
}
.counter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  max-width: 720px;
  margin: 0 auto 34px;
}
.counter-card {
  background: linear-gradient(135deg, rgba(255,92,141,0.14), rgba(255,200,87,0.06));
  border: 1px solid rgba(255,175,201,0.22);
  border-radius: 18px;
  padding: 20px 22px;
  min-width: 100px;
  flex: 1;
  max-width: 155px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
  text-align: center;
}
.counter-card:hover { transform: translateY(-4px); }
.counter-num {
  font-family: var(--font-ui);
  font-size: clamp(1.7rem, 5.4vw, 2.5rem);
  font-weight: 700;
  color: var(--gold);
  display: block;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(255,200,87,0.4);
}
.counter-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rose-soft);
  margin-top: 7px;
  display: block;
  font-weight: 600;
}
.bday-banner {
  background: linear-gradient(135deg, rgba(255,200,87,0.14), rgba(255,92,141,0.14));
  border: 1px solid rgba(255,200,87,0.28);
  border-radius: 20px;
  padding: 22px 28px;
  max-width: 520px;
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 2.4vw, 1.08rem);
  font-weight: 600;
  color: var(--cream);
  text-align: center;
  line-height: 1.6;
}
.bday-banner strong {
  color: var(--gold);
  font-family: var(--font-script);
  font-size: 1.35em;
  font-weight: 700;
}
.bday-banner .sub {
  display: block;
  font-size: 0.82rem;
  opacity: 0.75;
  margin-top: 8px;
  font-weight: 400;
}

/* ============================================================
   TREE SECTION
   ============================================================ */
#tree-section {
  padding: 50px 0 20px;
  text-align: center;
}
.tree-hint {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--rose-soft);
  margin-bottom: 22px;
  opacity: 0.85;
  animation: blink-hint 2.2s ease-in-out infinite;
}
@keyframes blink-hint {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}
#wrap {
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-md);
}
#canvas {
  display: block;
  margin: 0 auto;
  cursor: default;
}
#canvas.hand { cursor: pointer; }
#text {
  position: absolute;
  pointer-events: none;
}
#code {
  display: none;
  color: var(--blush);
  font-family: var(--font-script);
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  line-height: 1.85;
  text-align: center;
  text-shadow: 0 0 20px rgba(255,92,141,0.55), 0 2px 8px rgba(0,0,0,0.5);
  font-weight: 600;
}
.say { display: block; }

/* ============================================================
   MOMENTS GALLERY
   ============================================================ */
#moments {
  padding: 70px 20px;
  background: linear-gradient(180deg, transparent, var(--bg-mid) 15%, var(--bg-mid) 85%, transparent);
}
.moments-grid {
  display: flex;
  gap: 18px;
  max-width: var(--max-w);
  margin: 0 auto;
  overflow-x: auto;
  padding: 8px 4px 20px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.moments-grid::-webkit-scrollbar { height: 6px; }
.moments-grid::-webkit-scrollbar-thumb { background: rgba(255,92,141,0.35); border-radius: 10px; }

.moment-card {
  flex: 0 0 auto;
  width: min(240px, 62vw);
  scroll-snap-align: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  border: 1px solid rgba(255,175,201,0.18);
  transition: transform 0.35s ease;
}
.moment-card:hover { transform: translateY(-6px); }
.moment-card img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}
.moment-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 16px 14px;
  background: linear-gradient(0deg, rgba(26,10,18,0.92), transparent);
  font-family: var(--font-script);
  font-size: 1.25rem;
  color: var(--blush);
  font-weight: 600;
}

/* ============================================================
   LOVE LETTER
   ============================================================ */
#letter {
  padding: 70px 20px 40px;
}
.love-letter {
  max-width: 600px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(255,92,141,0.10), rgba(255,200,87,0.05));
  border: 1px solid rgba(255,175,201,0.2);
  border-radius: var(--radius-lg);
  padding: 44px 34px;
  backdrop-filter: blur(10px);
}
.love-letter p {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1.02rem, 2.6vw, 1.18rem);
  line-height: 1.85;
  color: var(--cream);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  margin-bottom: 22px;
}
.love-letter p:last-of-type { margin-bottom: 0; }
.love-letter p.visible {
  opacity: 1;
  transform: translateY(0);
}
.love-letter .heart-emoji { color: var(--rose-bright); }

.promise-card {
  margin-top: 28px;
  padding: 22px 22px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255,200,87,0.14), rgba(255,92,141,0.1));
  border: 1px solid rgba(255,200,87,0.3);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  text-align: left;
}
.promise-card.visible { opacity: 1; transform: translateY(0); }
.promise-card .promise-tag {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
}
.promise-card p {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  line-height: 1.8;
  color: var(--blush);
  opacity: 1;
  transform: none;
  transition: none;
  margin-bottom: 0;
}

.signature {
  margin-top: 30px;
  font-family: var(--font-script);
  font-size: clamp(1.5rem, 4.2vw, 2rem);
  color: var(--gold);
  opacity: 0;
  transition: opacity 1s ease 0.3s;
  text-align: center;
}
.signature.visible { opacity: 1; }

/* --- Sticker accents (decorative, tilted, small) --- */
.sticker-accent {
  width: 74px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.4);
  border: 2px solid rgba(255,246,248,0.85);
  opacity: 0;
  transform: translateY(14px) rotate(var(--tilt, -6deg));
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.sticker-accent.visible {
  opacity: 1;
  transform: translateY(0) rotate(var(--tilt, -6deg));
}
.sticker-inline {
  display: inline-flex;
  align-items: flex-end;
  gap: 14px;
}
.sticker-inline .sticker-accent {
  flex-shrink: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  text-align: center;
  padding: 36px 20px 44px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: rgba(255,175,201,0.6);
  line-height: 1.7;
}
footer .heart { color: var(--rose-bright); }

/* ============================================================
   FLOATING MUSIC TOGGLE
   ============================================================ */
#music-toggle {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--rose), var(--rose-bright));
  color: white;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(255,92,141,0.5);
  transition: transform 0.25s ease;
  animation: music-invite 2.6s ease-in-out infinite;
}
#music-toggle:hover { transform: scale(1.08); }
#music-toggle:active { transform: scale(0.95); }
#music-toggle.playing { animation: music-spin 6s linear infinite; }
@keyframes music-invite {
  0%, 100% { box-shadow: 0 8px 24px rgba(255,92,141,0.5), 0 0 0 0 rgba(255,92,141,0.45); }
  50%      { box-shadow: 0 8px 24px rgba(255,92,141,0.5), 0 0 0 12px rgba(255,92,141,0); }
}
@keyframes music-spin { to { transform: rotate(360deg); } }

/* ============================================================
   CONFETTI (celebration burst)
   ============================================================ */
#confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(600deg); opacity: 0.2; }
}

/* --- Small sticker placement helpers --- */
.hero-sticker {
  position: absolute;
  width: 58px;
  top: -8px;
  right: -6px;
  z-index: 4;
  transition-delay: 0.4s;
}
.tree-hint-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.tree-hint-row .tree-hint { margin-bottom: 0; }
.tree-hint-sticker { width: 48px; }
.footer-sticker {
  width: 42px;
  vertical-align: middle;
  margin-left: 8px;
}

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */
@media (max-width: 480px) {
  .counter-card { min-width: 82px; padding: 15px 10px; }
  .love-letter { padding: 32px 22px; }
  .countdown-unit { min-width: 56px; padding: 9px 4px; }
  .moment-card { width: min(210px, 66vw); }
  .sticker-inline .sticker-accent { width: 56px; }
  .hero-sticker { width: 46px; }
}

@media (min-width: 900px) {
  .hero-title { font-size: clamp(4.5rem, 8vw, 7rem); }
  #hero { padding-top: 70px; }
}
