:root {
  color-scheme: light;
  --background: #f2e4d8;
  --sand: #e7d3c0;
  --paper: #faf3ec;
  --ink: #3b2a22;
  --muted: #6b5446;
  --accent: #a04e34;
  --serif: "DM Serif Display", Georgia, serif;
  --handwritten: "Caveat", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--ink); font: 400 16px/1.6 "DM Sans", system-ui, sans-serif; }
body::before { content: ""; position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0.045; 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; }
: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 { font-family: var(--serif); font-weight: 400; overflow-wrap: anywhere; }
h2 { font-size: clamp(40px, 4.7vw, 60px); line-height: 1; }
em { color: var(--accent); }
section { scroll-margin-top: 24px; }
.container { width: 100%; max-width: 1208px; margin-inline: auto; padding-inline: 24px; }
.handwritten { font-family: var(--handwritten); font-size: 28px; line-height: 1.2; color: var(--accent); }
.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; }

.site-header { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px 32px; align-items: center; padding-block: 28px; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 15px; font-weight: 500; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.monogram { font: 600 34px/1 var(--handwritten); color: var(--accent); text-decoration: none; }
.header-button, .clay-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 22px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none; text-align: center; font-size: 15px; font-weight: 500; line-height: 1.5; cursor: pointer; }
.header-button { justify-self: end; }
.header-button:hover, .clay-button:hover { background: #793c2a; color: var(--paper); }
.hero { padding-top: 32px; padding-bottom: 96px; text-align: center; }
.hero-eyebrow { font-size: 30px; }
h1 { margin-top: 4px; font-size: clamp(64px, 10vw, 128px); line-height: 0.95; letter-spacing: -0.02em; }
.hero-portrait { position: relative; isolation: isolate; width: min(440px, 70%); margin: 48px auto 0; }
.hero-portrait::before, .hero-portrait::after, .rsvp-decoration::before, .rsvp-decoration::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.hero-portrait::before { left: -22%; top: 18%; width: 70%; height: 70%; background: #d9c3a3; border-radius: 62% 38% 55% 45% / 48% 60% 40% 52%; }
.hero-portrait::after { right: -18%; bottom: -6%; width: 52%; height: 48%; background: #c9cba8; border-radius: 45% 55% 40% 60% / 60% 42% 58% 40%; }
.hero-photo { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 999px 999px 18px 18px; filter: saturate(0.9) sepia(0.06); }
.hero-note { position: absolute; right: -46%; top: 12%; width: 180px; text-align: left; line-height: 1.1; transform: rotate(-6deg); }
.hero-arrow { position: absolute; right: -30%; top: 26%; width: 110px; height: 72px; color: var(--accent); }
.wedding-date { margin-top: 44px; font: 400 28px/1.4 var(--serif); overflow-wrap: anywhere; }
.countdown { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px; }
.countdown-unit { padding: 10px 22px; border-radius: 999px; background: var(--sand); }
.countdown-unit span { font: 400 26px/1 var(--serif); }
.countdown-unit small { font-size: 14px; }

.section-wave { display: block; width: 100%; height: 40px; margin-bottom: -1px; fill: var(--sand); }
.section-wave--bottom { margin-top: -1px; margin-bottom: 0; transform: scaleY(-1); }
.couple-section { background: var(--sand); padding-block: 88px 104px; text-align: center; }
.couple-section .container { max-width: 1088px; }
.couple-portraits { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 40px 56px; margin-top: 56px; }
.person { flex: 0 1 260px; min-width: 0; }
.person--bride { order: 1; }
.person--groom { order: 3; }
.portrait img { width: 240px; height: auto; aspect-ratio: 3 / 4; margin-inline: auto; object-fit: cover; object-position: top; border-radius: 999px 999px 14px 14px; }
.person h3 { margin-top: 20px; font-size: 34px; line-height: 1.3; }
.person p { color: var(--muted); overflow-wrap: anywhere; }
.godparents { order: 2; flex: 0 1 240px; padding-block: 24px; }
.godparents h3 { margin-top: 6px; font-size: 30px; line-height: 1.15; }
.godparents .family-pair + .family-pair { margin-top: 24px; }
.parents { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 56px; }
.parents .family-pair { flex: 0 1 368px; min-width: 0; padding: 20px 24px; border-radius: 20px; background: var(--background); }
.parents h3 { font-size: 22px; line-height: 1.4; }
.parents p { margin-top: 2px; font-size: 14px; color: var(--muted); }

.story-section { padding-top: 104px; padding-bottom: 96px; }
.story-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 64px; }
.story-heading h2 { flex: 0 1 480px; }
.story-copy { flex: 0 1 520px; min-width: 0; color: #4e3a2f; font-size: 18px; overflow-wrap: anywhere; }
.story-message p + p, .story-copy > p { margin-top: 16px; }
.story-section .invitation-story-gallery { max-width: none; margin-top: 56px; }
.story-section .invitation-story-gallery__grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px; }
.story-section .invitation-story-gallery__photo { flex: 1 1 200px; min-width: 0; max-width: 420px; height: 380px; aspect-ratio: auto; border-radius: 999px 999px 14px 14px; }
.story-section .invitation-story-gallery__photo:nth-child(2) { height: 300px; }
.story-section .invitation-story-gallery__photo:nth-child(3) { height: 420px; }
.story-section .invitation-story-gallery__photo:nth-child(4) { height: 330px; }
.story-section .invitation-story-gallery__dialog { background: var(--ink); }

.events-section { padding-top: 40px; padding-bottom: 104px; text-align: center; }
.events-date { margin-top: 8px; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 24px; margin-top: 48px; }
.event-card { min-width: 0; max-width: 440px; width: 100%; justify-self: center; padding: 14px 14px 28px; border-radius: 220px 220px 24px 24px; background: var(--paper); }
.event-photo { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 999px 999px 14px 14px; }
.event-time { display: block; margin-top: 22px; font-size: 30px; line-height: 1; }
.event-card h3 { margin-top: 10px; font-size: 28px; line-height: 1.2; }
.event-card > p { margin: 8px 16px 0; color: var(--muted); overflow-wrap: anywhere; }
.event-card .event-date { font-size: 14px; }
.event-card .invitation-navigation { gap: 10px; margin-top: 16px; }
.event-card .invitation-navigation a { border-color: var(--muted); border-radius: 999px; font-size: 14px; font-weight: 500; }

.rsvp-section { padding-top: 40px; padding-bottom: 96px; overflow: clip; }
.rsvp-decoration { position: relative; isolation: isolate; max-width: 620px; margin-inline: auto; }
.rsvp-decoration::before { left: -12%; top: 30%; width: 40%; height: 46%; background: #c9cba8; border-radius: 45% 55% 40% 60% / 60% 42% 58% 40%; }
.rsvp-decoration::after { right: -10%; top: 8%; width: 34%; height: 30%; background: #d9c3a3; border-radius: 62% 38% 55% 45% / 48% 60% 40% 52%; }
.rsvp-card { padding: 120px 56px 48px; border-radius: 310px 310px 28px 28px; background: var(--paper); text-align: center; }
.rsvp-copy > .handwritten { font-size: 30px; }
.rsvp-copy h2 { margin-top: 2px; font-size: 52px; }
.rsvp-intro, .rsvp-deadline, .guest-greeting { max-width: 420px; margin: 16px auto 0; color: var(--muted); }
.rsvp-content { margin-top: 32px; }
.attendance-field { min-width: 0; margin: 0 0 24px; padding: 4px; border: 0; border-radius: 999px; background: var(--sand); }
.attendance-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.attendance-options label { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px; border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer; }
.attendance-options label:has(input:checked) { background: var(--ink); color: var(--paper); }
.attendance-options input { flex-shrink: 0; margin: 0; accent-color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; text-align: left; }
.form-field { min-width: 0; }
.form-field--full { grid-column: 1 / -1; }
.form-field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.form-field input, .form-field textarea { display: block; width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--sand); border-radius: 14px; background: #fffaf6; color: var(--ink); font-size: 16px; }
.form-field textarea { resize: vertical; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #75665b; opacity: 1; }
.form-field .field_with_errors { display: contents; }
.form-field[hidden] { display: none; }
.invitation-guest-count-help { color: var(--muted); }
.submit-button { width: 100%; margin-top: 24px; background: var(--accent); }
.form-feedback:not(:empty), .form-status { margin-top: 20px; padding: 12px; border: 1px solid var(--accent); border-radius: 12px; }
.form-status { margin: 0 0 24px; }
.form-status--error { color: #963324; }
.rsvp-content .invitation-rsvp-notice { margin-top: 0; }

.invitation-footer { padding: 12px 24px 64px; text-align: center; }
.footer-names { font: 400 44px/1.2 var(--serif); overflow-wrap: anywhere; }
.footer-date { margin-top: 8px; font-size: 26px; color: var(--muted); }
.footer-note { margin-top: 16px; color: var(--muted); }
.wedday-credit { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; font-size: 13px; }

@media (max-width: 1000px) {
  .site-header { gap: 16px; }
  .site-header nav { gap: 8px 16px; font-size: 13px; }
  .hero-note { right: -36%; width: 140px; font-size: 25px; }
  .hero-arrow { right: -25%; width: 90px; }
  .couple-portraits { gap: 32px; }
  .person { flex-basis: 220px; }
  .godparents { flex-basis: 180px; }
  .story-heading h2 { flex-basis: 300px; }
  .story-copy { flex-basis: 440px; }
  .story-section .invitation-story-gallery__photo { flex-basis: calc(50% - 20px); max-width: none; }
}

@media (max-width: 760px) {
  .container { padding-inline: 20px; }
  .site-header { grid-template-columns: 1fr auto; padding-top: 20px; padding-bottom: 20px; }
  .site-header nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 8px 24px; }
  .monogram { grid-column: 1; grid-row: 1; }
  .header-button { grid-column: 2; grid-row: 1; font-size: 13px; padding-inline: 18px; }
  .hero { padding-top: 20px; padding-bottom: 64px; }
  h1 { font-size: clamp(56px, 12vw, 90px); line-height: 1.02; }
  .hero-portrait { width: min(360px, 70%); margin-top: 36px; }
  .hero-note, .hero-arrow { display: none; }
  .wedding-date { margin-top: 36px; font-size: 23px; }
  .countdown { gap: 8px; }
  .countdown-unit { padding: 10px 16px; }
  .countdown-unit span { font-size: 24px; }
  .countdown-unit small { font-size: 12px; }
  .section-wave { height: 24px; }
  .couple-section { padding-top: 56px; padding-bottom: 64px; }
  .couple-portraits { gap: 36px 20px; margin-top: 36px; align-items: flex-start; }
  .person { flex: 1 1 calc(50% - 20px); max-width: 260px; }
  .person--groom { order: 2; }
  .person h3 { font-size: 28px; margin-top: 14px; }
  .person p { font-size: 14px; }
  .godparents { order: 3; flex-basis: 100%; padding: 0; }
  .godparents h3 { font-size: 28px; }
  .parents { margin-top: 32px; }
  .parents .family-pair { flex-basis: 100%; padding: 18px; }
  .story-section { padding-top: 64px; padding-bottom: 64px; }
  .story-heading { gap: 24px; }
  .story-heading h2, .story-copy { flex-basis: 100%; }
  .story-copy { font-size: 16px; }
  .story-section .invitation-story-gallery { margin-top: 32px; }
  .story-section .invitation-story-gallery__grid { gap: 16px; }
  .story-section .invitation-story-gallery__photo:nth-child(n) { flex-basis: calc(50% - 16px); height: auto; aspect-ratio: 3 / 4; }
  .story-section .invitation-story-gallery__photo:nth-child(even) { aspect-ratio: 3 / 3.4; }
  .events-section { padding-top: 24px; padding-bottom: 64px; }
  .event-grid { margin-top: 32px; gap: 32px; }
  .rsvp-section { padding-top: 24px; padding-bottom: 64px; }
  .rsvp-card { padding: 90px 24px 32px; border-top-left-radius: 260px; border-top-right-radius: 260px; }
  .rsvp-copy h2 { font-size: 38px; }
  .attendance-options label { gap: 6px; padding: 8px 4px; font-size: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-names { font-size: 36px; }
}

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