:root {
  --ivory: #faf6ee;
  --ivory-dim: #f1ead9;
  --green-deep: #33422f;
  --green-mid: #5c6e50;
  --rose: #c97b84;
  --gold: #b9985a;
  --gold-deep: #7a5a28;  /* ~5.9:1 on --ivory, WCAG AA for small tracked text */
  --gold-soft: #85672e;  /* ~4.9:1 on --ivory, WCAG AA */
  --charcoal: #2b2b26;
  --line: rgba(51, 66, 47, 0.18);

  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --body: "Jost", "Century Gothic", "Avenir Next", sans-serif;

  --radius: 2px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .eyebrow,
  .couple-names,
  .hero-divider,
  .hero-detail,
  .hero-note {
    opacity: 0;
    animation: fade-up 900ms ease-out forwards;
  }
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5rem 1.5rem 4rem;
}

/* ---------- Hero ---------- */

.hero {
  width: 100%;
  max-width: 560px;
  text-align: center;
}

.wreath {
  width: 220px;
  height: auto;
  margin: 0 auto 1.25rem;
  opacity: 0;
  animation: fade-up 900ms ease-out 120ms forwards;
}

.wreath path,
.wreath ellipse {
  stroke: var(--green-mid);
}

.eyebrow {
  font-family: var(--body);
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.75rem;
  opacity: 0;
  animation: fade-up 800ms ease-out 260ms forwards;
}

.couple-names {
  font-family: var(--display);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.6rem, 8vw, 4rem);
  color: var(--charcoal); /* was var(--black), which was never defined */
  margin: 0 0 0.55rem;
  letter-spacing: 0.01em;
  opacity: 0;
  animation: fade-up 900ms ease-out 380ms forwards;
}

.couple-names .amp {
  margin: 0 0.06em; /* breathing room around the script ampersand */
}

.hero-divider {
  width: 46px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto 0.9rem;
  opacity: 0;
  animation: fade-up 800ms ease-out 480ms forwards;
}

.hero-detail {
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--green-deep);
  margin: 0.15rem 0;
  opacity: 0;
  animation: fade-up 800ms ease-out 560ms forwards;
}

.hero-detail.muted {
  color: var(--charcoal);
  opacity: 0.7;
  font-size: 0.92rem;
}

.invite-line {
  margin-top: 0.2rem;
  margin-bottom: 0.35rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.66rem;
  color: var(--gold-soft);
}

.invite-line--soft {
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--gold-soft);
  margin-bottom: 0.15rem;
}

.invite-line--strong {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--gold-deep);
  margin-top: 0;
  margin-bottom: 1rem;
}

.hero-note {
  margin-top: 1.1rem;
  font-size: 0.92rem;
  color: var(--charcoal);
  opacity: 0;
  animation: fade-up 800ms ease-out 660ms forwards;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Card / form ---------- */

.card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.4rem 2.2rem;
  padding-top: 3rem;
  margin-top: 2.2rem; /* was 3rem */
  box-shadow: 0 30px 60px -40px rgba(51, 66, 47, 0.35);
}

.card-title {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.85rem;
  color: var(--gold-deep);
  margin: 0 0 0.35rem;
  text-align: center;
}

.card-dear {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--green-mid);
  /* color: var(--gold-soft); */
  text-align: center;
  margin: 0.35rem 0 0.5rem;
}

.card-subtitle {
  text-align: center;
  font-size: 0.88rem;
  color: var(--charcoal);
  opacity: 0.65;
  margin: 0 0 0.55rem; /* was 0 0 2rem */
}

.card-deadline {
  text-align: center;
  font-size: 0.72rem;
  /* letter-spacing: 0.16em; */
  /* text-transform: lowercase; */
  color: var(--gold-deep);
  margin: 0 0 2rem;
  /* border-bottom: 1px solid var(--line); */

}

form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-mid);
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--charcoal);
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  transition: border-color 160ms ease, background 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--charcoal);
  opacity: 0.35;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

/* Attending toggle */

.toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.toggle-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-option span {
  display: block;
  text-align: center;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gold);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.toggle-option input:checked + span {
  border-color: var(--gold);
  background: var(--green-deep);
  color: var(--ivory);
}

.toggle-option input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Fields that only make sense when attending */

.conditional-fields {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  max-height: 400px;
  overflow: hidden;
  transition: max-height 320ms ease, opacity 280ms ease;
  opacity: 1;
}

.conditional-fields[hidden] {
  display: flex;
  max-height: 0;
  opacity: 0;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--charcoal);
  opacity: 0.55;
  margin-top: 0.4rem;
}

button[type="submit"] {
  margin-top: 0.4rem;
  font-family: var(--body);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ivory);
  background: var(--green-deep);
  border: none;
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

button[type="submit"]:hover {
  background: var(--rose);
}

button[type="submit"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.error-banner {
  background: #fbeceb;
  border: 1px solid var(--rose);
  color: #8a3b3b;
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Thank-you page ---------- */

.thankyou-card {
  text-align: center;
}

.thankyou-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.2rem;
}

.thankyou-title {
  font-family: var(--display);
  font-style: italic;
  font-size: 2rem;
  color: var(--gold);
  margin: 0 0 0.6rem;
}

.thankyou-text {
  font-size: 0.98rem;
  color: var(--charcoal);
  opacity: 0.8;
  max-width: 420px;
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}

.back-link:hover {
  border-color: var(--gold);
}

/* ---------- Guest list (admin) ---------- */

.guests-wrap {
  width: 100%;
  max-width: 780px;
}

.guests-summary {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin: 1.5rem 0 2.5rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-number {
  font-family: var(--display);
  font-style: italic;
  font-size: 2.4rem;
  color: var(--gold);
  display: block;
}

.stat-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--charcoal);
  opacity: 0.6;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-mid);
  font-weight: 500;
  background: var(--ivory-dim);
}

tr:last-child td {
  border-bottom: none;
}

.section-heading {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--gold);
  margin: 2.5rem 0 0.8rem;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--charcoal);
  opacity: 0.55;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .card {
    padding: 1.8rem 1.4rem;
  }
  .guests-summary {
    gap: 1.2rem;
  }
  th, td {
    padding: 0.6rem 0.6rem;
    font-size: 0.8rem;
  }
}

.hero-image {
  width: min(220px, 62vw);
  height: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.5rem;
  opacity: 1; /* ← changed from 0 to 1 */
}

@media (prefers-reduced-motion: no-preference) {
  .hero-image {
    opacity: 0;
    animation: fade-up 900ms ease-out 120ms forwards;
  }
}

/* Event Navigation - Pill Buttons */
.event-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 0 1rem 0;
}

.event-nav a.nav-pill {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--gold) !important;
  text-decoration: none !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.9rem;
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.event-nav a.nav-pill:hover {
  background: var(--gold) !important;
  color: var(--ivory) !important;
  border-color: var(--gold) !important;
}

.event-nav .nav-divider {
  color: var(--gold);
  opacity: 0.5;
  font-size: 0.8rem;
}

@media (max-width: 600px) {
  .event-nav {
    gap: 0.3rem;
  }
  .event-nav a.nav-pill {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
  }
  .event-nav .nav-divider {
    display: none;
  }
}

/* Pill Button - for no_invitation page */
.pill-button {
  font-family: var(--body);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ivory);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 1.2rem;
  background: var(--green-mid);
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.pill-button:hover {
  background: var(--green-deep);
  transform: translateY(-1px);
}

/* Back to RSVP pill - distinct from nav pills */
.event-nav a.nav-pill.back-pill {
  color: var(--green-mid) !important;
  border-color: var(--green-mid) !important;
  margin-left: 0.5rem;
}

.event-nav a.nav-pill.back-pill:hover {
  background: var(--green-mid) !important;
  color: var(--ivory) !important;
  border-color: var(--green-mid) !important;
}

.cordially {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--green-mid);
  margin: 0.5rem 0 0;
  opacity: 0;
  animation: fade-up 800ms ease-out 400ms forwards;
}

.grandparents {
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: var(--gold);
  margin: 0.25rem 0;
  opacity: 0;
  animation: fade-up 800ms ease-out 100ms forwards;
}
