:root {
  color-scheme: light;
  --sand: #efe6d6;
  --paper: #f8f4ec;
  --ink: #1e3536;
  --muted: #4a5c5c;
  --sea: #1f5a5e;
  --foam: #cfe2df;
  --accent: #a94e37;
  --serif: "Young Serif", Georgia, serif;
  --sans: "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--sand); color: var(--ink); font: 300 17px/1.6 var(--sans); }
body::before { content: ""; position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0.04; background: url("assets/grain.svg"); mix-blend-mode: multiply; }
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 currentColor; 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(--serif); font-weight: 400; }
h2 { font-size: clamp(38px, 4.6vw, 58px); line-height: 1; }
section { scroll-margin-top: 24px; }
.container { width: 100%; max-width: 1208px; margin-inline: auto; padding-inline: 24px; }
.eyebrow { color: var(--accent); font: 500 14px/1.6 var(--sans); letter-spacing: 0.24em; 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; }
.wave-definitions { position: absolute; color: var(--sea); }
.section-wave { display: block; width: 100%; height: 40px; fill: var(--sea); }
.section-wave--top { position: absolute; left: 0; top: -39px; }
.section-wave--bottom { margin-top: -1px; transform: scaleY(-1); }
.section-ripple { display: block; width: 120px; height: 20px; margin: 18px auto 0; color: var(--sea); }

.site-header { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between; padding-block: 28px; }
.header-names { font: 22px/1.3 var(--serif); text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 15px; font-weight: 400; }
.site-header a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.hero { position: relative; text-align: center; }
.hero-heading { padding-top: 40px; }
h1 { margin-top: 12px; font-size: clamp(64px, 10vw, 132px); line-height: 0.95; letter-spacing: -0.02em; }
.hero-photo-stage { --hero-size: min(420px, calc(100vw - 96px)); position: relative; height: calc(var(--hero-size) * 0.715); margin-top: 40px; }
.hero-photo-frame { position: absolute; left: 50%; top: 0; width: var(--hero-size); aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 14px rgb(200 100 74 / 18%), 0 0 0 30px rgb(200 100 74 / 8%); }
.hero-photo { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9); }
.hero-sea { position: relative; z-index: 2; background: var(--sea); color: var(--paper); padding: 16px 24px 96px; }
.sea-ripple { display: block; width: 100%; height: 20px; }
.sea-ripple--short { width: 70%; margin: 6px auto 0; }
.hero-details { margin-top: 48px; padding-inline: 0; }
.wedding-date { display: block; font: clamp(28px, 3.5vw, 44px)/1.2 var(--serif); }
.hero-location { margin-top: 8px; color: var(--foam); }
.countdown { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.countdown-unit { min-width: 132px; padding: 14px 18px; border: 1px solid rgb(248 244 236 / 40%); border-radius: 999px; }
[data-countdown-unit] { font: 28px/1.4 var(--serif); font-variant-numeric: tabular-nums; }
.countdown-label { font-size: 14px; }
.hero-button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; margin-top: 32px; padding: 10px 30px; border-radius: 999px; background: var(--paper); color: var(--sea); text-decoration: none; font-size: 16px; font-weight: 500; }
.hero-button:hover { background: #e3edeb; color: var(--sea); }

.couple-section { max-width: 1108px; padding-block: 104px 96px; text-align: center; }
.couple-layout { display: grid; grid-template-columns: minmax(0, 240px) minmax(240px, 308px) minmax(0, 240px); justify-content: center; align-items: start; gap: 48px 72px; margin-top: 52px; }
.couple-layout--without-family { grid-template-columns: repeat(2, minmax(0, 240px)); }
.person { min-width: 0; }
.portrait { width: min(220px, 100%); margin-inline: auto; }
.portrait img { width: 100%; height: auto; aspect-ratio: 11 / 17; object-fit: cover; object-position: top; border-radius: 999px; }
.person figcaption { margin-top: 20px; }
.person h3 { font-size: 32px; line-height: 1.25; }
.person figcaption p { margin-top: 8px; color: var(--muted); }
.family-card { align-self: center; min-width: 0; padding: 28px 24px; border-radius: 28px; background: var(--paper); }
.family-pair + .family-pair { margin-top: 22px; }
.family-pair .eyebrow { font-size: 13px; letter-spacing: 0.2em; }
.family-pair p { margin-top: 6px; font-size: 18px; }
.family-pair--godparents p { font: 24px/1.25 var(--serif); }

.story-section { padding-block: 100px 104px; background: var(--paper); }
.story-heading { display: flex; flex-wrap: wrap; gap: 24px 64px; align-items: flex-end; }
.story-heading h2 { flex: 1 1 320px; min-width: 0; }
.story-copy { flex: 1 1 440px; min-width: 0; color: #31494a; font-size: 19px; }
.story-message p + p { margin-top: 16px; }
.story-signature, .story-video { margin-top: 18px; }
.story-signature { font-weight: 400; }
.story-section .invitation-story-gallery { max-width: none; margin-top: 52px; }
.story-section .invitation-story-gallery__grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px; align-items: start; }
.story-section .invitation-story-gallery__photo { aspect-ratio: 3 / 4; border-radius: 120px 120px 24px 24px; }
.story-section .invitation-story-gallery__photo:nth-child(even) { border-radius: 24px; margin-top: 40px; }
.story-section .invitation-story-gallery__photo:nth-child(3) { border-radius: 24px 24px 120px 120px; }

.events-section { padding-block: 104px 112px; background: var(--sea); color: var(--paper); }
.events-section h2 { text-align: center; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 48px 32px; margin-top: 56px; text-align: center; }
.event-card { min-width: 0; }
.event-photo-frame { width: 240px; height: 240px; max-width: 100%; margin-inline: auto; padding: 8px; border: 2px dashed rgb(248 244 236 / 55%); border-radius: 50%; }
.event-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.event-time { display: block; margin-top: 24px; font: 34px/1 var(--serif); }
.event-card h3 { margin-top: 8px; color: var(--foam); font: 500 15px/1.5 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; }
.event-date { margin-top: 8px; color: var(--foam); font-size: 14px; }
.event-location { max-width: 280px; margin: 12px auto 0; }
.event-address { max-width: 280px; margin-inline: auto; }
.event-description { max-width: 280px; margin: 12px auto 0; font-size: 15px; }
.event-card .invitation-navigation { gap: 10px; margin-top: 16px; }
.event-card .invitation-navigation a { padding: 8px 18px; border-color: rgb(248 244 236 / 60%); border-radius: 999px; color: var(--paper); font-size: 15px; }
.event-card .invitation-navigation a:hover { background: rgb(255 255 255 / 10%); }

.rsvp-section { padding-block: 96px; }
.rsvp-card { max-width: 744px; margin-inline: auto; padding: clamp(28px, 6vw, 52px); border-radius: 32px; background: var(--paper); box-shadow: 0 30px 60px -40px rgb(30 53 54 / 50%); }
.rsvp-card h2 { text-align: center; font-size: 50px; }
.rsvp-intro, .rsvp-deadline, .guest-greeting { max-width: 440px; margin: 14px auto 0; text-align: center; color: var(--muted); }
.attendance-field { display: flex; gap: 4px; margin: 30px 0 0; padding: 4px; border: 0; border-radius: 999px; background: #e3edeb; }
.attendance-field label { display: flex; flex: 1; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 46px; padding: 8px 12px; border-radius: 999px; font-size: 16px; font-weight: 400; text-align: center; cursor: pointer; }
.attendance-field label:has(input:checked) { background: var(--sea); color: var(--paper); }
.attendance-field input { flex-shrink: 0; margin: 0; accent-color: var(--paper); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field[hidden] { display: none; }
.form-field--full { grid-column: 1 / -1; }
.form-field > label { font-size: 14px; font-weight: 500; }
.form-field input, .form-field textarea { min-width: 0; max-width: 100%; width: 100%; padding: 12px 16px; border: 1px solid #c9d8d5; border-radius: 16px; background: #fff; color: var(--ink); font: 300 16px/1.6 var(--sans); }
.form-field input::placeholder, .form-field textarea::placeholder { color: #5e6c6b; opacity: 1; }
.form-field textarea { resize: vertical; }
.submit-button { width: 100%; margin-top: 26px; min-height: 54px; padding: 14px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 500; }
.submit-button:hover { background: #883f2d; }
.form-status { margin-top: 24px; padding: 16px; border: 1px solid var(--sea); border-radius: 16px; }
.form-status--error { border-color: var(--accent); }
.form-feedback { margin-top: 16px; font-size: 14px; }
.form-feedback:empty { display: none; }
.invitation-footer { padding-bottom: 80px; text-align: center; }
.invitation-footer .section-ripple { width: 160px; margin-top: 0; }
.footer-names { margin-top: 18px; font: 42px/1.1 var(--serif); }
.footer-date { margin-top: 6px; color: var(--muted); font-size: 15px; letter-spacing: 0.24em; }
.footer-note { margin-top: 16px; }
.wedday-credit { display: inline-block; margin-top: 16px; font-size: 12px; }

@media (max-width: 840px) {
  .site-header { justify-content: center; gap: 12px; padding-block: 20px; text-align: center; }
  .header-names { width: 100%; justify-content: center; }
  .site-header nav { justify-content: center; gap: 8px 24px; }
  .hero-heading { padding-top: 24px; }
  .hero-sea { padding-bottom: 64px; }
  .couple-section { padding-block: 64px 72px; }
  .couple-layout { grid-template-columns: repeat(2, minmax(0, 240px)); gap: 36px 28px; margin-top: 36px; }
  .family-card { grid-column: 1 / -1; grid-row: 2; justify-self: center; width: min(100%, 380px); }
  .person--groom { grid-column: 2; grid-row: 1; }
  .person h3 { font-size: 28px; }
  .story-section { padding-block: 64px 72px; }
  .story-copy { font-size: 18px; }
  .story-section .invitation-story-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-section .invitation-story-gallery__photo:nth-child(even) { margin-top: 24px; }
  .events-section { padding-block: 64px 72px; }
  .event-grid { margin-top: 40px; }
  .rsvp-section { padding-block: 64px 72px; }
  .rsvp-card h2 { font-size: 40px; }
}

@media (max-width: 620px) {
  .event-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .container { padding-inline: 20px; }
  .site-header nav { gap: 4px 18px; font-size: 14px; }
  h1 { font-size: 52px; }
  .hero-sea { padding-inline: 20px; }
  .hero-details { padding-inline: 0; margin-top: 32px; }
  .countdown { gap: 8px; }
  .countdown-unit { min-width: 0; padding: 10px 12px; }
  [data-countdown-unit] { font-size: 24px; }
  .countdown-label { font-size: 12px; }
  .couple-layout { column-gap: 20px; }
  .person h3 { font-size: 24px; }
  .person figcaption p { font-size: 15px; }
  .story-section .invitation-story-gallery__grid { gap: 12px; }
  .story-section .invitation-story-gallery__photo { border-radius: 80px 80px 16px 16px; }
  .story-section .invitation-story-gallery__photo:nth-child(even) { border-radius: 16px; }
  .story-section .invitation-story-gallery__photo:nth-child(3) { border-radius: 16px 16px 80px 80px; }
  .rsvp-card { padding: 28px 20px; border-radius: 24px; }
  .rsvp-card h2 { font-size: 34px; }
  .attendance-field label { gap: 6px; padding-inline: 8px; font-size: 14px; }
  .footer-names { font-size: 34px; }
}

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