/* Responsive refinements; desktop composition remains unchanged. */
*,*::before,*::after{box-sizing:border-box}
img,video,iframe{max-width:100%}
@media(max-width:820px){
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  @supports(overflow:clip){html,body{overflow-x:clip}}
  .section{padding-inline:max(20px,env(safe-area-inset-left)) max(20px,env(safe-area-inset-right));padding-block:72px}
  .section-head{margin-bottom:36px}
  .opening{min-height:100vh;min-height:100svh;max-height:none;padding:calc(42px + env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) calc(64px + env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left))}
  .opening-bottom{position:static;display:block;margin-top:28px;grid-column:1;align-self:end}
  .opening-inner{min-width:0}
  .opening-phrase{font-size:clamp(10px,2.5vw,12px)}
  .opening-monogram{font-size:clamp(76px,20vw,110px)}
  .opening-scripture blockquote{font-size:clamp(21px,5.5vw,27px)}
  .opening-enter{max-width:100%;min-width:min(235px,100%);min-height:48px}
  .home-photo img{object-position:center}
  .film-section .section-head{display:block}
  .next-chapter{padding:65px 0 0}
  .next-chapter h3{font-size:clamp(36px,8vw,60px)}
  .countdown{margin-top:44px}
  .wine-swatches{flex-wrap:wrap;gap:12px}
  .wine-swatches span{width:clamp(28px,7vw,42px)}
  .unified-venue{grid-template-columns:minmax(0,1fr);gap:28px}
  .unified-venue .venue-info{padding-top:0}
  .unified-venue .venue-info h2{font-size:clamp(36px,8vw,56px)}
  .unified-venue .ceremony-location{display:flex;flex-direction:column}
  .unified-venue .venue-directions-row{order:0;text-align:left}
  .unified-venue .venue-map-frame{order:1;max-width:100%}
  .unified-venue .venue-directions{margin:0 0 24px;min-height:48px}
  .unified-venue .venue-map-frame iframe{height:360px}
  .rsvp-cinematic-inner{display:block;min-width:0}
  .rsvp-intro h2>span,.rsvp-intro h2>em{display:inline}
  .rsvp-section .rsvp-intro h2{font-size:clamp(42px,9vw,64px);line-height:1.06}
  .rsvp-section .rsvp-content{margin-top:32px}
  .rsvp-section .rsvp-intro>p:not(.label){font-size:clamp(19px,4.8vw,23px);max-width:100%}
  .rsvp-section .form-pair{grid-template-columns:minmax(0,1fr)}
  #rsvpForm input:not([type=radio]),#rsvpForm select,#rsvpForm textarea{width:100%;max-width:100%;min-width:0;font-size:16px;min-height:48px}
  .rsvp-section .solid-button{width:100%;min-width:0;min-height:48px}
  .rsvp-section .choice-text{font-size:14px;letter-spacing:.02em;line-height:1.5}
  .rsvp-section .choice-surface{min-height:150px}
  #rsvp.rsvp-interacting .rsvp-cinematic-inner,#rsvp.rsvp-interacting .story-cue{opacity:1!important;transform:none!important;filter:none!important}
  .music-control{width:44px;height:44px;min-height:44px;padding:0;justify-content:center;right:max(12px,env(safe-area-inset-right));bottom:calc(12px + env(safe-area-inset-bottom))}
  #musicLabel{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  body.nav-open .music-control,body.keyboard-open .music-control,body.rsvp-in-view .music-control{visibility:hidden;pointer-events:none}
  .snap-share-inner{display:block;text-align:center}
  .snap-share-art{flex-direction:row;justify-content:center;gap:18px;margin-bottom:32px}
  .snap-share-rule{height:1px;width:70px}
  .social-links{justify-content:center}
  .final-section.dark{min-height:100vh;min-height:100svh;padding-top:76px;padding-bottom:0}
  .final-section footer{display:flex;flex-direction:column;gap:18px;text-align:center;padding:28px 0 calc(100px + env(safe-area-inset-bottom))}
  .final-section footer>.secret-trigger{order:0;align-self:center;min-width:44px;min-height:44px}
  .final-section footer>.footer-branding{order:1;width:100%;min-width:0;border:0;padding:0;display:flex;flex-direction:column;gap:10px}
  .final-section .footer-created{order:0;flex-basis:auto}
  .final-section .footer-logo{order:1;flex-basis:auto;width:70px;height:70px;margin:0}
  .final-section .footer-brand-name{order:2}
  .final-section footer>.label{order:2;align-self:center;min-height:44px}
  .final-section .altar{margin-bottom:38px}
  .reveal.cinematic-reveal,.rsvp-cinematic-inner.cinematic-reveal{filter:none}
}
@media(min-width:769px) and (max-width:900px){
  #menuToggle{display:none}
  #navigation{position:static;display:flex;visibility:visible;pointer-events:auto;opacity:1;transform:none;max-height:none;overflow:visible;padding:0;background:transparent;border:0;gap:clamp(8px,1.3vw,12px)}
  #navigation a{font-size:7px;letter-spacing:.08em;padding:7px 0}
  #siteHeader{gap:12px;padding-inline:20px}
}
@media(max-width:768px){
  #siteHeader{padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right))}
  #navigation{grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px;padding-inline:20px}
  #navigation a{min-height:44px;white-space:normal}
  .home-composition{grid-template-columns:minmax(0,1fr);gap:26px;margin-top:36px}
  .home-photo{grid-row:1;aspect-ratio:4/5}
  .home-date{padding:0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 16px}
  .home-date>.label,.home-date>p{grid-column:1;max-width:none;margin:0}
  .home-date .text-link{grid-column:2;grid-row:1/4;align-self:center;margin:0;width:auto}
  .home h1{font-size:clamp(44px,13.7vw,100px);gap:clamp(8px,2vw,16px)}
  .home-caption{gap:12px;flex-wrap:wrap}
  .home-foot{gap:16px;line-height:1.8}
  .home-foot span{min-width:0}
  .moments-heading{display:block}
  .moments-heading>p:not(.label){padding:0;margin-top:24px;font-size:21px}
  .editorial-gallery{display:block}
  .editorial-gallery .gallery-item{width:100%;margin:0 0 36px!important}
  .gallery-item .gallery-image{aspect-ratio:auto;min-height:0}
  .gallery-image img{position:relative;inset:auto;display:block;width:100%;height:auto;object-fit:cover;transform:none!important}
  .gallery-item .gallery-image:has(img:not([src])){aspect-ratio:4/3}
  .gallery-decoration{margin-block:12px 32px}
  .guest-notes,.faq-section,.gift-details{display:block}
  .family-note{margin-top:32px;padding-top:32px;border-top:1px solid var(--line)}
  .gift-account+.gift-account{margin-top:32px}
  .faq-list{margin-top:32px}
  .snap-share-section h2,.moments-heading h2,.dress-section h2,.final-section h2{font-size:clamp(36px,10vw,64px)}
  .foundation-section blockquote{font-size:clamp(26px,6.7vw,38px)}
  .section-head>p:not(.label),.guest-notes p:not(.label),.faq-answer p{font-size:clamp(18px,4.6vw,22px)}
  .secret-dialog{padding-inline:20px}
  .lightbox-close,.lightbox-prev,.lightbox-next{min-width:44px;min-height:44px}
}
@media(max-width:390px){
  .unified-venue .venue-map-frame iframe{height:320px}
  .countdown-numbers{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 0}
  .countdown-numbers>div:nth-child(2){border-right:0}
  .countdown-numbers>div:nth-child(3){border-right:1px solid var(--line)}
}
@media(max-width:359px){
  .section{padding-inline:max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right))}
  .opening{padding-inline:16px}
  .home-head>.label{font-size:7px}
  .home-caption .label{font-size:6px}
  .rsvp-section .attendance-choices{grid-template-columns:minmax(0,1fr)}
  .rsvp-section .choice-surface{min-height:130px}
}
@media(prefers-reduced-motion:reduce){.venue-directions,.opening-stage{transition:none}}
@media(max-width:820px){
  .story-cue{transform:translate3d(0,calc((1 - var(--cue-progress))*10px),0)}
  .home-head h1.story-couple{transform:translateY(calc((1 - var(--cue-progress))*12px)) scale(calc(.99 + var(--cue-progress)*.01))}
  .gallery-item[data-photo-motion] .media{clip-path:none}
  .cinematic-reveal.media img,.cinematic-reveal .media img{transform:none;transition:opacity .6s}
}
@media(max-width:820px){body.venue-controls-in-view .music-control{visibility:hidden;pointer-events:none}}

/* Final mobile edge cases: scrollable entry and notched-screen navigation. */
@media(max-width:820px){
  svg{max-width:100%}
  .opening{max-height:100vh;max-height:100svh;overflow-y:auto;overscroll-behavior-y:contain}
  .section h1,.section h2,.section h3{overflow-wrap:break-word}
  .countdown-numbers>div{text-align:center}
  .prenup-video-wrap,.venue-map-frame{width:100%;max-width:100%}
  .modal-close,#previousPhoto,#nextPhoto{min-width:44px;min-height:44px}
}
@media(max-width:768px){
  #siteHeader{padding-top:calc(10px + env(safe-area-inset-top))}
  #navigation{max-height:calc(100vh - 65px - env(safe-area-inset-top) - env(safe-area-inset-bottom));max-height:calc(100svh - 65px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding-bottom:calc(30px + env(safe-area-inset-bottom));overscroll-behavior:contain}
}
@media(max-width:820px) and (max-height:600px){
  .opening{align-items:start;padding-top:calc(24px + env(safe-area-inset-top));padding-bottom:calc(24px + env(safe-area-inset-bottom))}
  .opening-scripture{margin-block:24px}
}

/* The fixed page lock must not carry the open menu above the viewport. */
@media(max-width:768px){
  body.nav-open #siteHeader{position:fixed;top:0;left:0;right:0;width:100%}
}
