/*
 * Template "Polaroid Scrapbook" (Pernikahan): a handmade journal page.
 * Colors from the variant (x-inv.head): --inv-primary (ink, buttons), --inv-accent (washi tape),
 * --inv-background (the page paper), --inv-text, --inv-tape (second tape), --inv-note (sticky notes),
 * --inv-desk (the cover board and the desk around the page).
 * Tilts use the `rotate`/`translate` properties: the shared scroll reveal animates `transform`.
 */

:root {
    --inv-primary: #8a4b2f;
    --inv-accent: #e8a598;
    --inv-background: #f6efe2;
    --inv-text: #3b2f25;
    --inv-tape: #a9c7b5;
    --inv-note: #ffe7a3;
    --inv-desk: #b98f63;
    --inv-radius: 6px;

    --ps-col: min(100vw, 460px);
    --ps-hand: 'Caveat', 'Segoe Print', cursive;
    --ps-note-font: 'Patrick Hand', 'Segoe Print', cursive;
    --ps-type: 'Special Elite', 'Courier New', monospace;
    --ps-sans: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --ps-white: #fffdf8;
    --ps-soft: color-mix(in srgb, var(--inv-text) 66%, transparent);
    --ps-line: color-mix(in srgb, var(--inv-text) 16%, transparent);
    --ps-doodle: color-mix(in srgb, var(--inv-accent) 55%, var(--inv-primary));
    --ps-shadow: 0 1px 2px rgb(0 0 0 / .14), 0 10px 22px -10px rgb(0 0 0 / .38);
    --ps-sketchy: 255px 18px 225px 18px / 18px 225px 18px 255px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
p, h1, h2, h3, figure, blockquote, dl, dd, ol { margin: 0; }
a { color: inherit; }

body.ps-body {
    min-height: 100vh;
    color: var(--inv-text);
    font-family: var(--ps-sans);
    font-size: 15.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    /* the desk: kraft fibers made of two dot grids */
    background-color: var(--inv-desk);
    background-image:
        radial-gradient(rgb(255 255 255 / .1) 1px, transparent 1.6px),
        radial-gradient(rgb(0 0 0 / .07) 1px, transparent 1.6px);
    background-size: 7px 7px, 11px 11px;
    background-position: 0 0, 3px 5px;
}

.ps-preview {
    position: fixed; top: 0; left: 50%; z-index: 60; translate: -50% 0;
    padding: .3rem .9rem; border-radius: 0 0 10px 10px;
    background: var(--inv-note); color: #2a2a2a; font: .72rem/1.4 var(--ps-type);
    box-shadow: var(--ps-shadow);
}

/* ---------- shared bits: tape, polaroid, labels, doodles ---------- */
.ps-tape {
    position: absolute; z-index: 3; width: 5.6rem; height: 1.55rem; pointer-events: none;
    background:
        repeating-linear-gradient(-45deg, rgb(255 255 255 / .3) 0 5px, transparent 5px 11px),
        color-mix(in srgb, var(--inv-accent) 85%, transparent);
    /* jagged torn ends */
    clip-path: polygon(3% 0, 97% 0, 100% 18%, 96% 36%, 100% 54%, 96% 72%, 99% 100%, 2% 100%, 5% 80%, 0 62%, 4% 44%, 0 26%);
    opacity: .92;
}
.ps-tape--alt {
    background:
        radial-gradient(rgb(255 255 255 / .55) 1.4px, transparent 1.9px) 0 0 / 8px 8px,
        color-mix(in srgb, var(--inv-tape) 88%, transparent);
}
.ps-tape--top { top: -.8rem; left: 50%; translate: -50% 0; rotate: -3deg; }
.ps-tape--left { top: -.35rem; left: -1.5rem; rotate: -38deg; }
.ps-tape--right { top: -.35rem; right: -1.5rem; rotate: 38deg; }
.ps-tape--corner { top: -.55rem; right: -1.1rem; rotate: 32deg; width: 4.6rem; }

.ps-polaroid {
    position: relative; margin: 0; padding: .65rem .65rem 0;
    background: var(--ps-white); box-shadow: var(--ps-shadow);
}
.ps-polaroid__img {
    display: block; width: 100%; aspect-ratio: 1; object-fit: cover;
    background: color-mix(in srgb, var(--inv-primary) 14%, #ddd);
    filter: saturate(.94) contrast(1.03) sepia(.06);
}
.ps-polaroid__img--empty { display: grid; place-items: center; font: 700 4.5rem/1 var(--ps-hand); color: var(--inv-primary); filter: none; }
.ps-polaroid__caption { padding: .35rem .3rem .65rem; text-align: center; font: 700 1.75rem/1.1 var(--ps-hand); color: var(--inv-text); }
.ps-polaroid--mini { padding: .4rem .4rem 1.5rem; }

.ps-label {
    display: inline-block; padding: .28rem .8rem; background: var(--ps-white);
    font: .74rem/1.3 var(--ps-type); letter-spacing: .16em; text-transform: uppercase; color: var(--inv-text);
    box-shadow: 0 1px 2px rgb(0 0 0 / .15);
}
.ps-label--small { padding: 0; background: none; box-shadow: none; font-size: .68rem; color: var(--inv-primary); }

.ps-doodle { display: block; color: var(--ps-doodle); overflow: visible; }

.ps-sticky {
    position: relative; padding: .8rem .9rem .9rem; background: var(--inv-note); color: #2c2620;
    box-shadow: 0 1px 1px rgb(0 0 0 / .1), 0 12px 18px -12px rgb(0 0 0 / .45);
    /* the lifted bottom corner of a sticky note */
    border-bottom-right-radius: 14px 4px;
}
.ps-sticky__pin {
    position: absolute; top: -.6rem; left: 50%; translate: -50% 0; rotate: 4deg;
    width: 3.6rem; height: 1.2rem; background: rgb(255 255 255 / .55);
    clip-path: polygon(4% 0, 96% 0, 100% 50%, 96% 100%, 4% 100%, 0 50%);
}

/* torn bottom edge (clip-path; give the parent a drop-shadow filter) */
.ps-torn {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), 95% 100%, 90% calc(100% - 7px), 84% calc(100% - 1px), 77% calc(100% - 9px), 70% calc(100% - 2px), 63% calc(100% - 10px), 55% 100%, 48% calc(100% - 8px), 40% calc(100% - 1px), 33% calc(100% - 9px), 25% 100%, 18% calc(100% - 7px), 10% calc(100% - 1px), 4% calc(100% - 8px), 0 calc(100% - 2px));
}

/* ---------- cover: the scrapbook cover board ---------- */
.ps-cover {
    position: fixed; top: 0; bottom: 0; left: 50%; z-index: 30; width: var(--ps-col);
    transform: translateX(-50%); transform-origin: left center;
    overflow: hidden;
    background-color: var(--inv-desk);
    background-image:
        linear-gradient(to right, rgb(0 0 0 / .28) 0 1.1rem, rgb(255 255 255 / .18) 1.1rem 1.25rem, transparent 1.25rem),
        radial-gradient(rgb(255 255 255 / .12) 1px, transparent 1.6px),
        radial-gradient(rgb(0 0 0 / .08) 1px, transparent 1.6px);
    background-size: auto, 7px 7px, 11px 11px;
    background-position: 0 0, 0 0, 3px 5px;
    box-shadow: 0 0 60px rgb(0 0 0 / .35);
}
.ps-cover__board {
    position: absolute; inset: calc(.8rem + env(safe-area-inset-top)) .8rem calc(.8rem + env(safe-area-inset-bottom)) 1.85rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .85rem;
    padding: 1rem .7rem;
    border: 2px dashed rgb(255 255 255 / .6); border-radius: 10px;
}
.ps-cover__title { position: relative; z-index: 4; }
.ps-cover__title span {
    display: inline-block; padding: .35rem 1rem; rotate: -2deg;
    background: var(--inv-text); color: var(--ps-white);
    font: .8rem/1.3 var(--ps-type); letter-spacing: .24em; text-transform: uppercase;
    box-shadow: 0 2px 4px rgb(0 0 0 / .25);
}

.ps-cover__polaroid {
    --ps-pol: min(70vw, 300px, 40vh);
    position: relative; width: var(--ps-pol); padding: .7rem .7rem 0; rotate: -3deg;
    background: var(--ps-white); box-shadow: 0 2px 3px rgb(0 0 0 / .18), 0 22px 40px -16px rgb(0 0 0 / .55);
}
.ps-cover__photo {
    position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1.08;
    background: var(--ps-photo, linear-gradient(150deg, var(--inv-accent), var(--inv-primary))) center / cover no-repeat;
}
.ps-cover__initials { display: flex; gap: .25rem; font: 700 4.5rem/1 var(--ps-hand); color: var(--ps-white); }
.ps-cover__names {
    padding: .3rem .2rem .55rem; text-align: center;
    font: 700 clamp(1.6rem, min(6.4vh, 8.6vw), 2.5rem)/1.05 var(--ps-hand); color: var(--inv-text);
    /* long names wrap onto a second line instead of being cut off with "…" */
    text-wrap: balance; overflow-wrap: anywhere;
}
.ps-cover__names span { color: var(--inv-primary); }

/* rubber stamp with the monogram and the date */
.ps-stamp {
    display: grid; place-content: center; justify-items: center; gap: .1rem;
    width: 4.7rem; height: 4.7rem; border-radius: 50%;
    border: 2.5px solid currentColor; outline: 1.5px solid currentColor; outline-offset: -6px;
    background: rgb(255 253 248 / .82); color: var(--inv-primary);
    font-family: var(--ps-type); text-transform: uppercase;
}
.ps-stamp__letters { display: flex; align-items: baseline; gap: .15rem; font-size: 1.15rem; line-height: 1; }
.ps-stamp__letters i { font-style: normal; font-size: .75rem; }
.ps-stamp__date { font-size: .55rem; letter-spacing: .08em; }
.ps-cover__stamp { position: absolute; right: -1.3rem; bottom: 2.4rem; rotate: -14deg; }

.ps-cover__date {
    padding: .3rem .85rem; rotate: 1.2deg; background: var(--ps-white);
    font: .82rem/1.3 var(--ps-type); letter-spacing: .06em; box-shadow: 0 2px 4px rgb(0 0 0 / .2);
}
.ps-cover__quote {
    max-width: 92%; padding: .45rem .85rem; rotate: -1deg; text-align: center;
    background: rgb(255 253 248 / .9); font: 500 1.08rem/1.25 var(--ps-hand);
    box-shadow: 0 2px 4px rgb(0 0 0 / .15);
}
.ps-cover__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .9rem 1.1rem; margin-top: .15rem; }
.ps-cover__note { min-width: 9.6rem; max-width: 100%; padding-right: 1.6rem; rotate: -4deg; text-align: left; }
.ps-cover__to { font: 500 1.05rem/1 var(--ps-hand); color: #6b5b47; }
.ps-cover__guest { margin-top: .15rem; font: 1.2rem/1.2 var(--ps-note-font); overflow-wrap: break-word; }
.ps-cover__note-heart { position: absolute; right: .35rem; bottom: .3rem; width: 1.1rem; height: 1.1rem; color: #d0607a; }

.ps-open {
    gap: .5rem; padding: .8rem 1.35rem;
    border: 2px solid var(--inv-text) !important; border-radius: var(--ps-sketchy) !important;
    background: var(--inv-primary); color: #fff; font: 1.15rem/1 var(--ps-note-font);
    box-shadow: 3px 4px 0 var(--inv-text);
}
.ps-cover__star { position: absolute; top: 1.2rem; right: 1.1rem; width: 2rem; height: 2rem; rotate: 12deg; }
.ps-cover__sparkle { position: absolute; top: 3.2rem; left: 1rem; width: 1.3rem; height: 1.3rem; }
.ps-cover__flower { position: absolute; bottom: 1.2rem; left: .9rem; width: 2.2rem; height: 2.2rem; }
.ps-cover .ps-doodle { color: color-mix(in srgb, var(--inv-primary) 45%, #fff); }

/* opening the cover swings it open like a book */
.ps-cover--leave { transition: transform .8s cubic-bezier(.6, 0, .35, 1), opacity .8s ease; }
.ps-cover--gone { transform: translateX(-50%) perspective(1400px) rotateY(-95deg); opacity: 0; }

/* the photo "develops" like a fresh polaroid; the stamp lands after */
@keyframes ps-develop {
    from { filter: brightness(1.7) sepia(.7) blur(3px) contrast(.7); }
    to { filter: none; }
}
@keyframes ps-stamp { from { opacity: 0; scale: 1.8; } 60% { opacity: 1; scale: .94; } to { opacity: 1; scale: 1; } }
html.inv-anim .ps-cover__photo { animation: ps-develop 2.8s ease-out .4s both; }
html.inv-anim .ps-cover__stamp { animation: ps-stamp .5s cubic-bezier(.3, 1.5, .5, 1) 1.5s both; }

/* short phones: a slightly smaller polaroid keeps the button well inside the screen */
@media (max-height: 760px) {
    .ps-cover__board { gap: .7rem; }
    .ps-cover__polaroid { --ps-pol: min(66vw, 280px, 37svh); }
}
@media (max-height: 700px) {
    .ps-cover__board { gap: .55rem; }
    .ps-cover__polaroid { --ps-pol: min(64vw, 260px, 34vh); }
    .ps-cover__quote { font-size: .98rem; }
}
@media (max-height: 600px) {
    .ps-cover__quote { display: none; }
}

/* ---------- the page ---------- */
.ps-page {
    position: relative; width: var(--ps-col); min-height: 100vh; margin: 0 auto; overflow: hidden;
    background-color: var(--inv-background);
    background-image:
        radial-gradient(color-mix(in srgb, var(--inv-text) 11%, transparent) 1px, transparent 1.4px),
        radial-gradient(ellipse at 50% 0, rgb(255 255 255 / .55), transparent 60%);
    background-size: 22px 22px, 100% 900px;
    background-repeat: repeat, no-repeat;
    box-shadow: 0 0 0 1px rgb(0 0 0 / .05), 0 0 50px rgb(0 0 0 / .3);
}

.ps-masthead { padding: 2.6rem 1.25rem .5rem; text-align: center; }
.ps-masthead .ps-label { rotate: -2deg; background: color-mix(in srgb, var(--inv-tape) 60%, var(--ps-white)); }
.ps-masthead__names { margin-top: .5rem; font: 700 3.3rem/1 var(--ps-hand); color: var(--inv-primary); }
.ps-masthead__names span { color: var(--ps-doodle); }
.ps-masthead__line { width: 12rem; height: 1rem; margin: .2rem auto 0; }

.ps-main { padding-bottom: 1rem; }
.ps-sec { position: relative; padding: 2.4rem 1.3rem; }
.ps-sec + .ps-sec::before {
    content: ''; position: absolute; top: 0; left: 50%; width: 38%; translate: -50% 0;
    border-top: 2px dashed var(--ps-line);
}
.ps-sec__intro { margin: -.6rem auto 1.5rem; max-width: 22rem; text-align: center; font: 1.08rem/1.45 var(--ps-note-font); color: var(--ps-soft); }

.ps-heading { margin-bottom: 1.9rem; text-align: center; }
.ps-heading__label {
    display: inline-block; padding: .3rem .9rem; rotate: -2deg;
    background: color-mix(in srgb, var(--inv-accent) 55%, var(--ps-white));
    font: .7rem/1.3 var(--ps-type); letter-spacing: .2em; text-transform: uppercase;
    clip-path: polygon(2% 0, 98% 0, 100% 30%, 97% 60%, 100% 100%, 1% 100%, 3% 66%, 0 33%);
}
.ps-heading__title { margin-top: .45rem; font: 700 2.7rem/1 var(--ps-hand); color: var(--inv-primary); }
.ps-heading__doodle { width: 9rem; height: .95rem; margin: .3rem auto 0; }
.ps-heading__doodle.ps-doodle--heart, .ps-heading__doodle.ps-doodle--star { width: 1.8rem; height: 1.8rem; }
.ps-heading__doodle.ps-doodle--loop { width: 6rem; height: 1.8rem; }

/* ---------- opening: lined notebook paper ---------- */
.ps-notebook {
    position: relative; padding: 1.75rem 1.2rem 2.2rem 3.4rem; rotate: -1deg;
    background-color: #fffefa;
    background-image:
        linear-gradient(to right, transparent 2.65rem, rgb(218 92 92 / .5) 2.65rem 2.75rem, transparent 2.75rem),
        repeating-linear-gradient(to bottom, transparent 0 calc(1.75rem - 1px), rgb(80 125 200 / .25) calc(1.75rem - 1px) 1.75rem);
    background-position: 0 0, 0 1.1rem;
    box-shadow: var(--ps-shadow);
    color: #2f2a26; font: 1.14rem/1.75rem var(--ps-note-font);
}
/* punched holes */
.ps-notebook::before {
    content: ''; position: absolute; top: .9rem; bottom: .9rem; left: .75rem; width: 1rem;
    background: radial-gradient(circle, color-mix(in srgb, var(--inv-background) 80%, #000) 0 .36rem, transparent .4rem) 0 0 / 1rem 3.5rem repeat-y;
    opacity: .55;
}
.ps-arabic { margin-bottom: .6rem; text-align: center; font: 1.65rem/3.5rem 'Amiri', 'Traditional Arabic', serif; color: var(--inv-primary); }
.ps-notebook__greeting { font-weight: 700; color: var(--inv-primary); }
.ps-notebook__text { margin-top: 1.75rem; }
.ps-notebook__heart { position: absolute; right: 1rem; bottom: .6rem; width: 1.6rem; height: 1.6rem; rotate: 12deg; color: #d0607a; }

.ps-scrap { position: relative; width: 90%; margin: 2rem 0 0 auto; rotate: 1.6deg; filter: drop-shadow(0 6px 8px rgb(0 0 0 / .22)); }
.ps-scrap__paper {
    padding: 1.5rem 1.3rem 2.1rem;
    background: color-mix(in srgb, var(--inv-desk) 22%, var(--ps-white));
}
.ps-scrap blockquote { font: 500 1.42rem/1.25 var(--ps-hand); color: var(--inv-text); }
.ps-scrap__source { margin-top: .7rem; font: .76rem/1.3 var(--ps-type); letter-spacing: .1em; text-transform: uppercase; color: var(--inv-primary); }

/* ---------- couple: two polaroids with note cards ---------- */
.ps-person { position: relative; display: flex; flex-direction: column; }
.ps-person__polaroid { width: 74%; rotate: -4deg; }
.ps-person__card { position: relative; z-index: 2; width: 84%; margin: -.1rem 0 0 auto; rotate: 1.5deg; }
.ps-person--bride .ps-person__polaroid { margin-left: auto; rotate: 4deg; }
.ps-person--bride .ps-person__card { margin: -.1rem auto 0 0; rotate: -1.5deg; }
.ps-card {
    padding: 1rem 1.1rem 1.1rem; background: var(--ps-white);
    border-top: 4px solid color-mix(in srgb, var(--inv-primary) 70%, transparent);
    box-shadow: var(--ps-shadow);
}
.ps-person__name { margin-top: .2rem; font: 700 2.05rem/1.02 var(--ps-hand); color: var(--inv-primary); }
.ps-person__parents { margin-top: .55rem; font-size: .9rem; color: var(--ps-soft); }
.ps-person__parents strong { color: var(--inv-text); font-weight: 700; }
.ps-ig {
    display: inline-flex; align-items: center; gap: .35rem; margin-top: .75rem; padding: .35rem .8rem;
    border: 1.5px dashed var(--inv-primary); border-radius: 999px;
    font: .78rem/1.2 var(--ps-type); color: var(--inv-primary); text-decoration: none;
}
.ps-ig:hover { background: color-mix(in srgb, var(--inv-primary) 10%, transparent); }

.ps-couple__and { display: flex; align-items: center; justify-content: center; gap: .6rem; margin: 1.4rem 0 1.6rem; }
.ps-couple__and span { font: 700 3.6rem/1 var(--ps-hand); color: var(--inv-primary); }
.ps-couple__arrow { width: 3.4rem; height: 2rem; rotate: 20deg; }
.ps-couple__heart { width: 2rem; height: 2rem; rotate: 10deg; color: #d0607a; }

/* ---------- countdown: a calendar page and sticky notes ---------- */
.ps-calendar {
    position: relative; width: 12.5rem; margin: 0 auto 2rem; rotate: 2deg; overflow: hidden;
    background: var(--ps-white); text-align: center; box-shadow: var(--ps-shadow);
}
.ps-calendar__rings {
    display: block; height: 1.1rem; background-color: color-mix(in srgb, var(--inv-primary) 85%, #000);
    background-image: radial-gradient(circle, var(--ps-white) 0 .2rem, transparent .24rem);
    background-size: 1.6rem 1.1rem; background-position: .4rem 0;
}
.ps-calendar__month { padding: .45rem .5rem; background: var(--inv-primary); color: #fff; font: .78rem/1.2 var(--ps-type); letter-spacing: .18em; text-transform: uppercase; }
.ps-calendar__day { padding: .7rem 0 .1rem; }
.ps-calendar__day span { position: relative; display: inline-block; padding: 0 .9rem; font: 800 4.6rem/1.05 var(--ps-sans); color: var(--inv-text); }
/* the date circled by hand */
.ps-calendar__day span::after {
    content: ''; position: absolute; inset: -.2rem -.15rem -.1rem; rotate: -8deg;
    border: 3px solid color-mix(in srgb, #d0475f 80%, transparent); border-radius: 50% 46% 52% 48% / 55% 50% 48% 45%;
}
.ps-calendar__weekday { padding: 0 0 .75rem; font: 700 1.6rem/1.2 var(--ps-hand); color: var(--inv-primary); }

.ps-countdown .inv-countdown { gap: .55rem; }
.ps-countdown .inv-countdown__item {
    flex: 1; min-width: 0; padding: .7rem .2rem .55rem; border-radius: 0 0 12px 0 / 0 0 4px 0;
    background: var(--inv-note); color: #2c2620;
    box-shadow: 0 1px 1px rgb(0 0 0 / .1), 0 10px 14px -10px rgb(0 0 0 / .45);
}
.ps-countdown .inv-countdown__item:nth-child(1) { rotate: -3deg; }
.ps-countdown .inv-countdown__item:nth-child(2) { rotate: 2deg; background: color-mix(in srgb, var(--inv-accent) 45%, var(--ps-white)); }
.ps-countdown .inv-countdown__item:nth-child(3) { rotate: -1.5deg; background: color-mix(in srgb, var(--inv-tape) 45%, var(--ps-white)); }
.ps-countdown .inv-countdown__item:nth-child(4) { rotate: 3deg; }
.inv-countdown__value { font: 700 2.5rem/1 var(--ps-hand); }
.inv-countdown__label { margin-top: .15rem; font: .62rem/1.2 var(--ps-type); letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.inv-countdown__done { text-align: center; font: 1.15rem var(--ps-note-font); }
.inv-countdown__actions { margin-top: 1.5rem; }
.inv-countdown__actions .inv-button { padding: .55rem 1rem; font-size: .98rem; }

/* ---------- buttons: drawn by hand ---------- */
.inv-button {
    padding: .7rem 1.3rem; border: 2px solid var(--inv-primary); border-radius: var(--ps-sketchy);
    background: var(--inv-primary); color: #fff; font: 1.08rem/1.1 var(--ps-note-font); letter-spacing: .02em;
}
.inv-button--outline { background: var(--ps-white); color: var(--inv-primary); box-shadow: none; }

/* ---------- events: index cards ---------- */
.ps-index {
    position: relative; margin-top: 2.6rem; padding: 1.15rem 1.15rem 1.25rem; rotate: -1deg;
    background-color: #fffefa;
    background-image:
        linear-gradient(to bottom, transparent 3.35rem, rgb(218 92 92 / .5) 3.35rem 3.45rem, transparent 3.45rem),
        repeating-linear-gradient(to bottom, transparent 0 calc(1.6rem - 1px), rgb(80 125 200 / .18) calc(1.6rem - 1px) 1.6rem);
    background-position: 0 0, 0 3.45rem;
    box-shadow: var(--ps-shadow);
}
.ps-heading + .ps-index { margin-top: 0; }
.ps-index--even { rotate: 1.2deg; }
.ps-index__photo { float: right; width: 7.4rem; margin: -2rem -1.1rem .6rem .8rem; rotate: 5deg; }
.ps-index--even .ps-index__photo { rotate: -4deg; }
.ps-index__name { font: 700 2.3rem/1.15 var(--ps-hand); color: var(--inv-primary); }
.ps-index__list { margin-top: .7rem; }
.ps-index__list > div + div { margin-top: .55rem; }
.ps-index__list dt { font: .66rem/1.3 var(--ps-type); letter-spacing: .14em; text-transform: uppercase; color: var(--ps-soft); }
.ps-index__list dd { font-size: .96rem; line-height: 1.45; }
.ps-index__list strong { display: block; }
.ps-index__address { display: block; font-size: .88rem; color: var(--ps-soft); }
.ps-index .inv-maps { clear: both; padding-top: .9rem; }
.inv-maps .inv-button { width: 100%; }

/* ---------- love story: a compact zig-zag along a dashed doodle line ---------- */
.ps-zz { position: relative; margin: 0; padding: 0; list-style: none; }
.ps-zz::before {
    content: ''; position: absolute; top: .4rem; bottom: .4rem; left: 50%; translate: -1px 0;
    border-left: 2px dashed var(--ps-doodle); opacity: .75;
}
.ps-zz__item {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 2.3rem minmax(0, 1fr);
    align-items: start; column-gap: .55rem;
}
.ps-zz__item + .ps-zz__item { margin-top: 1.7rem; }
.ps-zz__num {
    grid-column: 2; grid-row: 1; justify-self: center; display: grid; place-items: center;
    width: 2.3rem; height: 2.3rem; border: 2px solid var(--inv-primary); border-radius: 50%;
    background: var(--inv-background); color: var(--inv-primary); font: .8rem/1 var(--ps-type); letter-spacing: .04em;
}
.ps-zz__text { grid-column: 1; grid-row: 1; text-align: right; padding-top: .15rem; }
.ps-zz__side { grid-column: 3; grid-row: 1; text-align: left; }
.ps-zz__item--flip .ps-zz__text { grid-column: 3; text-align: left; }
.ps-zz__item--flip .ps-zz__side { grid-column: 1; text-align: right; }
.ps-zz__title { font: 700 1.55rem/1.05 var(--ps-hand); color: var(--inv-primary); overflow-wrap: anywhere; }
.ps-zz__rule {
    display: block; width: 78%; margin: .35rem 0 .45rem auto;
    border-top: 2px dotted color-mix(in srgb, var(--ps-doodle) 85%, transparent);
}
.ps-zz__item--flip .ps-zz__rule { margin-left: 0; margin-right: auto; }
.ps-zz__story { font: .98rem/1.38 var(--ps-note-font); color: var(--ps-soft); overflow-wrap: break-word; }
.ps-zz__date {
    display: inline-block; padding: .05rem .5rem .1rem; rotate: -2deg;
    background: var(--inv-note); color: #2c2620; font: 700 1.3rem/1.15 var(--ps-hand);
    box-shadow: 0 1px 1px rgb(0 0 0 / .08), 0 6px 10px -8px rgb(0 0 0 / .45);
}
.ps-zz__item--flip .ps-zz__date { rotate: 2deg; }
/* a SMALL taped polaroid, never wider than ~8.5rem */
.ps-zz__photo {
    position: relative; width: min(100%, 8.4rem); margin: .85rem 0 0; padding: .32rem .32rem 1.1rem;
    background: var(--ps-white); box-shadow: var(--ps-shadow); rotate: 3deg;
}
.ps-zz__item--flip .ps-zz__photo { margin-left: auto; rotate: -3deg; }
.ps-zz__photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.ps-zz__photo .ps-tape { width: 3.6rem; height: 1.1rem; top: -.6rem; }

/* ---------- gallery: the shared slider as one big taped polaroid + mini polaroids ---------- */
.ps-gallery__hint { margin: -1.2rem 0 1.1rem; text-align: center; font: 1.15rem var(--ps-hand); color: var(--ps-soft); }
.ps-slider .inv-gallery-slider { gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.ps-slider .inv-gallery-slider__thumbs { gap: .55rem; padding: .45rem .3rem .6rem; }
.ps-slider .inv-gallery-slider__thumb {
    width: 3.7rem; aspect-ratio: 4 / 5; padding: .2rem .2rem .6rem; border: 0; border-radius: 1px;
    background: var(--ps-white); box-shadow: 0 1px 2px rgb(0 0 0 / .18), 0 5px 9px -6px rgb(0 0 0 / .4);
    opacity: .6; rotate: -3deg;
}
.ps-slider .inv-gallery-slider__thumb:nth-child(even) { rotate: 2.5deg; }
.ps-slider .inv-gallery-slider__thumb.is-active {
    opacity: 1; rotate: 0deg; outline: 2px solid var(--inv-primary); outline-offset: 1px;
}
.ps-slider .inv-gallery-slider__arrow {
    width: 2.1rem; height: 2.1rem; padding: 0 0 .2rem; border: 2px solid var(--inv-text); border-radius: var(--ps-sketchy);
    background: var(--inv-primary); color: #fff; font: 700 1.6rem/1 var(--ps-hand);
}
.ps-slider .inv-gallery-slider__stage {
    aspect-ratio: 4 / 5.2; padding: .7rem .7rem 3rem; border-radius: 1px; overflow: visible;
    background: var(--ps-white); box-shadow: 0 2px 3px rgb(0 0 0 / .16), 0 22px 36px -18px rgb(0 0 0 / .5);
    rotate: -1.2deg;
}
.ps-slider .inv-gallery-slider__stage { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.ps-slider .inv-gallery-slider__slide { min-width: 0; overflow: hidden; }
/* washi tape across the top edge of the big polaroid */
.ps-slider .inv-gallery-slider__stage::before {
    content: ''; position: absolute; z-index: 3; top: -.75rem; left: 50%; width: 6.4rem; height: 1.6rem; translate: -50% 0; rotate: 3deg;
    background:
        repeating-linear-gradient(-45deg, rgb(255 255 255 / .3) 0 5px, transparent 5px 11px),
        color-mix(in srgb, var(--inv-accent) 85%, transparent);
    clip-path: polygon(3% 0, 97% 0, 100% 18%, 96% 36%, 100% 54%, 96% 72%, 99% 100%, 2% 100%, 5% 80%, 0 62%, 4% 44%, 0 26%);
    opacity: .92; pointer-events: none;
}
/* the counter becomes the handwritten caption of the polaroid */
.ps-slider .inv-gallery-slider__count {
    left: 0; right: 0; bottom: .55rem; padding: 0; border-radius: 0; background: none;
    text-align: center; color: var(--inv-primary); font: 700 1.55rem/1 var(--ps-hand); letter-spacing: .02em;
}
.ps-slider .inv-gallery__play { margin-top: -1.375rem; }

/* ---------- live streaming: a ticket stub ---------- */
.ps-ticket {
    position: relative; padding: 1.4rem 1.6rem 1.5rem; rotate: -1deg; text-align: center;
    background: color-mix(in srgb, var(--inv-tape) 35%, var(--ps-white));
    border: 2px dashed color-mix(in srgb, var(--inv-text) 25%, transparent);
    /* notches on both sides */
    -webkit-mask: radial-gradient(circle at 0 50%, transparent .85rem, #000 .9rem) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent .85rem, #000 .9rem) right / 51% 100% no-repeat;
    mask: radial-gradient(circle at 0 50%, transparent .85rem, #000 .9rem) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent .85rem, #000 .9rem) right / 51% 100% no-repeat;
}
.ps-ticket__stamp {
    position: absolute; top: .8rem; right: 1rem; rotate: 12deg; padding: .15rem .5rem;
    border: 2px solid #c8373a; border-radius: 4px; color: #c8373a;
    font: .78rem/1.2 var(--ps-type); letter-spacing: .1em; text-transform: uppercase;
}
.ps-ticket__title { margin: .3rem 0 .35rem; font: 700 2rem/1.05 var(--ps-hand); color: var(--inv-primary); }
.ps-ticket__text { font-size: .93rem; }
.ps-ticket__note { margin-top: .5rem; font: .76rem/1.4 var(--ps-type); color: var(--ps-soft); }
.ps-ticket .inv-button { margin-top: 1rem; }

/* ---------- gift: an envelope ---------- */
.ps-envelope {
    position: relative; padding: 5.2rem .7rem .9rem; border-radius: 6px;
    background: color-mix(in srgb, var(--inv-desk) 45%, var(--ps-white));
    box-shadow: var(--ps-shadow);
}
.ps-envelope__flap {
    position: absolute; top: 0; left: 0; right: 0; height: 4.6rem; border-radius: 6px 6px 0 0;
    background: color-mix(in srgb, var(--inv-desk) 70%, var(--ps-white));
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.ps-envelope__seal {
    position: absolute; top: 3.2rem; left: 50%; z-index: 2; translate: -50% 0;
    display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 47% 53% 50% 50%;
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--inv-primary) 70%, #fff), var(--inv-primary) 60%);
    color: rgb(255 255 255 / .9); font-size: 1.2rem; box-shadow: 0 3px 6px rgb(0 0 0 / .3);
}
.ps-envelope__letter {
    position: relative; padding: 1.4rem .75rem .9rem; background: var(--ps-white); rotate: -.8deg;
    box-shadow: 0 2px 6px rgb(0 0 0 / .15);
}
/* the accounts: small slips in the letter, two per row; an odd last one spans the row */
.inv-gift__accounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.inv-gift__account:last-child:nth-child(odd) { grid-column: 1 / -1; }
.inv-gift__account { min-width: 0; padding: .8rem .65rem; border-radius: 4px; background: transparent; border: 1.5px dashed var(--ps-line); text-align: center; }
.inv-gift__account + .inv-gift__account { margin-top: 0; }
.inv-gift__address { margin-top: .6rem; }
.inv-gift__bank { margin: 0 0 .4rem; font: .66rem/1.3 var(--ps-type); letter-spacing: .12em; text-transform: uppercase; color: var(--inv-primary); overflow-wrap: anywhere; }
.inv-gift__logo { height: 1.6rem; padding: .22rem .5rem; max-width: 100%; }
.inv-gift__logo img { max-width: 100%; }
.inv-gift__number { margin: 0; font: .98rem/1.3 var(--ps-type); letter-spacing: .03em; overflow-wrap: anywhere; }
.inv-gift__holder { margin: .2rem 0 .55rem; font: .6rem/1.35 var(--ps-type); letter-spacing: .08em; text-transform: uppercase; color: var(--ps-soft); overflow-wrap: anywhere; }
.inv-gift__address .inv-gift__holder { font-size: .7rem; }
.inv-gift__address > p:not([class]) { margin: 0 0 .7rem; font-size: .92rem; }
.inv-gift__account .inv-button { padding: .35rem .7rem; font-size: .8rem; }

/* ---------- RSVP & wishes: a spiral notepad ---------- */
.ps-notepad {
    position: relative; padding: 2.2rem 1.15rem 1.3rem;
    background-color: #fffefa;
    background-image: repeating-linear-gradient(to bottom, transparent 0 calc(1.8rem - 1px), rgb(80 125 200 / .14) calc(1.8rem - 1px) 1.8rem);
    background-position: 0 2rem;
    box-shadow: var(--ps-shadow);
}
/* the spiral: wire rings through a row of punched holes */
.ps-notepad::before {
    content: ''; position: absolute; top: -.8rem; left: .6rem; right: .6rem; height: 1.7rem;
    background:
        radial-gradient(ellipse .28rem .62rem at 50% 50%, transparent 0 62%, color-mix(in srgb, var(--inv-text) 55%, #999) 66% 92%, transparent 96%) 0 0 / 1.25rem 1.7rem repeat-x,
        radial-gradient(circle at 50% 74%, color-mix(in srgb, var(--inv-text) 45%, transparent) 0 .17rem, transparent .21rem) 0 0 / 1.25rem 1.7rem repeat-x;
}
.ps-notepad .inv-form { gap: .9rem; }
.ps-notepad .inv-form label, .ps-notepad .inv-form__choices legend { font: .72rem/1.3 var(--ps-type); letter-spacing: .1em; text-transform: uppercase; color: var(--ps-soft); }
.ps-notepad .inv-form__choices label { font: 1.05rem var(--ps-note-font); letter-spacing: 0; text-transform: none; color: var(--inv-text); }
.ps-notepad .inv-form input:not([type=radio]):not([type=checkbox]), .ps-notepad .inv-form select, .ps-notepad .inv-form textarea {
    padding: .4rem .2rem; border: 0; border-bottom: 2px dashed color-mix(in srgb, var(--inv-text) 30%, transparent); border-radius: 0;
    background: transparent; color: var(--inv-text); font: 1.12rem/1.4 var(--ps-note-font); letter-spacing: 0; text-transform: none;
}
.ps-notepad .inv-form textarea { padding: .5rem .6rem; border: 2px dashed color-mix(in srgb, var(--inv-text) 30%, transparent); border-radius: 6px; background: rgb(255 255 255 / .6); }
.ps-notepad .inv-form input:focus, .ps-notepad .inv-form select:focus, .ps-notepad .inv-form textarea:focus { outline: none; border-color: var(--inv-primary); }
.ps-notepad .inv-form > .inv-button, .ps-notepad .inv-form [type=submit] { justify-self: start; }
.inv-form__notice { background: var(--inv-note); color: #2c2620; border-radius: 2px; font-family: var(--ps-note-font); font-size: 1rem; }
.inv-rsvp__deadline { margin: 0 0 .8rem; font: .72rem/1.4 var(--ps-type); color: var(--ps-soft); }

/* the guests' wishes as sticky notes */
/* about three notes in the scroll box; side padding leaves room for the tilted notes */
.inv-wishes { --inv-wishes-height: 22rem; }
.inv-wishes__list { gap: .75rem; margin-top: 1.4rem; padding: .3rem .45rem .5rem .3rem; }
.inv-wish {
    padding: .65rem .8rem .7rem; border-radius: 0 0 14px 0 / 0 0 4px 0;
    background: var(--inv-note); color: #2c2620;
    box-shadow: 0 1px 1px rgb(0 0 0 / .1), 0 10px 14px -10px rgb(0 0 0 / .45);
}
.inv-wish:nth-child(odd) { rotate: -1deg; }
.inv-wish:nth-child(even) { rotate: 1.1deg; background: color-mix(in srgb, var(--inv-accent) 40%, var(--ps-white)); }
.inv-wish:nth-child(3n) { background: color-mix(in srgb, var(--inv-tape) 42%, var(--ps-white)); }
.inv-wish__name { font: 700 1.2rem/1.1 var(--ps-hand); color: var(--inv-primary); }
.inv-wish__message { font: .95rem/1.45 var(--ps-note-font); }
.inv-wish__time { margin-top: .25rem; font: .66rem/1.3 var(--ps-type); }
.inv-wish__reply { border-left-color: var(--inv-primary); background: rgb(255 255 255 / .5); }
.inv-wishes__empty { font: 1.05rem var(--ps-note-font); }

/* ---------- closing: the last polaroid ---------- */
.ps-closing { padding-top: 3rem; text-align: center; }
.ps-closing__polaroid { width: 80%; margin: 0 auto; rotate: -2deg; }
.ps-closing__polaroid .ps-polaroid__img { aspect-ratio: 4 / 4.6; }
.ps-closing__note { margin-top: 2rem; }
.ps-closing__message { max-width: 23rem; margin: 0 auto; font: 1.15rem/1.5 var(--ps-note-font); }
.ps-closing__sign { margin-top: 1.4rem; font: .74rem/1.3 var(--ps-type); letter-spacing: .18em; text-transform: uppercase; color: var(--ps-soft); }
.ps-closing__names { margin-top: .2rem; font: 700 3.1rem/1.05 var(--ps-hand); color: var(--inv-primary); }
.ps-closing__names span { color: var(--ps-doodle); }
.ps-closing__end { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 1.6rem; font: 500 1.25rem var(--ps-hand); color: var(--ps-soft); }
.ps-closing__spark { width: .9rem; height: .9rem; }

.ps-branding { padding: .5rem 1rem 1.5rem; color: var(--ps-soft); opacity: 1; font-size: .78rem; }
.inv-checkin { color: #1a1a1a; }

/* music (and auto scroll) buttons sit inside the page column */
.ps-body .inv-music { right: max(1rem, calc(50vw - 230px + 1rem)); }
/* below the closing line: a strip of the desk with room for the music button and the auto-scroll pill */
.ps-body .inv-music__space { height: calc(4.4rem + env(safe-area-inset-bottom)); }
.inv-music__button { border: 2px solid var(--ps-white); background: var(--inv-primary); font-size: 1.1rem; }

/* ---------- motion: sections pop in (data-reveal-sections="pop"), the heading doodles draw themselves,
   the love-story moments pop one after another and the last polaroid drifts a little (data-parallax) ---------- */
.ps-closing__polaroid { --inv-parallax: 18px; }
html.inv-anim .ps-heading__doodle path { stroke-dasharray: 420; stroke-dashoffset: 420; transition: stroke-dashoffset 1.3s .45s ease-out; }
html.inv-anim .ps-heading.is-revealed .ps-heading__doodle path { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce) {
    html .ps-cover__photo, html .ps-cover__stamp { animation: none; }
    .ps-cover--leave { transition: opacity .3s ease; }
    .ps-cover--gone { transform: translateX(-50%); }
}
