/* A Thousand Wishes: a faint sky of real clouds (clouds.jpg) stays still behind everything, and on it each
   section is its own sheet of washi photographed by Gemini: the paper itself (sheet.jpg, tiled at its own
   size so its flecks never stretch), the close-up's own creases cut out as they are (crease-a/b.webp,
   repeating along their length) and the light across the sheet's panels (fold-*.png, stretched to the
   section). Sections take four folds by turns (in half, in thirds, in quarters, in thirds across). A folded
   piece sits over each title, and the boat, house, tree and tulips float over the page in the gaps between
   sheets as it scrolls (drift.js). Buttons and boxes are printed on the sheet, so its creases run through
   them. The RSVP and the wishes unfold as they come into view (fold.js; reduce motion leaves them still).
   Over the wishes hangs a string of paper cranes, one per wish. Colors and fonts come from vars.css. */

html{background:var(--paper)}
body{background:transparent; font-synthesis-weight:none}
body::before{content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:var(--paper) url(../art/clouds.jpg) center / cover no-repeat}
/* the header's paper sky melts into the clouds instead of ending in a line */
.hero.painted{background:transparent;
  -webkit-mask:linear-gradient(#000 72%, transparent); mask:linear-gradient(#000 72%, transparent)}
.hero.painted::after{display:none}
/* the paper title fills the sky's width (Aaron): nearly edge to edge on a phone, half the screen on a laptop */
.hero-title{width:min(90vw, 500px)}
@media (min-width:900px){.hero-title{width:min(46vw, 640px)}}

/* ---------- type: Gloock is one weight, set a touch smaller than the script themes ---------- */
.sec-title{font-size:clamp(36px, 10vw, 50px); line-height:1.04; letter-spacing:-.005em; text-wrap:balance}
.lede{color:var(--soft)}
.caps{letter-spacing:.18em}

/* ---------- the pleated paper band at the top and bottom of the page ---------- */
.stripes{height:22px; background-size:auto 22px}

/* ---------- sections: each one its own creased sheet ---------- */
/* A sheet is its layers, top first: the panels' light, the creases, the paper. A crease strip is 51px across
   (centered on its line: the position's px part is f x 51 - 25.5) and repeats along its length. */
section{position:relative; z-index:1; padding-block:24px 14px; margin-block:10px}
.card::before{display:none}
#invite, .card{background-color:var(--card);
  background-image:var(--sheet-fold), var(--creases), url(../art/sheet.jpg);
  background-size:100% 100%, var(--crease-size), 248px 819px;
  background-position:0 0, var(--crease-at), 0 0;
  background-repeat:no-repeat, var(--crease-repeat), repeat;
  --sheet-fold:url(../art/fold-half.png);
  --creases:url(../art/crease-b-h.webp); --crease-size:819px 51px; --crease-at:0 50%; --crease-repeat:repeat-x}
.card{padding:40px max(20px, 5vw) 34px; border-radius:0}
.col > section:nth-of-type(4n+2) > .card{--sheet-fold:url(../art/fold-thirds.png);
  --creases:url(../art/crease-a.webp), url(../art/crease-b.webp); --crease-size:51px 819px, 51px 819px;
  --crease-at:calc(33.7% - 8.3px) 0, calc(67.2% + 8.8px) 0; --crease-repeat:repeat-y, repeat-y}
#invite, .col > section:nth-of-type(4n+3) > .card{--sheet-fold:url(../art/fold-quarters.png);
  --creases:url(../art/crease-a.webp), url(../art/crease-b-h.webp); --crease-size:51px 819px, 819px 51px;
  --crease-at:50% 0, 0 50%; --crease-repeat:repeat-y, repeat-x}
.col > section:nth-of-type(4n) > .card{--sheet-fold:url(../art/fold-across.png);
  --creases:url(../art/crease-a-h.webp), url(../art/crease-b-h.webp); --crease-size:819px 51px, 819px 51px;
  --crease-at:0 calc(33.7% - 8.3px), 0 calc(67.2% + 8.8px); --crease-repeat:repeat-x, repeat-x}
/* the sheet floats: a wide soft shadow well below it and a close one hugging its edges */
section::before, section::after{content:""; position:absolute; inset:24px 0 14px; z-index:-1; pointer-events:none}
section::before{background:rgba(var(--shadow-rgb),.22); filter:blur(26px); transform:translateY(24px) scale(.95, .97)}
section::after{background:rgba(var(--shadow-rgb),.15); filter:blur(4px); transform:translateY(3px)}
/* an unfolding sheet keeps its shadow back until it's open, so no gray shows where it's still folded */
section::before, section::after{transition:opacity .6s .5s}
html.fold-ready :is(#rsvp, #wishes):not(.opened)::before, html.fold-ready :is(#rsvp, #wishes):not(.opened)::after{opacity:0}
/* the invitation is a sheet itself, its shadow its own */
#invite{margin-top:20px; padding:38px max(14px, 4vw) 34px;
  box-shadow:0 1px 4px rgba(var(--shadow-rgb),.14), 0 26px 44px -18px rgba(var(--shadow-rgb),.32)}
#invite::before, #invite::after{display:none}

/* a small folded piece over each title */
.sec-title::before{content:""; display:none; width:68px; height:68px; margin:0 auto 10px; background:var(--fold) no-repeat center / contain;
  filter:drop-shadow(0 6px 5px rgba(var(--shadow-rgb),.18))}
#details{--fold:url(../art/envelope.webp)}
#rsvp{--fold:url(../art/heart.webp)}
#poll{--fold:url(../art/pinwheel.webp)}
#pool{--fold:url(../art/fortune.webp)}
#suggest{--fold:url(../art/tag.webp)}
#registry{--fold:url(../art/gift.webp)}
#checkin{--fold:url(../art/envelope.webp)}
#raffle{--fold:url(../art/pinwheel.webp)}
#quiz{--fold:url(../art/heart.webp)}
#match{--fold:url(../art/onesie.webp)}
#photos{--fold:url(../art/crane-blue.webp)}
:is(#details, #rsvp, #poll, #pool, #suggest, #registry, #checkin, #raffle, #photos, #quiz, #match) .sec-title::before{display:block}
#pool .sec-title::before{width:80px; height:76px}
/* the fortune teller opens and shuts when a guess is saved (theme.js adds .told) */
@keyframes tell{0%, 100%{transform:scale(1, 1)} 20%, 60%{transform:scale(1.14, .78)} 40%, 80%{transform:scale(.86, 1.12)}}
#pool.told .sec-title::before{animation:tell .9s ease-in-out}

/* ---------- unfolding: the sheet opens down from its top fold as it comes into view. Drawn with a clip and a
   shadow that lifts, never a transform, so nothing on it changes size or place while it opens. ---------- */
@keyframes unfold{
  from{clip-path:inset(0 0 calc(100% - 26px) 0); filter:brightness(.9)}
  45%{clip-path:inset(0 0 52% 0); filter:brightness(.95)}
  to{clip-path:inset(0 0 -40px 0); filter:none}}
html.fold-ready :is(#rsvp, #wishes) > .card:not(.unfolded){clip-path:inset(0 0 calc(100% - 26px) 0)}
html.fold-ready :is(#rsvp, #wishes) > .card.unfolded{animation:unfold 1.1s cubic-bezier(.3, .6, .25, 1) both}

/* ---------- the countdown: a folded card inside the sheet ---------- */
.log{background:transparent; border-radius:0; border-color:rgba(var(--ink-rgb),.28)}
.log::before{border-color:rgba(var(--accent-rgb),.3)}
.count span{letter-spacing:.1em}

/* ---------- When & Where: two folded panels on a laptop ---------- */
.detail-grid h3{color:var(--accent)}
@media (min-width:900px){
  .col{max-width:700px}
  .detail-grid{grid-template-columns:1fr 1fr; gap:22px 34px}
  .detail-grid > .span{grid-column:auto}
}

/* ---------- the vote: two sheets to pick, the pressed one ringed in its team's paper. The tint stays light enough
   for its small labels to pass contrast; the ring and "Your vote" mark the pick. ---------- */
.pick{background:transparent; border-radius:0; border-color:rgba(var(--ink-rgb),.3)}
.pick.boy[aria-pressed=true]{background:rgba(var(--wash-rgb),.3); mix-blend-mode:multiply}
.pick.girl[aria-pressed=true]{background:rgba(var(--girl-soft-rgb),.3); mix-blend-mode:multiply}
.lane{border-bottom:1px dashed rgba(var(--ink-rgb),.3)}
:root{--racer-size:62px}

/* ---------- name ideas: each one a paper tag on a dashed line ---------- */
.name-list li{border-bottom-style:dashed}

/* ---------- wishes: Gemini's deckled white cards (card-1..4, their torn edges kept, the middle stretched to the
   wish), each held by a gold tack pushed through just under its top edge (its shadow falls on the card) ---------- */
.note{background:none; box-shadow:none; border-radius:0; border-style:solid; border-width:14px; padding:22px 14px 8px;
  border-image:var(--card-art, url(../art/card-1.webp)) 30 fill / 14px stretch;
  filter:drop-shadow(0 1px 1px rgba(var(--shadow-rgb),.12)) drop-shadow(0 10px 12px rgba(var(--shadow-rgb),.16))}
.note[data-v="1"], .note[data-v="5"]{--card-art:url(../art/card-2.webp)}
.note[data-v="2"]{--card-art:url(../art/card-3.webp)}
.note[data-v="3"]{--card-art:url(../art/card-4.webp)}
[data-note-attach="art"] .notes{--note-room:4px}
[data-note-attach="art"] .note{padding-top:28px}
[data-note-attach="art"] .note[data-v]{--attach-tilt:0deg}
[data-note-attach="art"] .note[data-v]::after{top:calc(5px - var(--note-attach-h) / 2)}
.note .by{font-size:24px}

/* ---------- the string of cranes over the wishes (theme.js hangs one crane per wish) ---------- */
.crane-string{position:relative; height:138px; margin:2px -6px 16px; pointer-events:none}
.crane-string::before{content:""; position:absolute; left:0; right:0; top:8px; height:44px;
  border-bottom:1.5px solid rgba(var(--ink-rgb),.4); border-radius:0 0 50% 50% / 0 0 100% 100%}
.crane-string .crane{position:absolute; top:0; width:var(--cw, 52px); transform:translateX(-50%); transform-origin:50% 0;
  animation:sway 6s ease-in-out infinite alternate; animation-delay:var(--delay, 0s)}
.crane-string .crane::before{content:""; display:block; width:1px; height:var(--drop, 30px); margin:0 auto; background:rgba(var(--ink-rgb),.4)}
.crane-string .crane img{display:block; width:100%; height:auto; filter:drop-shadow(0 5px 4px rgba(var(--shadow-rgb),.2))}
.crane-string .crane.gold{--cw:66px}
@keyframes sway{from{transform:translateX(-50%) rotate(-3deg)} to{transform:translateX(-50%) rotate(3deg)}}
/* a posted wish: a square of paper folds itself into a crane and flies up to the string */
.folding{position:fixed; z-index:30; width:64px; height:64px; pointer-events:none}
.folding .sheet{position:absolute; inset:0; background:var(--card) url(../art/sheet.jpg); background-size:124px 410px;
  box-shadow:0 6px 12px -4px rgba(var(--shadow-rgb),.35)}
.folding .sheet{background-blend-mode:multiply}
.folding .sheet[data-paper=pink], .folding .sheet[data-paper=waves]{background-color:var(--girl-soft)}
.folding .sheet[data-paper=blue]{background-color:var(--wash)}
.folding .sheet[data-paper=jade]{background-color:var(--leaf)}
.folding .sheet[data-paper=indigo]{background-color:var(--ink)}
.folding img{position:absolute; inset:0; width:100%; height:100%; object-fit:contain; opacity:0}
@media (prefers-reduced-motion: reduce){
  .crane-string .crane{animation:none}
  #pool.told .sec-title::before{animation:none}
}

/* ---------- buttons and boxes are printed on the sheet: its creases and fibers run through them ---------- */
.btn.solid{background:rgba(var(--ink-rgb),.9); mix-blend-mode:multiply}
.btn.solid:hover{background:rgba(var(--ink-deep-rgb),.92)}
.btn:not(.solid){background:transparent}
.btn:not(.solid):hover{background:rgba(var(--wash-rgb),.3); mix-blend-mode:multiply}
input[type=text], input[type=date], input[type=email], input[type=tel], select, textarea{background:rgba(var(--field-rgb),.4); mix-blend-mode:multiply}
.prompt[aria-pressed=true]{background:rgba(var(--wash-rgb),.35); mix-blend-mode:multiply}

/* ---------- small things ---------- */
.yourpart li a{border-style:dashed}
.yourpart li.done a{background:rgba(var(--wash-rgb),.45)}
.piece{filter:drop-shadow(0 8px 8px rgba(var(--shadow-rgb),.2))}

/* ---------- the reveal: a sheet of paper that unfolds, top fold first, to "Girl" or "Boy" ---------- */
@keyframes reveal-unfold{
  from{clip-path:inset(0 0 calc(100% - 18px) 0); transform:translateY(16px); filter:brightness(.88)}
  50%{clip-path:inset(0 0 48% 0); filter:brightness(.95)}
  to{clip-path:inset(-30px -30px -30px -30px); transform:none; filter:none}}
.reveal .in{padding:30px 34px 34px; background:var(--card) url(../art/sheet.jpg); background-size:248px 819px; border-radius:2px;
  box-shadow:0 2px 3px rgba(var(--shadow-rgb),.12), 0 30px 50px -24px rgba(var(--shadow-rgb),.5);
  animation:reveal-unfold 1.3s cubic-bezier(.3, .6, .25, 1) both}
@media (prefers-reduced-motion: reduce){ .reveal .in{animation:none} }

/* ---------- the pieces floating over the page, each in a gap between sheets at the screen's edge (drift.js) ---------- */
.drifters{position:absolute; inset:0; z-index:3; pointer-events:none; overflow:hidden}
.drifter{position:absolute; width:84px; height:auto; transform:translateY(-50%) rotate(var(--tilt, 0deg)); will-change:transform;
  filter:drop-shadow(0 3px 2px rgba(var(--shadow-rgb),.18)) drop-shadow(0 16px 14px rgba(var(--shadow-rgb),.22))}
.drifter.left{left:-30px}
.drifter.right{right:-30px}
.drifter.crane{width:66px}
@media (min-width:700px){
  .drifter{width:130px}
  .drifter.crane{width:96px}
  .drifter.left{left:calc(50% - 350px - 190px)}
  .drifter.right{right:calc(50% - 350px - 190px)}
}
@media (min-width:1200px){ .drifter{width:160px} .drifter.left{left:calc(50% - 350px - 250px)} .drifter.right{right:calc(50% - 350px - 250px)} }
