:root {
  color-scheme: dark;
  --background: #1c2520;
  --paper: #efe6d6;
  --accent: #d6b47a;
  --muted: #b9b19f;
  --line: rgba(239, 230, 214, 0.2);
  --serif: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--paper); font: 300 16px/1.6 "Work Sans", system-ui, sans-serif; }
body::before { content: ""; position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0.035; background-image: url("assets/grain.svg"); }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
: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: 300; overflow-wrap: anywhere; }
h2 { margin-top: 16px; font-size: clamp(36px, 4.4vw, 56px); line-height: 1.04; letter-spacing: -0.02em; }
em { font-weight: inherit; }
section { scroll-margin-top: 24px; }
.container { width: 100%; max-width: 1248px; margin-inline: auto; padding-inline: 24px; }
.section { padding-top: 120px; padding-bottom: 40px; }
.eyebrow { color: var(--accent); font-family: "Work Sans", system-ui, sans-serif; font-size: 12px; font-weight: 400; line-height: 1.6; letter-spacing: 0.22em; text-transform: uppercase; }
.skip-link { position: absolute; top: -100px; left: 20px; z-index: 10; padding: 12px; background: var(--paper); color: var(--background); }
.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; }

.hero { position: relative; min-height: 820px; display: flex; flex-direction: column; isolation: isolate; }
.hero-photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; filter: saturate(0.7) contrast(1.05) brightness(0.85); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(28, 37, 32, 0.55), rgba(28, 37, 32, 0.1) 35%, rgba(28, 37, 32, 0.2) 60%, var(--background)); }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px 40px; padding-block: 28px; }
.monogram { flex-shrink: 0; font: 300 22px var(--serif); letter-spacing: 0.04em; text-decoration: none; }
.monogram em, h1 em, .footer-names em { color: var(--accent); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 13px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.hero-content { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px 64px; margin-top: auto; padding-top: 160px; padding-bottom: 72px; }
h1 { min-width: 0; font-size: clamp(76px, 11vw, 164px); line-height: 0.9; letter-spacing: -0.04em; }
h1 > span { display: block; }
.hero-details { flex: 0 0 300px; padding-bottom: 12px; }
.wedding-date { display: block; }
.date-numbers { display: block; font: 300 72px/1 var(--serif); }
.date-numbers em { color: var(--accent); font-style: normal; }
.date-caption { display: block; margin-top: 10px; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; }
.gold-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 26px; border: 1px solid var(--accent); border-radius: 2px; background: var(--accent); color: var(--background); text-decoration: none; text-align: center; font-size: 13px; font-weight: 500; line-height: 1.6; letter-spacing: 0.18em; text-transform: uppercase; cursor: pointer; }
.gold-button:hover { color: var(--background); background: var(--paper); border-color: var(--paper); }
.hero-details .gold-button { margin-top: 24px; }

.countdown-section { padding-top: 24px; }
.countdown { display: grid; grid-template-columns: 1.05fr repeat(3, 1fr); border-block: 1px solid var(--line); }
.countdown-label { padding: 28px 20px 28px 0; color: var(--muted); }
.countdown-unit { padding: 20px 24px; border-left: 1px solid var(--line); }
.countdown-unit span { display: block; font: 300 56px/1 var(--serif); }
.countdown-unit small { display: block; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }

.couple-section { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.godparents { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.family-pair + .family-pair { margin-top: 20px; }
.family-pair .eyebrow { color: var(--muted); }
.godparents h3 { margin-top: 8px; font-size: 34px; font-style: italic; line-height: 1.15; }
.parents { display: flex; flex-wrap: wrap; gap: 24px 40px; margin-top: 32px; }
.parents .family-pair { min-width: 0; margin-top: 0; }
.parents h3 { font-size: 22px; line-height: 1.3; }
.parents .eyebrow { margin-top: 4px; font-size: 11px; }
.couple-portraits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.person:nth-child(2) { margin-top: 64px; }
.portrait { padding: 10px; border: 1px solid rgba(214, 180, 122, 0.5); }
.portrait img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; filter: saturate(0.75); }
.person figcaption { margin-top: 16px; }
.person h3 { font-size: 30px; font-style: italic; }
.person p { color: var(--muted); overflow-wrap: anywhere; }

.story-section > .eyebrow { margin-top: 0; }
.story-mosaic { margin-top: 28px; }
.story-mosaic--collage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; align-items: start; }
.story-copy { min-width: 0; max-width: 640px; }
.story-mosaic--collage .story-copy { grid-column: 2; grid-row: 1; padding: 8px 8px 8px 0; }
.story-message { font: 300 28px/1.35 var(--serif); overflow-wrap: anywhere; }
.story-message p + p { margin-top: 18px; }
.signature, .story-copy > p { margin-top: 18px; color: #cfc7b5; }
.story-mosaic .invitation-story-gallery, .story-mosaic .invitation-story-gallery__grid { display: contents; }
.story-mosaic .invitation-story-gallery__photo { border-radius: 0; }
.story-mosaic .invitation-story-gallery__photo img { filter: saturate(0.75) contrast(1.05); }
.story-mosaic .invitation-story-gallery__photo:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; height: 100%; min-height: 480px; aspect-ratio: auto; }
.story-mosaic .invitation-story-gallery__photo:nth-child(2) { grid-column: 3; grid-row: 1; }
.story-mosaic .invitation-story-gallery__photo:nth-child(3) { grid-column: 4; grid-row: 1; }
.story-mosaic .invitation-story-gallery__photo:nth-child(4) { grid-column: 2; grid-row: 2; }
.story-mosaic .invitation-story-gallery__photo:nth-child(5) { grid-column: 3; grid-row: 2; }
.story-mosaic .invitation-story-gallery__dialog { background: var(--background); color: var(--paper); }

.event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 28px; margin-top: 48px; }
.event-card { min-width: 0; }
.event-photo { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; filter: saturate(0.6) contrast(1.05) brightness(0.9); }
.event-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.event-heading h3 { font-size: 26px; font-weight: 400; line-height: 1.2; }
.event-time { flex-shrink: 0; font: 300 26px var(--serif); color: var(--accent); }
.event-card > p { margin-top: 12px; color: #cfc7b5; overflow-wrap: anywhere; }
.event-card .event-date { font-size: 13px; letter-spacing: 0.08em; }
.event-card .invitation-navigation { justify-content: flex-start; gap: 8px 24px; }
.event-card .invitation-navigation a { padding: 0; border: 0; border-radius: 0; font-size: 14px; font-weight: 400; text-decoration: underline; }

.rsvp-section { padding-top: 140px; padding-bottom: 100px; }
.rsvp-card { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr); gap: 48px 80px; padding: 56px 64px; border: 1px solid rgba(214, 180, 122, 0.3); background: radial-gradient(ellipse at center, rgba(239, 230, 214, 0.07), transparent 85%); }
.rsvp-copy h2 { font-size: clamp(36px, 4vw, 52px); }
.rsvp-copy > p:not(.eyebrow) { max-width: 340px; margin-top: 20px; color: #cfc7b5; }
.rsvp-content { min-width: 0; }
.attendance-field { min-width: 0; margin: 0 0 28px; padding: 0; border: 0; }
.attendance-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.attendance-options label { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px; border: 1px solid rgba(239, 230, 214, 0.35); text-align: center; font-size: 14px; font-weight: 400; cursor: pointer; }
.attendance-options label:has(input:checked) { background: var(--paper); color: var(--background); }
.attendance-options input { margin: 0; accent-color: var(--background); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
.form-field { min-width: 0; }
.form-field--full { grid-column: 1 / -1; }
.form-field label { display: block; font-size: 12px; font-weight: 400; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.form-field input, .form-field textarea { display: block; width: 100%; min-height: 44px; padding: 10px 0; border: 0; border-bottom: 1px solid rgba(239, 230, 214, 0.35); border-radius: 0; background: transparent; color: var(--paper); font-size: 17px; }
.form-field textarea { resize: vertical; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #aaa492; 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%; min-height: 52px; margin-top: 28px; }
.form-feedback:not(:empty), .form-status { margin-top: 20px; padding: 12px; border: 1px solid var(--accent); color: var(--paper); }
.form-status { margin: 0 0 24px; }
.form-status--error { border-color: #e4aaa3; }
.rsvp-content .invitation-rsvp-notice { margin-top: 0; }

.invitation-footer { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-bottom: 72px; }
.footer-names { font: 300 44px/1.2 var(--serif); overflow-wrap: anywhere; }
.footer-date { color: var(--muted); }
.footer-note { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.wedday-credit { display: inline-block; margin-top: 12px; min-height: 44px; }

@media (min-width: 1600px) {
  .hero { min-height: 900px; }
}

@media (max-width: 1000px) {
  .hero { min-height: 760px; }
  .hero-content { gap: 32px; }
  .hero-details { flex-basis: 250px; }
  .couple-section { gap: 36px; }
  .couple-portraits { gap: 16px; }
  .story-mosaic--collage { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .story-mosaic .invitation-story-gallery__photo:nth-child(3) { grid-column: 2; grid-row: 2; }
  .story-mosaic .invitation-story-gallery__photo:nth-child(4) { grid-column: 3; grid-row: 2; }
  .story-mosaic .invitation-story-gallery__photo:nth-child(5) { grid-column: 1; grid-row: 3; }
  .event-grid { gap: 28px 20px; }
  .event-heading { flex-wrap: wrap; gap: 8px; }
  .rsvp-card { padding: 40px 32px; gap: 36px; }
}

@media (max-width: 760px) {
  .container { padding-inline: 20px; }
  .section { padding-top: 76px; padding-bottom: 24px; }
  .site-header { align-items: flex-start; gap: 16px; padding-top: 18px; }
  .site-header nav { max-width: 310px; justify-content: flex-end; gap: 0 16px; font-size: 10px; letter-spacing: 0.1em; }
  .hero { min-height: 780px; min-height: max(740px, 95svh); }
  .hero-photo { object-position: 46% center; }
  .hero::after { background: linear-gradient(180deg, rgba(28, 37, 32, 0.55), rgba(28, 37, 32, 0.05) 24%, rgba(28, 37, 32, 0.5) 56%, var(--background)); }
  .hero-content { flex-direction: column; align-items: flex-start; gap: 32px; padding-top: 230px; padding-bottom: 36px; }
  h1 { width: 100%; font-size: clamp(66px, 15vw, 112px); }
  .hero-details { flex: auto; padding: 0; }
  .date-numbers { font-size: 52px; }
  .date-caption { font-size: 11px; }
  .countdown { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .countdown-label { grid-column: 1 / -1; padding: 18px 0; border-bottom: 1px solid var(--line); text-align: center; }
  .countdown-unit { padding: 18px; }
  .countdown-unit:nth-child(2) { border-left: 0; }
  .countdown-unit span { font-size: 44px; }
  .countdown-unit small { font-size: 10px; }
  .couple-section { grid-template-columns: 1fr; gap: 40px; }
  .couple-copy { max-width: 560px; }
  .godparents { margin-top: 32px; }
  .person:nth-child(2) { margin-top: 40px; }
  .portrait { padding: 6px; }
  .person h3 { font-size: 28px; }
  .person p { font-size: 14px; }
  .story-mosaic--collage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .story-mosaic--collage .story-copy { grid-column: 1 / -1; grid-row: 1; padding: 0 0 12px; }
  .story-message { font-size: 26px; }
  .story-mosaic .invitation-story-gallery__photo:nth-child(n) { grid-column: auto; grid-row: auto; }
  .story-mosaic .invitation-story-gallery__photo:nth-child(1) { grid-column: 1 / -1; min-height: 0; height: auto; aspect-ratio: 4 / 5; }
  .event-grid { grid-template-columns: 1fr; margin-top: 32px; gap: 40px; }
  .event-heading { flex-wrap: nowrap; }
  .rsvp-section { padding-bottom: 64px; }
  .rsvp-card { grid-template-columns: 1fr; gap: 32px; padding: 32px 24px; }
  .rsvp-copy > p:not(.eyebrow) { max-width: none; }
  .attendance-options { gap: 8px; }
  .attendance-options label { gap: 6px; padding: 10px 6px; font-size: 12px; }
  .form-grid { grid-template-columns: 1fr; gap: 24px; }
  .invitation-footer { padding-bottom: 40px; }
  .footer-names { font-size: 36px; }
}

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