/* ==========================================================================
   Maci - a summer wedding in a field of wildflowers, painted in watercolour: poppies, cornflowers and daisies over a
   meadow that runs along the foot of the opening. The photo sits on a sheet of watercolour paper with torn edges, a
   wildflower bouquet beside it sways in the wind and a touch sends a butterfly up from it; butterflies flutter and
   dandelion seeds drift across the whole page, and scrolling is a gust. A wildflower sways above every title, the
   portraits sit on torn paper with a bud tucked in, the family is written on labels tied with twine, every moment of
   the day has a pressed flower, the days left sit at the heart of daisies, and the meadow returns at the end.
   Palette: --inv-primary (the poppy), --inv-accent (the daisy heart), --inv-bg, --inv-text.
   The flowers and the meadow (assets/flowers, Pixabay, see LICENSES.md); on the dark palette (.ma-dark, set by
   script.js) the flowers sit on a soft glow and the meadow turns to dusk. script.js draws the butterflies and seeds
   ========================================================================== */

.maci {
    --ma-script: 'Hurricane', 'Segoe Script', cursive;
    --ma-soft: color-mix(in srgb, var(--inv-text) 64%, var(--inv-bg));
    --ma-line: color-mix(in srgb, var(--inv-text) 14%, transparent);
    --ma-paper: color-mix(in srgb, var(--inv-surface) 94%, #f3ead8);
    --ma-twine: #b89a6a;
    --ma-deckle: polygon(0.0% 0.5%, 3.8% 0.2%, 7.7% 1.0%, 11.5% 0.1%, 15.4% 0.9%, 19.2% 0.6%, 23.1% 0.1%, 26.9% 0.8%, 30.8% 0.1%, 34.6% 0.7%, 38.5% 0.1%, 42.3% 0.1%, 46.2% 0.7%, 50.0% 1.3%, 53.8% 0.2%, 57.7% 0.4%, 61.5% 1.0%, 65.4% 1.5%, 69.2% 0.9%, 73.1% 0.6%, 76.9% 1.6%, 80.8% 0.1%, 84.6% 1.4%, 88.5% 0.5%, 92.3% 0.2%, 96.2% 0.2%, 99.5% 0.0%, 98.7% 3.3%, 99.7% 6.7%, 99.1% 10.0%, 99.0% 13.3%, 99.4% 16.7%, 99.1% 20.0%, 99.9% 23.3%, 99.9% 26.7%, 99.7% 30.0%, 98.9% 33.3%, 99.3% 36.7%, 99.5% 40.0%, 99.1% 43.3%, 99.3% 46.7%, 99.5% 50.0%, 98.7% 53.3%, 98.9% 56.7%, 99.6% 60.0%, 99.1% 63.3%, 99.2% 66.7%, 98.6% 70.0%, 98.8% 73.3%, 99.5% 76.7%, 98.4% 80.0%, 99.8% 83.3%, 99.3% 86.7%, 98.8% 90.0%, 99.8% 93.3%, 99.2% 96.7%, 100.0% 99.9%, 96.2% 98.9%, 92.3% 98.8%, 88.5% 99.1%, 84.6% 98.6%, 80.8% 99.5%, 76.9% 98.9%, 73.1% 99.0%, 69.2% 99.1%, 65.4% 99.3%, 61.5% 98.7%, 57.7% 98.5%, 53.8% 99.2%, 50.0% 98.9%, 46.2% 99.9%, 42.3% 98.9%, 38.5% 99.0%, 34.6% 98.4%, 30.8% 98.7%, 26.9% 99.5%, 23.1% 99.4%, 19.2% 98.9%, 15.4% 100.0%, 11.5% 99.3%, 7.7% 99.7%, 3.8% 99.8%, 0.1% 100.0%, 1.2% 96.7%, 0.2% 93.3%, 0.4% 90.0%, 0.6% 86.7%, 1.4% 83.3%, 0.1% 80.0%, 0.7% 76.7%, 0.9% 73.3%, 1.4% 70.0%, 1.3% 66.7%, 1.4% 63.3%, 0.4% 60.0%, 0.7% 56.7%, 0.6% 53.3%, 1.4% 50.0%, 1.5% 46.7%, 0.2% 43.3%, 0.3% 40.0%, 0.4% 36.7%, 0.4% 33.3%, 0.8% 30.0%, 0.9% 26.7%, 0.4% 23.3%, 0.0% 20.0%, 0.7% 16.7%, 0.6% 13.3%, 0.9% 10.0%, 1.5% 6.7%, 1.1% 3.3%);
    --ma-shade: color-mix(in srgb, var(--inv-text) 11%, transparent);
    --kit-radius: 6px;
    --kit-field-bg: var(--inv-surface);
    --kit-field-border: var(--ma-line);
    font-family: var(--inv-font-body);
    font-size: 1.02rem;
    line-height: 1.72;
    background:
        radial-gradient(70% 40% at 90% 4%, color-mix(in srgb, var(--inv-accent) 14%, transparent), transparent 70%),
        radial-gradient(60% 40% at 0% 50%, color-mix(in srgb, var(--inv-primary) 6%, transparent), transparent 70%),
        var(--inv-bg);
    overflow-x: clip;
}
.maci h1, .maci h2, .maci h3 { font-family: var(--inv-font-heading); font-weight: 500; line-height: 1.18; }
:where(.maci) :is(h1, h2, h3) { margin: 0; }
:where(.maci) p { margin: 0 0 .9em; }
.maci a { color: var(--inv-primary); }
.ma-kicker { font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--inv-primary); margin: 0 0 10px; }
.ma-role { display: block; font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ma-soft); margin: 0 0 4px; }
.ma-names-line { display: block; font-family: var(--inv-font-heading); font-size: 1.32rem; line-height: 1.3; margin: 0; }
.ma-hero, .ma-main, .ma-footer { position: relative; z-index: 1; }
/* a sheet of cream paper with torn edges */
/* (shadows are a second torn sheet a little lower, not a filter: many filtered layers make Chrome drop photos) */
.ma-sheet, .ma-paper, .ma-label { position: relative; isolation: isolate; }
.ma-sheet::before, .ma-paper::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ma-paper); clip-path: var(--ma-deckle); }
.ma-sheet::after, .ma-paper::after, .ma-label::after { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--ma-shade); clip-path: var(--ma-deckle); translate: 2px 7px; pointer-events: none; }

/* butterflies and seeds on canvas, over the background and behind the content */
.ma-air { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ---------- The flowers ---------- */
.ma-art { position: relative; display: block; }
.ma-art img { display: block; width: 100%; height: auto; }
.ma-dark .ma-art:not(.ma-meadow)::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, #fff7ea 50%, transparent), transparent); filter: blur(8px); pointer-events: none; }
.ma-dark .ma-art:not(.ma-meadow) img { position: relative; }
/* a flower swaying on its stem */
@keyframes ma-sway { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }
@keyframes ma-sway-soft { 0%, 100% { rotate: -1.5deg; } 50% { rotate: 1.8deg; } }

/* ---------- Navigation ---------- */
.ma-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 6; display: flex; justify-content: center; padding: 18px; }
.ma-nav .kit-nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; list-style: none; margin: 0; padding: 0; }
.ma-nav .kit-nav-links a { font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--inv-text); padding: 6px 0; border-bottom: 2px solid transparent; }
.ma-nav .kit-nav-links a:hover, .ma-nav .kit-nav-links a.is-current { border-color: var(--inv-primary); color: var(--inv-primary); }
.ma-nav .kit-nav-brand { font-family: var(--ma-script); font-size: 2.2rem; line-height: 1; color: var(--inv-primary); text-decoration: none; }
.ma-nav.is-stuck { justify-content: space-between; align-items: center; padding: 6px clamp(16px, 4vw, 40px); background: color-mix(in srgb, var(--inv-bg) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--ma-line); }
.maci .kit-to-top { background: var(--inv-surface); color: var(--inv-primary); border: 1px solid var(--ma-line); }
@media (max-width: 899px) {
    .ma-nav { justify-content: flex-end; padding: 12px; }
    .ma-nav .kit-nav-toggle { width: 46px; height: 46px; border-radius: 50%; background: var(--inv-surface); color: var(--inv-primary); border: 1px solid var(--ma-line); font-size: 1.2rem; }
    .ma-nav .kit-nav-links { display: none; }
    .ma-nav.is-open .kit-nav-links {
        display: flex; flex-direction: column; gap: 12px; position: absolute; top: 66px; left: 12px; right: 12px;
        padding: 24px; border-radius: 10px; background: var(--inv-surface); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .3);
    }
    .ma-nav.is-stuck { padding: 6px 12px; }
}

/* ---------- Hero: torn paper, the bouquet and the meadow ---------- */
.ma-hero { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 92px 16px clamp(200px, 30vw, 240px); overflow: hidden; overflow: clip; isolation: isolate; }
.ma-meadow { position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; height: clamp(220px, 42vw, 440px); pointer-events: none;
    -webkit-mask: linear-gradient(transparent, #000 48%, #000 88%, transparent); mask: linear-gradient(transparent, #000 48%, #000 88%, transparent); }
.ma-meadow img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 78%; }
.ma-dark .ma-meadow img { filter: brightness(.42) saturate(.85) hue-rotate(-8deg); }
.ma-hero-inner { width: min(1080px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 30px; text-align: center; }
.ma-scene { position: relative; width: min(380px, 80vw); padding-right: 16%; }
.ma-paper { margin: 0; rotate: var(--tilt, -2deg); }
.ma-paper-in { position: relative; display: block; padding: 7%; }
.ma-paper img, .ma-initial { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.ma-initial { display: grid; place-items: center; background: color-mix(in srgb, var(--inv-accent) 22%, var(--inv-surface)); font-family: var(--ma-script); font-size: 6rem; color: var(--inv-primary); }
.ma-posy { position: absolute; right: -6%; bottom: -14%; width: 56%; transform-origin: 50% 96%; cursor: pointer; touch-action: manipulation; animation: ma-sway-soft 6s ease-in-out infinite; }
.ma-posy.is-shaken { animation: ma-shake 1.3s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes ma-shake { 0% { rotate: 0deg; } 20% { rotate: 8deg; } 42% { rotate: -6deg; } 64% { rotate: 3deg; } 84% { rotate: -1deg; } 100% { rotate: 0deg; } }
.ma-hero-poppies { position: absolute; left: -4%; bottom: 2%; width: min(300px, 42vw); transform-origin: 30% 100%; animation: ma-sway 7s ease-in-out infinite; pointer-events: none; }
.kit-js .ma-paper--hero { animation: ma-in 1.3s cubic-bezier(.3, 1.2, .5, 1) .15s both; }
.kit-js .ma-posy img, .kit-js .ma-hero-poppies img { animation: ma-grow 1.5s cubic-bezier(.3, 1.3, .5, 1) .6s both; transform-origin: 50% 100%; }
@keyframes ma-in { from { opacity: 0; translate: 0 26px; } to { opacity: 1; translate: 0 0; } }
@keyframes ma-grow { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }
.ma-hero-text { display: grid; justify-items: center; width: 100%; min-width: 0; }
.maci .ma-names { font-family: var(--ma-script); font-weight: 400; font-size: clamp(4.2rem, 17vw, 7.4rem); line-height: .95; color: var(--inv-primary); overflow-wrap: anywhere; margin: 0 0 10px; }
.ma-names span { display: block; }
.ma-names .ma-and { font-size: .5em; line-height: 1.1; color: var(--ma-soft); }
.ma-hero-date { font-family: var(--inv-font-heading); font-size: 1.4rem; margin: 4px 0 2px; }
.ma-hero-place { font-size: .74rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ma-soft); margin: 0; }
.maci .ma-subtitle { max-width: 44ch; margin: 16px auto 0; color: var(--ma-soft); }
@keyframes ma-up { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
.kit-js .ma-hero-text > * { animation: ma-up 1s ease .7s both; }
.kit-js .ma-hero-text > :nth-child(n+3) { animation-delay: 1s; }
@media (min-width: 900px) {
    .ma-hero { padding-top: 110px; }
    .ma-hero-inner { grid-template-columns: auto minmax(0, 1fr); gap: 80px; text-align: left; align-items: center; }
    .ma-hero-text { justify-items: start; }
    .maci .ma-subtitle { margin-left: 0; }
    .ma-scene { width: min(420px, 38vw); }
}

/* ---------- Titles: a wildflower sways above every title ---------- */
.ma-title { margin: 0 auto clamp(26px, 4vw, 42px); text-align: center; }
.ma-title-flower { width: 92px; margin: 0 auto 4px; transform-origin: 20% 100%; }
.ma-title-flower--daisy { width: 78px; }
.ma-title-flower--cornflower { width: 70px; transform-origin: 50% 80%; }
.ma-title-flower img { transform-origin: 20% 100%; }
.kit-js .ma-title .ma-title-flower img { opacity: 0; scale: .4; rotate: -24deg; transition: opacity .6s ease, scale 1s cubic-bezier(.3, 1.5, .5, 1), rotate 1.2s cubic-bezier(.3, 1.4, .5, 1); }
.kit-js .ma-title.is-visible .ma-title-flower img { opacity: 1; scale: 1; rotate: 0deg; }
.kit-js .ma-title.is-visible .ma-title-flower { animation: ma-sway 5s ease-in-out 1.2s infinite; }
.ma-title h2 { font-size: clamp(1.9rem, 5.4vw, 2.6rem); color: var(--inv-primary); text-wrap: balance; }

/* ---------- Sections ---------- */
.ma-main { width: min(1080px, 100%); margin: 0 auto; padding: 0 16px; overflow-x: clip; }
.ma-section { padding-top: clamp(84px, 11vw, 128px); }
.ma-welcome { text-align: center; max-width: 680px; margin: 0 auto; }
.ma-welcome-art { width: min(200px, 50vw); margin: 0 auto 6px; transform-origin: 50% 100%; }
.kit-js .ma-welcome .ma-welcome-art img { opacity: 0; scale: .6; transform-origin: 50% 100%; transition: opacity .8s ease, scale 1.2s cubic-bezier(.3, 1.4, .5, 1); }
.kit-js .ma-welcome.is-visible .ma-welcome-art img { opacity: 1; scale: 1; }
.kit-js .ma-welcome.is-visible .ma-welcome-art { animation: ma-sway-soft 6s ease-in-out 1.2s infinite; }
.maci .ma-welcome-title { font-family: var(--ma-script); font-weight: 400; font-size: clamp(3.6rem, 12vw, 5rem); line-height: 1; color: var(--inv-primary); margin-bottom: 14px; }
.ma-welcome p { font-size: 1.06rem; }
.ma-quote-author { font-family: var(--inv-font-heading); font-style: italic; font-size: 1.1rem; color: var(--inv-primary); }
.ma-lead { text-align: center; font-family: var(--inv-font-heading); font-style: italic; font-size: 1.24rem; line-height: 1.5; color: var(--ma-soft); max-width: 34ch; margin: 0 auto 30px; }

/* Couple */
.ma-couple-grid { display: grid; gap: 60px; grid-template-columns: minmax(0, 1fr); max-width: 940px; margin: 0 auto; }
.ma-person { text-align: center; }
.ma-paper--portrait { width: min(270px, 66vw); margin: 0 auto 22px; }
.ma-tuck { position: absolute; }
.ma-tuck--bud { right: -14px; top: -24px; width: 46px; rotate: 18deg; }
.ma-tuck--cornflower { left: -18px; top: -18px; width: 74px; rotate: -16deg; }
.ma-person h3 { font-size: 1.7rem; color: var(--inv-primary); margin-bottom: 10px; }
.ma-person p { max-width: 38ch; margin-left: auto; margin-right: auto; }
@media (min-width: 760px) { .ma-couple-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; } }

/* Family: labels tied with twine */
.ma-labels { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 22px 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); max-width: 820px; }
.ma-label { padding: 30px 22px 22px; text-align: center; rotate: var(--tilt); }
/* a tag with cut corners, a hole ringed with twine */
.ma-label::before { content: ""; position: absolute; inset: 0; z-index: -1; clip-path: polygon(14% 0, 86% 0, 100% 22%, 100% 100%, 0 100%, 0 22%);
    background: radial-gradient(circle at 50% 15px, var(--inv-bg) 0 4.5px, var(--ma-twine) 5px 7px, transparent 7.5px), var(--ma-paper); }
.ma-label::after { clip-path: polygon(14% 0, 86% 0, 100% 22%, 100% 100%, 0 100%, 0 22%); }

/* Story: photos taped on torn paper */
.ma-chapters { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: clamp(56px, 8vw, 90px); max-width: 960px; }
.ma-chapter { display: grid; gap: 28px; justify-items: center; text-align: center; }
.ma-paper--story { width: min(400px, 84vw); }
.ma-paper--story img { aspect-ratio: 5 / 4; }
.ma-tape { position: absolute; left: 50%; top: -12px; z-index: 2; width: 96px; height: 26px; margin-left: -48px; rotate: -4deg; background: color-mix(in srgb, var(--inv-accent) 46%, transparent); -webkit-mask: linear-gradient(90deg, transparent, #000 4px calc(100% - 4px), transparent); mask: linear-gradient(90deg, transparent, #000 4px calc(100% - 4px), transparent); }
.ma-chapter-text { max-width: 44ch; }
.ma-chapter-text h3 { font-size: 1.7rem; color: var(--inv-primary); margin-bottom: 10px; }
@media (min-width: 900px) {
    .ma-chapter { grid-template-columns: auto minmax(0, 1fr); gap: 64px; text-align: left; justify-items: start; align-items: center; }
    .ma-chapter:nth-child(even) .ma-paper--story { order: 2; }
}

/* Programme: sheets of paper, each with a pressed flower */
.ma-moments { list-style: none; margin: 0 auto; padding: 0; max-width: 680px; display: grid; gap: 34px; }
.ma-moments .ma-moment:nth-child(odd) .ma-sheet { rotate: -.7deg; }
.ma-moments .ma-moment:nth-child(even) .ma-sheet { rotate: .7deg; }
.ma-moment .ma-sheet { padding: 30px clamp(84px, 22vw, 130px) 26px clamp(22px, 5vw, 40px); }
.ma-pressed { position: absolute; right: clamp(12px, 3vw, 26px); top: 18px; width: clamp(62px, 16vw, 96px); rotate: 14deg; }
.ma-pressed--cornflower { width: clamp(56px, 14vw, 80px); }
.kit-js .ma-moment .ma-pressed img { opacity: 0; scale: .5; rotate: -30deg; transition: opacity .6s ease, scale 1s cubic-bezier(.3, 1.5, .5, 1) .2s, rotate 1s ease .2s; }
.kit-js .ma-moment.is-visible .ma-pressed img { opacity: 1; scale: 1; rotate: 0deg; }
.maci .ma-moment-time { font-family: var(--ma-script); font-size: 2.8rem; line-height: 1; color: var(--inv-primary); margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.ma-sheet h3 { font-size: clamp(1.36rem, 4.2vw, 1.6rem); margin-bottom: 4px; }
.ma-moment-date { font-size: .74rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ma-soft); margin: 0 0 8px; }
.ma-moment-place { font-weight: 600; margin: 0; }
.ma-moment-address, .ma-moment-notes { color: var(--ma-soft); margin: 0; }
.ma-moment-notes { font-style: italic; margin-top: 6px; }
.ma-moment .kit-event-actions { margin-top: 14px; }
.maci .kit-button { border-radius: 4px; border: 1.5px solid var(--inv-primary); color: var(--inv-primary); background: transparent; font-size: .76rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 7px 16px; text-decoration: none; }
.maci .kit-button:hover { background: var(--inv-primary); color: var(--inv-bg); }

/* Countdown: the number at the heart of a daisy */
.ma-countdown { text-align: center; }
.ma-countdown .kit-countdown { display: flex; justify-content: center; flex-wrap: wrap; gap: 30px clamp(6px, 2.6vw, 28px); margin-top: 18px; padding-bottom: 18px; }
.ma-countdown .kit-countdown-unit { position: relative; width: clamp(76px, 20vw, 120px); min-width: 0; aspect-ratio: 1; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; isolation: isolate; }
/* white petals all round, a golden heart in the middle */
.ma-countdown .kit-countdown-unit::before { content: ""; position: absolute; inset: 0; z-index: -2; border-radius: 50%;
    background: repeating-conic-gradient(from 6deg, #fffdf7 0 11deg, #efe9dc 13deg, transparent 15deg 22.5deg);
    -webkit-mask: radial-gradient(circle, #000 0 64%, transparent 70%); mask: radial-gradient(circle, #000 0 64%, transparent 70%);
    filter: drop-shadow(0 6px 8px rgba(60, 50, 20, .18)); }
.ma-countdown .kit-countdown-unit::after { content: ""; position: absolute; inset: 26%; z-index: -1; border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--inv-accent) 60%, #fff), var(--inv-accent) 55%, color-mix(in srgb, var(--inv-accent) 70%, #8a5a00));
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--inv-accent) 60%, #a06a00); }
.kit-js .ma-countdown .kit-countdown-unit::before { scale: .3; rotate: -90deg; opacity: 0; transition: scale 1s cubic-bezier(.3, 1.5, .5, 1), rotate 1.2s ease, opacity .5s ease; }
.kit-js .ma-countdown.is-visible .kit-countdown-unit::before { scale: 1; rotate: 0deg; opacity: 1; }
.kit-js .ma-countdown.is-visible .kit-countdown-unit:nth-child(2)::before { transition-delay: .12s; }
.kit-js .ma-countdown.is-visible .kit-countdown-unit:nth-child(3)::before { transition-delay: .24s; }
.kit-js .ma-countdown.is-visible .kit-countdown-unit:nth-child(4)::before { transition-delay: .36s; }
.ma-countdown .kit-countdown-value { font-family: var(--inv-font-heading); font-weight: 500; font-size: clamp(1.05rem, 4vw, 1.5rem); line-height: 1; color: #3a2a08; font-variant-numeric: tabular-nums; }
.ma-countdown .kit-countdown-label { position: absolute; bottom: -22px; left: 0; right: 0; margin: 0; opacity: 1; color: var(--ma-soft); font-size: .58rem; font-weight: 600; letter-spacing: .12em; }

/* Gallery: photos on torn paper */
.ma-gallery-grid.kit-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 26px); }
.ma-gallery-grid.kit-gallery a { position: relative; isolation: isolate; aspect-ratio: 1; padding: 8%; overflow: visible; --tilt: -1.4deg; }
.ma-gallery-grid.kit-gallery a:nth-child(3n+2) { --tilt: 1.6deg; }
.ma-gallery-grid.kit-gallery a:nth-child(3n) { --tilt: -.6deg; }
/* the paper, its shadow and the photo, each turned on its own: a drop-shadow filter on six large photos makes Chrome
   drop some of them, so the shadow is a second torn sheet a little lower */
.ma-gallery-grid.kit-gallery a::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ma-paper); clip-path: var(--ma-deckle); rotate: var(--tilt); }
.ma-gallery-grid.kit-gallery a::after { content: ""; position: absolute; inset: 0; z-index: -2; background: color-mix(in srgb, var(--inv-text) 12%, transparent); clip-path: var(--ma-deckle); rotate: var(--tilt); translate: 2px 6px; }
.ma-gallery-grid.kit-gallery img { position: relative; width: 100%; height: 100%; object-fit: cover; rotate: var(--tilt); transition: scale .8s ease; }
.ma-gallery-grid.kit-gallery a:hover img { scale: 1.03; }
@media (min-width: 760px) { .ma-gallery-grid.kit-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* RSVP, info, contact */
.ma-reply.ma-sheet { max-width: 700px; margin: 0 auto; padding: clamp(40px, 6vw, 58px) clamp(24px, 6vw, 56px) clamp(32px, 5vw, 48px); }
.maci .inv-rsvp__intro { font-family: var(--inv-font-heading); font-style: italic; font-size: 1.14rem; line-height: 1.5; }
.maci .inv-rsvp__deadline { font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--inv-primary); }
.ma-info-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.ma-info-item { padding: 30px 24px 20px; text-align: center; }
.ma-info-item h3 { font-size: 1.36rem; color: var(--inv-primary); margin-bottom: 8px; }
.ma-faq { max-width: 720px; margin: 46px auto 0; text-align: center; display: grid; gap: 14px; }
.ma-faq details { text-align: left; }
.ma-faq summary { cursor: pointer; list-style: none; padding: 18px 54px 18px 24px; position: relative; font-family: var(--inv-font-heading); font-size: 1.12rem; }
.ma-faq summary::-webkit-details-marker { display: none; }
.ma-faq summary::after { content: "+"; position: absolute; right: 22px; top: 50%; translate: 0 -50%; font-size: 1.6rem; line-height: 1; color: var(--inv-primary); transition: rotate .4s ease; }
.ma-faq details[open] summary::after { rotate: 45deg; }
.ma-faq summary:focus-visible { outline: 2px solid var(--inv-primary); outline-offset: 2px; }
.ma-faq details p { padding: 0 24px; color: var(--ma-soft); }
.ma-faq details p:last-child { padding-bottom: 18px; }
.ma-contact { text-align: center; }
.ma-contact-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 64px; }
.ma-contact-person a { text-decoration: none; font-weight: 600; }

/* ---------- Footer: the meadow again ---------- */
.ma-footer { text-align: center; padding: clamp(90px, 13vw, 140px) 16px 0; overflow: hidden; overflow: clip; isolation: isolate; }
.ma-footer-text { position: relative; z-index: 1; padding-bottom: clamp(200px, 36vw, 320px); }
.ma-meadow--footer { height: clamp(240px, 44vw, 460px); -webkit-mask: linear-gradient(transparent, #000 48%); mask: linear-gradient(transparent, #000 48%); }
.ma-footer-poppies { position: absolute; right: -3%; bottom: -2%; width: min(260px, 44vw); transform-origin: 40% 100%; animation: ma-sway 8s ease-in-out -3s infinite; pointer-events: none; }
.ma-footer-poppies img { scale: -1 1; }
.ma-footer-message { font-family: var(--inv-font-heading); font-style: italic; font-size: 1.24rem; line-height: 1.5; color: var(--ma-soft); max-width: 32ch; margin: 0 auto 6px; }
.maci .ma-footer-names { font-family: var(--ma-script); font-size: clamp(3.8rem, 14vw, 6rem); line-height: 1; color: var(--inv-primary); margin: 4px 0 10px; overflow-wrap: anywhere; }
.ma-hashtag { font-weight: 600; letter-spacing: .08em; color: var(--inv-primary); }

@media (prefers-reduced-motion: reduce) {
    .ma-posy, .ma-hero-poppies, .ma-footer-poppies, .kit-js .ma-paper--hero, .kit-js .ma-posy img, .kit-js .ma-hero-poppies img, .kit-js .ma-hero-text > *, .kit-js .ma-title.is-visible .ma-title-flower, .kit-js .ma-welcome.is-visible .ma-welcome-art { animation: none; }
    .kit-js .ma-title .ma-title-flower img, .kit-js .ma-welcome .ma-welcome-art img, .kit-js .ma-moment .ma-pressed img { opacity: 1; scale: 1; rotate: 0deg; transition: none; }
    .kit-js .ma-countdown .kit-countdown-unit::before { scale: 1; rotate: 0deg; opacity: 1; transition: none; }
}
