/* =========================================================
   Theme
   ========================================================= */
:root {
  --cream: #FAF3E7;
  --blush: #F5D5D0;
  --rose: #C9908A;
  --deep-rose: #8B4A47;
  --gold: #D4A574;
  --ink: #2A1F1D;
  --ink-soft: #5a4842;
  --paper: #FDF8EC;

  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --t-fast: 280ms;
  --t-med: 600ms;
  --t-slow: 1100ms;

  --serif: "Playfair Display", "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --hand: "Caveat", "Bradley Hand", cursive;

  --maxw: 1100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100svh;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }

h1, h2 { font-family: var(--serif); font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.15; }

.kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 0.6rem;
  font-weight: 500;
}

/* =========================================================
   Section base + reveal-on-scroll
   ========================================================= */
.section {
  /* Full-viewport width — content blocks inside have their own max-width
     so text doesn't span absurdly wide on big monitors. */
  padding: clamp(4rem, 10vw, 8rem) clamp(1.25rem, 6vw, 6rem);
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* No `align-items` here — each section sets its own. The timeline relies
     on the default `stretch` so its scroll track can span edge-to-edge. */
}

/* Center bounded content blocks horizontally within now full-width sections. */
.hero-inner,
.letter-paper,
.video-wrap,
.reasons-stage,
.section-head {
  margin-left: auto;
  margin-right: auto;
}

.section-head {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   Mute toggle
   ========================================================= */
.mute-toggle {
  position: fixed;
  top: clamp(0.9rem, 2vw, 1.4rem);
  right: clamp(0.9rem, 2vw, 1.4rem);
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(250, 243, 231, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--deep-rose);
  display: grid;
  place-items: center;
  z-index: 100;
  box-shadow: 0 4px 18px rgba(139, 74, 71, 0.12);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.mute-toggle:hover { transform: scale(1.06); }
.mute-toggle[data-muted="true"] .mute-icon svg path:nth-child(2),
.mute-toggle[data-muted="true"] .mute-icon svg path:nth-child(3) {
  opacity: 0.25;
}
.mute-toggle[data-muted="true"]::after {
  content: "";
  position: absolute;
  width: 24px; height: 1.6px;
  background: var(--deep-rose);
  transform: rotate(-35deg);
  border-radius: 2px;
}

/* =========================================================
   Gate / countdown
   ========================================================= */
.gate {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(245, 213, 208, 0.5), transparent 65%),
    var(--cream);
  display: grid;
  place-items: center;
  z-index: 50;
  text-align: center;
  padding: 2rem 1.25rem;
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.gate.is-leaving {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}
.gate.is-gone { display: none; }

.gate-inner {
  max-width: 720px;
  width: 100%;
}

.gate-eyebrow {
  font-family: var(--sans);
  font-weight: 300;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--rose);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.gate-name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(3.4rem, 11vw, 6.6rem);
  color: var(--deep-rose);
  line-height: 1;
  margin-bottom: clamp(2rem, 6vw, 3.4rem);
}

.countdown {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(0.4rem, 2vw, 1.2rem);
  flex-wrap: nowrap;
  font-variant-numeric: tabular-nums;
}
.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(56px, 14vw, 92px);
}
.cd-num {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 6vw, 3.4rem);
  color: var(--ink);
  line-height: 1;
}
.cd-label {
  font-family: var(--sans);
  font-size: clamp(0.62rem, 1.6vw, 0.75rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rose);
  margin-top: 0.5rem;
}
.cd-sep {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  color: var(--rose);
  opacity: 0.6;
  line-height: 1;
  padding-top: 0.15em;
}

.gate-hint {
  margin-top: clamp(2rem, 5vw, 3rem);
  font-size: 0.85rem;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}
.gate-hint.is-ready {
  opacity: 1;
  animation: gateHintPulse 2.4s var(--ease) infinite;
}
@keyframes gateHintPulse {
  0%, 100% { opacity: 0.55; transform: translateY(0); }
  50%      { opacity: 1;    transform: translateY(-3px); }
}

.skip-link {
  position: absolute;
  right: 1rem; bottom: 1rem;
  font-size: 0.72rem;
  color: var(--ink-soft);
  opacity: 0.45;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.6rem;
  transition: opacity var(--t-fast) var(--ease);
}
.skip-link:hover { opacity: 1; }

/* =========================================================
   Petals layer
   ========================================================= */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}
.petal {
  position: absolute;
  bottom: -20px;
  width: 14px; height: 14px;
  border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
  background: linear-gradient(135deg, var(--blush), var(--rose));
  opacity: 0.55;
  filter: blur(0.3px);
  animation: petalRise linear infinite;
}
@keyframes petalRise {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.7; }
  100% { transform: translate3d(var(--drift, 30px), -110vh, 0) rotate(360deg); opacity: 0; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  text-align: center;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(circle at 20% 30%, rgba(245, 213, 208, 0.6), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(212, 165, 116, 0.25), transparent 55%),
    linear-gradient(180deg, var(--cream), #fbe5dd);
  z-index: -1;
  animation: heroBgDrift 18s ease-in-out infinite alternate;
}
@keyframes heroBgDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-2%, -1%) scale(1.05); }
}
.hero-inner { max-width: 900px; }
.hero-eyebrow {
  font-family: var(--sans);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--rose);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.hero-name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(3.6rem, 13vw, 8rem);
  color: var(--deep-rose);
  line-height: 1;
  margin-bottom: 1.6rem;
}
.hero-sub {
  font-family: var(--hand);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--ink-soft);
}
.hero-scroll-hint {
  position: absolute;
  bottom: 2rem; left: 50%; transform: translateX(-50%);
  width: 1px; height: 56px;
  background: linear-gradient(to bottom, transparent, var(--rose));
  opacity: 0.5;
}
.hero-scroll-hint span {
  position: absolute;
  top: 0; left: -3px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rose);
  animation: scrollDot 2.2s var(--ease) infinite;
}
@keyframes scrollDot {
  0%   { transform: translateY(0);   opacity: 1; }
  100% { transform: translateY(48px); opacity: 0; }
}

/* =========================================================
   Photo timeline
   ========================================================= */
.timeline { overflow: hidden; }
.timeline-track {
  display: flex;
  gap: clamp(1.5rem, 4vw, 2.6rem);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2rem 1rem 3rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: var(--rose) transparent;
}
.timeline-track::-webkit-scrollbar { height: 6px; }
.timeline-track::-webkit-scrollbar-track { background: transparent; }
.timeline-track::-webkit-scrollbar-thumb { background: var(--rose); border-radius: 999px; opacity: 0.6; }
.timeline-track.is-dragging { cursor: grabbing; }

.polaroid {
  flex: 0 0 auto;
  width: clamp(220px, 28vw, 280px);
  background: var(--paper);
  padding: 14px 14px 22px;
  box-shadow:
    0 1px 1px rgba(42, 31, 29, 0.05),
    0 12px 28px -10px rgba(139, 74, 71, 0.25);
  scroll-snap-align: center;
  transform: rotate(var(--rot, -1.6deg));
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.polaroid:hover {
  transform: rotate(0deg) translateY(-6px);
  box-shadow:
    0 1px 1px rgba(42, 31, 29, 0.06),
    0 22px 36px -14px rgba(139, 74, 71, 0.32);
}
.polaroid-img-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--blush);
}
.polaroid-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.polaroid-date {
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose);
}
.polaroid-caption {
  margin-top: 0.4rem;
  font-family: var(--hand);
  font-size: 1.15rem;
  color: var(--ink);
  line-height: 1.3;
}

.timeline-hint {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--rose);
  opacity: 0.65;
}

/* Mobile timeline → vertical stack with snap */
@media (max-width: 720px) {
  .timeline-track {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    max-height: 78vh;
    padding: 1rem 0.5rem 2rem;
    gap: 2rem;
    align-items: center;
  }
  .polaroid {
    width: min(82vw, 320px);
    scroll-snap-align: center;
  }
  .timeline-hint { display: none; }
}

/* =========================================================
   Video + letter
   ========================================================= */
.letter-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.video-wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}
.video-frame {
  position: relative;
  background: #1a1212;
  padding: 28px 16px;
  border-radius: 4px;
  box-shadow: 0 24px 60px -20px rgba(42, 31, 29, 0.45);
}
.video-frame video {
  width: 100%;
  display: block;
  background: #000;
}
.film-grain {
  position: absolute;
  inset: 28px 16px;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.55'/></svg>");
}

.letter-paper {
  position: relative;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(201, 144, 138, 0.18) 32px
    ),
    var(--paper);
  max-width: 640px;
  width: 100%;
  padding: clamp(2rem, 5vw, 3.4rem) clamp(1.8rem, 5vw, 3rem);
  box-shadow:
    0 1px 1px rgba(0,0,0,0.04),
    0 30px 50px -30px rgba(139, 74, 71, 0.3);
  transform: rotate(-0.3deg);
}
.letter-corner {
  position: absolute;
  width: 28px; height: 28px;
  background: rgba(212, 165, 116, 0.35);
  border-radius: 2px;
  filter: blur(0.4px);
}
.letter-corner-tl { top: -8px;  left: 18%;  transform: rotate(-12deg); }
.letter-corner-tr { top: -8px;  right: 18%; transform: rotate(8deg); }
.letter-corner-bl { bottom: -8px; left: 22%;  transform: rotate(7deg); }
.letter-corner-br { bottom: -8px; right: 22%; transform: rotate(-9deg); }

.letter-title {
  font-family: var(--hand);
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--deep-rose);
  font-weight: 600;
  margin-bottom: 1.4rem;
  line-height: 1;
}
.letter-body {
  font-family: var(--hand);
  font-size: clamp(1.25rem, 2.6vw, 1.55rem);
  line-height: 32px;
  color: var(--ink);
  white-space: pre-wrap;
  min-height: 12em;
}
.letter-body::after {
  content: "▍";
  color: var(--rose);
  animation: caret 1s steps(1) infinite;
  margin-left: 1px;
}
.letter-body.is-done::after { content: ""; }
@keyframes caret { 50% { opacity: 0; } }

.letter-sign {
  margin-top: 1.4rem;
  font-family: var(--hand);
  font-size: 1.5rem;
  text-align: right;
  color: var(--deep-rose);
}

/* =========================================================
   Reasons
   ========================================================= */
.reasons { text-align: center; align-items: center; }
.reasons-stage {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}
.reason-card {
  width: 100%;
  background: var(--paper);
  border: 1px solid rgba(201, 144, 138, 0.25);
  border-radius: 18px;
  padding: clamp(2rem, 5vw, 2.8rem) clamp(1.4rem, 4vw, 2.2rem);
  min-height: 160px;
  display: grid;
  place-items: center;
  box-shadow: 0 18px 40px -22px rgba(139, 74, 71, 0.3);
  transition: transform var(--t-med) var(--ease);
}
.reason-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.reason-text.is-out { opacity: 0; transform: translateY(8px); }

.reason-btn {
  padding: 0.95rem 2.1rem;
  background: var(--deep-rose);
  color: var(--cream);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  box-shadow: 0 10px 24px -10px rgba(139, 74, 71, 0.6);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.reason-btn:hover {
  transform: translateY(-2px);
  background: #76393a;
  box-shadow: 0 14px 28px -10px rgba(139, 74, 71, 0.7);
}
.reason-btn:active { transform: translateY(0); }

.reasons-meter {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose);
  opacity: 0.7;
  min-height: 1em;
}

/* =========================================================
   Closing
   ========================================================= */
.closing {
  text-align: center;
  align-items: center;
  background: linear-gradient(180deg, transparent, rgba(245, 213, 208, 0.4));
}
.closing-kicker {
  font-family: var(--sans);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--rose);
  margin-bottom: 1.2rem;
}
.closing-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--deep-rose);
  max-width: 720px;
  line-height: 1.35;
}
.closing-footer {
  margin-top: clamp(3rem, 8vw, 5rem);
  font-family: var(--hand);
  font-size: 1.4rem;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.closing-footer .heart {
  color: var(--deep-rose);
  animation: heartBeat 2.4s var(--ease) infinite;
  display: inline-block;
}
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .petals { display: none; }
  [data-reveal] { opacity: 1; transform: none; }
}
