:root {
  --stone: #e6e1d8;
  --paper: #efebe4;
  --ink: #2b2a28;
  --muted: #5f5a52;
  --clay: #7a5640;
  --line: #c9c2b6;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter Tight", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { position: relative; margin: 0; background: var(--stone); color: var(--ink); font: 300 16px/1.7 var(--sans); }
body::before { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; background: url("assets/grain.svg"); mix-blend-mode: multiply; opacity: 0.6; }
main { counter-reset: sections; }
a { color: inherit; text-underline-offset: 5px; }
a:hover { color: var(--clay); }
a, button, input, textarea { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--clay); outline-offset: 5px; }
button, input, textarea { font: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 300; }
h1, h2, h3, p, dd, a { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
section { scroll-margin-top: 28px; }
.container { width: calc(100% - 48px); max-width: 1120px; margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 20; padding: 12px 18px; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 12px; }

.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding-block: 32px; }
.header-names { font: italic 22px/1.3 var(--serif); text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 15px; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }

.hero { display: flex; align-items: center; gap: 48px 72px; padding-block: 64px 48px; }
.date-circle { position: relative; flex: 0 1 340px; aspect-ratio: 1; min-width: 0; color: var(--clay); }
.date-circle svg { display: block; width: 100%; height: 100%; }
.wedding-date, .circle-initials { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--ink); }
.wedding-day { font: 300 96px/1 var(--serif); }
.wedding-month { font-size: 14px; letter-spacing: 0.3em; }
.wedding-year { color: var(--muted); font-size: 13px; letter-spacing: 0.3em; }
.circle-initials { font: italic 48px/1 var(--serif); }
.hero-heading { flex: 1 1 440px; min-width: 0; }
h1 { font-size: clamp(80px, 10vw, 150px); line-height: 0.92; letter-spacing: -0.03em; }
h1 > span { display: block; }
.hero-conjunction { padding-left: 0.2em; color: var(--clay); font-style: italic; font-size: 0.42em; line-height: 1.55; letter-spacing: 0; }
.hero-details { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 7px; margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); max-width: 420px; font-size: 15px; color: var(--muted); }
.countdown { display: inline-flex; flex-wrap: wrap; gap: 0 7px; }
.countdown > span { white-space: nowrap; }
.hero-location:has(+ .countdown)::after, .countdown > span:not(:last-child)::after { content: " ·"; margin-left: 7px; }
.hero-button { display: inline-block; padding-block: 6px; margin-top: 12px; font: italic 24px/1.4 var(--serif); text-underline-offset: 6px; }
.hero-photo-stage { display: flex; justify-content: flex-end; align-items: flex-end; gap: 20px; padding-block: 48px 120px; }
.hero-photo-caption { max-height: 260px; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 13px; letter-spacing: 0.3em; color: var(--muted); }
.hero-photo { width: min(640px, 85%); height: auto; aspect-ratio: 3 / 2; object-fit: cover; filter: saturate(0.6) contrast(0.95) sepia(0.12); }

.numbered-section { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px 72px; padding-bottom: 120px; counter-increment: sections; }
.section-heading::before { content: counter(sections, lower-roman) "."; display: block; margin-bottom: 4px; color: var(--clay); font: italic 20px/1.7 var(--serif); }
.section-heading h2 { font-size: 42px; line-height: 1; letter-spacing: -0.025em; }
.section-content { min-width: 0; }
.couple-portraits { display: flex; align-items: flex-start; gap: 40px 56px; }
.person { flex: 0 1 220px; min-width: 0; }
.person--groom { margin-top: 48px; }
.portrait img { width: 100%; height: auto; aspect-ratio: 220 / 260; object-fit: cover; object-position: top; border-radius: 48% 52% 46% 54% / 55% 47% 53% 45%; filter: saturate(0.6) sepia(0.1); }
.person--groom .portrait img { border-radius: 55% 45% 52% 48% / 46% 56% 44% 54%; }
.person figcaption { margin-top: 18px; }
.person h3 { font-size: 30px; line-height: 1.2; }
.person p { margin-top: 6px; color: var(--muted); white-space: pre-line; }
.family-section { max-width: 620px; margin-top: 56px; border-bottom: 1px solid var(--line); }
.family-pair { display: flex; flex-wrap: wrap; gap: 4px 24px; padding-block: 16px; border-top: 1px solid var(--line); }
.family-pair dt { flex: 0 0 160px; font-size: 14px; color: var(--muted); }
.family-pair dd { flex: 1 1 200px; min-width: 0; font: 400 22px/1.4 var(--serif); }

.story-message { max-width: 600px; font: 300 30px/1.4 var(--serif); }
.story-message p + p { margin-top: 20px; }
.story-signature { margin-top: 20px; font: italic 24px/1.4 var(--serif); }
.story-video { margin-top: 20px; }
.invitation-story-gallery { margin-top: 64px; }
.invitation-story-gallery__grid { display: flex; align-items: flex-start; gap: 32px; }
.invitation-story-gallery__photo { flex: 0 1 300px; min-width: 0; width: auto; aspect-ratio: 4 / 5; border-radius: 0; }
.invitation-story-gallery__photo:nth-child(2) { flex-basis: 200px; margin-top: 120px; aspect-ratio: 1; }
.invitation-story-gallery__photo:nth-child(3) { flex-basis: 240px; margin-top: 40px; aspect-ratio: 3 / 4; }
.invitation-story-gallery__photo img { filter: saturate(0.6) sepia(0.1); transition: filter 180ms ease; }
.invitation-story-gallery__photo:hover img, .invitation-story-gallery__photo:focus-visible img { filter: none; }

.events-date { margin-top: 12px; font-size: 14px; color: var(--muted); }
.event-list { border-bottom: 1px solid var(--line); }
.event-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding-block: 28px; border-top: 1px solid var(--line); }
.event-photo { flex: 0 0 96px; width: 96px; height: 96px; object-fit: cover; border-radius: 42% 58% 50% 50% / 52% 44% 56% 48%; filter: saturate(0.6) sepia(0.1); }
.event-card:nth-child(2) .event-photo { border-radius: 55% 45% 52% 48% / 46% 56% 44% 54%; }
.event-card:nth-child(3) .event-photo { border-radius: 48% 52% 46% 54% / 55% 47% 53% 45%; }
.event-time-column { flex: 0 0 80px; }
.event-time { display: block; font: 300 34px/1 var(--serif); }
.event-date { margin-top: 6px; font-size: 12px; color: var(--muted); }
.event-details { flex: 1 1 220px; min-width: 0; }
.event-details h3 { font-size: 24px; font-weight: 400; line-height: 1.25; }
.event-details p { margin-top: 2px; color: var(--muted); }
.event-description { font-size: 14px; white-space: pre-line; }
.invitation-navigation { justify-content: flex-start; gap: 0 16px; margin: 0; }
.invitation-navigation a { padding: 4px 0; border: 0; border-radius: 0; font-size: 14px; font-weight: 400; text-decoration: underline; }

.rsvp-card { padding: clamp(28px, 5vw, 48px); background: var(--paper); }
.rsvp-intro { max-width: 480px; font: 400 22px/1.45 var(--serif); white-space: pre-line; }
.rsvp-deadline, .guest-greeting { margin-top: 16px; }
.attendance-field { display: flex; flex-wrap: wrap; gap: 8px 32px; padding: 0; margin: 28px 0 0; border: 0; }
.attendance-field label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 17px; cursor: pointer; }
.attendance-field input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; margin-top: 20px; }
.form-field { min-width: 0; }
.form-field--full { grid-column: 1 / -1; }
.form-field label { display: block; font-size: 14px; color: var(--muted); }
.form-field input, .form-field textarea { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 10px 0; border: 0; border-bottom: 1px solid #a8a091; border-radius: 0; background: transparent; font-size: 17px; color: var(--ink); }
.form-field textarea { resize: vertical; }
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--muted); opacity: 1; }
.submit-button { margin-top: 32px; min-height: 52px; max-width: 100%; padding: 12px 40px; border: 0; border-radius: 2px; background: var(--ink); color: var(--paper); font-size: 16px; font-weight: 400; cursor: pointer; }
.submit-button:hover { background: var(--clay); }
.form-feedback:not(:empty), .form-status { margin-top: 20px; padding: 12px 16px; border: 1px solid var(--line); }
.form-status--error { border-color: #8c473d; color: #8c473d; }

.invitation-footer { display: flex; align-items: flex-start; gap: 20px; padding-bottom: 80px; }
.footer-circle { flex: 0 0 56px; width: 56px; height: 56px; color: var(--clay); }
.footer-content { min-width: 0; padding-top: 12px; }
.footer-signature { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.footer-names { font: 300 32px/1.1 var(--serif); }
.footer-date { color: var(--muted); font-size: 14px; letter-spacing: 0.2em; }
.footer-note { margin-top: 12px; color: var(--muted); white-space: pre-line; }
.wedday-credit { display: inline-block; padding-block: 10px; color: var(--muted); font-size: 12px; }

@media (max-width: 1000px) {
  .hero { gap: 40px; }
  .date-circle { flex-basis: 280px; }
  .numbered-section { grid-template-columns: 170px minmax(0, 1fr); column-gap: 40px; }
  .section-heading h2 { font-size: 36px; }
  .couple-portraits { gap: 32px; }
  .event-card { column-gap: 20px; }
  .event-details { flex-basis: 200px; }
  .invitation-story-gallery__grid { gap: 20px; }
  .invitation-story-gallery__photo:nth-child(2) { margin-top: 80px; }
}

@media (max-width: 760px) {
  .site-header { padding-block: 24px; }
  .site-header nav { gap: 4px 20px; }
  .hero { padding-block: 40px; gap: 24px; }
  .date-circle { flex-basis: 220px; }
  .wedding-day { font-size: 72px; }
  .wedding-month { font-size: 12px; letter-spacing: 0.15em; }
  .hero-photo-stage { padding-block: 32px 80px; gap: 14px; }
  .numbered-section { grid-template-columns: minmax(0, 1fr); padding-bottom: 80px; }
  .section-heading h2 { max-width: 440px; font-size: 40px; }
  .couple-portraits { justify-content: center; }
  .family-section { max-width: none; }
  .invitation-story-gallery { margin-top: 40px; }
  .event-details { flex-basis: 220px; }
  .rsvp-card { padding: 32px; }
}

@media (max-width: 520px) {
  .container { width: calc(100% - 40px); }
  .site-header nav { gap: 0 16px; font-size: 14px; }
  .hero { flex-direction: column; align-items: stretch; gap: 32px; padding-block: 16px 24px; }
  .date-circle { flex: none; width: 220px; align-self: center; }
  .hero-heading { flex: none; }
  h1 { font-size: clamp(72px, 21vw, 108px); }
  .hero-details { margin-top: 24px; }
  .hero-photo-stage { padding-block: 32px 72px; }
  .hero-photo { width: calc(100% - 32px); }
  .hero-photo-caption { font-size: 11px; letter-spacing: 0.2em; max-height: 190px; }
  .numbered-section { gap: 28px; padding-bottom: 72px; }
  .couple-portraits { gap: 24px; }
  .person--groom { margin-top: 40px; }
  .person h3 { font-size: 28px; }
  .person p { font-size: 15px; }
  .family-section { margin-top: 40px; }
  .family-pair { gap: 4px; }
  .family-pair dt { flex-basis: 100%; }
  .story-message { font-size: 27px; }
  .invitation-story-gallery__grid { flex-wrap: wrap; gap: 24px; }
  .invitation-story-gallery__photo { flex: 0 0 calc(58% - 12px); }
  .invitation-story-gallery__photo:nth-child(2) { flex-basis: calc(42% - 12px); margin-top: 64px; }
  .invitation-story-gallery__photo:nth-child(3) { flex-basis: 60%; margin: 0 0 0 auto; }
  .event-card { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 16px 24px; }
  .event-photo { width: 80px; height: 80px; }
  .event-details, .invitation-navigation { grid-column: 1 / -1; }
  .rsvp-card { padding: 28px 24px; }
  .attendance-field { column-gap: 24px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .submit-button { width: 100%; padding-inline: 20px; }
  .invitation-footer { gap: 12px; padding-bottom: 48px; }
  .footer-circle { flex-basis: 44px; width: 44px; height: 44px; }
  .footer-content { padding-top: 8px; }
  .footer-names { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
