:root {
  --ivory: #fbf4ef;
  --blush: #f0c7be;
  --blush-light: #f7e3dd;
  --rose: #d98c86;
  --rose-deep: #c06a63;
  --terracotta: #cc7148;
  --navy: #262a3b;
  --navy-light: #3a3f55;
  --sage: #7e8b6c;
  --gold: #b9924b;

  --font-display: "Playfair Display", serif;
  --font-script: "Cormorant Garamond", serif;
  --font-body: "Karla", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--ivory);
  color: var(--navy);
  font-family: var(--font-body);
  overflow-x: hidden;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- Background ---------- */
.watercolor-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -10;
  background-image: url("../images/watercolor-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.watercolor-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(251, 244, 239, 0.55) 0%,
    rgba(251, 244, 239, 0.72) 50%,
    rgba(251, 244, 239, 0.55) 100%
  );
}

/* ---------- Utility ---------- */
.section {
  max-width: 48rem;
  margin: 0 auto;
  padding: 6rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-script);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--rose-deep);
}

.heading {
  margin-top: 0.4rem;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--navy);
}

@media (min-width: 640px) {
  .heading {
    font-size: 2.5rem;
  }
}

.invite-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 1.75rem;
  box-shadow: 0 10px 40px -10px rgba(204, 113, 72, 0.15);
}

.divider {
  margin: 1.5rem 0;
  height: 24px;
  width: 160px;
}

.btn-primary {
  display: inline-block;
  border-radius: 999px;
  background: var(--navy);
  color: var(--ivory);
  padding: 0.85rem 2.2rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  box-shadow: 0 20px 60px -20px rgba(38, 42, 59, 0.25);
  transition: transform 0.25s ease, background 0.25s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--navy-light);
}

.btn-outline {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid var(--navy);
  color: var(--navy);
  padding: 0.75rem 2rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  transition: background 0.25s ease, color 0.25s ease;
}
.btn-outline:hover {
  background: var(--navy);
  color: var(--ivory);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 1.5rem 0;
  background: transparent;
  transition: all 0.4s ease;
}
.navbar.scrolled {
  padding: 0.75rem 0;
  background: rgba(251, 244, 239, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(185, 146, 75, 0.18);
}
.nav-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-script);
  font-style: italic;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
}
.nav-links {
  display: none;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(38, 42, 59, 0.8);
  transition: color 0.2s ease;
}
.nav-links a:hover {
  color: var(--terracotta);
}
@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
}
.nav-toggle {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  width: 24px;
  background: var(--navy);
  transition: transform 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.nav-mobile {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 0;
  background: rgba(251, 244, 239, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(185, 146, 75, 0.18);
  list-style: none;
  margin: 0.5rem 0 0;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(38, 42, 59, 0.8);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7rem 1.5rem 4rem;
  text-align: center;
}
.hero-tagline {
  font-family: var(--font-script);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--rose-deep);
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeIn 1s ease-out 0.2s forwards;
}
.hero-illustration-wrap {
  position: relative;
  width: 280px;
  height: 246px;
  margin-top: 0.5rem;
  opacity: 0;
  transform: scale(0.92);
  animation: heroPop 1.1s ease-out 0.1s forwards;
}
@media (min-width: 640px) {
  .hero-illustration-wrap { width: 360px; height: 317px; }
}
.hero-illustration {
  animation: float 7s ease-in-out infinite;
  filter: drop-shadow(0 25px 35px rgba(38, 42, 59, 0.18));
}
.hero-illustration img {
  width: 100%;
  height: auto;
}
.hero-names {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  line-height: 1.15;
  font-family: var(--font-display);
  font-size: 2.25rem;
  color: var(--navy);
  opacity: 0;
  animation: fadeUp 1s ease-out 0.5s forwards;
}
@media (min-width: 640px) {
  .hero-names { font-size: 3.5rem; }
}
.hero-names .amp {
  font-family: var(--font-script);
  font-style: italic;
  color: var(--terracotta);
}
.hero-divider {
  opacity: 0;
  animation: fadeIn 1s ease-out 0.8s forwards;
}
.hero-date {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: rgba(38, 42, 59, 0.7);
  opacity: 0;
  animation: fadeIn 1s ease-out 1s forwards;
}
.hero-cta {
  margin-top: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s ease-out 1.2s forwards;
}
.hero-countdown-wrap {
  margin-top: 3rem;
  opacity: 0;
  animation: fadeUp 0.8s ease-out 1.4s forwards;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-14px); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Countdown ---------- */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.countdown.compact {
  display: flex;
  gap: 1rem;
}
.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.countdown-circle {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
}
.countdown.compact .countdown-circle {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.15rem;
}
@media (min-width: 640px) {
  .countdown-circle { width: 5rem; height: 5rem; font-size: 1.75rem; }
  .countdown.compact .countdown-circle { width: 4rem; height: 4rem; font-size: 1.25rem; }
}
.countdown-label {
  margin-top: 0.5rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(38, 42, 59, 0.6);
}

/* ---------- Info card (date/location) ---------- */
.info-card {
  width: 100%;
  padding: 2.5rem 2rem;
}
.info-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--navy);
}
.info-row.address {
  align-items: flex-start;
  text-align: center;
}
.info-row svg { color: var(--terracotta); flex-shrink: 0; }
.info-row .label-lg {
  font-family: var(--font-display);
  font-size: 1.4rem;
}
@media (min-width: 640px) {
  .info-row .label-lg { font-size: 1.6rem; }
}

/* ---------- Cards generic ---------- */
.card-icon-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 2.5rem;
  width: 100%;
  transition: transform 0.25s ease;
}
.card-icon-block:hover { transform: translateY(-4px); }
.card-icon-block svg { color: var(--terracotta); }
.card-icon-block .title {
  font-family: var(--font-display);
  font-size: 1.5rem;
}
.card-icon-block p {
  max-width: 26rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(38, 42, 59, 0.7);
}

.story-text {
  padding: 2.5rem 2rem;
  font-family: var(--font-script);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.7;
  color: rgba(38, 42, 59, 0.7);
}
@media (min-width: 640px) {
  .story-text { font-size: 1.5rem; }
}

/* ---------- Form ---------- */
.rsvp-form {
  width: 100%;
  text-align: left;
  padding: 2.5rem 2rem;
}
.form-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .form-grid.two-col { grid-template-columns: 1fr 1fr; }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.field label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(38, 42, 59, 0.7);
}
.field input,
.field select,
.field textarea {
  border-radius: 0.75rem;
  border: 1px solid rgba(38, 42, 59, 0.15);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.65rem 1rem;
  color: var(--navy);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--terracotta);
}
.submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.rsvp-success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3.5rem 2.5rem;
  text-align: center;
}
.rsvp-success svg { color: var(--sage); }
.rsvp-success.show { display: flex; }
.rsvp-form.hidden { display: none; }

/* ---------- Footer ---------- */
.footer {
  max-width: 36rem;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  text-align: center;
}
.footer-thanks {
  margin-top: 1.5rem;
  font-family: var(--font-script);
  font-style: italic;
  font-size: 1.15rem;
  color: rgba(38, 42, 59, 0.7);
}
.footer-names {
  margin-top: 0.25rem;
  font-family: var(--font-display);
  font-size: 1.9rem;
}
.footer-date {
  margin-top: 2rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(38, 42, 59, 0.4);
}

/* ---------- Floating buttons ---------- */
.floating-buttons {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}
.fab {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  transition: transform 0.2s ease;
}
.fab:hover { transform: scale(1.08); }
.fab:active { transform: scale(0.96); }
.share-toast {
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.share-toast.show { opacity: 1; }

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ivory);
  transition: opacity 0.6s ease;
}
.loader.hide {
  opacity: 0;
  pointer-events: none;
}
.loader-mark {
  font-family: var(--font-script);
  font-style: italic;
  font-size: 2rem;
  color: var(--navy);
  opacity: 0;
  animation: fadeUp 0.8s ease-out 0.1s forwards;
}
.loader-line {
  margin-top: 1rem;
  height: 1.5px;
  width: 96px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  animation: growLine 1.2s ease-in-out 0.3s forwards;
}
@keyframes growLine {
  to { transform: scaleX(1); }
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
