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

html {
  font-size: 16px;
  /* prevent layout shift from scrollbar */
  scrollbar-gutter: stable;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* iOS rubber-band fix */
  overscroll-behavior: none;
}

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

/* Site hidden until PIN unlocked */
.site-hidden { display: none; }

/* ============================================================
   LOCK SCREEN
============================================================ */
#lock-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(160deg, #0a0812 0%, #180a2e 40%, #3a1060 80%, #26034a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease, transform 0.7s ease;
  /* prevent scroll behind lock */
  overflow: hidden;
}
#lock-screen.unlocking {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.lock-inner {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 1.25rem;
}

.lock-flower { position: absolute; opacity: 0.4; pointer-events: none; }
.lock-flower-tl { top: -36px; left: -16px; width: 110px; }
.lock-flower-br { bottom: -36px; right: -16px; width: 90px; }

.lock-card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(215,189,226,0.18);
  border-radius: 24px;
  padding: 2rem 1.5rem;
  text-align: center;
}

.lock-hint-top {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(215,189,226,0.5);
  margin-bottom: 0.6rem;
}

.lock-title {
  font-family: 'Dancing Script', cursive;
  font-size: 2.2rem;
  color: #D7BDE2;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.lock-hint {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  color: rgba(215,189,226,0.45);
  margin-bottom: 1.75rem;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 1rem;
}

.pin-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(215,189,226,0.35);
  background: transparent;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.pin-dot.filled  { background: #A97BCD; border-color: #A97BCD; transform: scale(1.15); }
.pin-dot.shake   { animation: pin-shake 0.35s ease; }

@keyframes pin-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

.pin-error {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  color: #A97BCD;
  margin-bottom: 1rem;
  opacity: 0;
  transition: opacity 0.25s;
  min-height: 1.3rem;
}
.pin-error.visible { opacity: 1; }

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pin-key {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.6rem;
  color: #FAF7F2;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  /* large touch target */
  padding: 1.1rem 0;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.pin-key:hover  { background: rgba(155,89,182,0.22); }
.pin-key:active { transform: scale(0.91); background: rgba(155,89,182,0.38); }
.pin-key-del    { font-size: 1.1rem; color: rgba(215,189,226,0.65); }

/* ============================================================
   VEIL
============================================================ */
#veil { transition: opacity 0.8s ease; }
#veil.gone { opacity: 0; pointer-events: none; }

/* ============================================================
   HERO
============================================================ */
.hero-bloom {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  will-change: transform, opacity;
}
.hero-bloom-l {
  width: 50vw; height: 50vw; max-width: 420px; max-height: 420px;
  background: radial-gradient(circle, rgba(155,89,182,0.18), transparent 70%);
  top: 15%; left: -12%;
  animation: bloom-pulse 6s ease-in-out infinite alternate;
}
.hero-bloom-r {
  width: 40vw; height: 40vw; max-width: 350px; max-height: 350px;
  background: radial-gradient(circle, rgba(16,185,129,0.15), transparent 70%);
  top: 28%; right: -10%;
  animation: bloom-pulse 8s ease-in-out infinite alternate-reverse;
}
@keyframes bloom-pulse {
  from { transform: scale(1);   opacity: 0.6; }
  to   { transform: scale(1.2); opacity: 1;   }
}

/* D + S avatars */
#ds-pair {
  /* GPU layer for smooth GSAP fade */
  will-change: opacity, transform;
}

.ds-avatar {
  position: relative;
  width: 90px; height: 90px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
@media (min-width: 480px) {
  .ds-avatar { width: 115px; height: 115px; }
}
@media (min-width: 768px) {
  .ds-avatar { width: 130px; height: 130px; }
}

.ds-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 15%;
  border-radius: 50%;
  display: block;
}

.ds-avatar-d {
  box-shadow: 0 0 0 2.5px rgba(155,89,182,0.5), 0 4px 20px rgba(155,89,182,0.2);
}
.ds-avatar-s {
  box-shadow: 0 0 0 2.5px rgba(16,185,129,0.5), 0 4px 20px rgba(16,185,129,0.2);
}

.ds-deco {
  position: absolute;
  inset: -14px;
  width: calc(100% + 28px);
  height: calc(100% + 28px);
  animation: deco-spin 30s linear infinite reverse;
  pointer-events: none;
  will-change: transform;
}
@keyframes deco-spin { to { transform: rotate(360deg); } }

.ds-heart {
  width: 32px; height: 32px;
  flex-shrink: 0;
  animation: heart-beat 2.5s ease-in-out infinite;
  will-change: transform;
}
@media (min-width: 480px) { .ds-heart { width: 40px; height: 40px; } }
@media (min-width: 768px) { .ds-heart { width: 48px; height: 48px; } }
@keyframes heart-beat {
  0%,100% { transform: scale(1);    }
  25%      { transform: scale(1.2); }
  50%      { transform: scale(0.95);}
  75%      { transform: scale(1.12);}
}

.scroll-chevron {
  display: flex; align-items: center; justify-content: center;
  animation: chevron-bounce 1.6s ease-in-out infinite;
  opacity: 0.55;
}
.scroll-chevron-2 {
  animation-delay: 0.25s;
  opacity: 0.3;
}
@keyframes chevron-bounce {
  0%,100% { transform: translateY(0);    opacity: 0.55; }
  50%     { transform: translateY(6px);  opacity: 0.9;  }
}

/* ============================================================
   GALLERY TIMELINE
============================================================ */
.timeline-entry {
  display: grid;
  gap: 1rem;
  align-items: start;
  opacity: 0;
  transform: translateY(30px);
}

/* Mobile: single column */
@media (max-width: 767px) {
  .timeline-entry {
    grid-template-columns: 1fr;
  }
  .entry-dot, .timeline-line { display: none !important; }
}

/* Desktop: alternating */
@media (min-width: 768px) {
  .timeline-entry {
    grid-template-columns: 1fr 2rem 1fr;
    gap: 1.5rem 2.5rem;
    align-items: center;
  }
  .timeline-entry.left  .entry-photo { order: 1; }
  .timeline-entry.left  .entry-dot   { order: 2; }
  .timeline-entry.left  .entry-text  { order: 3; }

  .timeline-entry.right .entry-photo { order: 3; }
  .timeline-entry.right .entry-dot   { order: 2; }
  .timeline-entry.right .entry-text  { order: 1; text-align: right; }
  .timeline-entry.right .entry-location { justify-content: flex-end; }
}

.entry-dot {
  display: flex; justify-content: center; align-items: flex-start; padding-top: 6px;
}
.entry-dot::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #A97BCD;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px #FAF7F2, 0 0 0 6px rgba(169,123,205,0.35);
}

/* Photos — natural size, no crop */
.entry-photo { line-height: 0; }
.entry-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(45,27,27,0.12);
  cursor: zoom-in;
  /* GPU composite for hover */
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94),
              box-shadow 0.35s ease;
}
@media (hover: hover) {
  .entry-photo img:hover {
    transform: scale(1.015) translateY(-2px);
    box-shadow: 0 14px 42px rgba(45,27,27,0.18);
  }
}

.entry-text { padding: 0.4rem 0; }

.entry-date {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: #A97BCD;
  margin-bottom: 0.35rem;
}

.entry-location {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem; letter-spacing: 0.13em;
  text-transform: uppercase; color: #9E9E9E;
  margin-bottom: 0.65rem;
  display: flex; align-items: center; gap: 0.3rem;
}
.entry-location svg { width: 9px; height: 9px; flex-shrink: 0; }

.entry-caption {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic; font-size: 1.05rem; line-height: 1.7; color: #6B5C5C;
}

.milestone-badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.58rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: #8B53A8;
  background: #EBDEF0;
  border-radius: 100px; padding: 0.2rem 0.7rem; margin-bottom: 0.45rem;
}

.timeline-entry.milestone .entry-photo img {
  border: 2px solid rgba(169,123,205,0.28);
  box-shadow: 0 6px 28px rgba(169,123,205,0.16);
}

/* ============================================================
   FIXED BOTTOM PORTRAITS — drift apart as page scrolls
============================================================ */
#floating-portraits {
  position: fixed;
  bottom: 18px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  z-index: 40;
  opacity: 0; /* fades in via GSAP */
}
#fp-d, #fp-s { flex-shrink: 0; }

.fp-img {
  width: 58px; height: 58px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}
.fp-img-d {
  box-shadow: 0 0 0 2px rgba(169,123,205,0.6), 0 3px 14px rgba(169,123,205,0.25);
}
.fp-img-s {
  box-shadow: 0 0 0 2px rgba(16,185,129,0.6), 0 3px 14px rgba(16,185,129,0.25);
}
@media (min-width: 480px) {
  .fp-img { width: 68px; height: 68px; }
  #floating-portraits { bottom: 22px; gap: 12px; }
}

/* ============================================================
   QUESTION SECTION
============================================================ */
.q-btn {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.25rem;
  color: #2D1B1B;
  border: 2px solid rgba(45,27,27,0.18);
  border-radius: 14px;
  padding: 0.9rem 2rem;
  background: transparent;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
@media (min-width: 480px) {
  .q-btn { width: auto; padding: 1rem 2.5rem; }
}
@media (hover: hover) {
  .q-btn:hover {
    border-color: #A97BCD; color: #A97BCD;
    background: rgba(169,123,205,0.06);
    transform: translateY(-2px);
  }
}

.q-reveal-btn {
  display: inline-block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.2rem; color: #FAF7F2;
  background: #A97BCD; border: none;
  border-radius: 14px; padding: 0.85rem 2.5rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  letter-spacing: 0.03em;
}
@media (hover: hover) {
  .q-reveal-btn:hover {
    background: #9B59B6;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(169,123,205,0.3);
  }
}

/* Glowing continue-to-next-section button */
.q-continue-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(169,123,205,0.12);
  border: 2px solid rgba(169,123,205,0.4);
  color: #A97BCD;
  cursor: pointer;
  margin: 0 auto;
  animation: q-continue-pulse 2s ease-in-out infinite;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
@media (hover: hover) {
  .q-continue-btn:hover {
    background: rgba(169,123,205,0.22);
    transform: scale(1.08);
  }
}
@keyframes q-continue-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(169,123,205,0.4); }
  50%     { box-shadow: 0 0 0 10px rgba(169,123,205,0); }
}

/* ============================================================
   PETAL RAIN
============================================================ */
.petal {
  position: absolute;
  border-radius: 50% 0;
  opacity: 0;
  animation: fall linear forwards;
  pointer-events: none;
  will-change: transform, opacity;
}
@keyframes fall {
  0%   { opacity: 0.6; transform: translateY(-20px) rotate(0deg); }
  100% { opacity: 0;   transform: translateY(110vh) rotate(720deg); }
}

/* ============================================================
   CONFETTI
============================================================ */
.confetti-piece {
  position: absolute;
  opacity: 0;
  animation: confetti-fall linear forwards;
  will-change: transform, opacity;
}
@keyframes confetti-fall {
  0%   { opacity: 1; transform: translateY(-20px) rotate(0deg) scaleX(1); }
  50%  { transform: translateY(50vh) rotate(360deg) scaleX(-1); }
  100% { opacity: 0; transform: translateY(105vh) rotate(720deg) scaleX(1); }
}

/* ============================================================
   LIGHTBOX
============================================================ */
#lightbox {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(10,8,18,0.96);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s ease;
  padding: 1rem;
}
#lightbox.open { opacity: 1; pointer-events: all; }
#lightbox img {
  max-width: 100%; max-height: 90vh;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6);
}
#lightbox-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 2.75rem; height: 2.75rem;
  background: rgba(255,255,255,0.1); border: none; border-radius: 50%;
  cursor: pointer; color: #FAF7F2; font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ============================================================
   LILY FLOAT
============================================================ */
.lily-float {
  pointer-events: none;
  will-change: transform, opacity;
}

/* ============================================================
   SCROLLBAR (desktop only)
============================================================ */
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 4px; }
  ::-webkit-scrollbar-track { background: #FAF7F2; }
  ::-webkit-scrollbar-thumb { background: #D7BDE2; border-radius: 100px; }
}

/* ============================================================
   SELECTION
============================================================ */
::selection { background: #EBDEF0; color: #2D1B1B; }

/* ============================================================
   TIMELINE LINE
============================================================ */
.timeline-line { pointer-events: none; will-change: transform; }

/* ============================================================
   SECTION PADDING — tighter on mobile
============================================================ */
@media (max-width: 479px) {
  /* Reduce generous desktop padding */
  section { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }

  /* Lock screen */
  .lock-card { padding: 1.75rem 1.25rem; }
  .lock-title { font-size: 1.9rem; }
  .pin-key { font-size: 1.4rem; padding: 0.95rem 0; }

  /* Hero */
  #hero-label { font-size: 0.6rem; }

  /* Quote card */
  .quote-card { padding: 1.75rem 1.25rem !important; }

  /* Change cards */
  #changed h2 { font-size: 2rem !important; }

  /* Gallery */
  #gallery h2 { font-size: 2rem !important; }

  /* Question */
  #question-section h2 { font-size: 2.5rem !important; }

  /* Always */
  #always h2 { font-size: 2.25rem !important; }

  /* Birthday */
  #birthday h2 { font-size: 2.5rem !important; }
  #birthday .font-script { font-size: 2.5rem !important; }
}

/* ============================================================
   PERFORMANCE — reduce animation on low-end / prefers-reduced-motion
============================================================ */
@media (prefers-reduced-motion: reduce) {
  .ds-deco, .ds-heart,
  .hero-bloom-l, .hero-bloom-r,
  .scroll-chevron, .lily-float { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}
