/* 10 Nov layered-artwork revision (review candidate only). Loaded last.
   One idea carried through the page: ivory paper over a warm ground, with the venue's
   architecture in muted ochre ink behind the people and the words.
   - Cover: the envelope on a faint block-print lattice, the Fairmont drawing rising
     from the warm ground around (never behind) the date, and one ground colour from
     the cover's lower edge to the page canvas and the footer, so no band can show.
   - Couple fold: the venue-inspired arch (its own file) behind, the arched names, the
     couple cutout (its own file) in front. The two images are never flattened.
   - Calendar rosette, compact venue, fairy lights on the reply arch, guest icons,
     families typography, Shri Ganesh's lift on entering view.
   Every hidden or moving state is gated on html.motion-on (off under reduced motion),
   every automatic sequence ends within five seconds, nothing loops or flashes, and
   decorative layers are aria-hidden or pseudo-elements. Wording is unchanged. */

:root{
  --ground:#f3ead8;            /* the warm ground: cover's lower edge, page canvas, footer */
  --cover-label-space:clamp(22px,4.5svh,40px)
}

@media screen{
  /* ---------- One ground, edge to edge ---------- */
  /* The canvas behind everything (overscroll, toolbar areas, any gap) is the footer's
     ground, so nothing below the footer or the cover can read as a white patch. */
  html{background-color:var(--ground);color-scheme:light}
  body{margin:0;background-color:var(--ground)}
  /* Keep ivory paper inside the invitation, not on the browser-edge canvas. */
  #main{background-color:var(--ivory)}

  /* ---------- Cover ---------- */
  /* The cover is pinned to all four viewport edges (top:0;bottom:0) instead of a fixed
     100svh height: when a mobile toolbar retracts, the visible area grows past 100svh
     and a fixed-height cover left that strip uncovered. Safe-area insets are added
     outside the two equal label zones. */
  .envelope-summary{
    inset:0;height:auto;min-height:0;
    padding:env(safe-area-inset-top,0px) 20px env(safe-area-inset-bottom,0px);
    background-color:var(--ivory);
    background-image:
      linear-gradient(to bottom,transparent calc(100% - 32px),var(--ground) 100%),
      radial-gradient(ellipse 85% 70% at 50% 44%,rgba(255,253,247,0) 55%,rgba(238,222,190,.3)),
      linear-gradient(to bottom,rgba(243,234,216,0) 58%,var(--ground) 100%);
    isolation:isolate
  }
  .envelope-summary__inner{
    position:relative;z-index:1;box-sizing:border-box;
    display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;
    align-items:center;justify-items:center;
    width:100%;max-width:480px;height:100%;min-height:100%;margin:0 auto;padding:0
  }
  /* Both labels own the same padding above and below. */
  .envelope-label,.opening-date{padding-block:var(--cover-label-space);margin:0}
  /* The date now sits on the warm ground: a deeper ink keeps it at about 6:1 (it was 4.6:1). */
  .envelope-label,.opening-date{color:#66533b}
  .opening-stage{align-self:center}
  /* A faint block-print lattice (the card's own ogee-and-buti ground, in ochre line)
     gathered behind the envelope and fading out toward the edges. */
  .envelope-summary:before,.envelope-summary:after{content:'';position:absolute;z-index:0;pointer-events:none}
  .envelope-summary:before{
    inset:0;
    background:url('/assets/ornament/cover-jaali-v24.svg') 50% 47%/44px 66px repeat;
    opacity:.13;
    -webkit-mask-image:radial-gradient(ellipse min(70vw,440px) min(42vh,380px) at 50% 46%,#000 30%,rgba(0,0,0,.45) 62%,transparent 100%);
    mask-image:radial-gradient(ellipse min(70vw,440px) min(42vh,380px) at 50% 46%,#000 30%,rgba(0,0,0,.45) 62%,transparent 100%)
  }
  /* The existing Fairmont drawing rises from the warm ground behind the envelope's foot;
     a soft clearing keeps the centred date on plain paper. */
  .envelope-summary:after{
    --land-w:min(128vw,500px);
    left:50%;bottom:0;width:var(--land-w);aspect-ratio:1536/1024;transform:translateX(-50%);
    background:url('/assets/art/fairmont-ochre-v9.webp') 50% 100%/contain no-repeat;
    opacity:.24;
    -webkit-mask-image:linear-gradient(to top,#000 40%,transparent 92%),radial-gradient(ellipse 150px 40px at 50% calc(100% - var(--cover-label-space) - 9px - env(safe-area-inset-bottom,0px)),transparent 55%,#000 100%);
    -webkit-mask-composite:source-in;
    mask-image:linear-gradient(to top,#000 40%,transparent 92%),radial-gradient(ellipse 150px 40px at 50% calc(100% - var(--cover-label-space) - 9px - env(safe-area-inset-bottom,0px)),transparent 55%,#000 100%);
    mask-composite:intersect
  }
  @media (min-width:601px){.envelope-summary:after{--land-w:min(70vw,760px);opacity:.2}}
  .envelope-summary:before,.envelope-summary:after{transition:opacity .55s ease}
  body[data-opening]:not([data-opening=closed]) .envelope-summary:before,
  body[data-opening]:not([data-opening=closed]) .envelope-summary:after{opacity:0}
  @media (forced-colors:active){.envelope-summary:before,.envelope-summary:after{display:none}}

  /* ---------- Couple fold ---------- */
  #top{padding-top:28px}
  @media (min-width:601px){#top{padding-top:40px}}
  #top .hero-stage{
    --arch-w:min(118vw,520px);--arch-top:-22px;--title-w:min(94%,390px);--couple-w:min(100%,360px);
    position:relative;display:flex;flex-direction:column;align-items:center;width:100%
  }
  @media (min-width:601px){#top .hero-stage{--arch-w:min(92vw,720px);--arch-top:-24px;--title-w:min(100%,560px);--couple-w:min(100%,430px)}}
  /* The arch drawing: muted, behind the names and the couple. Its foot dissolves into the
     paper by the couple's feet (a mask over its own alpha fade), so the transparent opening
     never continues down the page as a pale column. The wrapper is the arch's exact size
     and spans the page, so a wider-than-phone drawing is trimmed at the screen edges and
     never scrolls. */
  #top .hero-arch{
    position:absolute;z-index:0;top:var(--arch-top);left:-24px;right:-24px;height:calc(var(--arch-w) * 1.5);
    overflow:hidden;pointer-events:none
  }
  #top .hero-arch img{
    position:absolute;left:50%;top:0;display:block;width:var(--arch-w);max-width:none;height:auto;
    transform:translateX(-50%);opacity:.30;
    -webkit-mask-image:linear-gradient(to bottom,#000 35%,rgba(0,0,0,.55) 55%,transparent 72%);
    mask-image:linear-gradient(to bottom,#000 35%,rgba(0,0,0,.55) 55%,transparent 72%)
  }
  /* The names, gently arched like the opening names. The real heading text stays in the
     h1 (read once; the drawn arc is aria-hidden); at the narrowest widths and 200% zoom
     the flat text shows instead and wraps. */
  #top .couple-title{
    position:relative;z-index:2;width:var(--title-w);max-width:100%;margin:calc(var(--arch-w) * .035) auto 0;
    line-height:1;font-size:clamp(40px,13.2vw,72px)
  }
  /* A soft paper halo clears the name line while the arch remains at the outer edges. */
  #top .couple-title:before{content:'';position:absolute;z-index:-1;inset:-12px -8px;background:radial-gradient(ellipse at center,var(--ivory) 36%,rgba(255,253,247,.94) 52%,rgba(255,253,247,0) 76%);pointer-events:none}
  #top .couple-title .couple-title__text{
    position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;white-space:nowrap;clip-path:inset(50%);
    font:inherit;color:inherit;vertical-align:baseline
  }
  #top .couple-title .couple-title__text>span{font-family:var(--display);font-style:italic;font-size:.5em;margin-inline:.14em;vertical-align:.12em;color:#9a6a2c}
  #top .couple-title__arc{display:block;width:100%;height:auto;overflow:visible}
  #top .couple-title__arc text{
    font-family:var(--names);font-size:96px;fill:#6c3f0e;
    stroke:rgba(255,251,240,.95);stroke-width:5px;stroke-linejoin:round;paint-order:stroke fill
  }
  #top .couple-title__amp{font-family:var(--display);font-style:italic;font-size:50px;fill:#9a6a2c}
  @media (forced-colors:active){#top .couple-title__arc text,#top .couple-title__amp{fill:CanvasText;stroke:Canvas}}
  /* The couple stands in the arch's opening, heads just under its crown. */
  #top .couple-illustration{
    position:relative;z-index:1;width:var(--couple-w);max-width:none;
    margin:clamp(18px,4vw,26px) auto clamp(14px,2.4svh,24px)
  }
  #top .couple-illustration:before,#top .couple-illustration:after{content:none;display:none}
  #top .couple-illustration img{display:block;width:100%;height:auto}
  /* Keep the original face pixels. The generated edit is visible ONLY at the joined hands.
     Complementary soft masks avoid a hard seam; the patch cannot reach either face. */
  #top .hand-correction-ready .couple-original{display:block;-webkit-mask-image:radial-gradient(ellipse 8% 8.6% at 46.42% 49.57%,transparent 78%,#000 100%);mask-image:radial-gradient(ellipse 8% 8.6% at 46.42% 49.57%,transparent 78%,#000 100%)}
  #top .couple-illustration .couple-hand-correction{display:none}
  #top .couple-illustration.hand-correction-ready .couple-hand-correction{display:block;position:absolute;inset:0;pointer-events:none;clip-path:inset(40.97% 45.58% 41.83% 38.42%);-webkit-mask-image:radial-gradient(ellipse 8% 8.6% at 46.42% 49.57%,#000 78%,transparent 100%);mask-image:radial-gradient(ellipse 8% 8.6% at 46.42% 49.57%,#000 78%,transparent 100%)}
  /* Narrowest widths and 200% zoom: flat, wrapping names; the arch sits behind the couple only. */
  @media (max-width:300px){
    #top .couple-title{width:auto}
    #top .couple-title .couple-title__text{position:static;width:auto;height:auto;margin:0;white-space:normal;overflow:visible;clip-path:none}
    #top .couple-title__arc{display:none}
    #top .hero-stage{--arch-top:calc(2.6 * clamp(40px,13.2vw,72px) - var(--arch-w) * .2)}
    #top .couple-illustration{margin-top:calc(var(--arch-w) * .16)}
  }
  /* Arrival: the arch emerges softly behind the names as they ink in. */
  html.motion-on body:is([data-opening=closed],[data-opening=top-bottom],[data-opening=left-right]) #top .hero-arch img{opacity:0;transform:translate(-50%,14px)}
  html.motion-on #top .hero-arch img{transition:opacity 1.6s var(--ease-out) .5s,transform 2s var(--ease-out) .5s}

  /* ---------- Save the date ---------- */
  /* An engraved lotus rosette rises behind the calendar like a sunrise (centred above the
     calendar's middle, so its rays show above and beside it on phones): line work only, no box. */
  #celebration .generated-calendar{position:relative;isolation:isolate}
  #celebration .generated-calendar:before{
    content:'';position:absolute;z-index:-1;left:50%;top:35%;
    width:min(128%,calc(100vw - 24px),450px);aspect-ratio:1;transform:translate(-50%,-60%);
    background:url('/assets/ornament/celebration-rosette-v24.svg') center/contain no-repeat;
    opacity:.17;pointer-events:none;
    -webkit-mask-image:radial-gradient(closest-side,#000 16%,rgba(0,0,0,.6) 42%,rgba(0,0,0,.14) 68%,transparent 92%);mask-image:radial-gradient(closest-side,#000 16%,rgba(0,0,0,.6) 42%,rgba(0,0,0,.14) 68%,transparent 92%)
  }
  #celebration .generated-calendar img{position:relative}
  html.motion-on.motion-ready #celebration .generated-calendar:before{transition:opacity 1.8s var(--ease-out) .25s,transform 2.4s var(--ease-out) .25s}
  html.motion-on.motion-ready #celebration .day__body:not(.is-visible) .generated-calendar:before{opacity:0;transform:translate(-50%,-54%) scale(.94) rotate(-6deg)}
  @media (forced-colors:active){#celebration .generated-calendar:before{display:none}}

  /* ---------- Venue ---------- */
  /* Compact: on phones and tablets the building comes straight after the name (pulled up),
     drawn wide and shallower, then the address and actions. Text keeps its size. */
  @media (max-width:879px){
    #venue{display:flex;flex-direction:column;padding-bottom:8px}
    #venue>.wrap,#venue .split{display:contents}
    #venue .split__head{order:1}
    #venue .venue__art--bleed{order:2;width:min(100%,520px);max-width:none;margin:14px auto 4px}
    #venue .split__body{order:3;margin-top:8px}
    #venue .venue__note{margin-top:8px}
    #venue .cta-row{margin-top:18px;flex-direction:row;justify-content:center;gap:10px}
    #venue .cta-row .button{flex:1 1 0;width:auto;min-width:0;max-width:240px;padding-inline:10px}
    #venue .text-link{margin-top:6px}
  }
  @media (max-width:339px){#venue .cta-row{flex-direction:column;align-items:center}#venue .cta-row .button{width:min(100%,320px);max-width:none}}
  @media (min-width:601px) and (max-width:879px){#venue .split__head,#venue .split__body{width:min(100%,560px);margin-inline:auto}}
  #venue .venue__art--bleed img{
    -webkit-mask-image:linear-gradient(to right,transparent 0,#000 6%,#000 94%,transparent 100%),linear-gradient(to bottom,#000 88%,transparent 100%);
    mask-image:linear-gradient(to right,transparent 0,#000 6%,#000 94%,transparent 100%),linear-gradient(to bottom,#000 88%,transparent 100%)
  }

  /* ---------- Reply card ---------- */
  #rsvp .rsvp__intro>p:last-child{font-size:15px;line-height:1.6}
  /* Fairy lights: a fine wire along the arch with nine dim warm bulbs. They glow up one by
     one when the card comes into view, then rest dim and steady (no loop). */
  #rsvp .rsvp-lights{
    position:absolute;z-index:1;left:0;top:calc(var(--card-w) * -24 / 600);
    width:100%;height:auto;overflow:visible;pointer-events:none
  }
  #rsvp .rsvp-lights__wire{stroke:rgba(214,178,115,.55);stroke-width:1.1px}
  #rsvp .rsvp-lights__bulbs circle{fill:#f7c672;filter:drop-shadow(0 0 5px rgba(255,200,120,.95)) drop-shadow(0 0 16px rgba(255,170,70,.55));opacity:.7}
  html.motion-on #rsvp .rsvp-lights__bulbs circle{opacity:.22}
  html.motion-on #rsvp .rsvp-lights.is-lit .rsvp-lights__bulbs circle{animation:fairy-glow 2.6s ease-in-out 1 both}
  html.motion-on #rsvp .rsvp-lights.has-lit:not(.is-lit) .rsvp-lights__bulbs circle{opacity:.7}
  #rsvp .rsvp-lights__bulbs circle:nth-child(1),#rsvp .rsvp-lights__bulbs circle:nth-child(9){animation-delay:0s}
  #rsvp .rsvp-lights__bulbs circle:nth-child(2),#rsvp .rsvp-lights__bulbs circle:nth-child(8){animation-delay:.3s}
  #rsvp .rsvp-lights__bulbs circle:nth-child(3),#rsvp .rsvp-lights__bulbs circle:nth-child(7){animation-delay:.6s}
  #rsvp .rsvp-lights__bulbs circle:nth-child(4),#rsvp .rsvp-lights__bulbs circle:nth-child(6){animation-delay:.9s}
  #rsvp .rsvp-lights__bulbs circle:nth-child(5){animation-delay:1.2s}
  @keyframes fairy-glow{0%{opacity:.22}40%{opacity:.95}70%{opacity:.55}100%{opacity:.7}}
  @media (forced-colors:active){#rsvp .rsvp-lights{display:none}}
  /* Guest icons beside the labels: decorative line drawings, the text is unchanged. */
  /* Inline icons, so a wrapped choice keeps its words together under the icon's line. */
  #rsvp .field__label[for=guestNames]:before,#rsvp .side-choice span:before{
    content:'';display:inline-block;width:20px;height:20px;margin-right:8px;vertical-align:-4px;
    background:url('/assets/ornament/icon-guests-v24.svg') center/contain no-repeat;opacity:.9
  }
  #rsvp .side-choice[for=side-bride] span:before{background-image:url('/assets/ornament/icon-bride-v24.svg')}
  #rsvp .side-choice[for=side-groom] span:before{background-image:url('/assets/ornament/icon-groom-v24.svg')}
  @media (forced-colors:active){#rsvp .field__label[for=guestNames]:before,#rsvp .side-choice span:before{display:none}}
  /* Preview only: the space below the button equals the card's side inset. The card's
     inner gilt rule sits W/60 inside both the sides and the foot, so equal padding gives
     equal visible margins around the button. Empty status lines take no room. */
  #rsvp .rsvp-form__status:empty,#rsvp .rsvp-form__detail:empty{display:none}
  #rsvp .rsvp__inner{--rsvp-side:clamp(22px,6vw,56px);padding-inline:var(--rsvp-side);padding-bottom:var(--rsvp-side)}
  /* The fields and button use the card's full inner width (the legacy 320px cap in
     refinement-v21.css left ~110px side gaps at 574px and 140px on wide screens). */
  #rsvp .rsvp-form{width:100%;max-width:none}
  @media (max-width:600px){#rsvp .rsvp__inner{--rsvp-side:clamp(18px,6vw,28px)}}
  @media (max-width:300px){#rsvp .rsvp__inner{--rsvp-side:12px}}

  /* ---------- Shri Ganesh ---------- */
  /* A gentle lift in a warm glow each time the image itself comes into view (after a
     cooldown), then rest. No rotation, no bounce, no loop; under 5s per entrance. */
  html.motion-on .prayer-lockup__ganesha.is-blessing{animation:ganesh-lift 3.4s cubic-bezier(.37,0,.25,1) 1 both}
  @keyframes ganesh-lift{
    0%{transform:none;filter:drop-shadow(0 0 4px rgba(236,176,86,.2))}
    38%{transform:translateY(-12px);filter:drop-shadow(0 6px 14px rgba(236,176,86,.6))}
    58%{transform:translateY(-12px);filter:drop-shadow(0 6px 16px rgba(236,176,86,.55))}
    100%{transform:none;filter:drop-shadow(0 0 4px rgba(236,176,86,.2))}
  }

  /* ---------- Families ---------- */
  .blessings .blessings__lead,.type-trial-fairmont .blessings .blessings__lead{
    font:500 11px/1.5 var(--body);letter-spacing:.28em;padding-left:.28em;text-transform:uppercase;color:var(--kicker-ink);margin:0 0 12px
  }
  .blessings__elders{margin:0 0 16px;font:600 clamp(21px,5.6vw,27px)/1.3 var(--display);letter-spacing:.005em;color:#5b3510;text-wrap:balance}
  .blessings__elders strong{font-weight:600}
  .blessings .amp,#blessings .amp{font-family:var(--display);font-style:italic;font-weight:400;color:#9a6a2c;font-size:1.06em;margin-inline:.06em}
  .blessings .blessings__text{
    font:500 11.5px/1.9 var(--body);letter-spacing:.16em;padding-left:.16em;text-transform:uppercase;font-style:normal;
    color:#5a4630;max-width:34em;margin:0 auto
  }
  /* One narrow card at every width; the frame is a nine-slice so its scooped corners keep
     their true size instead of stretching. */
  #blessings .families{
    display:grid;grid-template-columns:minmax(0,1fr);justify-items:center;
    width:min(440px,100%);box-sizing:border-box;margin:36px auto 0;padding:34px 30px 32px;gap:12px
  }
  #blessings .families:before{
    background:none;box-sizing:border-box;border:36px solid transparent;
    border-image:url('/assets/ornament/family-frame-v24.svg') 36 fill / 36px stretch
  }
  #blessings .families__one{padding:0}
  #blessings .families__parents strong{white-space:normal;font-weight:600}
  @media (max-width:600px){#blessings .families{margin-top:28px;padding:28px 22px 26px}}
  @media (max-width:300px){#blessings .families{padding-inline:10px}#blessings .families:before{border-width:24px;border-image-width:24px}}
  @media (forced-colors:active){#blessings .families:before{border-image:none;border:1px solid CanvasText}}

  /* ---------- Footer ---------- */
  /* Flush to the page's end on the same ground as the canvas, with a clear breath
     above it after the families card. */
  #blessings{padding-bottom:clamp(64px,9vw,96px)}
  .site-footer{margin:0;padding-top:26px;padding-bottom:calc(30px + env(safe-area-inset-bottom,0px));background-color:var(--ground);border-top:0}
}

@media print{
  #top .couple-illustration{position:relative}
  #top .hand-correction-ready .couple-original{display:block;-webkit-mask-image:radial-gradient(ellipse 8% 8.6% at 46.42% 49.57%,transparent 78%,#000 100%);mask-image:radial-gradient(ellipse 8% 8.6% at 46.42% 49.57%,transparent 78%,#000 100%)}
  #top .couple-illustration .couple-hand-correction{display:none}
  #top .couple-illustration.hand-correction-ready .couple-hand-correction{display:block;position:absolute;inset:0;width:100%;height:auto;clip-path:inset(40.97% 45.58% 41.83% 38.42%);-webkit-mask-image:radial-gradient(ellipse 8% 8.6% at 46.42% 49.57%,#000 78%,transparent 100%);mask-image:radial-gradient(ellipse 8% 8.6% at 46.42% 49.57%,#000 78%,transparent 100%)}
  .envelope-summary:before,.envelope-summary:after,#celebration .generated-calendar:before,#rsvp .rsvp-lights{display:none!important}
  #top .hero-arch img{opacity:.30!important;transform:translateX(-50%)!important}
}
