:root {
  --primary: #b96f54;
  --secondary: #f4e8df;
  --paper: #fbf7f3;
  --ink: #493b34;
  --accent: #d6a278;
  --heading: "Playfair Display", Georgia, serif;
  --body: "DM Sans", sans-serif;
  --radius: 18px;
  --space: clamp(5rem, 10vw, 9rem);
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
body { margin: 0; color: var(--ink); background: var(--paper); }
/* The cover is the only page shown until the guest opens the invitation. */
body:not(.invitation-open) { overflow: hidden; }
body:not(.invitation-open) main > :not(#portada),
body:not(.invitation-open) .music-controls { display: none; }
body.invitation-open #portada { display: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.loading { min-height: 100svh; display: grid; place-items: center; color: var(--primary); font: italic 1.2rem var(--heading); }

/* A printed invitation: quiet margins, a small seal, and one keepsake image. */
.cover {
  min-height: 100svh;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 4.8rem;
  text-align: center;
  background-color: var(--paper);
  background-image: radial-gradient(ellipse at 50% 40%, #fffefa 0, transparent 62%), repeating-linear-gradient(0deg, #7d593606 0 1px, transparent 1px 4px);
  background-position: center, center;
  background-size: auto, auto;
  background-repeat: no-repeat, repeat;
}
.cover::before, .cover::after { content: ""; position: absolute; z-index: -1; inset-inline: 0; height: clamp(145px, 24vh, 230px); background-position: center; background-repeat: no-repeat; background-size: cover; opacity: .42; pointer-events: none; }
.cover::before { top: 0; background-image: url('/assets/images/watermark-flower.png'); }
.cover::after { bottom: 0; background-image: url('/assets/images/watermark-leaves.png'); }
.cover-topline { position: absolute; inset: 1.7rem 2.2rem auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: #88796d; font-size: .58rem; letter-spacing: .16em; }
.cover-spark { color: var(--primary); font-size: 1rem; }
.cover-content { width: min(100%, 620px); animation: arrive .8s ease both; }
.eyebrow { display: block; color: var(--primary); font-size: .63rem; font-weight: 600; letter-spacing: .19em; line-height: 1.7; }
.cover-intro { display: block; margin-top: 1.25rem; color: #78695f; font: italic 1.05rem var(--heading); }
.cover h1 { margin: .25rem 0 -.3rem; color: var(--primary); font: 400 clamp(3.7rem, 10vw, 6.7rem)/1.05 "Parisienne", cursive; }
.cover-names { margin: .7rem 0 .2rem; color: var(--ink); font: italic clamp(1rem, 2.3vw, 1.3rem) var(--heading); }
.cover-couple { margin: .15rem 0 .45rem; color: #8a776b; font: italic .78rem var(--heading); }
.pass-count { margin: .45rem 0 0; color: #8a776b; font-size: .68rem; letter-spacing: .07em; }
.cover-date { display: inline-block; margin-top: .9rem; padding: .62rem 1.2rem; border-block: 1px solid color-mix(in srgb, var(--accent), transparent 30%); color: var(--primary); font-size: .67rem; letter-spacing: .2em; text-transform: uppercase; }
.cover-art { position: relative; isolation: isolate; overflow: hidden; width: min(74vw, 435px); height: clamp(210px, 30vh, 255px); margin: 1.35rem auto .1rem; filter: drop-shadow(0 14px 18px #543a261a); }
.cover-art::before { content: ""; position: absolute; z-index: -1; inset: 0; background: #e9e5dc; border: 1px solid #d5cfc4; box-shadow: inset 0 0 0 6px #ffffff70; transform: rotate(-1deg); }
.cover-art::after { display: none; }
.cover-image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; transform: scale(1.3); opacity: 1; mix-blend-mode: normal; }
.cover-monogram { display: none; }
.open-invitation { display: inline-flex; align-items: center; gap: .8rem; min-height: 48px; margin: 1.5rem auto 0; padding: .75rem 1.2rem; border: 1px solid #e7d9cc; border-radius: 99px; background: #fffdfa; color: var(--primary); box-shadow: 0 5px 16px #563a2614; font: italic .82rem var(--heading); cursor: pointer; transition: border-color .2s, transform .2s, box-shadow .2s; }
.open-invitation:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 9px 22px #563a2622; }
.open-invitation span { font: 1rem var(--body); }
.cover-caption { position: absolute; bottom: 1.3rem; color: #9a887a; font-size: .51rem; letter-spacing: .2em; }

.section { position: relative; isolation: isolate; width: min(100%, 1120px); margin-inline: auto; padding: var(--space) 1.5rem; }
.section::before, .section::after { content: ""; position: absolute; z-index: 0; inset-inline: 0; height: clamp(130px, 20vw, 205px); background-position: center; background-repeat: no-repeat; background-size: cover; opacity: .34; pointer-events: none; }
.section::before { top: 0; background-image: url('/assets/images/watermark-flower.png'); }
.section::after { bottom: 0; background-image: url('/assets/images/watermark-leaves.png'); }
.section > * { position: relative; z-index: 1; }
.reveal-on-scroll { opacity: 0; transition: opacity .9s ease; }
.reveal-on-scroll.is-visible { opacity: 1; }
.reveal-piece { opacity: 0; transition: opacity .75s ease; }
.reveal-piece.is-visible { opacity: 1; }
.section-heading { max-width: 570px; margin: 0 auto 2.8rem; text-align: center; }
.section-heading h2 { margin: .45rem 0 .65rem; color: var(--primary); font: 400 clamp(2.5rem, 6vw, 4.3rem)/1.08 var(--heading); }
.section-heading p { max-width: 440px; margin: .6rem auto 0; color: #77685e; font: 400 .93rem/1.8 var(--heading); }
.ornament { display: block; margin-top: 1rem; color: var(--accent); font-size: .9rem; }

/* Editorial couple portrait with the story set in the facing column. */
.intro { display: grid; grid-template-columns: minmax(0, .82fr) minmax(300px, 1.18fr); align-items: center; gap: 2rem 8%; padding-top: clamp(5rem, 10vw, 8rem); }
.intro-copy .section-heading { margin: 0; text-align: left; }
.intro-copy .section-heading p { margin-left: 0; }
.intro-copy .section-heading h2 { font-size: clamp(3rem, 6vw, 5rem); }
.portrait-frame { position: relative; width: min(100%, 490px); justify-self: center; padding: 0 0 0 0; }
.portrait-frame::before { position: absolute; inset: 1rem 0 0 1rem; border: 1px solid var(--accent); border-radius: 48% 48% 3px 3px; content: ""; opacity: .8; }
.portrait { position: relative; display: block; width: 100%; height: clamp(330px, 48vw, 570px); border-radius: 48% 48% 3px 3px; background: var(--secondary); object-fit: cover; }
.portrait-stamp { position: absolute; right: -.8rem; bottom: 1.3rem; display: grid; width: 76px; aspect-ratio: 1; place-content: center; border: 1px solid #f7e9d7; border-radius: 50%; background: var(--primary); color: white; box-shadow: 0 8px 20px #33221924; font: 1.35rem var(--heading); text-align: center; }
.portrait-stamp b { font-size: .6rem; }
.countdown-wrap { grid-column: 1 / -1; padding: 2.2rem 1rem; border-block: 1px solid color-mix(in srgb, var(--accent), transparent 55%); text-align: center; }
.countdown { display: flex; justify-content: center; gap: clamp(1.3rem, 6vw, 4.5rem); margin: 1rem auto; }
.countdown div { display: grid; min-width: 56px; gap: .35rem; }
.countdown strong { color: var(--primary); font: 500 clamp(2.2rem, 6vw, 3.8rem) var(--heading); font-variant-numeric: tabular-nums; }
.countdown span { color: #88796e; font-size: .56rem; letter-spacing: .16em; }
.countdown-note { margin: .7rem 0 0; color: #827168; font: italic 0.8rem var(--heading); }
.calendar-button { margin-top: 1rem; }
.countdown-past { color: var(--primary); font: italic 1.2rem var(--heading); }

/* Venue cards use a long photograph and concise event details. */
.events-section { max-width: 1040px; }
.event-grid { display: grid; gap: 1.25rem; }
.event-card { display: grid; grid-template-columns: minmax(220px, .85fr) 1fr; overflow: hidden; border: 1px solid #e7d9cc; border-radius: 4px; background: #fffdf9; box-shadow: 0 12px 34px #5837200b; }
.event-card:nth-child(even) { grid-template-columns: 1fr minmax(220px, .85fr); }
.event-card:nth-child(even) .event-photo { order: 2; }
.event-photo { display: block; width: 100%; height: 100%; min-height: 250px; background: var(--secondary); object-fit: cover; }
.event-content { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(1.5rem, 4vw, 3rem); }
.event-content h3 { margin: .45rem 0 .2rem; color: var(--primary); font: 400 clamp(1.8rem, 3.5vw, 2.7rem) var(--heading); }
.event-content p { margin: .35rem 0; color: #71655d; font-size: .82rem; line-height: 1.8; }
.event-content .event-time { color: var(--primary); font-size: .72rem; font-weight: 600; letter-spacing: .1em; }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: .7rem; padding: .75rem 1.35rem; border: 1px solid var(--primary); border-radius: 99px; background: var(--primary); color: #fff; font-size: .78rem; text-decoration: none; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.button:hover { transform: translateY(-2px); box-shadow: 0 8px 20px #44200f22; }
.button-small { min-height: 40px; margin-top: .8rem; padding: .55rem 1rem; font-size: .7rem; }

.itinerary-section { max-width: 920px; }
.timeline { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.timeline::before { position: absolute; top: 22px; right: 9%; left: 9%; border-top: 1px solid var(--accent); content: ""; transform: scaleX(0); transform-origin: left center; transition: transform 1.4s ease .25s; }
.itinerary-section.is-visible .timeline::before { transform: scaleX(1); }
.timeline-item { position: relative; padding: 0 .5rem; text-align: center; }
.timeline-dot { position: relative; z-index: 1; display: grid; width: 46px; aspect-ratio: 1; place-items: center; margin: 0 auto 1rem; border: 1px solid var(--accent); border-radius: 50%; background: var(--paper); color: var(--primary); font: 1rem var(--heading); }
.timeline-item time { color: var(--primary); font-size: .69rem; letter-spacing: .09em; }
.timeline-item h3 { margin: .5rem 0 .35rem; font: 1.15rem var(--heading); }
.timeline-item p { color: #7c7067; font-size: .76rem; line-height: 1.65; }
.timeline-item { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.itinerary-section.is-visible .timeline-item { opacity: 1; transform: translateY(0); }

.dress-section { padding-top: 3rem; }
.dress-card { max-width: 680px; margin: auto; padding: 2rem 1.3rem; border-block: 1px solid #e3d2c1; text-align: center; }
.dress-icon { color: var(--accent); font-size: 1.8rem; }
.dress-card h3 { margin: .45rem 0; color: var(--primary); font: 400 2rem var(--heading); }
.dress-card p { color: #776b63; font-size: .8rem; }
.dress-examples { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: center; gap: 1.25rem; margin: 1.5rem auto; }
.dress-examples figure { margin: 0; }
.dress-examples img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; border-radius: var(--radius); background: var(--secondary); }
.dress-examples figcaption { margin-top: .65rem; color: var(--primary); font: italic 1rem var(--heading); }
.notes-section { padding-top: 2rem; }
.note-card { max-width: 740px; margin: auto; padding: 2rem; border: 1px solid #ead9c9; text-align: center; }
.note-card .section-heading { margin-bottom: .5rem; }
.note-card .section-heading h2 { font-size: 2.5rem; }
.note-card ul { padding: 0; list-style: none; font-size: .84rem; line-height: 1.9; }
.note-card li + li { margin-top: .7rem; padding-top: .7rem; border-top: 1px solid #ead9c9; }

/* Staggered photo wall rather than a uniform thumbnail grid. */
.gallery-section { max-width: 1160px; }
.gallery-grid { display: grid; grid-template-columns: 1.18fr .82fr 1fr; align-items: stretch; gap: 1rem; }
.gallery-item { overflow: hidden; aspect-ratio: 4 / 5; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.gallery-item:nth-child(2) { aspect-ratio: auto; }
.gallery-item:nth-child(3n) { aspect-ratio: auto; }
.gallery-photo { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .55s cubic-bezier(.2,.65,.25,1); }
.gallery-item:hover .gallery-photo { transform: scale(1.045); }

.rsvp-section { max-width: none; padding-inline: 1.5rem; background: var(--secondary); text-align: center; }
.rsvp-section .section-heading { margin-bottom: 1.2rem; }
.guest-name { margin: 1.5rem 0; color: #716258; font: italic 1rem/1.8 var(--heading); }
.guest-name strong { color: var(--primary); }
.gift-grid { display: grid; max-width: 850px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: auto; }
.gift-card { padding: 1.5rem; border: 1px solid #ead9c9; background: #fffdf9; }
.gift-card h3 { margin: .5rem 0; color: var(--primary); font: 400 1.4rem var(--heading); }
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-top: 1px solid #eee4db; text-align: left; }
.copy-row span { display: grid; min-width: 0; gap: .2rem; }
.copy-row small { color: #887a70; font-size: .67rem; }
.copy-row strong { overflow-wrap: anywhere; font-size: .82rem; }
.copy-button { min-height: 38px; padding: .45rem .75rem; border: 1px solid var(--accent); border-radius: 99px; background: transparent; color: var(--primary); font-size: .7rem; cursor: pointer; }
.song-section { max-width: 790px; }
.song-form { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 1rem; }
.song-form label { display: grid; gap: .5rem; color: #73645a; font-size: .73rem; text-align: left; }
.song-form input { width: 100%; height: 48px; padding: 0 .8rem; border: 1px solid #ddcbbb; border-radius: 4px; background: #fffdf9; color: var(--ink); }
.song-form .button { grid-column: 1 / -1; justify-self: center; }

.footer { position: relative; isolation: isolate; overflow: hidden; padding: 4rem 1rem 3rem; background: #eee4da; text-align: center; }
.footer::before, .footer::after { content: ""; position: absolute; z-index: 0; inset-inline: 0; height: clamp(120px, 18vw, 190px); background-position: center; background-repeat: no-repeat; background-size: cover; opacity: .34; pointer-events: none; }
.footer::before { top: 0; background-image: url('/assets/images/watermark-flower.png'); }
.footer::after { bottom: 0; background-image: url('/assets/images/watermark-leaves.png'); }
.footer > * { position: relative; z-index: 1; }
.footer > p { max-width: 420px; margin: 1rem auto; color: #76685e; font: italic 1rem/1.7 var(--heading); }
.footer-names { margin: .8rem 0; color: var(--primary); font: 2.5rem "Parisienne", cursive; }
.footer-date { font-size: .68rem; letter-spacing: .12em; }
.footer-mark { display: block; margin-top: 1.5rem; color: var(--accent); }

.music-controls { position: fixed; z-index: 4; right: 1rem; bottom: 1rem; display: grid; justify-items: end; gap: .35rem; }
.music-toggle { display: flex; min-height: 44px; align-items: center; gap: .5rem; padding: .65rem .9rem; border: 1px solid var(--accent); border-radius: 99px; background: #fffdf2ed; color: var(--primary); box-shadow: 0 5px 20px #0002; cursor: pointer; }
.music-toggle span { font-size: .7rem; }
.music-credit { padding: .2rem .45rem; border-radius: 8px; background: #fffdf2df; color: #716258; font-size: .56rem; text-align: right; }
.music-credit a { color: inherit; }
.toast { position: fixed; z-index: 10; bottom: 1rem; left: 50%; max-width: 90vw; padding: .8rem 1.1rem; transform: translate(-50%, 150%); border-radius: 99px; background: #342e29; color: white; font-size: .8rem; transition: transform .25s; }
.toast.show { transform: translate(-50%, 0); }
.lightbox { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100vh; padding: 3rem 3.5rem; border: 0; background: #1d1917ee; color: white; }
.lightbox[open] { display: grid; grid-template: 1fr auto / 50px minmax(0, 1000px) 50px; place-items: center; gap: 1rem; }
.lightbox::backdrop { background: #1d1917ee; }
.lightbox img { grid-area: 1 / 2; max-width: 100%; max-height: 82vh; object-fit: contain; }
.lightbox-close, .lightbox-prev, .lightbox-next { width: 44px; height: 44px; border: 1px solid #ffffff80; border-radius: 50%; background: transparent; color: white; font-size: 1.5rem; cursor: pointer; }
.lightbox-close { position: absolute; top: 1.2rem; right: 1.2rem; }
.lightbox-prev { grid-area: 1 / 1; }
.lightbox-next { grid-area: 1 / 3; }
.lightbox-count { grid-area: 2 / 2; text-align: center; font-size: .8rem; }
.error-screen { max-width: 650px; min-height: 100vh; margin: auto; padding: 12vh 1.5rem; text-align: center; }
.error-screen h1 { color: var(--primary); font: 400 3rem var(--heading); }
.error-screen p { line-height: 1.8; }
.no-motion *, .no-motion *::before, .no-motion *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }

@keyframes arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) {
  .cover { min-height: 100svh; padding-top: 5rem; }
  .cover-topline { inset-inline: 1rem; font-size: .5rem; }
  .cover-art { width: min(82vw, 400px); height: clamp(200px, 30vh, 240px); }
  .intro { grid-template-columns: 1fr; gap: 2rem; padding-top: 5rem; }
  .intro-copy .section-heading { text-align: center; }
  .intro-copy .section-heading p { margin-inline: auto; }
  .portrait-frame { width: min(86%, 430px); }
  .portrait { height: clamp(340px, 105vw, 500px); }
  .countdown-wrap { grid-column: auto; }
  .event-card, .event-card:nth-child(even) { grid-template-columns: 1fr; }
  .event-card:nth-child(even) .event-photo { order: 0; }
  .event-photo { height: 220px; min-height: 0; }
  .event-content { align-items: center; padding: 1.5rem; text-align: center; }
  .timeline { max-width: 460px; grid-template-columns: 1fr; gap: 1.3rem; margin: auto; }
  .timeline::before { top: 14px; bottom: 14px; left: 22px; right: auto; border-top: 0; border-left: 1px solid var(--accent); transform: scaleY(0); transform-origin: top center; }
  .itinerary-section.is-visible .timeline::before { transform: scaleY(1); }
  .timeline-item { display: grid; grid-template-columns: 46px 1fr; column-gap: 1rem; padding: 0; text-align: left; }
  .timeline-dot { grid-row: 1 / 4; margin: 0; }
  .timeline-item time, .timeline-item h3, .timeline-item p { grid-column: 2; margin: .1rem 0; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .gallery-item, .gallery-item:nth-child(2), .gallery-item:nth-child(3n), .gallery-item:nth-child(4n + 1) { aspect-ratio: 1 / 1; }
  .song-form { grid-template-columns: 1fr; }
  .song-form .button { grid-column: auto; justify-self: stretch; }
  .lightbox { padding: 3.5rem .75rem; }
  .lightbox[open] { grid-template-columns: 38px minmax(0, 1fr) 38px; gap: .3rem; }
  .lightbox-prev, .lightbox-next { width: 36px; height: 36px; }
  .footer { padding-bottom: 5rem; }
}

@media (max-width: 380px) {
  .cover-topline { inset-inline: .7rem; letter-spacing: .1em; }
  .cover-date { padding-inline: .75rem; letter-spacing: .13em; }
  .countdown { gap: .5rem; }
  .countdown div { min-width: 50px; }
  .countdown strong { font-size: 1.9rem; }
  .gallery-grid { gap: .45rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal-on-scroll, .reveal-piece, .timeline-item { opacity: 1; transform: none; transition: none; }
}
