:root {
  --ink: #24191d;
  --muted: #75676d;
  --paper: #fbf7f3;
  --paper-2: #f4ebe6;
  --wine: #7e243e;
  --wine-dark: #4d1426;
  --rose: #c46a80;
  --line: rgba(52, 31, 38, .12);
  --shadow: 0 24px 70px rgba(62, 31, 41, .16);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img { display: block; width: 100%; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.progress {
  position: fixed; z-index: 100; left: 0; right: 0; top: 0; height: 3px;
  background: rgba(255,255,255,.12);
}
.progress span { display: block; width: 0; height: 100%; background: #fff; }

.lock-screen {
  position: fixed; inset: 0; z-index: 90; min-height: 100svh;
  display: grid; place-items: end center; overflow: hidden; color: white;
}
.lock-photo {
  position: absolute; inset: -4%;
  background: url("assets/photos/14.jpg") center 42% / cover no-repeat;
  filter: blur(2px); transform: scale(1.05);
}
.lock-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,9,12,.22) 0%, rgba(15,9,12,.35) 34%, rgba(15,9,12,.92) 100%);
}
.lock-content {
  position: relative; width: min(100%, 480px); padding: 42px 24px calc(34px + env(safe-area-inset-bottom));
  text-align: center;
}
.monogram { margin: 0 0 18px; letter-spacing: .24em; text-transform: uppercase; font-weight: 600; }
.monogram span { color: #f1a5b8; margin-inline: 3px; }
.lock-content h1 {
  margin: 0 auto 10px; max-width: 340px; font: 600 clamp(2.6rem, 11vw, 4.2rem)/.93 var(--serif);
  letter-spacing: -.035em;
}
.lock-subtitle { margin: 0 0 24px; color: rgba(255,255,255,.72); }
.password-form {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  padding: 6px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px; backdrop-filter: blur(18px);
}
.password-form input {
  min-width: 0; border: 0; outline: 0; color: white; background: transparent; padding: 0 14px;
}
.password-form input::placeholder { color: rgba(255,255,255,.6); }
.password-form button {
  border: 0; border-radius: 999px; padding: 12px 18px; background: white; color: #351923; font-weight: 700;
}
.error { min-height: 20px; margin: 10px 0 0; color: #ffd6df; font-size: .88rem; }
.lock-screen.unlocking { animation: unlock .8s ease forwards; }
@keyframes unlock { to { opacity: 0; transform: scale(1.015); visibility: hidden; } }

.music-button {
  position: fixed; z-index: 80; right: 16px; top: calc(16px + env(safe-area-inset-top));
  width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%;
  color: white; background: rgba(28,18,22,.44); backdrop-filter: blur(14px); box-shadow: 0 10px 35px rgba(0,0,0,.14);
}
.music-button.playing { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

.hero {
  position: relative; min-height: 100svh; display: flex; align-items: flex-end; color: white; overflow: hidden;
}
.hero-photo {
  position: absolute; inset: 0;
  background: url("assets/photos/10.jpg") 50% 34% / cover no-repeat;
  transform: scale(1.03);
}
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18,9,13,.07) 0%, rgba(18,9,13,.2) 38%, rgba(18,9,13,.88) 100%);
}
.hero-content {
  position: relative; width: min(100%, 680px); margin: 0 auto; padding: 72px 24px calc(38px + env(safe-area-inset-bottom));
}
.hero h1 {
  margin: 8px 0 18px; max-width: 580px; font: 600 clamp(3.5rem, 14vw, 6.6rem)/.86 var(--serif);
  letter-spacing: -.055em;
}
.hero-content > p:not(.kicker) { max-width: 470px; margin: 0; color: rgba(255,255,255,.78); line-height: 1.65; }
.kicker { margin: 0; color: var(--wine); font-size: .77rem; font-weight: 700; text-transform: uppercase; letter-spacing: .19em; }
.kicker.light { color: #ffd5df; }
.scroll-cue {
  display: inline-flex; gap: 12px; align-items: center; margin-top: 30px; padding: 0; border: 0; color: white; background: none; text-align: left;
}
.scroll-cue span { font-size: .83rem; letter-spacing: .05em; opacity: .78; }
.scroll-cue b { font-size: 1.35rem; animation: bob 1.5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(7px); } }

.intro-note {
  padding: 110px 24px; text-align: center; background: var(--paper);
}
.intro-note p { margin: 0 0 8px; color: var(--muted); }
.intro-note h2 {
  max-width: 600px; margin: 0 auto; font: 600 clamp(2.5rem, 10vw, 4.4rem)/.98 var(--serif); letter-spacing: -.035em;
}

.story { overflow: clip; }
.chapter {
  padding: 82px 20px; border-top: 1px solid var(--line); background: var(--paper);
}
.chapter:nth-child(even):not(.quote-chapter) { background: #fffdfb; }
.chapter-inner { width: min(100%, 720px); margin: 0 auto; }
.chapter-copy { margin-bottom: 30px; }
.chapter-copy h2 {
  margin: 8px 0 14px; font: 600 clamp(2.5rem, 10vw, 4.4rem)/.94 var(--serif); letter-spacing: -.04em;
}
.chapter-copy p { margin: 0; color: var(--muted); line-height: 1.72; font-size: .98rem; }
.photo-frame {
  position: relative; overflow: hidden; border-radius: 26px; background: #eae1dc; box-shadow: var(--shadow);
}
.photo-frame img { aspect-ratio: 4 / 5; object-fit: cover; }
.photo-frame.landscape img { aspect-ratio: 4 / 3; }
.photo-caption {
  padding: 12px 4px 0; color: var(--muted); font-size: .78rem; text-align: center;
}
.single-photo { margin-top: 30px; }
.gallery {
  display: grid; gap: 18px;
}
.gallery .photo-block:nth-child(even) { margin-left: 28px; }
.gallery .photo-block:nth-child(odd) { margin-right: 28px; }
.gallery .photo-block:nth-child(3n) { margin-left: 12px; margin-right: 0; }

.quote-chapter {
  min-height: 72svh; display: grid; place-items: center; text-align: center;
  background: var(--wine-dark); color: white; border: 0;
}
.quote-chapter blockquote {
  width: min(100%, 660px); margin: 0 auto; font: 600 clamp(2.8rem, 11vw, 5rem)/.97 var(--serif); letter-spacing: -.04em;
}
.quote-chapter .quote-mark { display: block; margin-bottom: 20px; color: #f3aabc; font-size: 2rem; }

.surprise-grid { display: grid; gap: 24px; }
.surprise-card {
  padding: 10px 10px 18px; border-radius: 28px; background: white; box-shadow: var(--shadow); transform: rotate(-1.4deg);
}
.surprise-card:nth-child(2) { transform: rotate(1.4deg); }
.surprise-card img { aspect-ratio: 4/5; object-fit: cover; border-radius: 20px; }
.surprise-card p { margin: 13px 8px 0; text-align: center; font: 600 1.35rem/1.1 var(--serif); }

.before-proposal {
  min-height: 86svh; display: grid; place-items: center; padding: 100px 24px;
  background: linear-gradient(180deg, var(--paper) 0%, #2e1520 100%); color: white; text-align: center;
}
.before-inner { width: min(100%, 660px); }
.tiny-heart { display: block; margin-bottom: 28px; color: #f1a1b5; font-size: 1.6rem; }
.before-inner p { margin: 0 0 12px; color: rgba(255,255,255,.66); }
.before-inner h2 { margin: 0; font: 600 clamp(2.8rem, 11vw, 5rem)/.96 var(--serif); letter-spacing: -.04em; }

.proposal {
  position: relative; min-height: 100svh; display: grid; place-items: center; padding: 70px 22px;
  background: #170d12; color: white; overflow: hidden;
}
.proposal-glow {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(165,70,96,.35), rgba(165,70,96,0) 66%); filter: blur(4px);
}
.proposal-card { position: relative; width: min(100%, 560px); text-align: center; }
.ring { margin-bottom: 18px; font-size: 3rem; filter: drop-shadow(0 8px 20px rgba(255,220,150,.18)); }
.proposal h2 {
  margin: 10px 0 16px; font: 600 clamp(3.7rem, 15vw, 7rem)/.83 var(--serif); letter-spacing: -.055em;
}
.proposal-card > p:not(.kicker) { margin: 0 auto 28px; max-width: 410px; color: rgba(255,255,255,.7); line-height: 1.65; }
.yes-button {
  width: 100%; min-height: 58px; border: 0; border-radius: 999px; padding: 16px 22px;
  background: linear-gradient(135deg, #fff 0%, #f7e8ec 100%); color: #4f1729; font-weight: 800;
  box-shadow: 0 18px 60px rgba(184,89,116,.24); transition: transform .2s ease, box-shadow .2s ease;
}
.yes-button:active { transform: scale(.985); }
.proposal small { display: block; margin-top: 16px; color: rgba(255,255,255,.34); line-height: 1.5; }

.accepted {
  position: fixed; inset: 0; z-index: 120; min-height: 100svh; display: grid; place-items: center; padding: 28px;
  background: #160c11; color: white; text-align: center;
}
#confettiCanvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.accepted-content { position: relative; width: min(100%, 600px); }
.accepted-heart { color: #f2a0b4; font-size: 3rem; animation: heartBeat 1.25s ease-in-out infinite; }
@keyframes heartBeat { 50% { transform: scale(1.18); } }
.accepted h2 { margin: 16px 0; font: 600 clamp(3.2rem, 13vw, 6rem)/.9 var(--serif); letter-spacing: -.05em; }
.accepted-content > p:last-child { color: rgba(255,255,255,.72); font-size: 1.05rem; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.photo-reveal { opacity: 0; transform: translateY(32px) scale(.985); transition: opacity .9s ease, transform .95s cubic-bezier(.2,.8,.2,1); }
.photo-reveal.visible { opacity: 1; transform: translateY(0) scale(1); }

@media (min-width: 720px) {
  .chapter { padding: 120px 28px; }
  .chapter-copy { margin-bottom: 44px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 28px; align-items: start; }
  .gallery .photo-block:nth-child(n) { margin: 0; }
  .gallery .photo-block:nth-child(2) { margin-top: 70px; }
  .gallery .photo-block:nth-child(3) { grid-column: 1 / -1; width: 62%; margin: -8px auto 0; }
  .surprise-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal, .photo-reveal { opacity: 1; transform: none; }
}
