﻿/* ---------- Colors & fonts (change them here only) ---------- */
:root {
  --bg: #1A0F14;
  --neon: #FF8FAB;
  --soft: #F4B6C2;
  --text: #E8D5DA;
  --glass: rgba(255, 143, 171, 0.06);
  --line: rgba(255, 143, 171, 0.35);
  --font-script: "Great Vibes", cursive;
  --font-body: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

/* ---------- Neon heading ---------- */
.neon-title {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--soft);
  margin: 0;
  text-align: center;
  line-height: 1.1;
  text-shadow:
    0 0 6px rgba(255, 143, 171, 0.8),
    0 0 18px rgba(255, 143, 171, 0.55),
    0 0 36px rgba(255, 143, 171, 0.35);
}

/* ---------- Full-screen layout ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(255, 143, 171, 0.16), transparent 60%),
    radial-gradient(ellipse at 50% -10%, rgba(244, 182, 194, 0.07), transparent 55%),
    var(--bg);
  transition: opacity 0.9s ease, visibility 0.9s;
}
.screen.leaving { opacity: 0; visibility: hidden; }

/* ---------- PIN screen ---------- */
#pin-title { font-size: clamp(3rem, 15vw, 4.6rem); }

.pin-line {
  margin: 14px 0 38px;
  font-style: italic;
  color: var(--text);
  opacity: 0.85;
  letter-spacing: 0.04em;
  text-align: center;
}

.pin-boxes { display: flex; gap: 14px; }

.pin-box {
  width: 56px;
  height: 68px;
  border: 1px solid var(--neon);
  border-radius: 14px;
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 143, 171, 0.35), inset 0 0 12px rgba(255, 143, 171, 0.1);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.pin-box.active {
  box-shadow: 0 0 18px rgba(255, 143, 171, 0.8), inset 0 0 14px rgba(255, 143, 171, 0.2);
}
.pin-box.filled::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 10px var(--neon);
}

/* Wrong PIN: a soft side-to-side wobble, no red, no error text */
.pin-boxes.shake { animation: shake 0.55s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

/* The real input sits invisibly over the boxes so a tap opens the keypad */
.pin-input {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 80px;
  opacity: 0;
  font-size: 16px; /* 16px stops iPhones zooming in */
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
}

/* ---------- Floating outline hearts (decoration) ---------- */
.deco-hearts { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.deco-hearts svg {
  position: absolute;
  bottom: -40px;
  fill: none;
  stroke: var(--neon);
  stroke-width: 1.5;
  opacity: 0;
  filter: drop-shadow(0 0 4px rgba(255, 143, 171, 0.6));
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  15% { opacity: 0.35; }
  85% { opacity: 0.2; }
  100% { transform: translateY(-110vh) rotate(15deg); opacity: 0; }
}

/* ---------- Welcome screen ---------- */
.welcome { z-index: 5; }
.welcome-text {
  font-size: clamp(2.6rem, 12vw, 4.4rem);
  max-width: 14em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 2.2s ease, transform 2.2s ease;
}
.welcome.show .welcome-text { opacity: 1; transform: none; }
.welcome .deco-hearts svg { opacity: 0; }

/* Site fades in after the welcome */
.site { opacity: 0; transition: opacity 1.4s ease; }
.site.visible { opacity: 1; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 4%, rgba(26, 15, 20, 0.75) 38%, rgba(26, 15, 20, 0.1) 70%, rgba(26, 15, 20, 0.35));
}
.hero-content {
  position: relative;
  text-align: center;
  padding: 0 20px 44px;
  max-width: 640px;
}
.hero-title { font-size: clamp(3.4rem, 17vw, 6rem); }
.hero-tagline {
  margin: 14px 0 30px;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text);
}

/* Neon outline button */
.neon-btn {
  display: inline-block;
  padding: 12px 28px;
  border: 1px solid var(--neon);
  border-radius: 999px;
  color: var(--soft);
  text-decoration: none;
  letter-spacing: 0.08em;
  background: var(--glass);
  box-shadow: 0 0 12px rgba(255, 143, 171, 0.4), inset 0 0 10px rgba(255, 143, 171, 0.1);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.neon-btn:hover, .neon-btn:focus-visible {
  box-shadow: 0 0 22px rgba(255, 143, 171, 0.7), inset 0 0 12px rgba(255, 143, 171, 0.2);
}
.neon-btn::after { content: " \2193"; }

html { scroll-behavior: smooth; }

/* Gentle fade-in on scroll (add class "reveal" to anything) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1.1s ease, transform 1.1s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Shared section layout ---------- */
.section { padding: 72px 20px; max-width: 640px; margin: 0 auto; }
.section-title { font-size: clamp(2.8rem, 13vw, 4rem); margin-bottom: 40px; }

.glass-card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 18px rgba(255, 143, 171, 0.08);
}

/* ---------- Our Story timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 30px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--neon) 8%, var(--neon) 92%, transparent);
  box-shadow: 0 0 8px rgba(255, 143, 171, 0.6);
}
.tl-item { position: relative; margin-bottom: 36px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-item::before { /* glowing dot */
  content: "";
  position: absolute;
  left: -30px;
  top: 22px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--neon);
  box-shadow: 0 0 10px var(--neon);
}
.tl-card { overflow: hidden; }
.tl-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 1px solid var(--line); }
.tl-body { padding: 18px 20px 22px; }
.tl-date {
  margin: 0 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--neon);
}
.tl-title {
  margin: 0 0 8px;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.15;
  color: var(--soft);
  text-shadow: 0 0 10px rgba(255, 143, 171, 0.5);
}
.tl-text { margin: 0; }
.tl-item.forever .tl-title { font-size: 2.8rem; }
.tl-item.forever .tl-card { text-align: center; }
.tl-heart { display: block; margin: 0 auto 6px; fill: none; stroke: var(--neon); stroke-width: 1.5; filter: drop-shadow(0 0 5px rgba(255,143,171,.7)); }

/* ---------- Polaroids ---------- */
.polaroid-stack { display: flex; flex-direction: column; padding: 10px 0 30px; overflow: hidden; }
.polaroid {
  --tilt: -4deg;
  width: 74%;
  margin: 0 0 -14px;
  padding: 12px 12px 30px;
  background: #F6ECE4;
  border-radius: 3px;
  color: #3b2a31;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 143, 171, 0.14);
  transform: rotate(var(--tilt));
}
.polaroid:nth-child(even) { align-self: flex-end; --tilt: 3.5deg; }
.polaroid:nth-child(3n) { --tilt: -2deg; }
.polaroid img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; background: #2a1820; }
.polaroid figcaption {
  font-family: var(--font-script);
  font-size: 1.7rem;
  line-height: 1.2;
  text-align: center;
  padding-top: 10px;
}
.polaroid.reveal { transform: translateY(18px) rotate(var(--tilt)); }
.polaroid.reveal.in { transform: rotate(var(--tilt)); }

/* ---------- Our Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gallery-item {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--glass);
  cursor: pointer;
  aspect-ratio: 1 / 1;
  box-shadow: 0 0 14px rgba(255, 143, 171, 0.08);
  transition: box-shadow 0.3s ease;
}
.gallery-item:hover, .gallery-item:focus-visible { box-shadow: 0 0 18px rgba(255, 143, 171, 0.5); }
.gallery-item img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Love letter ---------- */
.letter-card { padding: 34px 24px 38px; }
.letter-card p { margin: 0 0 1.4em; font-size: 1.12rem; line-height: 1.9; }
.letter-greeting { font-family: var(--font-script); font-size: 2.2rem !important; line-height: 1.3 !important; color: var(--soft); text-shadow: 0 0 10px rgba(255, 143, 171, 0.5); }
.letter-closing { font-style: italic; margin-top: 2em !important; margin-bottom: 0.2em !important; }
.letter-sign {
  margin: 0 !important;
  font-family: var(--font-script);
  font-size: 3rem !important;
  line-height: 1.2 !important;
  color: var(--soft);
  text-shadow: 0 0 8px rgba(255, 143, 171, 0.8), 0 0 22px rgba(255, 143, 171, 0.4);
}
@media (min-width: 700px) { .letter-card { padding: 48px 56px 52px; } }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 60px 20px calc(70px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  max-width: 640px;
  margin: 40px auto 0;
}
.footer-heart { fill: none; stroke: var(--neon); stroke-width: 1.4; filter: drop-shadow(0 0 6px rgba(255, 143, 171, 0.8)); }
.footer-text {
  margin: 14px 0 28px;
  font-family: var(--font-script);
  font-size: 2.2rem;
  line-height: 1.2;
  color: var(--soft);
  text-shadow: 0 0 8px rgba(255, 143, 171, 0.7), 0 0 22px rgba(255, 143, 171, 0.35);
}
.days { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.days-before, .days-after { font-style: italic; opacity: 0.85; letter-spacing: 0.04em; }
.days-number {
  font-family: var(--font-body);
  font-size: 3.4rem;
  font-weight: 500;
  line-height: 1.15;
  color: var(--neon);
  text-shadow: 0 0 10px rgba(255, 143, 171, 0.7), 0 0 28px rgba(255, 143, 171, 0.4);
  font-variant-numeric: tabular-nums;
}

/* "See all" button + the Gallery page */
.see-all-wrap { text-align: center; margin: 26px 0 0; }
.see-all-btn { font: inherit; cursor: pointer; }
.see-all-btn::after { content: " \203A"; }

.gallery-page {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(255, 143, 171, 0.12), transparent 60%),
    var(--bg);
  animation: viewerIn 0.35s ease;
}
.gallery-page-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 8px 16px;
  background: rgba(26, 15, 20, 0.92);
  border-bottom: 1px solid var(--line);
}
.gallery-page-title { font-size: 2.2rem; }
.gallery-page-back {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--soft);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.gallery-page-grid { padding: 16px 16px 40px; max-width: 900px; margin: 0 auto; }

/* Floating "Gallery" button */
.gallery-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid var(--neon);
  border-radius: 999px;
  background: rgba(26, 15, 20, 0.85);
  color: var(--soft);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  box-shadow: 0 0 14px rgba(255, 143, 171, 0.45);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.gallery-fab.show { opacity: 1; transform: none; pointer-events: auto; }
.gallery-fab svg { fill: none; stroke: var(--neon); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Full-screen viewer */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #0E070A;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
  overscroll-behavior: contain;
  animation: viewerIn 0.3s ease;
}
@keyframes viewerIn { from { opacity: 0; } to { opacity: 1; } }
.viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.viewer-img.dragging { transition: none; }
.viewer-btn {
  position: absolute;
  z-index: 2;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(26, 15, 20, 0.7);
  color: var(--soft);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 143, 171, 0.25);
}
.viewer-close { top: 14px; right: 14px; }
.viewer-prev, .viewer-next { top: 50%; margin-top: -23px; display: none; }
.viewer-prev { left: 10px; }
.viewer-next { right: 10px; }
.viewer-count {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: var(--soft);
}
@media (hover: hover) and (min-width: 700px) { .viewer-prev, .viewer-next { display: block; } }
body.no-scroll { overflow: hidden; }

@media (min-width: 700px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }

/* ---------- Our Music ---------- */
.section-line { text-align: center; font-style: italic; margin: -22px 0 30px; opacity: 0.9; }
.music-card { padding: 10px; }
.music-card iframe { display: block; width: 100%; height: 352px; border: 0; border-radius: 12px; }

/* ---------- Reasons (one big statement) ---------- */
.reasons-list { text-align: center; padding: 20px 0 30px; }
.reason-line {
  margin: 0 0 22px;
  font-family: var(--font-script);
  font-size: clamp(2rem, 9.5vw, 2.8rem);
  line-height: 1.3;
  text-wrap: balance;
  color: var(--soft);
  text-shadow: 0 0 8px rgba(255, 143, 171, 0.7), 0 0 24px rgba(255, 143, 171, 0.4);
  transition-delay: 0s;
}
.reason-line:last-child { margin-bottom: 0; transition-delay: 0.9s; }
.temp-note { padding: 40px 16px; text-align: center; }

/* ---------- Bigger screens ---------- */
@media (min-width: 700px) {
  .pin-box { width: 64px; height: 76px; }
  .pin-boxes { gap: 18px; }
}

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .deco-hearts { display: none; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .polaroid.reveal { transform: rotate(var(--tilt)); }
}
