/* =============================================================
   SWEET COOKIEZAYA TURNS 23 — style.css
   Edit colours at the top :root block to retheme anything.
   ============================================================= */

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  --cream:        #FFF8F0;
  --cookie-brown: #8B5E3C;
  --dark-brown:   #5C3D2E;
  --soft-pink:    #D4A878;
  --caramel:      #D4860A;
  --caramel-light:#F5A623;
  --frosting:     #FFFDF8;
  --pink-light:   #FDF0DC;
  --shadow:       rgba(139, 94, 60, 0.15);
  --shadow-deep:  rgba(139, 94, 60, 0.28);

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Nunito', sans-serif;
  --font-letter:  'Dancing Script', cursive;
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--dark-brown);
  overflow-x: hidden;
}

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

/* ─── Section reveal animation ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Shared section styles ─────────────────────────────────── */
.section { padding: 90px 24px; }

.section-header {
  text-align: center;
  margin-bottom: 56px;
}
.section-eyebrow {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--caramel);
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--dark-brown);
  line-height: 1.2;
  margin-bottom: 12px;
}
.section-sub {
  font-size: 1.05rem;
  color: var(--cookie-brown);
  opacity: 0.85;
}

/* ─── Gradient text helper ──────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--dark-brown) 0%, var(--caramel) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Button ─────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 40px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--frosting);
  background: linear-gradient(135deg, var(--cookie-brown), var(--caramel));
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 24px var(--shadow-deep);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  letter-spacing: 0.02em;
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 36px var(--shadow-deep);
  filter: brightness(1.08);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

/* ─── NAV BAR ────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(255, 248, 240, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(139, 94, 60, 0.1);
}
.nav-title {
  font-family: var(--font-letter);
  font-size: 1.2rem;
  color: var(--dark-brown);
  font-weight: 700;
}
.nav-right { display: flex; align-items: center; gap: 12px; }


/* ─── HERO ───────────────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 24px 80px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, #fff0e6 0%, var(--cream) 70%);
}

.floating-cookies {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.cookie {
  position: absolute;
  font-size: 2rem;
  opacity: 0.25;
  animation: float 8s ease-in-out infinite;
  user-select: none;
}

.c1  { left: 5%;  top: 12%; font-size: 1.8rem; animation-delay: 0s;    animation-duration: 7s;  }
.c2  { left: 18%; top: 65%; font-size: 2.4rem; animation-delay: 1.2s;  animation-duration: 9s;  }
.c3  { left: 32%; top: 8%;  font-size: 1.5rem; animation-delay: 0.6s;  animation-duration: 6s;  }
.c4  { left: 48%; top: 78%; font-size: 2rem;   animation-delay: 2s;    animation-duration: 8s;  }
.c5  { left: 60%; top: 20%; font-size: 1.6rem; animation-delay: 0.4s;  animation-duration: 10s; }
.c6  { left: 72%; top: 55%; font-size: 2.2rem; animation-delay: 1.8s;  animation-duration: 7.5s;}
.c7  { left: 85%; top: 10%; font-size: 1.9rem; animation-delay: 0.9s;  animation-duration: 9s;  }
.c8  { left: 92%; top: 70%; font-size: 1.4rem; animation-delay: 3s;    animation-duration: 6.5s;}
.c9  { left: 10%; top: 85%; font-size: 2rem;   animation-delay: 1.5s;  animation-duration: 8.5s;}
.c10 { left: 55%; top: 88%; font-size: 1.7rem; animation-delay: 2.5s;  animation-duration: 7s;  }
.c11 { left: 78%; top: 33%; font-size: 1.5rem; animation-delay: 0.3s;  animation-duration: 11s; }
.c12 { left: 25%; top: 40%; font-size: 1.3rem; animation-delay: 2.2s;  animation-duration: 9.5s;}

@keyframes float {
  0%   { transform: translateY(0)   rotate(0deg);   opacity: 0.2; }
  33%  { transform: translateY(-18px) rotate(8deg);  opacity: 0.35; }
  66%  { transform: translateY(-8px)  rotate(-5deg); opacity: 0.28; }
  100% { transform: translateY(0)   rotate(0deg);   opacity: 0.2; }
}

.hero-content { position: relative; z-index: 2; max-width: 720px; }

.hero-eyebrow {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--soft-pink);
  margin-bottom: 20px;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.15;
  color: var(--dark-brown);
  margin-bottom: 24px;
}
.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-style: italic;
  color: var(--cookie-brown);
  opacity: 0.9;
  margin-bottom: 44px;
  line-height: 1.7;
}
.br-desktop { display: inline; }

.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--cookie-brown);
  opacity: 0.4;
  font-size: 1.5rem;
  animation: bounce 2.2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ─── COOKIE JAR ─────────────────────────────────────────────── */
#cookie-jar {
  background: linear-gradient(180deg, var(--cream) 0%, #fff0e0 100%);
  text-align: center;
}

.jar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 48px;
}

.jar {
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.15s;
}
.jar:hover { transform: scale(1.04); }

.jar-lid {
  width: 110px;
  height: 30px;
  background: linear-gradient(135deg, var(--cookie-brown), var(--dark-brown));
  border-radius: 50% 50% 0 0;
  position: relative;
  z-index: 2;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.12);
}
.jar-lid-knob {
  width: 22px;
  height: 16px;
  background: var(--cookie-brown);
  border-radius: 50% 50% 0 0;
  margin: 0 auto;
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
}
.jar.open .jar-lid {
  transform: translateY(-36px) rotate(-15deg);
}

.jar-body {
  width: 130px;
  height: 180px;
  background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,240,210,0.85) 100%);
  border: 2.5px solid rgba(139, 94, 60, 0.35);
  border-radius: 12px 12px 30px 30px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 4px 20px rgba(255,255,255,0.6), 0 8px 32px var(--shadow);
}
.jar-shine {
  position: absolute;
  top: 12px; left: 14px;
  width: 22px; height: 70px;
  background: rgba(255,255,255,0.55);
  border-radius: 12px;
  transform: rotate(8deg);
}
.jar-label {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cookie-brown);
  opacity: 0.6;
}
.jar-label span:first-child { font-size: 1.4rem; opacity: 1; }

.jar-base {
  width: 150px;
  height: 16px;
  background: linear-gradient(135deg, var(--cookie-brown), var(--dark-brown));
  border-radius: 0 0 20px 20px;
  box-shadow: 0 6px 16px var(--shadow-deep);
}

.jar-hint {
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--cookie-brown);
  opacity: 0.65;
  font-style: italic;
  transition: opacity 0.3s;
}

/* Cookie popup — one cookie per jar click */
.cookie-messages {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
  margin-top: 2rem;
}
.cookie-popup {
  border-radius: 48% 52% 55% 45% / 52% 44% 57% 43%;
  background:
    radial-gradient(ellipse 55% 45% at 32% 28%, rgba(220,168,100,0.38) 0%, transparent 60%),
    radial-gradient(ellipse 45% 40% at 72% 75%, rgba(72,36,12,0.45) 0%, transparent 55%),
    radial-gradient(circle at 50% 48%, #A8682E 0%, #8B5E3C 52%, #7A4E28 100%);
  color: var(--frosting);
  width: 300px;
  height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  flex-shrink: 0;
  animation: cookiePop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  box-shadow:
    0 20px 56px rgba(92, 61, 46, 0.52),
    0 6px 14px rgba(0, 0, 0, 0.22),
    inset 0 5px 16px rgba(220, 170, 100, 0.22),
    inset 0 -10px 22px rgba(65, 32, 10, 0.42);
}
.cookie-popup::before {
  content: '';
  position: absolute;
  inset: 12%;
  border: 1.5px solid rgba(255, 255, 255, 0.13);
  border-radius: 46% 54% 52% 48% / 54% 46% 54% 46%;
  pointer-events: none;
}
.cookie-popup::after {
  content: '';
  position: absolute;
  top: 13%; left: 18%;
  width: 40%; height: 28%;
  background: radial-gradient(ellipse, rgba(255, 238, 185, 0.24) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.cookie-popup.cookie-exit {
  animation: cookieExit 0.22s ease-in forwards;
}
@keyframes cookiePop {
  0%   { opacity: 0; transform: scale(0.05) translateY(80px) rotate(-10deg); }
  65%  { opacity: 1; transform: scale(1.07) translateY(-6px) rotate(1.5deg); }
  82%  { transform: scale(0.97) translateY(2px) rotate(-0.5deg); }
  100% { opacity: 1; transform: scale(1) translateY(0) rotate(0deg); }
}
@keyframes cookieExit {
  0%   { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(0.08) translateY(50px); }
}
.cookie-chip {
  position: absolute;
  width: 13px; height: 9px;
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 35% 28%, #4a2c1a 0%, #1c0c04 100%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5), inset 0 1px 2px rgba(255,255,255,0.04);
}
.cookie-popup-num {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 0.55rem;
  position: relative; z-index: 1;
}
.cookie-popup-text {
  font-family: var(--font-body);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.55;
  padding: 0 0.4rem;
  position: relative; z-index: 1;
}
.cookie-popup-counter {
  margin-top: 0.85rem;
  font-size: 0.7rem;
  font-family: var(--font-body);
  opacity: 0.42;
  letter-spacing: 0.06em;
  position: relative; z-index: 1;
}

/* ─── MEMORY WALL ────────────────────────────────────────────── */
#memories {
  background: linear-gradient(180deg, #fff0e0 0%, var(--cream) 100%);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 32px;
  max-width: 960px;
  margin: 0 auto;
}

.polaroid {
  background: #fff;
  padding: 14px 14px 40px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.polaroid:hover {
  transform: scale(1.04) !important;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}
.p-tilt-l { transform: rotate(-2deg); }
.p-tilt-r { transform: rotate(2deg);  }

.photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--pink-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.83rem;
  color: var(--cookie-brown);
  font-weight: 600;
}
.photo-placeholder span:first-child { font-size: 2.4rem; }
.polaroid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.memory-caption {
  font-family: var(--font-letter);
  font-size: 1.05rem;
  color: var(--cookie-brown);
  text-align: center;
  margin-top: 12px;
  line-height: 1.3;
}

/* ─── BIRTHDAY LETTER ────────────────────────────────────────── */
#letter {
  background: var(--cream);
}

.letter-card {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  background: #FFFEF5;
  border-radius: 4px;
  box-shadow: 0 8px 40px var(--shadow), 0 2px 8px rgba(0,0,0,0.06);
  padding: 60px 52px 70px;
  overflow: hidden;
}

.letter-lines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    transparent 0px,
    transparent 31px,
    rgba(139, 94, 60, 0.06) 31px,
    rgba(139, 94, 60, 0.06) 32px
  );
  pointer-events: none;
}

.letter-card::before {
  content: '';
  position: absolute;
  top: 0; left: 74px;
  width: 1px; height: 100%;
  background: rgba(212, 134, 10, 0.2);
}

.letter-content {
  position: relative;
  font-family: var(--font-letter);
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  color: var(--dark-brown);
  line-height: 2.1;
}
.letter-content p + p { margin-top: 20px; }
.letter-salutation {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 4px;
}
.letter-sign {
  margin-top: 36px;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 700;
}
.editable-name { color: var(--caramel); }

.wax-seal {
  position: absolute;
  bottom: 20px; right: 24px;
  width: 52px; height: 52px;
  background: radial-gradient(circle, var(--caramel) 60%, #b8722a 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 3px 10px rgba(212,134,10,0.35);
}

/* ─── CELEBRATION SECTION ────────────────────────────────────── */
#celebration {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--dark-brown) 0%, var(--cookie-brown) 40%, var(--caramel) 100%);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  padding: 80px 24px;
}

.crumb-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.crumb {
  position: absolute;
  top: -40px;
  font-size: 1.2rem;
  opacity: 0;
  animation: fall linear infinite;
}
@keyframes fall {
  0%   { transform: translateY(0)       rotate(0deg);   opacity: 0.6; }
  80%  { opacity: 0.5; }
  100% { transform: translateY(110vh)   rotate(360deg); opacity: 0; }
}

.celebration-content { position: relative; z-index: 2; }
.celebration-big {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--frosting);
  line-height: 1.2;
  margin-bottom: 16px;
}
.celebration-emoji { font-size: 4rem; margin-bottom: 24px; }
.celebration-sub {
  font-size: 1.1rem;
  color: rgba(255,253,248,0.8);
  font-style: italic;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── FINAL / BLOW THE CANDLE ────────────────────────────────── */
#final {
  background: var(--cream);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.final-card {
  max-width: 540px;
  margin: 0 auto;
  background: var(--frosting);
  border-radius: 28px;
  padding: 56px 40px;
  box-shadow: 0 12px 48px var(--shadow-deep);
  position: relative;
  z-index: 2;
}

.cake-display {
  position: relative;
  margin-bottom: 28px;
  display: inline-block;
}
.cake-glow {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,134,10,0.25) 0%, transparent 70%);
  animation: pulse-glow 2.5s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { transform: scale(1);    opacity: 0.7; }
  50%       { transform: scale(1.15); opacity: 1;   }
}
.cake-emoji { font-size: 5rem; }
.cake-cookies { font-size: 1.5rem; letter-spacing: 6px; margin-top: 8px; }

.final-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--dark-brown);
  line-height: 1.25;
  margin-bottom: 36px;
}

.btn-candle { margin-bottom: 32px; }
.btn-candle.blown {
  background: linear-gradient(135deg, #aaa, #888);
  cursor: default;
  box-shadow: none;
}

.final-message {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--dark-brown);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.final-message.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Confetti */
#confettiContainer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px; height: 10px;
  border-radius: 2px;
  opacity: 0;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { opacity: 1;   transform: translateY(0)      rotate(0deg)   scale(1);   }
  90%  { opacity: 0.8; }
  100% { opacity: 0;   transform: translateY(105vh)  rotate(720deg) scale(0.4); }
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
.footer {
  background: var(--dark-brown);
  padding: 32px 24px 20px;
  text-align: center;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.footer-text {
  font-size: 0.9rem;
  color: rgba(255,253,248,0.7);
}
.easter-egg-btn {
  font-size: 1.1rem;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
  padding: 4px;
}
.easter-egg-btn:hover {
  opacity: 1;
  transform: scale(1.3) rotate(-10deg);
}

.easter-message {
  max-height: 0;
  overflow: hidden;
  font-family: var(--font-letter);
  font-size: 1.1rem;
  color: var(--soft-pink);
  transition: max-height 0.5s ease, padding 0.4s;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.easter-message.revealed {
  max-height: 80px;
  padding: 14px 0 6px;
}

/* ─── KEYFRAMES: wobble ──────────────────────────────────────── */
@keyframes wobble {
  0%, 100% { transform: rotate(0); }
  20%  { transform: rotate(-6deg); }
  40%  { transform: rotate(6deg);  }
  60%  { transform: rotate(-4deg); }
  80%  { transform: rotate(4deg);  }
}
.jar.wobble { animation: wobble 0.5s ease; }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .section { padding: 70px 20px; }
  .letter-card { padding: 44px 28px 60px; }
  .letter-card::before { left: 50px; }
  .memory-grid  { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .br-desktop { display: none; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .memory-grid  { grid-template-columns: 1fr; max-width: 340px; }
  .letter-card { padding: 36px 20px 52px; }
  .letter-card::before { display: none; }
  .final-card { padding: 40px 24px; }
  .nav-title { font-size: 1rem; }
}
