/* ===================== ADIBA BIRTHDAY =====================
   Intimate digital scrapbook. Warm palette, editorial type.
   =========================================================== */

/* --- Palette & Typography --- */
:root {
  --cream: #fdf8f4;
  --blush: #f5e6e0;
  --dusty-rose: #c9a0a0;
  --soft-pink: #e8cfc8;
  --burgundy: #6e3b4c;
  --ink: #3a2a2e;
  --muted: #8a7478;
  --light-muted: #b8a5a8;
  --paper: #f9f3ee;
  --line: rgba(110, 59, 76, 0.12);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --hand: "Parisienne", cursive;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  color: var(--ink);
  background: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

::selection { background: var(--soft-pink); color: var(--ink); }
button { font: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding: 20px 28px;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}
.header nav {
  display: none;
  gap: 28px;
}
.header nav a {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  transition: color 0.3s ease;
}
.header nav a:hover { color: var(--ink); }
.music-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  transition: all 0.3s ease;
}
.music-btn:hover { background: var(--blush); color: var(--ink); }

/* --- Hero --- */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  padding: 80px 28px 40px;
  position: relative;
}
.hero-left { max-width: 500px; }
.hero-date {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--dusty-rose);
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(12px);
  animation: heroFadeIn 0.8s ease forwards 0.2s;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(16px);
  animation: heroFadeIn 0.9s ease forwards 0.4s;
}
.hero-title em {
  font-style: normal;
  color: var(--burgundy);
}
.hero-note {
  font-family: var(--hand);
  font-size: 1.1rem;
  color: var(--dusty-rose);
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(10px);
  animation: heroFadeIn 0.8s ease forwards 0.7s;
}
.hero-cta {
  display: inline-block;
  font-family: var(--hand);
  font-size: 0.95rem;
  color: var(--burgundy);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.3s ease;
  opacity: 0;
  animation: heroFadeIn 0.8s ease forwards 0.9s;
}
.hero-cta:hover { color: var(--ink); }
.hero-scroll {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  color: var(--light-muted);
  opacity: 0;
  animation: heroFadeIn 0.8s ease forwards 1.4s;
}
.hero-right {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  animation: heroPhotoIn 1s ease forwards 0.6s;
}
.hero-photo-wrap {
  position: relative;
  width: clamp(240px, 28vw, 360px);
  transform: rotate(2.5deg);
}
.hero-photo {
  width: 100%;
  height: auto;
  display: block;
  border: 7px solid white;
  box-shadow:
    0 1px 3px rgba(48, 36, 38, 0.05),
    0 8px 24px rgba(48, 36, 38, 0.09),
    0 20px 48px rgba(48, 36, 38, 0.06);
}
.hero-label {
  position: absolute;
  top: -14px;
  left: 12px;
  font-family: var(--sans);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--light-muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.hero-annotation {
  position: absolute;
  top: 14px;
  right: -24px;
  font-family: var(--hand);
  font-size: 0.8rem;
  color: var(--dusty-rose);
  transform: rotate(4deg);
}
.hero-photo-caption {
  position: absolute;
  bottom: -30px;
  right: -6px;
  font-family: var(--hand);
  font-size: 0.85rem;
  color: var(--dusty-rose);
  transform: rotate(-2.5deg);
  white-space: nowrap;
}
.hero-page-num {
  display: block;
  text-align: right;
  margin-top: 48px;
  font-family: var(--sans);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--light-muted);
}

@keyframes heroFadeIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroPhotoIn {
  to { opacity: 1; }
}

/* --- Photo Collage --- */
.collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 20px 20px 80px;
  max-width: 1100px;
  margin: 0 auto;
}
.collage-item { position: relative; overflow: hidden; }
.collage-item .photo-btn {
  width: 100%;
  height: 100%;
  padding: 0;
  display: block;
}
.collage-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.collage-item:hover img { transform: scale(1.03); }

.collage-large {
  grid-column: 1;
  grid-row: 1 / 3;
  min-height: 380px;
}
.collage-polaroid {
  grid-column: 2;
  background: white;
  padding: 10px 10px 36px;
  box-shadow: 0 2px 8px rgba(58, 42, 46, 0.08);
  transform: rotate(1deg);
  overflow: visible;
}
.collage-polaroid img { height: 100%; object-fit: cover; }
.polaroid-caption {
  position: absolute;
  bottom: 10px;
  left: 16px;
  font-family: var(--hand);
  font-size: 0.8rem;
  color: var(--muted);
}
.collage-tall {
  grid-column: 2;
  min-height: 260px;
}
.collage-wide {
  grid-column: 1;
  min-height: 200px;
}
.collage-small {
  grid-column: 2;
  min-height: 200px;
}

/* --- A Little Note --- */
.note-section {
  padding: 100px 28px;
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}
.note-label {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--dusty-rose);
  margin-bottom: 32px;
}
.note-quote {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 28px;
  border: none;
}
.note-text {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.75;
}

/* --- Scrapbook --- */
.scrapbook {
  padding: 60px 28px 100px;
  max-width: 900px;
  margin: 0 auto;
}
.scrapbook-title {
  font-family: var(--hand);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--dusty-rose);
  text-align: center;
  margin-bottom: 48px;
}
.scrapbook-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 32px;
}
.scrap-item {
  background: var(--paper);
  padding: 28px 24px 32px;
  position: relative;
  border: 1px solid var(--line);
  transition: transform 0.4s ease;
}
.scrap-rotate-left { transform: rotate(-0.8deg); }
.scrap-rotate-right { transform: rotate(0.6deg); }
.scrap-rotate-slight { transform: rotate(-0.3deg); }
.scrap-item:hover { transform: rotate(0deg) translateY(-2px); }
.scrap-num {
  font-family: var(--serif);
  font-size: 0.7rem;
  color: var(--light-muted);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 10px;
}
.scrap-item h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  margin-bottom: 8px;
  color: var(--ink);
}
.scrap-item p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
}
.scrap-annotation {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-family: var(--hand);
  font-size: 0.7rem;
  color: var(--light-muted);
  transform: rotate(-2deg);
}

/* --- Full-bleed photo --- */
.fullbleed {
  padding: 40px 0 80px;
  text-align: center;
}
.fullbleed .photo-btn {
  display: block;
  width: 100%;
  max-height: 70vh;
  overflow: hidden;
  padding: 0;
}
.fullbleed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: 70vh;
  transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.fullbleed:hover img { transform: scale(1.02); }
.fullbleed-caption {
  font-family: var(--hand);
  font-size: 0.85rem;
  color: var(--light-muted);
  margin-top: 16px;
}

/* --- Letter --- */
.letter {
  padding: 100px 28px 120px;
  max-width: 640px;
  margin: 0 auto;
}
.letter-label {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--dusty-rose);
  margin-bottom: 40px;
  text-align: center;
}
.letter-body {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--ink);
}
.letter-body p { margin-bottom: 22px; }
.letter-dear {
  font-family: var(--hand);
  font-size: 1.6rem;
  color: var(--burgundy);
  margin-bottom: 28px !important;
}
.letter-closing {
  margin-top: 40px !important;
  margin-bottom: 0 !important;
}
.letter-sign {
  font-family: var(--hand);
  font-size: 1.3rem;
  color: var(--burgundy);
}

/* --- Surprise --- */
.surprise {
  padding: 80px 28px 100px;
  text-align: center;
  min-height: 60svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.surprise-trigger {
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--dusty-rose);
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  transition: color 0.3s ease;
}
.surprise-trigger:hover { color: var(--ink); }
.surprise-message {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s ease 0.2s;
}
.surprise-message.open {
  max-height: 400px;
  opacity: 1;
}
.surprise-big {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--ink);
  margin-bottom: 16px;
  margin-top: 32px;
}
.surprise-small {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}

/* --- Footer --- */
footer {
  padding: 32px 28px 40px;
  text-align: center;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--light-muted);
  border-top: 1px solid var(--line);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(42, 28, 32, 0.88);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: min(100%, 900px);
  max-height: 88svh;
  object-fit: contain;
  border: 4px solid white;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.lightbox.open img { transform: scale(1); }
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1.4rem;
  display: grid;
  place-items: center;
  transition: background 0.3s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }

/* --- Confetti --- */
.confetti {
  position: fixed;
  z-index: 150;
  top: -20px;
  pointer-events: none;
  animation: confettiFall 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes confettiFall {
  to {
    transform: translate3d(var(--x), 105vh, 0) rotate(var(--r));
    opacity: 0;
  }
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Reduced motion --- */
@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;
  }
}

/* ===================== RESPONSIVE ===================== */

/* Small mobile adjustments */
@media (max-width: 480px) {
  .hero-right {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    margin-top: 40px;
    justify-self: start;
    animation: heroPhotoIn 1s ease forwards 0.6s;
  }
  .hero-photo-wrap {
    width: 200px;
    transform: rotate(2deg);
  }
  .hero-label { top: -12px; left: 8px; font-size: 0.5rem; }
  .hero-annotation { right: -20px; top: 10px; font-size: 0.7rem; }
  .hero-photo-caption { bottom: -26px; font-size: 0.75rem; }
  .hero-page-num { margin-top: 36px; }
  .collage-polaroid { padding: 8px 8px 30px; }
  .polaroid-caption { font-size: 0.7rem; bottom: 6px; left: 12px; }
  .scrapbook-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* Tablet */
@media (min-width: 620px) {
  .header nav { display: flex; }

  .hero {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    column-gap: 40px;
    padding: 80px 48px 40px;
  }
  .hero-left { align-self: end; padding-bottom: 20px; }
  .hero-right {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    align-self: center;
    justify-self: end;
  }
  .hero-photo-wrap {
    width: clamp(280px, 30vw, 400px);
    transform: rotate(2deg);
  }
  .hero-scroll {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .collage {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    gap: 14px;
    padding: 20px 32px 100px;
  }
  .collage-large { grid-column: 1 / 3; grid-row: 1 / 3; min-height: 0; }
  .collage-polaroid { grid-column: 3; grid-row: 1 / 2; min-height: 0; }
  .collage-polaroid img { height: 100%; }
  .collage-tall { grid-column: 4; grid-row: 1 / 3; min-height: 0; }
  .collage-wide { grid-column: 1 / 3; grid-row: 3 / 4; min-height: 0; }
  .collage-small { grid-column: 3 / 5; grid-row: 3 / 4; min-height: 0; }

  .scrapbook { padding: 80px 48px 120px; }
  .scrapbook-grid { gap: 32px 40px; }

  .letter { padding: 120px 48px 140px; }
}

/* Desktop */
@media (min-width: 900px) {
  .hero { padding: 80px 64px 40px; }
  .hero-title { font-size: clamp(3.2rem, 6vw, 5rem); }

  .collage {
    grid-auto-rows: 240px;
    gap: 16px;
    padding: 20px 48px 120px;
  }

  .scrapbook-grid { gap: 36px 48px; }
  .scrap-item { padding: 32px 28px 36px; }

  .letter { padding: 140px 64px 160px; }
  .letter-body { font-size: 1.2rem; }
}
