:root {
  --rose:       #d4647a;
  --rose-deep:  #8a2e44;
  --blush:      #f8c8d8;
  --cream:      #fffaf3;
  --paper:      #fff7f1;
  --ink:        #2d1822;
  --ink-soft:   #5a3a48;
  --gold:       #c9a96b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #fff7f1;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------- HERO ---------- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  color: var(--rose-deep);
  background:
    radial-gradient(140% 90% at 50% 40%, #ffffff 0%, #fff4ec 55%, #ffe2d4 100%);
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 62%;
  z-index: 0;
  animation: heroFloat 9s ease-in-out infinite alternate;
  will-change: transform;
  filter: saturate(1.05) contrast(1.02);
}

.hero-photo.missing { display: none; }

/* Fallback when bike.jpg is missing */
body.no-photo .hero {
  background:
    radial-gradient(120% 80% at 50% 30%, #ffe9e0 0%, #ffd4cc 60%, #f8b8ba 100%);
}
body.no-photo .hero::before {
  content: "drop a photo of mom\2019s Tiger Sport at /bike.jpg";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: rgba(138, 46, 68, 0.5);
  z-index: 1;
  pointer-events: none;
}

@keyframes heroFloat {
  from { transform: translateY(0)    scale(1); }
  to   { transform: translateY(-6px) scale(1.012); }
}

/* Soft pink wash to integrate the photo with the page */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(255, 244, 236, 0.85) 0%,
      rgba(255, 244, 236, 0.0) 22%,
      rgba(255, 244, 236, 0.0) 70%,
      rgba(255, 226, 212, 0.95) 100%);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 95% at 50% 50%, transparent 55%, rgba(168, 58, 85, 0.18) 100%);
}

.hero-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.05;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.6  0 0 0 0 0.6  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

.hero-content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  text-align: center;
  padding: clamp(28px, 5vw, 56px) 24px clamp(70px, 10vw, 110px);
  pointer-events: none;
}

.eyebrow {
  margin: 0;
  align-self: end;
  padding-bottom: clamp(8px, 1.4vw, 14px);
  font-size: clamp(11px, 1.5vw, 14px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--rose-deep);
  opacity: 0.75;
  font-weight: 500;
  animation: rise 1.4s 0.1s cubic-bezier(.2,.7,.2,1) both;
}

.title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2px, 0.8vw, 6px);
  font-weight: 400;
  line-height: 0.95;
  align-self: end;
  animation: rise 1.4s 0.25s cubic-bezier(.2,.7,.2,1) both;
}

.title-top {
  font-size: clamp(34px, 5.6vw, 62px);
  letter-spacing: 0.04em;
  font-weight: 300;
  color: var(--rose-deep);
}

.title-script {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: clamp(56px, 10.5vw, 124px);
  line-height: 0.9;
  background: linear-gradient(100deg,
    var(--rose-deep)  0%,
    var(--rose)       30%,
    var(--gold)       50%,
    var(--rose)       70%,
    var(--rose-deep)  100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  filter: drop-shadow(0 2px 14px rgba(255, 230, 220, 0.9));
  animation: shimmer 6s ease-in-out infinite, rise 1.4s 0.4s cubic-bezier(.2,.7,.2,1) both;
}

@keyframes shimmer {
  0%   { background-position: 120% 0; }
  100% { background-position: -20% 0; }
}

.hero-quote {
  margin: 0;
  align-self: start;
  padding-top: clamp(8px, 1.4vw, 16px);
  font-style: italic;
  font-size: clamp(16px, 2vw, 21px);
  letter-spacing: 0.04em;
  color: var(--rose-deep);
  opacity: 0.85;
  font-weight: 400;
  animation: rise 1.4s 0.6s cubic-bezier(.2,.7,.2,1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scroll-cue {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: transparent;
  border: 0;
  color: var(--rose-deep);
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  opacity: 0.7;
  animation: rise 1.4s 1.1s cubic-bezier(.2,.7,.2,1) both;
}

.scroll-cue:hover { opacity: 1; }

.scroll-line {
  display: block;
  width: 1px;
  height: 36px;
  background: linear-gradient(180deg, transparent, var(--rose-deep) 50%, transparent);
  animation: scroll-pulse 2.2s ease-in-out infinite;
}

.scroll-label {
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: lowercase;
  opacity: 0.85;
}

@keyframes scroll-pulse {
  0%, 100% { transform: translateY(-6px); opacity: 0.4; }
  50%      { transform: translateY(6px);  opacity: 1; }
}

/* ---------- LETTER ---------- */
.letter {
  position: relative;
  background:
    radial-gradient(800px 500px at 20% 0%, #ffe8ee 0%, transparent 60%),
    radial-gradient(700px 500px at 100% 100%, #ffe1d3 0%, transparent 55%),
    linear-gradient(180deg, var(--paper) 0%, #fff3eb 100%);
  padding: clamp(70px, 12vw, 140px) 24px clamp(50px, 8vw, 90px);
  overflow: hidden;
}

.letter::before, .letter::after {
  content: "";
  position: absolute;
  left: 50%; transform: translateX(-50%);
  height: 1px;
  width: min(540px, 70%);
  background: linear-gradient(90deg, transparent, rgba(168,58,85,0.3), transparent);
}
.letter::before { top: clamp(34px, 7vw, 70px); }
.letter::after  { bottom: clamp(34px, 7vw, 70px); }

.letter-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.greeting {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  color: var(--rose-deep);
  font-size: clamp(34px, 5vw, 48px);
  margin: 0 0 clamp(20px, 3vw, 32px) 0;
  line-height: 1.1;
}

.message {
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.7;
  color: var(--ink);
  font-weight: 400;
}

.message p {
  margin: 0 0 0.9em 0;
}
.message p:nth-child(odd) { font-style: italic; color: var(--ink-soft); }

.rule {
  margin: clamp(28px, 4vw, 44px) auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rule span {
  display: block;
  width: 110px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rose) 50%, transparent);
  position: relative;
}
.rule span::before, .rule span::after {
  content: "";
  position: absolute; top: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--rose);
  transform: translateY(-50%);
}
.rule span::before { left: -8px; }
.rule span::after  { right: -8px; }

.signoff {
  margin: 0;
  font-size: clamp(16px, 1.9vw, 19px);
  color: var(--rose-deep);
  font-style: italic;
  letter-spacing: 0.01em;
}

.signature {
  margin: 6px 0 0 0;
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: clamp(40px, 6vw, 60px);
  color: var(--rose);
  line-height: 1;
}

/* ---------- FOOT ---------- */
.foot {
  background: linear-gradient(180deg, #fff3eb 0%, #ffe7e0 100%);
  text-align: center;
  padding: 22px 18px 28px;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: lowercase;
  color: var(--rose-deep);
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.foot-mark {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--rose);
  transform: rotate(-45deg);
  position: relative;
  vertical-align: middle;
}
.foot-mark::before, .foot-mark::after {
  content: "";
  position: absolute;
  width: 7px; height: 7px;
  background: var(--rose);
  border-radius: 50%;
}
.foot-mark::before { top: -3.5px; left: 0; }
.foot-mark::after  { top: 0; left: 3.5px; }

/* ---------- AMBIENT PETALS ---------- */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -40px;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 30% 30%, #ffd6e0, var(--blush) 60%, var(--rose) 100%);
  border-radius: 80% 0 80% 0;
  opacity: 0;
  filter: drop-shadow(0 2px 4px rgba(168, 58, 85, 0.18));
  animation: petalFall linear infinite;
}

@keyframes petalFall {
  0%   { transform: translate3d(0, -10vh, 0) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.85; }
  100% { transform: translate3d(var(--drift, 40px), 110vh, 0) rotate(720deg); opacity: 0.55; }
}

/* ---------- REVEAL ON SCROLL ---------- */
.letter-inner > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1);
}
.letter-inner.in > .greeting   { transition-delay: 0.05s; opacity: 1; transform: none; }
.letter-inner.in > .message    { transition-delay: 0.18s; opacity: 1; transform: none; }
.letter-inner.in > .rule       { transition-delay: 0.32s; opacity: 1; transform: none; }
.letter-inner.in > .signoff    { transition-delay: 0.42s; opacity: 1; transform: none; }
.letter-inner.in > .signature  { transition-delay: 0.55s; opacity: 1; transform: none; }

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-photo,
  .title-script,
  .scroll-line,
  .petal,
  .eyebrow, .title, .hero-quote, .scroll-cue,
  .letter-inner > * { animation: none !important; transition: none !important; }
  .title-script { -webkit-text-fill-color: var(--rose); color: var(--rose); }
  .letter-inner > * { opacity: 1; transform: none; }
}

/* ---------- SMALL SCREENS ---------- */
@media (max-width: 480px) {
  .hero { min-height: 560px; }
  .hero-photo { object-position: center 60%; }
  .hero-content { padding: 22px 18px 80px; }
  .scroll-cue { bottom: 16px; }
  .scroll-line { height: 28px; }
}
