/*
  Elegant, warm birthday page styles
  Palette: soft peach, blush, cream, subtle gold accents
*/

:root {
  --bg-1: #fff7f2; /* cream */
  --bg-2: #fde8e1; /* blush */
  --bg-3: #f7d7c8; /* peach */
  --text: #3b2f2f; /* warm brown */
  --muted: #7a6a6a;
  --accent: #e7b08b; /* warm caramel */
  --gold-1: #f0d28a;
  --gold-2: #d9aa52;
  --heading: #8b5e3c; /* rich warm heading color */
  --card: rgba(255, 255, 255, 0.62);
  --card-border: rgba(255, 255, 255, 0.9);
  --shadow: 0 10px 30px rgba(59, 47, 47, 0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  /* Prefer Chinese sans-serif (黑体) across platforms */
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Noto Sans CJK SC", "Source Han Sans SC", "Heiti SC", SimHei,
               -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  /* Solid background color (no gradients) */
  background: var(--bg-1);
  overflow-x: hidden;
}

.background { position: fixed; inset: 0; pointer-events: none; }

/* Grain / paper texture overlay */
/* removed heavy noise overlay for performance */

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 6rem 1.25rem 4rem;
}

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

/* Global rounded corners for all photos */
img { border-radius: 18px; }

.hero-figure {
  margin: 0 auto 1rem auto;
  width: min(74vw, calc(60vh * 1.618), 720px);
  aspect-ratio: 1618 / 1000; /* golden ratio */
  position: relative;
}
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: opacity 180ms ease;
}
.hero-photo.is-fading { opacity: 0.2; }

/* Screen-reader only text */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.script {
  /* Artistic script font stack (no network). Falls back gracefully. */
  font-family: "Snell Roundhand", "Apple Chancery", "Brush Script MT",
               "Segoe Script", Zapfino, "Bradley Hand", cursive;
  font-size: clamp(2.6rem, 5.5vw, 5rem);
  font-weight: 400;
  font-style: normal;
  font-variant-ligatures: common-ligatures contextual;
  line-height: 1.1;
  margin: 0 0 0.5rem 0;
  letter-spacing: 0;
  color: var(--heading);
}

.dear {
  margin: 0.25rem 0 0.25rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.dear .name {
  color: #8b5e3c;
  font-weight: 600;
}

.sub {
  margin: 0.5rem auto 1.4rem;
  font-size: 1.05rem;
  color: #5a4a4a;
  max-width: 36ch;
}

.cta {
  appearance: none;
  border: 0;
  padding: 0.85rem 1.35rem;
  font: 600 1rem inherit;
  color: #3b2f2f;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff5e7, #ffe6c8);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.8) inset,
    0 10px 20px rgba(195, 132, 93, 0.15);
  position: relative;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.cta::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0));
  mix-blend-mode: screen; opacity: 0.6;
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(195, 132, 93, 0.22); }
.cta:active { transform: translateY(0); }

.message { margin-top: 2.5rem; }
.cards {
  display: grid;
  gap: 1.25rem; /* primary spacing between greetings */
  grid-gap: 1.25rem; /* fallback for older Safari */
}
/* extra fallback in case gap is unsupported */
.cards > .card + .card { margin-top: 1.25rem; }

.title {
  font-family: inherit;
  font-weight: 600;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  margin: 0 0 0.8rem 0;
  color: #5a4030;
}

.card {
  padding: clamp(1rem, 3vw, 1.5rem) clamp(1rem, 3vw, 1.6rem);
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  /* removed backdrop blur for performance */
}
.card p { margin: 0 0 1rem; }
.card p:last-child { margin-bottom: 0; }
.signature { color: #6b4b3a; font-style: italic; }

.foot {
  text-align: center;
  margin-top: 2.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Floating petals */
#petals { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute;
  top: -10vh;
  width: 14px; height: 16px;
  background: radial-gradient(60% 60% at 50% 50%, #ffd9d1 0%, #ffc2b6 45%, #f7a89a 100%);
  border-radius: 60% 60% 60% 60% / 70% 70% 45% 45%;
  box-shadow: 0 2px 4px rgba(150, 80, 60, 0.15);
  opacity: 0.85;
  transform: rotate(15deg);
  will-change: transform;
  animation: fall linear infinite;
}

@keyframes fall {
  to { transform: translateY(110vh) rotate(360deg); }
}
/* removed sway (layout-thrashing) for performance */

/* Confetti pieces */
.confetti {
  position: fixed;
  top: -10px;
  width: 8px; height: 14px;
  border-radius: 2px;
  animation: confetti-fall 1200ms cubic-bezier(.25,.7,.3,1) forwards;
  will-change: transform, opacity;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0); opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Motion accessibility */
@media (prefers-reduced-motion: reduce) {
  .petal, .confetti { animation: none !important; }
  .cta { transition: none; }
}

/* Small screens */
@media (max-width: 480px) {
  .container { padding-top: 4.5rem; }
  .sub { font-size: 1rem; }
}
