:root {
  color-scheme: light;
  --background: #f6f4ec;
  --paper: #fbfaf5;
  --ink: #33382a;
  --muted: #5a5e4e;
  --accent: #5f6b3f;
  --leaf: #8c9670;
  --line: #c9ccb6;
  --heading: "Marcellus", Georgia, serif;
  --body: "Lora", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--ink); font: 400 18px/1.65 var(--body); }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
img { display: block; max-width: 100%; }
figure, h1, h2, h3, p { margin: 0; }
h1, h2, h3, p, a { overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--heading); font-weight: 400; }
h2 { font-size: clamp(38px, 4.3vw, 54px); line-height: 1.05; }
em { color: var(--accent); font-family: var(--body); font-weight: 400; }
section { scroll-margin-top: 24px; }
.container { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 24px; }
.eyebrow { color: var(--accent); font: 400 13px/1.6 var(--heading); letter-spacing: 0.2em; text-transform: uppercase; }
.skip-link { position: absolute; top: -100px; left: 20px; z-index: 10; padding: 12px; background: var(--paper); }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.olive-definitions { position: absolute; }
.branch-divider { display: block; width: 180px; height: 32px; margin-inline: auto; }

.site-header { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between; padding-block: 28px; }
.header-monogram { font: 22px/1.5 var(--heading); letter-spacing: 0.12em; text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font: 14px/1.5 var(--heading); letter-spacing: 0.14em; text-transform: uppercase; }
.site-header a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.hero { display: flex; flex-wrap: wrap; gap: 48px 64px; align-items: center; padding-block: 40px 96px; }
.hero-content { flex: 1 1 420px; min-width: 0; }
.hero-eyebrow { font-size: 14px; letter-spacing: 0.24em; }
h1 { margin-top: 18px; font-size: clamp(68px, 9vw, 120px); line-height: 0.98; }
.hero-conjunction { color: var(--accent); font-family: var(--body); font-style: italic; font-size: 0.5em; }
.hero-details { margin-top: 28px; font-style: italic; font-size: clamp(20px, 2.1vw, 24px); }
.hero-details > * + *::before { content: " · "; }
.countdown { display: flex; flex-wrap: wrap; gap: 16px 28px; max-width: 380px; margin-top: 28px; padding-block: 16px; border-block: 1px solid var(--line); }
.countdown-part { display: flex; flex-direction: column; }
.countdown-number { font: 36px/1 var(--heading); font-variant-numeric: tabular-nums; }
.countdown-label { margin-top: 4px; color: var(--muted); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; }
.hero-button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; margin-top: 32px; padding: 10px 30px; border: 1px solid var(--ink); border-radius: 999px; text-decoration: none; font: 14px/1.5 var(--heading); letter-spacing: 0.18em; text-transform: uppercase; }
.hero-button:hover { background: var(--ink); color: var(--paper); }
.hero-photo-stage { position: relative; flex: 0 1 480px; min-width: 0; width: 100%; max-width: 480px; aspect-ratio: 1; }
.hero-photo { position: absolute; left: 14%; top: 8%; width: 72%; height: 72%; object-fit: cover; border-radius: 50%; }
.hero-branches { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }

.couple-section { padding-block: 104px; background: var(--paper); text-align: center; }
.couple-section > .container { max-width: 1048px; }
.couple-section h2 { margin-top: 16px; }
.couple-portraits { display: flex; flex-wrap: wrap; justify-content: center; gap: 48px 96px; margin-top: 56px; }
.person { flex: 0 1 260px; min-width: 0; }
.portrait { padding: 8px; border: 1px solid #a9af92; }
.portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }
.person figcaption { margin-top: 22px; }
.person h3 { font: italic 32px/1.4 var(--body); }
.person figcaption p { color: var(--muted); }
.family-section { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px 0; margin-top: 64px; }
.family-group { flex: 1 1 260px; min-width: 0; padding-inline: 20px; }
.family-group + .family-group { border-left: 1px solid var(--line); }
.family-pair + .family-pair { margin-top: 24px; }
.family-pair p { margin-top: 6px; font-size: 21px; }
.family-godparents p { font-style: italic; font-size: 24px; }

.story-section { display: flex; flex-wrap: wrap; gap: 48px 72px; align-items: center; padding-block: 104px; }
.story-heading { flex: 1 1 340px; min-width: 0; }
.story-message { font-size: 21px; line-height: 1.6; }
.story-message p { margin-top: 24px; }
.story-signature, .story-video { margin-top: 18px; }
.story-signature { font-style: italic; color: var(--accent); }
.story-photos { flex: 1 1 560px; min-width: 0; }
.story-section .invitation-story-gallery { margin: 0; }
.story-section .invitation-story-gallery__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.story-section .invitation-story-gallery__photo { aspect-ratio: 3 / 4; border-radius: 0; }
.story-section .invitation-story-gallery__photo:nth-child(3n + 2) { margin-top: 56px; }
.story-section .invitation-story-gallery__photo:nth-child(3n) { margin-top: 20px; }

.events-section { padding-block: 104px; background: var(--paper); }
.events-section h2, .events-date { text-align: center; }
.events-date { margin-top: 10px; font-style: italic; font-size: 21px; color: var(--muted); }
.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 40px 0; margin-top: 56px; }
.event-card { min-width: 0; padding-inline: 28px; text-align: center; }
.event-card + .event-card { border-left: 1px solid var(--line); }
.event-photo { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 160px 160px 0 0; }
.event-time { display: block; margin-top: 24px; color: var(--accent); font: 40px/1 var(--heading); }
.event-card h3 { margin-top: 10px; font-size: 15px; letter-spacing: 0.2em; text-transform: uppercase; line-height: 1.6; }
.event-date { margin-top: 8px; color: var(--muted); font-size: 14px; }
.event-location { margin-top: 10px; color: var(--muted); }
.event-address, .event-description { margin-top: 6px; color: var(--muted); }
.event-card .invitation-navigation { justify-content: center; gap: 12px 24px; margin-top: 14px; font-style: italic; }
.event-card .invitation-navigation a { padding: 0; border: 0; border-radius: 0; font: inherit; text-decoration: underline; }

.rsvp-section { padding: 104px 24px 72px; }
.rsvp-card { max-width: 640px; margin-inline: auto; padding: clamp(28px, 6vw, 52px); background: var(--paper); border: 1px solid var(--line); outline: 1px solid var(--line); outline-offset: 8px; text-align: center; }
.rsvp-card .branch-divider { width: 200px; }
.rsvp-card h2 { margin-top: 16px; font-size: clamp(36px, 4.5vw, 48px); }
.rsvp-intro, .rsvp-deadline, .guest-greeting { max-width: 440px; margin: 14px auto 0; color: var(--muted); }
.attendance-field { display: flex; gap: 12px; margin: 28px 0 0; padding: 0; border: 0; }
.attendance-field label { display: flex; flex: 1; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 48px; padding: 8px 12px; border: 1px solid var(--ink); border-radius: 999px; font-size: 16px; text-align: center; cursor: pointer; }
.attendance-field label:has(input:checked) { background: var(--ink); color: var(--paper); }
.attendance-field input { flex-shrink: 0; margin: 0; accent-color: var(--paper); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 28px; text-align: left; }
.form-field { display: flex; flex-direction: column; min-width: 0; }
.form-field[hidden] { display: none; }
.form-field--full { grid-column: 1 / -1; }
.form-field > label { color: var(--muted); font: 13px/1.6 var(--heading); letter-spacing: 0.14em; text-transform: uppercase; }
.form-field input, .form-field textarea { min-width: 0; max-width: 100%; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid #a9af92; border-radius: 0; background: transparent; color: var(--ink); font: 18px/1.6 var(--body); }
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--muted); opacity: 1; }
.form-field textarea { resize: vertical; }
.submit-button { width: 100%; margin-top: 30px; min-height: 54px; padding: 14px; border: 0; border-radius: 999px; background: var(--accent); color: var(--paper); font: 15px/1.6 var(--heading); letter-spacing: 0.18em; text-transform: uppercase; }
.submit-button:hover { filter: brightness(0.9); }
.form-status { margin-top: 24px; padding: 16px; border: 1px solid var(--accent); }
.form-status--error { border-color: #a63b30; }
.form-feedback { margin-top: 16px; font-size: 14px; }
.form-feedback:empty { display: none; }
.invitation-footer { padding: 24px 24px 80px; text-align: center; }
.invitation-footer .branch-divider { width: 160px; }
.footer-names { margin-top: 12px; font: 40px/1.1 var(--heading); }
.footer-date { margin-top: 6px; font-style: italic; color: var(--muted); }
.footer-note { margin-top: 16px; }
.wedday-credit { display: inline-block; margin-top: 16px; font-size: 12px; }

@media (max-width: 1000px) {
  .hero { justify-content: center; }
  .hero-content { flex-basis: 100%; text-align: center; }
  .countdown { justify-content: center; margin-inline: auto; }
  .hero-photo-stage { flex-basis: 440px; }
  .hero-branches { transform: scale(0.86); transform-origin: 50% 85%; }
  .story-heading { flex-basis: 100%; text-align: center; }
  .event-grid { grid-template-columns: 1fr; gap: 40px; max-width: 600px; margin-inline: auto; }
  .event-card + .event-card { border-left: 0; padding-top: 40px; border-top: 1px solid var(--line); }
}

@media (max-width: 840px) {
  .site-header { justify-content: center; gap: 12px; padding-block: 20px; text-align: center; }
  .header-monogram { width: 100%; justify-content: center; }
  .site-header nav { justify-content: center; gap: 8px 24px; }
  .hero { padding-block: 24px 64px; }
  .couple-section, .events-section { padding-block: 72px; }
  .couple-portraits { gap: 40px 56px; margin-top: 40px; }
  .family-section { flex-direction: column; gap: 24px; margin-top: 48px; }
  .family-group { flex: none; }
  .family-group + .family-group { border-left: 0; }
  .story-section { padding-block: 72px; }
  .story-photos { flex-basis: 100%; }
  .rsvp-section { padding-block: 72px; }
}

@media (max-width: 620px) {
  .couple-portraits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .person h3 { font-size: 28px; }
  .person figcaption p { font-size: 15px; }
  .story-message { font-size: 19px; }
  .story-section .invitation-story-gallery__grid { gap: 10px; }
  .story-section .invitation-story-gallery__photo:nth-child(3n + 2) { margin-top: 28px; }
  .story-section .invitation-story-gallery__photo:nth-child(3n) { margin-top: 10px; }
  .event-card { padding-inline: 0; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .container { padding-inline: 20px; }
  .site-header nav { gap: 4px 18px; font-size: 12px; }
  .hero { gap: 24px; }
  .countdown { gap: 20px; }
  .couple-portraits { gap: 16px; }
  .rsvp-card { padding: 28px 18px; }
  .rsvp-card .branch-divider { max-width: 100%; }
  .attendance-field { flex-direction: column; gap: 8px; }
  .footer-names { font-size: 32px; }
}

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