/* ---------- Design tokens ---------- */
:root {
  --cream: #faf6ef;
  --cream-2: #f2eadd;
  --surface: #ffffff;
  --ink: #2a2420;
  --ink-soft: #5b5148;
  --terracotta: #c1613f;
  --terracotta-dark: #a3502f;
  --line: #e6dbc9;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 12px 32px rgba(120, 90, 50, 0.12);
  --serif: "Cormorant Garamond", "Georgia", serif;
  --sans: "Mulish", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

section, .footer {
  scroll-margin-top: 72px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 2.75rem);
  text-align: center;
  margin: 0 0 2.5rem;
  color: var(--ink);
}
.section-title::after {
  content: "";
  display: block;
  width: 0;
  height: 2px;
  background: var(--terracotta);
  margin: 0.9rem auto 0;
  transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}
.reveal.is-visible .section-title::after,
.section-title.reveal.is-visible::after {
  width: 56px;
}

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

a { color: inherit; text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background 0.25s ease;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible {
  outline: 2px solid var(--terracotta-dark);
  outline-offset: 3px;
}

.btn--primary {
  background: var(--terracotta);
  color: #fff;
  box-shadow: 0 10px 24px rgba(193, 97, 63, 0.35);
}
.btn--primary:hover { background: var(--terracotta-dark); }

/* Gentle heartbeat glow on the hero's main call to action */
.hero__actions .btn--primary {
  animation: ctaPulse 3.2s ease-in-out infinite;
}
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 10px 24px rgba(193, 97, 63, 0.35); }
  50% { box-shadow: 0 10px 24px rgba(193, 97, 63, 0.35), 0 0 0 7px rgba(193, 97, 63, 0.14); }
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.btn--ghost:hover { background: rgba(42, 36, 32, 0.06); }

/* ---------- Top nav ---------- */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 64px;
  background: rgba(250, 246, 239, 0.7);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.topnav.is-scrolled { border-color: var(--line); }

.topnav__brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
}

.topnav__links {
  display: flex;
  gap: 1.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.topnav__links a { opacity: 0.75; transition: opacity 0.2s ease; }
.topnav__links a:hover { opacity: 1; }

@media (max-width: 640px) {
  .topnav__links { display: none; }
}

/* ---------- Floating donate CTA ---------- */
.floating-cta {
  position: fixed;
  right: 1.5rem;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  transform: translateY(16px);
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background: var(--terracotta);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(193, 97, 63, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease;
}
.floating-cta svg { width: 18px; height: 18px; flex-shrink: 0; }
.floating-cta:hover { background: var(--terracotta-dark); }
.floating-cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.floating-cta.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  animation: floatingCtaGreet 1.6s ease-in-out 0.4s 2;
}
@keyframes floatingCtaGreet {
  0%, 100% { box-shadow: 0 12px 28px rgba(193, 97, 63, 0.32); }
  50% { box-shadow: 0 12px 28px rgba(193, 97, 63, 0.32), 0 0 0 8px rgba(193, 97, 63, 0.16); }
}

@media (max-width: 480px) {
  .floating-cta {
    padding: 0.75rem 1.1rem;
    right: 1rem;
    font-size: 0.82rem;
    gap: 0.4rem;
  }
  .floating-cta svg { width: 16px; height: 16px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6rem 1.5rem 3rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(193, 97, 63, 0.16), transparent 60%),
    linear-gradient(180deg, #fdf9f2 0%, var(--cream) 55%, var(--cream-2) 100%);
  text-align: center;
}

.hero__scene {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(70vw, 480px);
  color: var(--terracotta);
  opacity: 0.14;
  pointer-events: none;
  animation: houseFloat 7s ease-in-out infinite;
}
@keyframes houseFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-12px); }
}

.hero__hearts {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero__hearts .heart {
  position: absolute;
  bottom: -10%;
  color: var(--terracotta);
  opacity: 0;
  animation: heartRise linear infinite;
}
.heart.h1 { left: 10%;  font-size: 2.75rem; animation-duration: 13s; animation-delay: 0s; }
.heart.h2 { left: 26%;  font-size: 1.9rem; animation-duration: 10s; animation-delay: 3.5s; }
.heart.h3 { left: 70%;  font-size: 3.25rem; animation-duration: 15s; animation-delay: 1.5s; }
.heart.h4 { left: 85%;  font-size: 2.25rem;  animation-duration: 11.5s; animation-delay: 6s; }
@keyframes heartRise {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  12% { opacity: 0.4; }
  85% { opacity: 0.4; }
  100% { transform: translateY(-65vh) rotate(10deg); opacity: 0; }
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.hero__content > * {
  opacity: 0;
  animation: heroIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero__title { animation-delay: 0.2s; }
.hero__subtitle { animation-delay: 0.4s; }
.hero__date { animation-delay: 0.55s; }
.hero__actions { animation-delay: 0.7s; }
@keyframes heroIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1.05;
  margin: 1.5rem 0 0;
}
.hero__amp {
  color: var(--terracotta);
  font-style: italic;
  padding: 0 0.15rem;
}

.hero__subtitle {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--ink-soft);
  margin: 0.4rem 0 0;
}

.hero__date {
  font-family: var(--serif);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  color: var(--terracotta-dark);
  margin: 0.2rem 0 0.6rem;
  padding-bottom: 0.15rem; /* italic descender clearance */
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
  margin-top: 0.8rem;
}

/* ---------- Countdown ---------- */
.countdown {
  padding: 3rem 1.5rem;
  text-align: center;
}
.countdown__label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}
.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 110px));
  gap: 1rem;
  justify-content: center;
}
.countdown__item {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1.1rem 0.5rem;
  box-shadow: var(--shadow);
}
.countdown__num {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--terracotta-dark);
  font-variant-numeric: tabular-nums;
}
.countdown__num.tick {
  animation: numTick 0.4s ease;
}
@keyframes numTick {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.countdown__item {
  opacity: 0;
  transform: translateY(24px);
}
.countdown.reveal.is-visible .countdown__item {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.countdown__item:nth-child(1) { transition-delay: 0s; }
.countdown__item:nth-child(2) { transition-delay: 0.08s; }
.countdown__item:nth-child(3) { transition-delay: 0.16s; }
.countdown__item:nth-child(4) { transition-delay: 0.24s; }
.countdown__unit {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

@media (max-width: 480px) {
  .countdown__grid { grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
  .countdown__item { padding: 0.8rem 0.3rem; }
}

/* ---------- Weather ---------- */
.weather {
  padding: 0 1.5rem 3rem;
  text-align: center;
}
.weather__card {
  max-width: 420px;
  margin: 0 auto;
  padding: 1.75rem 2rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.weather__label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.1rem;
}
.weather__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.weather__icon {
  width: 40px;
  height: 40px;
  color: var(--terracotta);
  margin-bottom: 0.2rem;
}
.weather__temp {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--ink);
  margin: 0;
}
.weather__desc {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0;
}
.weather__loading,
.weather__fallback-text {
  font-size: 0.92rem;
  color: var(--ink-soft);
  max-width: 32ch;
  margin: 0;
}

/* ---------- Story ---------- */
.story {
  padding: 3.5rem 1.5rem;
  background: var(--surface);
}
.story__inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.story__text {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0 auto 1.2rem;
}
.story__anniversary {
  margin: 2rem auto 0;
  padding: 1.75rem 2.25rem;
  max-width: fit-content;
  background: var(--cream-2);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.story__anniversary-text {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--terracotta-dark);
  margin: 0;
  padding-bottom: 0.15rem;
}
.story__memory-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  font-weight: 600;
  color: var(--ink);
  transition: background 0.2s ease;
}
.story__memory-link:hover {
  background: rgba(42, 36, 32, 0.06);
}
.story__memory-arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.story__memory-link:hover .story__memory-arrow {
  transform: translateX(4px);
}

@media (max-width: 480px) {
  .story__anniversary { padding: 1.5rem 1.25rem; }
}

/* ---------- Gallery ---------- */
.gallery {
  padding: 3.5rem 1.5rem;
}
.gallery__grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.photo {
  margin: 0;
}
.photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.photo figcaption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
}
.photo:hover img {
  transform: translateY(-4px) scale(1.02);
}
.gallery__grid .photo {
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s ease;
}
.gallery__grid .photo:nth-child(1) { transition-delay: 0s; }
.gallery__grid .photo:nth-child(2) { transition-delay: 0.08s; }
.gallery__grid .photo:nth-child(3) { transition-delay: 0.16s; }
.gallery__grid .photo:nth-child(4) { transition-delay: 0.24s; }

@media (max-width: 860px) {
  .gallery__grid { grid-template-columns: repeat(2, 1fr); max-width: 560px; }
}
@media (max-width: 480px) {
  .gallery__grid { grid-template-columns: 1fr; max-width: 320px; }
}

/* ---------- Fund ---------- */
.fund {
  padding: 3.5rem 1.5rem;
  background: var(--surface);
}
.fund__inner {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}
.fund__text {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 55ch;
  margin: 0 auto 2.2rem;
}
.fund__wishlist-label {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}
.fund__wishlist {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  max-width: 640px;
  margin: 0 auto 2.5rem;
  padding: 0;
}
.fund__wishlist li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem 0.5rem 0.7rem;
  border-radius: 999px;
  background: var(--cream-2);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.fund__wishlist svg {
  width: 18px;
  height: 18px;
  color: var(--terracotta);
  flex-shrink: 0;
}
.fund__card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.75rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  scroll-margin-top: 88px;
}
.fund__icon {
  width: 42px;
  height: 42px;
  color: var(--terracotta);
}
.fund__card-title {
  font-weight: 600;
  margin: 0;
}
.fund__note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0;
}
.fund__thanks {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--terracotta-dark);
  margin-top: 2rem;
  padding-bottom: 0.15rem;
}

/* ---------- Visit ---------- */
.visit {
  padding: 3.5rem 1.5rem 4rem;
  background: var(--surface);
}
.visit__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.visit__address {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--terracotta-dark);
  margin: 0 0 2rem;
  padding-bottom: 0.15rem;
}
.visit__map {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 1.75rem;
  line-height: 0;
}
.visit__map iframe {
  display: block;
  width: 100%;
  height: 420px;
}
.visit__transit {
  margin-top: 2.5rem;
  padding: 1.75rem 2rem;
  background: var(--cream-2);
  border-radius: var(--radius-lg);
  text-align: center;
}
.visit__transit-icon {
  width: 32px;
  height: 32px;
  color: var(--terracotta);
  margin: 0 auto 0.7rem;
}
.visit__transit-title {
  font-weight: 700;
  margin: 0 0 0.6rem;
}
.visit__transit-text {
  font-size: 0.92rem;
  color: var(--ink-soft);
  max-width: 55ch;
  margin: 0 auto;
}
.visit__transit-text a {
  color: var(--terracotta-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 640px) {
  .visit__map iframe { height: 320px; }
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 2.5rem 1.5rem 6.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}
.footer span { color: var(--terracotta); }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn { transition: none; }

  .hero__content > *,
  .hero__actions .btn--primary,
  .countdown__num.tick {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  .hero__scene {
    animation: none;
    transform: translateX(-50%);
  }
  .hero__hearts { display: none; }
  .floating-cta {
    transition: opacity 0.2s ease;
  }
  .floating-cta.is-visible { animation: none; }
  .countdown__item,
  .gallery__grid .photo {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .section-title::after { transition: none; }
}
