/* Invitation engine v11 styles: v10's, plus living artwork (data-wind, the drift) and the RSVP's test-mode note (at the end).
   v10 styles: v9's, plus the continuous letter.
   v9 styles: the same as v8's (v9's change, the drawn opening's start, is in core-v9.js).
   v8 styles: v7's, plus the seal shimmer while the film or the drawn opening's art finishes loading
   (.inv-wait), and the boot cover ([data-boot]) the page draws before anything else loads. */
/* ==========================================================
   Invitation engine v7 — the same styles as v6 (v7's change, outfit masks, is in core-v7.js).
   v6 — v5 plus scratch focus, tabs, copy and outfit styles for the standard structure.
   Each design sets these tokens on :root (or a section):
   --bg --ink --muted --accent --line --btn-bg --btn-fg
   --field-line --seg-on-bg --seg-on-fg --ctl-bg --ctl-fg --sheet-bg
   --font-display --font-body --font-label
   ========================================================== */
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;background:var(--page-bg,var(--bg))}
body{color:var(--ink);font-family:var(--font-body);font-size:19px;line-height:1.55;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-x:hidden;-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%}
html.locked,html.locked body{overflow:hidden;overscroll-behavior:none}
img,svg,canvas{max-width:100%}
[hidden]{display:none!important}
a{color:inherit}
button{font:inherit;color:inherit}
:focus-visible{outline:1.5px solid var(--accent);outline-offset:3px}

.inv-page{max-width:520px;margin:0 auto;position:relative;overflow:hidden;background:var(--bg)}
.inv-wrap{padding-left:max(26px,env(safe-area-inset-left,0px));padding-right:max(26px,env(safe-area-inset-right,0px));padding-block:76px}
.inv-center{text-align:center}
.inv-stage{position:fixed;inset:0;z-index:50;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:manipulation}
.inv-stage.done{pointer-events:none}

/* buttons */
.inv-btns{display:flex;flex-direction:column;gap:12px}
.inv-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:52px;padding:0 22px;border:0;border-radius:var(--btn-radius,1px);cursor:pointer;text-decoration:none;
  font-family:var(--font-label);font-weight:500;font-size:12px;letter-spacing:.24em;text-transform:uppercase;background:transparent;color:var(--ink);
  box-shadow:inset 0 0 0 1px var(--line);transition:background-color .35s cubic-bezier(.22,1,.36,1),box-shadow .35s,transform .3s cubic-bezier(.22,1,.36,1)}
.inv-btn:hover{box-shadow:inset 0 0 0 1px var(--ink)}
.inv-btn:active{transform:scale(.98)}
.inv-btn svg{width:15px;height:15px;flex:none}
.inv-btn--solid{background:var(--btn-bg);color:var(--btn-fg);box-shadow:none}
.inv-btn--solid:hover{box-shadow:none;filter:brightness(1.08)}

/* rsvp */
.inv-form{display:flex;flex-direction:column;gap:22px;margin-top:28px;text-align:left}
.inv-field{display:flex;flex-direction:column;gap:8px;border:0;margin:0;padding:0;min-width:0}
.inv-field label,.inv-field legend{padding:0;font-family:var(--font-label);font-weight:500;font-size:11px;letter-spacing:.24em;text-transform:uppercase;color:var(--muted)}
.inv-input{width:100%;min-height:48px;padding:10px 2px;border:0;border-radius:0;background:transparent;color:var(--ink);box-shadow:inset 0 -1px 0 var(--field-line);
  font-family:var(--font-body);font-size:20px;transition:box-shadow .3s}
.inv-input::placeholder{color:var(--muted);opacity:.7;font-style:italic}
.inv-input:focus{outline:none;box-shadow:inset 0 -2px 0 var(--accent)}
textarea.inv-input{min-height:84px;resize:vertical;line-height:1.4}
.inv-seg{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.inv-seg input{position:absolute;opacity:0;pointer-events:none}
.inv-seg label{display:flex;align-items:center;justify-content:center;min-height:54px;padding:6px 8px;text-align:center;cursor:pointer;border-radius:var(--btn-radius,1px);
  font-family:var(--font-body);font-style:italic;font-size:18px;letter-spacing:0;text-transform:none;color:var(--ink);
  box-shadow:inset 0 0 0 1px var(--line);transition:background-color .4s,color .4s,box-shadow .4s}
.inv-seg input:checked + label{background:var(--seg-on-bg);color:var(--seg-on-fg);box-shadow:inset 0 0 0 1px var(--seg-on-bg)}
.inv-seg input:focus-visible + label{outline:1.5px solid var(--accent);outline-offset:3px}
.inv-stepper{display:flex;align-items:center;gap:6px;width:max-content;box-shadow:inset 0 0 0 1px var(--line);border-radius:999px;padding:3px}
.inv-stepper button{width:44px;height:44px;border-radius:50%;border:0;background:transparent;font-size:22px;cursor:pointer;color:var(--accent)}
.inv-stepper button:active{background:var(--line)}
.inv-stepper output{min-width:34px;text-align:center;font-family:var(--font-display);font-size:24px;font-variant-numeric:tabular-nums lining-nums}
.inv-guests{transition:opacity .4s}
.inv-guests.off{opacity:.35;pointer-events:none}
.inv-err{margin:-10px 0 0;font-size:16px;font-style:italic;color:var(--err,#B0473B);min-height:1em}
.inv-thanks{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;margin-top:26px}
.inv-thanks svg{width:80px;height:80px;color:var(--accent)}
.inv-thanks circle,.inv-thanks path{fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1}
.inv-thanks.show circle{animation:inv-draw 1.1s cubic-bezier(.62,.04,.24,1) forwards}
.inv-thanks.show path{animation:inv-draw .7s cubic-bezier(.62,.04,.24,1) .8s forwards}
.inv-thanks h3{margin:4px 0 0;font-family:var(--font-display);font-weight:400;font-size:28px;line-height:1.2;text-wrap:balance}
.inv-thanks p{margin:0;color:var(--muted);max-width:30ch}
.inv-thanks .inv-btn{margin-top:12px}

/* floating music control */
.inv-music{position:fixed;z-index:40;right:calc(14px + env(safe-area-inset-right,0px));bottom:calc(14px + env(safe-area-inset-bottom,0px));width:48px;height:48px;border-radius:50%;border:0;cursor:pointer;
  display:grid;place-items:center;color:var(--ctl-fg);background:var(--ctl-bg);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
  box-shadow:0 0 0 1px var(--line),0 8px 20px -10px rgba(0,0,0,.45);
  opacity:0;transform:translateY(10px);pointer-events:none;transition:opacity .8s cubic-bezier(.22,1,.36,1) .6s,transform .8s cubic-bezier(.22,1,.36,1) .6s}
.ui-on .inv-music{opacity:1;transform:none;pointer-events:auto}
.inv-music svg{width:20px;height:20px}
.inv-music .w{transition:opacity .3s}.inv-music .x{opacity:0;transition:opacity .3s}
.inv-music.off .w{opacity:0}.inv-music.off .x{opacity:1}
.inv-music.on .w path{animation:inv-wave 1.6s ease-in-out infinite}
.inv-music.on .w path + path{animation-delay:.25s}

/* calendar sheet */
.inv-sheet-bg{position:fixed;inset:0;z-index:70;background:rgba(20,15,10,.38);opacity:0;pointer-events:none;transition:opacity .45s}
.inv-sheet-bg.open{opacity:1;pointer-events:auto}
.inv-sheet{position:fixed;z-index:71;left:50%;bottom:0;width:min(100%,520px);transform:translate(-50%,105%);transition:transform .6s cubic-bezier(.22,1,.36,1);
  border-radius:18px 18px 0 0;background:var(--sheet-bg,var(--bg));color:var(--ink);box-shadow:0 -10px 40px rgba(0,0,0,.25);text-align:center;
  padding:12px max(22px,env(safe-area-inset-right,0px)) calc(24px + env(safe-area-inset-bottom,0px)) max(22px,env(safe-area-inset-left,0px))}
.inv-sheet::before{content:"";display:block;width:38px;height:4px;border-radius:2px;background:var(--line);margin:0 auto 18px}
.inv-sheet.open{transform:translate(-50%,0)}
.inv-sheet-t{margin:0 0 18px;font-family:var(--font-label);font-weight:500;font-size:12px;letter-spacing:.28em;text-transform:uppercase;color:var(--muted)}
.inv-sheet-n{margin:12px 0 0;font-size:16px;font-style:italic;color:var(--muted);min-height:1.4em;white-space:pre-line}

#inv-fx{position:fixed;inset:0;width:100%;height:100%;z-index:60;pointer-events:none;max-width:none}

/* scroll reveals */
html.js .rv{opacity:0;transform:translateY(20px);transition:opacity 1.1s cubic-bezier(.22,1,.36,1),transform 1.3s cubic-bezier(.22,1,.36,1),filter 1.1s;transition-delay:var(--d,0ms)}
html.js .rv.in{opacity:1;transform:none}
html.js .rv.rv-scale{transform:translateY(26px) scale(.96)}
html.js .rv.rv-scale.in{transform:none}
[data-par]{will-change:translate}

@keyframes inv-draw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
@keyframes inv-wave{0%,100%{opacity:1}50%{opacity:.3}}
@keyframes inv-fadeUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;animation-delay:0ms!important;transition-duration:.2s!important;transition-delay:0ms!important}
}

/* letter-by-letter text */
[data-type] .tw{display:inline-block;white-space:nowrap}
html.js [data-type] .tc{display:inline-block;opacity:0;filter:blur(4px);transform:translateY(.25em);transition:opacity .6s ease,filter .6s ease,transform .7s cubic-bezier(.22,1,.36,1)}
html.js [data-type].in .tc,html.js .live [data-type].t-in .tc{opacity:1;filter:none;transform:none}
/* photo slots */
[data-photo]{position:relative;overflow:hidden}
[data-photo] .photo-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .8s ease}
[data-photo].has-photo .photo-img{opacity:1}
[data-photo].has-photo > svg,[data-photo].has-photo > canvas:not([data-scratch]){visibility:hidden}
/* scratch foils */
canvas[data-scratch]{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:grab;transition:opacity .8s ease;max-width:none}
canvas[data-scratch].done{opacity:0;pointer-events:none}

/* envelope fades in once its artwork is decoded */
html.assets-wait [data-stage]{opacity:0}
html.assets-ready [data-stage]{animation:inv-stageIn .7s cubic-bezier(.22,1,.36,1) both}
/* v8: with a boot cover the envelope is already on screen: the stage appears at once and the cover fades off it */
html.inv-booted.assets-ready [data-stage]{animation:none}
[data-boot].inv-boot-out{opacity:0;transition:opacity .45s ease;pointer-events:none}
@keyframes inv-stageIn{from{opacity:0}to{opacity:1}}
[data-stage] canvas,[data-stage] img{backface-visibility:hidden;-webkit-backface-visibility:hidden}

/* ================= opening film =================
   .inv-filmbox is a 9:16 box that covers the phone exactly as the video does (centred, sides cropped on tall phones),
   capped to the page column on wider screens. Anything placed inside it in percentages or cqw lines up with the film
   on every screen, which is what makes the hand-over invisible. */
:root{--inv-vw:min(100vw,520px);--inv-fw:max(var(--inv-vw),calc(100vh * 9 / 16));--inv-fh:max(100vh,calc(var(--inv-vw) * 16 / 9))}
@supports (height:1svh){:root{--inv-fw:max(var(--inv-vw),calc(100svh * 9 / 16));--inv-fh:max(100svh,calc(var(--inv-vw) * 16 / 9))}}
.inv-filmbox{position:absolute;left:50%;top:50%;width:var(--inv-fw);height:var(--inv-fh);margin-left:calc(var(--inv-fw) / -2);margin-top:calc(var(--inv-fh) / -2);container-type:inline-size}
.inv-vlayer{z-index:4;overflow:hidden;transition:opacity .7s ease}
.inv-vlayer.out{opacity:0}
.inv-vlayer > .inv-vposter,.inv-vlayer > video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;max-width:none}
.inv-vlayer > video{opacity:0;pointer-events:none}
.inv-vlayer > video.on{opacity:1}
/* v8: while the film finishes loading after the tap, a soft shimmer on the seal (INVITE.video.seal = [x%, y%] in the film box) */
.inv-ringbox{z-index:8;pointer-events:none}
.inv-vring{position:absolute;display:none;left:var(--inv-seal-x,50%);top:var(--inv-seal-y,50%);width:22cqw;height:22cqw;margin:-11cqw 0 0 -11cqw;
  border-radius:50%;pointer-events:none;background:radial-gradient(circle,rgba(255,253,248,.85) 0,rgba(255,246,236,.42) 32%,rgba(255,240,230,0) 68%);mix-blend-mode:screen}
.inv-stage.inv-wait .inv-vring{display:block;animation:inv-wait 1.1s ease-in-out infinite}
@keyframes inv-wait{0%,100%{opacity:.3;transform:scale(.82)}50%{opacity:1;transform:scale(1.12)}}
.inv-stage.has-film.done{opacity:0;transition:opacity .7s ease}
[data-stage].inv-stage.skipped{opacity:0;transition:opacity .7s ease}     /* outranks a design's own .inv-stage.done fade */
/* the entrance animation lets go of the stage at the first tap; if it still held the opacity, or let go in the same frame as
   the skip, the 0.7 s skip fade would never show */
html.assets-ready [data-stage].inv-tapped,html.assets-ready [data-stage].done,html.assets-ready [data-stage].skipped{animation:none}

/* ================= hand-over: lift and type =================
   The design sets how far [data-lift] rises, e.g. [data-handover].lifted [data-lift]{transform:translateY(-4cqw)} */
[data-handover] [data-lift]{transition:transform .8s cubic-bezier(.62,.02,.24,1),box-shadow .8s cubic-bezier(.62,.02,.24,1)}
html.inv-ho .inv-ch{opacity:0;transition:opacity .16s ease}
html.inv-ho .inv-ch.on{opacity:1}
html.inv-ho [data-wipe]{-webkit-mask-image:linear-gradient(90deg,#000 45%,transparent 55%);mask-image:linear-gradient(90deg,#000 45%,transparent 55%);
  -webkit-mask-size:260% 100%;mask-size:260% 100%;-webkit-mask-position:100% 0;mask-position:100% 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;padding:.32em .3em;margin:-.32em -.3em}
html.inv-ho [data-wipe].on{-webkit-mask-position:0 0;mask-position:0 0;transition:-webkit-mask-position var(--inv-dur) linear,mask-position var(--inv-dur) linear}
html.inv-ho [data-handover].typed [data-wipe]{-webkit-mask-image:none;mask-image:none}
html.inv-ho [data-after-type]{opacity:0;transition:opacity .8s ease}
html.inv-ho [data-handover].typed [data-after-type]{opacity:1}
[data-handover].instant [data-lift],[data-handover].instant .inv-ch,[data-handover].instant [data-wipe],[data-handover].instant [data-after-type]{transition:none!important}

/* ================= v5: per-event RSVP and calendar sheet ================= */
.inv-event legend{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:2px 12px;width:100%}
.inv-event .inv-ev-n{color:var(--ink)}
.inv-event .inv-ev-d{font-size:10px;letter-spacing:.18em;opacity:.8}
.inv-event.miss .inv-seg label{box-shadow:inset 0 0 0 1px var(--err,#B0473B)}
.inv-btn:disabled{opacity:.6;cursor:progress}
.inv-sheet{max-height:88vh;overflow:auto;overscroll-behavior:contain}
.inv-sheet:not(.open){visibility:hidden;transition:transform .6s cubic-bezier(.22,1,.36,1),visibility 0s .6s}
.inv-sheet-list{margin-top:18px}
.inv-sheet-s{margin:0 0 6px;font-family:var(--font-label);font-weight:500;font-size:10.5px;letter-spacing:.24em;text-transform:uppercase;color:var(--muted)}
.inv-sheet-ev{display:flex;align-items:center;gap:14px;padding:10px 0;border-top:1px solid var(--line);font-size:16px}
.inv-sheet-ev span{flex:1;min-width:0}
.inv-sheet-ev a{flex:none;color:var(--accent);font-family:var(--font-label);font-size:11px;letter-spacing:.18em;text-transform:uppercase;text-decoration:none;padding:8px 0}

/* ================= v6 ================= */
canvas[data-scratch]:focus-visible{outline:1.5px solid var(--accent);outline-offset:3px}
[role=tab]{cursor:pointer}
.inv-outfits{display:flex;justify-content:center;align-items:flex-end;gap:4%;flex-wrap:wrap}
.inv-outfit{position:relative;margin:0;flex:0 0 22%;aspect-ratio:2/3;isolation:isolate}
.inv-outfits.n1 .inv-outfit{flex-basis:40%}.inv-outfits.n2 .inv-outfit{flex-basis:36%}.inv-outfits.n3 .inv-outfit{flex-basis:28%}
.inv-outfit-fill{position:absolute;inset:0;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  -webkit-mask-position:center;mask-position:center;background-color:#ddd;transition:background-color 1.4s ease}
.inv-outfit-lines{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;mix-blend-mode:multiply;max-width:none}
[data-swatch]{cursor:pointer}


/* ===== v10: the continuous letter (CLAUDE.md: Continuous letter). A theme opts in with <html class="inv-letter">, sets
   --inv-paper-size (its paper tile's width) and --inv-paper-color (the paper's average, for the first paint), and gives the
   two images itself, because a url() inside a custom property resolves against this stylesheet, not the page:
     html.inv-letter,html.inv-letter body{background-image:url(assets/paper.webp)}   (a seamless tile)
     .inv-wash::before{background-image:url(assets/wash.webp)}
   Rules these enforce:
   1. One paper from top to bottom: every section is transparent, with no rectangle, band, border, shadow or torn edge.
   2. Darker moments are .inv-wash: the wash fades in and out of the paper over --inv-wash-fade (at least 120 px), never a band.
   3. Artwork is .inv-cutout, positioned to overlap section boundaries; data-par gives it a slow parallax.
   4. Photographs and paintings are .inv-vignette images (their own alpha dissolves into the paper), never boxed. */
html.inv-letter,html.inv-letter body{background-color:var(--inv-paper-color,#F3ECDF);background-position:0 0;background-size:var(--inv-paper-size,384px) auto;background-repeat:repeat}
html.inv-letter [data-page]{background:none}
html.inv-letter [data-page] > section,html.inv-letter [data-page] > footer{background:none !important;border:0 !important;box-shadow:none !important;
  border-image:none !important;clip-path:none !important;overflow:visible;position:relative}
html.inv-letter [data-page] > section:not(.inv-wash)::before,html.inv-letter [data-page] > section::after{background-image:none}
.inv-wash{position:relative;isolation:isolate;--inv-wash-fade:150px}
.inv-wash::before{content:"";position:absolute;left:0;right:0;top:calc(var(--inv-wash-fade) * -.6);bottom:calc(var(--inv-wash-fade) * -.6);z-index:-1;
  background-position:center;background-size:cover;background-repeat:no-repeat;opacity:var(--inv-wash-opacity,.8);pointer-events:none;
  -webkit-mask-image:linear-gradient(transparent,#000 var(--inv-wash-fade),#000 calc(100% - var(--inv-wash-fade)),transparent);
  mask-image:linear-gradient(transparent,#000 var(--inv-wash-fade),#000 calc(100% - var(--inv-wash-fade)),transparent)}
.inv-cutout{position:absolute;z-index:1;pointer-events:none;max-width:none;height:auto;-webkit-user-select:none;user-select:none}
.inv-vignette{display:block;max-width:100%;height:auto}

/* ===== v11: living artwork (CLAUDE.md, Standards for every theme) =====
   [data-wind]: layered art that sways like a breeze passes through it (built by the engine from INVITE.wind). Each piece
   swings about its own pivot with CSS rotate only, at its own speed; at rest (before .inv-alive, and with reduced motion)
   the layers rebuild the art exactly. */
.inv-wind{position:relative}
.inv-wind-base,.inv-wind-part{position:absolute;display:block;background-repeat:no-repeat}
.inv-wind-base{inset:0;background-size:100% 100%}
.inv-wind-part{animation:inv-sway var(--d,4s) ease-in-out var(--dl,0s) infinite alternate;animation-play-state:paused;will-change:rotate}
.inv-wind-dup{animation-name:inv-breathe}
html.inv-alive .inv-wind-part{animation-play-state:running}
@keyframes inv-sway{from{rotate:calc(var(--a,2deg) * -1)}to{rotate:var(--a,2deg)}}
@keyframes inv-breathe{from{rotate:calc(var(--a,.6deg) * -1);scale:.996}to{rotate:var(--a,.6deg);scale:1.004}}
/* INVITE.drift: petals falling slowly down the whole page, behind the words and buttons ([data-page] sits above it) */
.inv-drift{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden;opacity:0;transition:opacity 2.4s ease}
.inv-drift.on{opacity:1}
html.inv-letter [data-page]{position:relative;z-index:1}
.inv-drift-f{position:absolute;top:0;display:block;animation:inv-fall 22s linear infinite;will-change:transform}
.inv-drift-s{display:block;animation:inv-drift-sway 5s ease-in-out infinite alternate;will-change:transform}
.inv-drift-p{display:block;background-repeat:no-repeat}
.inv-drift-blur{filter:blur(1.6px)}
@keyframes inv-fall{from{transform:translate3d(0,-60px,0)}to{transform:translate3d(0,calc(100vh + 60px),0)}}
@keyframes inv-drift-sway{from{transform:translate3d(calc(var(--sx,20px) * -1),0,0) rotate(calc(var(--sr,30deg) * -1))}to{transform:translate3d(var(--sx,20px),0,0) rotate(var(--sr,30deg))}}
@media (prefers-reduced-motion: reduce){.inv-wind-part{animation:none}.inv-drift{display:none}}
/* v11: the RSVP says when it is in test mode */
.inv-testmode{margin:0 0 6px;padding:10px 12px;border-left:2px solid currentColor;font-size:15.5px;line-height:1.45;font-style:italic;text-align:left;color:var(--ink,#2C3B28)}
.inv-thanks.inv-test p{max-width:34ch}
