:root {
  --bg-deep: #1e2a24;
  --bg-mid: #2f4036;
  --bg-soft: #f3efe6;
  --bg-page: #e8e2d6;
  --ink: #1c2420;
  --ink-soft: #4a564e;
  --accent: #6b7f5a;
  --accent-deep: #4f6143;
  --gold: #b8955a;
  --line: rgba(30, 42, 36, 0.12);
  --white: #faf8f3;
  --shadow: 0 18px 50px rgba(30, 42, 36, 0.12);
  --radius: 2px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Manrope', 'Segoe UI', sans-serif;
  --max: 42rem;
  --section-pad: clamp(3.5rem, 8vw, 6rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg-soft);
  background-image:
    linear-gradient(180deg, rgba(250, 248, 243, 0.72) 0%, rgba(243, 239, 230, 0.78) 45%, rgba(232, 226, 214, 0.82) 100%),
    url('../assets/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.is-locked {
  overflow: hidden;
  height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

button,
input {
  font: inherit;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* —— Cover —— */
.cover {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--white);
  background-color: var(--bg-deep);
  background-image:
    linear-gradient(160deg, rgba(30, 42, 36, 0.78) 0%, rgba(47, 64, 54, 0.72) 55%, rgba(36, 48, 40, 0.8) 100%),
    url('../assets/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.8s ease, visibility 0.8s ease, transform 0.8s ease;
}

.cover--hide {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.03);
  pointer-events: none;
}

.cover__inner {
  text-align: center;
  padding: 2rem;
  position: relative;
}

.cover__monogram {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 6.5rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
}

.cover__hint {
  margin: 1.75rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
  animation: hint-breathe 2.4s ease-in-out infinite;
}

.cover__pulse {
  display: block;
  width: 10px;
  height: 10px;
  margin: 2rem auto 0;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(184, 149, 90, 0.55);
  animation: pulse-ring 2.2s ease-out infinite;
}

@keyframes hint-breathe {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(184, 149, 90, 0.55);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(184, 149, 90, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(184, 149, 90, 0);
  }
}

/* —— Layout —— */
.invitation {
  position: relative;
  z-index: 1;
}

.section {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
  padding-block: var(--section-pad);
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section__label,
.section__title {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
}

.section__label {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

.section__title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  color: var(--ink);
}

.section__text {
  margin: 0 auto 1.75rem;
  max-width: 36rem;
  text-align: center;
  color: var(--ink-soft);
}

/* —— Reveal —— */
.reveal {
  opacity: 1;
  transform: none;
}

.reveal.reveal--pending {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s ease, transform 0.85s ease;
}

.reveal.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* —— Hero —— */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding-top: clamp(4rem, 12vh, 7rem);
  padding-bottom: clamp(3rem, 8vh, 5rem);
}

.hero__eyebrow {
  margin: 0 0 1.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero__names {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 13vw, 5.75rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: 0.02em;
}

.hero__amp {
  display: block;
  margin: 0.35rem 0;
  font-size: 0.45em;
  font-style: italic;
  color: var(--gold);
}

.hero__date {
  margin: 1.5rem 0 0;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.hero__title {
  margin: 2.5rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 500;
}

.hero__text {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--ink-soft);
}

/* —— Countdown —— */
.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.countdown__cell {
  text-align: center;
  padding: 1.1rem 0.5rem;
  background: rgba(250, 248, 243, 0.55);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.countdown__value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  transition: transform 0.25s ease, color 0.25s ease;
}

.countdown__value.is-tick {
  transform: scale(1.06);
  color: var(--accent-deep);
}

.countdown__unit {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* —— Timeline —— */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.timeline__item {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  align-items: start;
}

.timeline__time {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--accent-deep);
  padding-top: 0.15rem;
}

.timeline__title {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 500;
}

.timeline__desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* —— Location —— */
.location {
  text-align: center;
}

.location__place {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
}

.location__address {
  margin: 0 0 1.75rem;
  color: var(--ink-soft);
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.85rem;
  padding: 0.7rem 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  width: 100%;
  background: var(--bg-deep);
  color: var(--white);
  border-color: var(--bg-deep);
}

.btn--primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.btn--primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(30, 42, 36, 0.28);
}

.btn--ghost:hover {
  background: rgba(30, 42, 36, 0.06);
  border-color: var(--ink);
}

/* —— Dress / palette —— */
.palette {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 1.5rem;
}

.palette__item {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  width: 4.5rem;
}

.palette__swatch {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: 1px solid rgba(30, 42, 36, 0.15);
  box-shadow: inset 0 0 0 3px rgba(250, 248, 243, 0.55);
}

.palette__name {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--ink-soft);
}

/* —— Notes —— */
.notes__grid {
  display: grid;
  gap: 1.5rem;
}

.note__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  text-align: center;
}

.note__text {
  margin: 0;
  text-align: center;
  color: var(--ink-soft);
}

/* —— Contacts —— */
.contacts__list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
}

.contact {
  text-align: center;
}

.contact__note {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.contact__role {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.contact__name {
  margin: 0.35rem 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
}

.contact__phone {
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid transparent;
}

.contact__phone:hover {
  border-bottom-color: var(--ink);
}

/* —— RSVP —— */
.rsvp__deadline {
  font-style: italic;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.rsvp__form {
  display: grid;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.field {
  display: grid;
  gap: 0.55rem;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.field label,
.field legend {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field input[type='text'] {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(30, 42, 36, 0.2);
  border-radius: var(--radius);
  background: rgba(250, 248, 243, 0.7);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input[type='text']:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107, 127, 90, 0.18);
}

.choices {
  display: grid;
  gap: 0.55rem;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: rgba(250, 248, 243, 0.45);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.choice:hover {
  border-color: rgba(107, 127, 90, 0.45);
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: rgba(107, 127, 90, 0.1);
}

.choice input {
  margin-top: 0.2rem;
  accent-color: var(--accent-deep);
}

.choice span {
  flex: 1;
}

.rsvp__status {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
}

.rsvp__status--success {
  color: var(--accent-deep);
}

.rsvp__status--error {
  color: #8a3b3b;
}

/* —— Footer —— */
.footer {
  text-align: center;
  padding: 3rem 1.25rem 4rem;
  border-top: 1px solid var(--line);
}

.footer__monogram {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.footer__date {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* —— Desktop —— */
@media (min-width: 720px) {
  .countdown__grid {
    gap: 1rem;
  }

  .timeline__item {
    grid-template-columns: 5.5rem 1fr;
    gap: 1.5rem;
  }

  .notes__grid {
    grid-template-columns: 1fr;
  }

  .contacts__list {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .choices {
    grid-template-columns: 1fr 1fr;
  }

  #attendance-options {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 960px) {
  .notes__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }

  .note__title,
  .note__text {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cover__hint,
  .cover__pulse,
  .countdown__value,
  .reveal.reveal--pending {
    animation: none !important;
    transition: none !important;
  }

  .reveal.reveal--pending {
    opacity: 1;
    transform: none;
  }
}
