:root {
  --cream: #fff6f2;
  --peach: #ffd9c9;
  --pink: #ffb6c1;
  --rose: #e85d75;
  --rose-deep: #c94f6d;
  --gold: #e8b04b;
  --text: #4a2c34;
  --text-soft: #7a5a63;
  --shadow: 0 20px 50px -20px rgba(201, 79, 109, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #hearts-canvas { display: none; }
  .reason-card, .gallery-grid img { opacity: 1 !important; transform: none !important; }
  .scroll-cue span::before { animation: none; }
}

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(180deg, #fff6f2 0%, #fff0e9 40%, #ffe9f0 100%);
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

#hearts-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.section, .hero, .footer { position: relative; z-index: 2; }

/* ---------- HERO ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(2rem + env(safe-area-inset-top)) calc(1.5rem + env(safe-area-inset-right)) 2rem calc(1.5rem + env(safe-area-inset-left));
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 182, 193, 0.45), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(232, 176, 75, 0.25), transparent 55%);
}

.hero-inner { max-width: 700px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--rose-deep);
  opacity: 0.75;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: clamp(2.2rem, 7vw, 4rem);
  color: var(--text);
  line-height: 1.15;
}

.hero-comma { color: var(--rose); }

.hero-name {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  font-size: clamp(3.5rem, 12vw, 7rem);
  color: var(--rose-deep);
  line-height: 1;
  margin: 0.2rem 0 1.2rem;
  text-shadow: 0 6px 30px rgba(201, 79, 109, 0.25);
}

.hero-sub {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--text-soft);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3.5rem;
  text-decoration: none;
  color: var(--text-soft);
}

.scroll-cue span {
  width: 22px;
  height: 34px;
  border: 2px solid var(--rose-deep);
  border-radius: 20px;
  position: relative;
}

.scroll-cue span::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 4px;
  height: 8px;
  background: var(--rose-deep);
  border-radius: 4px;
  transform: translateX(-50%);
  animation: scrollDot 1.6s ease-in-out infinite;
}

@keyframes scrollDot {
  0% { top: 6px; opacity: 1; }
  70% { top: 18px; opacity: 0; }
  100% { top: 6px; opacity: 0; }
}

.scroll-cue small {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ---------- SECTIONS ---------- */
.section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 6rem 1.5rem;
  text-align: center;
}

.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--rose);
  margin-bottom: 0.6rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.section-hint {
  color: var(--text-soft);
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

/* ---------- REASONS ---------- */
.reasons-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  text-align: left;
}

.reason-card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(232, 93, 117, 0.15);
  border-radius: 20px;
  padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  opacity: 0;
  transform: translateY(24px);
}

.reason-card.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reason-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 55px -18px rgba(201, 79, 109, 0.45);
}

.reason-card .icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.75rem;
}

.reason-card p {
  color: var(--text);
  line-height: 1.5;
  font-size: 0.98rem;
}

/* ---------- GALLERY (JS-built columns, keeps each photo's own proportions) ---------- */
/* Built as separate column divs in JS instead of CSS column-count, because many
   mobile browsers (iOS Safari in particular) slice images in half at column
   breaks and ignore break-inside: avoid. Plain flex columns never split an image. */
.gallery-grid {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.gallery-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.gallery-grid img {
  width: 100%;
  display: block;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.35s ease, filter 0.35s ease;
  opacity: 0;
  transform: scale(0.94) translateY(12px);
}

.gallery-grid img.in-view {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.gallery-grid img:hover {
  transform: scale(1.02) rotate(-0.3deg);
}

@media (max-width: 420px) {
  .gallery-grid { gap: 0.6rem; }
  .gallery-col { gap: 0.6rem; }
  .gallery-grid img { border-radius: 12px; }
}

.gallery-empty {
  grid-column: 1 / -1;
  color: var(--text-soft);
  background: rgba(255,255,255,0.5);
  border-radius: 16px;
  padding: 2.5rem 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- LETTER ---------- */
.letter-card {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: clamp(2rem, 5vw, 3.5rem);
  box-shadow: var(--shadow);
  border: 1px solid rgba(232, 93, 117, 0.15);
  position: relative;
}

.letter-card::before {
  content: "❝";
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  color: var(--pink);
  position: absolute;
  top: -0.5rem;
  left: 1.5rem;
  opacity: 0.8;
}

.letter-text {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.85;
  color: var(--text);
}

.letter-sign {
  margin-top: 1.5rem;
  font-family: 'Great Vibes', cursive;
  font-size: 2rem;
  color: var(--rose-deep);
}

/* ---------- WISHES ---------- */
.wishes-list {
  list-style: none;
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  text-align: left;
}

.wishes-list li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 1.1rem 1.3rem;
  border: 1px solid rgba(232, 93, 117, 0.15);
  font-size: 0.98rem;
}

.wishes-list .icon { font-size: 1.4rem; }

/* ---------- INTERACTIVE HEART ---------- */
.heart-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.heart-hint {
  color: var(--text-soft);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.big-heart {
  background: none;
  border: none;
  font-size: clamp(4rem, 12vw, 7rem);
  cursor: pointer;
  filter: drop-shadow(0 10px 25px rgba(232, 93, 117, 0.4));
  transition: transform 0.15s ease;
  line-height: 1;
}

.big-heart:active { transform: scale(0.85); }

.heart-counter {
  margin-top: 0.75rem;
  color: var(--rose-deep);
  font-weight: 700;
  min-height: 1.5em;
}

.floating-heart {
  position: fixed;
  pointer-events: none;
  font-size: 1.6rem;
  z-index: 50;
  animation: floatUp 1.4s ease-out forwards;
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-160px) scale(1.4); opacity: 0; }
}

/* ---------- FOOTER ---------- */
.footer {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  color: var(--rose-deep);
}

.footer p:first-child {
  font-family: 'Great Vibes', cursive;
  font-size: 2.4rem;
}

.footer-date {
  margin-top: 0.5rem;
  color: var(--text-soft);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(30, 12, 18, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  z-index: 100;
  padding: 2rem;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: min(92vw, 900px);
  max-height: 78vh;
  border-radius: 12px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.5);
}

.lightbox p {
  color: #fff2f2;
  font-size: 0.95rem;
  max-width: 600px;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
}

@media (max-width: 520px) {
  .section { padding: 4.5rem 1.25rem; }
  .gallery-grid img { height: 160px; }
}
