/* 11 Nov design correction (local review only). Loaded last.
   Builds on balanced-finish-11nov.css; opening-smooth-11nov.css is superseded by the
   paper renderer in opening-v17.js and stays unlinked. */

/* ---------- Paper opening ---------- */
/* While the paper renderer runs: the envelope's leaves and inside are painted on two
   canvases, and the real couple fold (#top) sits between them as the card. Its contents
   are shown finished (a printed card does not animate), the rest of the page waits. */
.paper-canvas{position:fixed;left:0;top:0;width:100vw;height:100%;pointer-events:none}
.paper-canvas--back{z-index:205}
.paper-canvas--front{z-index:215}
body.paper-active .envelope{visibility:hidden}
html.opening-ready body.paper-active #invitation-shell>main{visibility:visible;opacity:1;animation:none;transition:none}
body.paper-active #top{position:relative;z-index:210;background-color:var(--ivory);will-change:transform,clip-path}
body.paper-active #invitation-shell>main>:not(#top),body.paper-active #invitation-shell>.site-footer{opacity:0;transition:none}
html.motion-on body.paper-active #couple-names,
html.motion-on body.paper-active #top .invite-line,
html.motion-on.opening-ready body.paper-active #top .couple-illustration{opacity:1;clip-path:none;transform:none;transition:none}
html.motion-on body.paper-active #top .hero-arch img{opacity:var(--arch-opacity,.4);transform:translateX(-50%);transition:none}
html.motion-on body.paper-active #top:after,html.motion-on body.paper-active #top .hero__details:after{clip-path:inset(0 0 0 0);transition:none}
/* After the hand-off the rest of the page fades in beneath the finished card. */
#invitation-shell>main>section:not(#top),#invitation-shell>.site-footer{transition:opacity .6s ease}
@media print{.paper-canvas{display:none!important}}

@media screen{
  /* ---------- Couple fold ---------- */
  /* The names are the heading's own text on one level line (no tilted path), in the
     script face (preloaded) with the Bodoni ampersand, so they are crisp, zoom and wrap. */
  #top .couple-title{
    width:auto;max-width:100%;margin:4px auto 0;
    font:400 clamp(36px,12.4vw,86px)/1.1 var(--names);letter-spacing:.004em;text-align:center
  }
  #top .couple-title .couple-title__text{
    position:static;display:inline-block;width:auto;height:auto;margin:0;overflow:visible;white-space:normal;clip-path:none;
    text-wrap:balance
  }
  #couple-names .couple-title__text{color:#6c3f0e;-webkit-text-stroke:.014em rgba(108,63,14,.8);text-shadow:0 0 .14em var(--ivory),0 1px 0 rgba(255,251,240,.9)}
  #couple-names .couple-title__text>span{color:#9a6a2c;-webkit-text-stroke:0;font-size:.54em;margin-inline:.16em .1em;vertical-align:.14em}
  /* Names never flash in a fallback face: held invisible (space kept) until the script and
     display faces are ready, at most 1.6s. */
  html.opening-ready:not(.names-ready) :is(#couple-names,.opening-names){visibility:hidden}

  /* The approved couple (v19) is an ivory illustration with its own faint arch. Its outer edge
     is feathered so the image never reads as a rectangle on the page, and its top tucks under
     the names. The drawing itself is untouched: no scaling of the figures, no recolouring. */
  #top .hero-stage{--couple-w:min(100%,352px)}
  @media (min-width:601px){#top .hero-stage{--couple-w:min(100%,470px)}}
  #top .couple-illustration{margin-top:calc(var(--couple-w) * -.1)}
  #top .couple-illustration img{
    -webkit-mask-image:linear-gradient(to right,transparent,#000 3.5%,#000 96.5%,transparent),linear-gradient(to bottom,transparent,#000 8%,#000 95.5%,transparent);
    -webkit-mask-composite:source-in;
    mask-image:linear-gradient(to right,transparent,#000 3.5%,#000 96.5%,transparent),linear-gradient(to bottom,transparent,#000 8%,#000 95.5%,transparent);
    mask-composite:intersect
  }
  /* Backdrop elements a little more present, still quiet behind the couple and names. */
  #top .hero-stage{--arch-opacity:.52}
  #top .hero-arch img{opacity:var(--arch-opacity)}
  #top .hero-stage:after{opacity:.22}

  /* ---------- Save the date ---------- */
  #celebration .generated-calendar:before{opacity:.62;background-size:150px 150px}

  /* ---------- Venue ---------- */
  /* A smaller hotel drawing, so the address and note breathe. */
  #venue .venue__art--bleed{width:min(76%,360px);max-width:360px;margin-top:14px;margin-bottom:22px}
  @media (min-width:880px){
    #venue{grid-template-columns:minmax(0,420px) minmax(0,420px);column-gap:clamp(48px,6vw,88px)}
    #venue .venue__art--bleed{width:100%;max-width:420px;margin:0}
  }

  /* ---------- Reading rhythm and the reply form ---------- */
  body{line-height:1.46}
  #rsvp .rsvp-form textarea.field__input{min-height:48px;height:48px;max-height:144px;line-height:1.4;padding:11px 12px;font-size:16px;overflow-y:auto;resize:vertical}
}

@media screen{
  /* ---------- Opening arch composition (approved v20 sheet) ---------- */
  /* One untouched 1254 x 1254 image, shown twice from the same file and never stretched:
     its crown and upper vines (top 40%) open the page and frame the names and couple; its
     lower vines (bottom 27%) frame the invitation lines and close the invitation. The sheet's
     blank middle is never shown, so its paper never meets the page as a band; seams fade. */
  #top{--arch-a:100vw}
  @media (min-width:601px){#top{--arch-a:min(94vw,860px)}}
  #top .opening-arch{
    position:absolute;z-index:-1;left:50%;width:var(--arch-a);transform:translateX(-50%);pointer-events:none;
    background:url('/assets/art/opening-arch-ivory-v20.png') no-repeat;background-size:100% auto;
    background-image:image-set(url('/assets/art/opening-arch-ivory-v20.webp') type('image/webp'),url('/assets/art/opening-arch-ivory-v20.png') type('image/png'));
    /* The sheet's paper is a shade warmer than the page: a uniform lift takes it to white and
       multiply then lets it vanish into the page, so only the drawn ornament remains. */
    filter:brightness(1.06);mix-blend-mode:multiply
  }
  #top .opening-arch--top{
    top:0;height:calc(var(--arch-a) * .4);background-position:50% 0;
    -webkit-mask-image:linear-gradient(to bottom,#000 72%,transparent);mask-image:linear-gradient(to bottom,#000 72%,transparent)
  }
  #top .opening-arch--foot{
    bottom:calc(var(--divider-room,56px) * .2);height:calc(var(--arch-a) * .27);background-position:50% 100%;
    -webkit-mask-image:linear-gradient(to top,#000 70%,transparent);mask-image:linear-gradient(to top,#000 70%,transparent)
  }
  @media (min-width:601px){
    #top .opening-arch--top,#top .opening-arch--foot{
      -webkit-mask-image:linear-gradient(to right,transparent,#000 5%,#000 95%,transparent),linear-gradient(var(--arch-fade));
      -webkit-mask-composite:source-in;
      mask-image:linear-gradient(to right,transparent,#000 5%,#000 95%,transparent),linear-gradient(var(--arch-fade));
      mask-composite:intersect
    }
    #top .opening-arch--top{--arch-fade:to bottom,#000 72%,transparent}
    #top .opening-arch--foot{--arch-fade:to top,#000 70%,transparent}
  }
  /* The section is its own paper (isolated, on the page ivory), so the arch blends with it and
     sits behind every line of content without repositioning the divider. */
  #top{isolation:isolate;background-color:var(--ivory)}
  /* The names sit inside the crown, below where its scallops curve in (measured from the
     sheet: 85% of the width is clear at 22% down); the couple stands within the arch. */
  #top{padding-top:calc(var(--arch-a) * .2)}
  @media (min-width:601px){#top{padding-top:calc(var(--arch-a) * .148)}#top .couple-title{font-size:min(86px,calc(var(--arch-a) * .092))}}
  /* The earlier ceremonial-arch layer would stack a second arch behind the new composition. */
  #top .hero-arch{display:none}
  /* The faint Fairmont layer stopped at the edges of the ivory couple image and read as a
     column; the arch composition now carries the backdrop here (the cover keeps the hotel). */
  #top .hero-stage:after{content:none;display:none}
  @media (forced-colors:active){#top .opening-arch{display:none}}

  /* ---------- Ending motif ---------- */
  /* Family names end on clear ivory paper. The lower vines belong to a dedicated
     decorative band in the footer, never behind or immediately under the names. */
  #blessings{background-image:none;padding-bottom:clamp(64px,10vw,88px)}
  #blessings .closing-wishes{position:relative;padding-block:28px 22px}
  .site-footer{
    background-color:var(--ivory);background-image:linear-gradient(to bottom,var(--ivory) 0%,#fcf8ef 38%,#f7efdf 74%,var(--ground) 100%);
    padding-top:28px;padding-bottom:calc(42px + env(safe-area-inset-bottom,0px))
  }
  .site-footer .footer-motif{
    display:block;position:relative;width:min(100%,620px);height:calc(min(100vw - 40px,620px) * .27);margin:0 auto 28px;
    background:url('/assets/art/opening-arch-ivory-v20.png') 50% 100%/100% auto no-repeat;opacity:.72;pointer-events:none;
    background-image:image-set(url('/assets/art/opening-arch-ivory-v20.webp') type('image/webp'),url('/assets/art/opening-arch-ivory-v20.png') type('image/png'));
    filter:brightness(1.06);mix-blend-mode:multiply;
    -webkit-mask-image:linear-gradient(to top,#000 52%,transparent);mask-image:linear-gradient(to top,#000 52%,transparent)
  }
  @media (min-width:661px){
    .site-footer .footer-motif{
      -webkit-mask-image:linear-gradient(to right,transparent,#000 6%,#000 94%,transparent),linear-gradient(to top,#000 52%,transparent);-webkit-mask-composite:source-in;
      mask-image:linear-gradient(to right,transparent,#000 6%,#000 94%,transparent),linear-gradient(to top,#000 52%,transparent);mask-composite:intersect
    }
  }
  @media (forced-colors:active){.site-footer .footer-motif{display:none}}

  /* ---------- Calendar: a denser, visible engraved motif ---------- */
  /* Keep the engraved rosette distinct from the opening arch, with visible fine lines. */
  #celebration .generated-calendar:before{opacity:.62;background-size:150px 150px}
}
/* Late-arriving couple (slow network): a short fade instead of a pop. */
#top .couple-illustration img{transition:opacity .5s ease}
html.opening-ready #top .couple-illustration img:not([data-loaded]){opacity:0}
@media print{#top .couple-illustration img{opacity:1!important}#top .opening-arch,.site-footer .footer-motif{display:none!important}}

/* Reduced-motion / no-canvas preview card: the same opening arch as the page (the retired
   ceremonial-arch layer is no longer downloaded anywhere). */
.opening-home-preview__arch{
  background:url('/assets/art/opening-arch-ivory-v20.webp') 50% 0/100% auto no-repeat;opacity:1;
  filter:brightness(1.06);mix-blend-mode:multiply;
  -webkit-mask-image:linear-gradient(#000 30%,transparent 42%);mask-image:linear-gradient(#000 30%,transparent 42%)
}

/* Mobile follow-up: transparent architecture extends beyond the approved couple's
   paper edges. Its central area stays clear; the photo-based illustration is unchanged. */
@media screen{
 #top .hero-stage:after{content:'';display:block;position:absolute;z-index:0;left:50%;right:auto;top:18%;bottom:auto;width:min(calc(100% + 32px),620px);height:78%;transform:translateX(-50%);background:url('/assets/ornament/hall-backdrop-v21.svg') center/100% 100% no-repeat;opacity:.76;pointer-events:none;-webkit-mask-image:linear-gradient(transparent,#000 12%,#000 78%,transparent);mask-image:linear-gradient(transparent,#000 12%,#000 78%,transparent)}
 #top{overflow:clip}
}
@media(forced-colors:active){#top .hero-stage:after{display:none}}

/* Completing the envelope is also a final visibility guarantee. Observers or an
   async decode callback must never leave the loaded portrait invisible. */
html.opening-ready body[data-opening=complete] #top .couple-illustration{opacity:1;transform:none;clip-path:none}
html.opening-ready body[data-opening=complete] #top .couple-illustration img{opacity:1}
@media(prefers-reduced-motion:reduce){#top .couple-illustration img{transition:none}}
