/* ==========================================================================
   Fermă - a birthday on the farm, painted in watercolour: the photo inside a red barn with white trim, the hens
   pecking beside it and the donkey peeking round the corner (a touch makes the hens hop, a few feathers float off
   and the donkey twitches its ears). Butterflies flutter over the page, a little picket fence springs up above
   every title, the lambs say hello, the birthday child's portrait sits in the hub of a cart wheel beside the pony,
   the theme hangs on a wooden sign, every moment has its animal, the days left sit on eggs in a straw nest, the
   photos hide behind barn shutters that swing open, the alpaca peeks over the reply form and at the end the
   scarecrow waves beside the coop.
   Palette: --inv-primary (the ink), --inv-accent (the soft colour), --inv-bg, --inv-text.
   The watercolours (assets/art, Pixabay, see LICENSES.md) came transparent; on the dark palette (.fe-dark, set by
   script.js) they get back a sheet of watercolour paper. script.js draws the butterflies (canvas.fe-air)
   ========================================================================== */

.ferma {
    --fe-soft: color-mix(in srgb, var(--inv-text) 64%, var(--inv-bg));
    --fe-line: color-mix(in srgb, var(--inv-primary) 18%, transparent);
    --fe-paper: color-mix(in srgb, #fffbef 90%, var(--inv-accent));
    --fe-barn: #b8372e;
    --fe-barn-dark: #8e2721;
    --fe-wood: #c08a52;
    --fe-wood-dark: #8a5a2e;
    --fe-straw: #e3bd62;
    --fe-shadow: 0 1px 2px color-mix(in srgb, var(--inv-text) 8%, transparent), 0 24px 48px -30px color-mix(in srgb, var(--inv-text) 50%, transparent);
    --kit-radius: 14px;
    --kit-field-bg: var(--inv-surface);
    --kit-field-border: var(--fe-line);
    font-family: var(--inv-font-body);
    font-weight: 400;
    font-size: 1.03rem;
    line-height: 1.72;
    background: var(--inv-bg);
    overflow-x: clip;
}
.ferma h1, .ferma h2, .ferma h3 { font-family: var(--inv-font-heading); font-weight: 600; line-height: 1.12; }
:where(.ferma) :is(h1, h2, h3) { margin: 0; }
:where(.ferma) p { margin: 0 0 .9em; }
.ferma strong { font-weight: 700; }
.ferma a { color: var(--inv-primary); }
.fe-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--inv-primary); margin: 0 0 10px; }
.fe-role { font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--fe-soft); margin: 0 0 4px; }
.fe-names { font-family: var(--inv-font-heading); font-weight: 600; font-size: 1.3rem; margin: 0; }
.fe-hero, .fe-main, .fe-footer { position: relative; z-index: 1; }
.fe-card { position: relative; background: var(--inv-surface); border-radius: 22px; box-shadow: var(--fe-shadow), 0 0 0 1px var(--fe-line); }
.fe-air { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ---------- The watercolours ---------- */
.fe-art { position: relative; display: block; }
.fe-art img { display: block; width: 100%; height: auto; }
.fe-dark .fe-art img { background: radial-gradient(closest-side, var(--fe-paper) 54%, color-mix(in srgb, var(--fe-paper) 40%, transparent) 78%, transparent 100%); }

/* ---------- The red barn round the photo: the gabled front, the white trim and the hayloft window ---------- */
.fe-barn { --gable: polygon(50% 0, 100% 30%, 100% 100%, 0 100%, 0 30%); position: relative; margin: 0; aspect-ratio: .84; filter: drop-shadow(0 24px 30px color-mix(in srgb, var(--inv-text) 34%, transparent)); }
.fe-barn::before, .fe-barn::after { content: ""; position: absolute; clip-path: var(--gable); }
/* the red boards, then the white trim inside them */
.fe-barn::before { inset: 0; background: repeating-linear-gradient(90deg, transparent 0 15px, rgba(0, 0, 0, .12) 15px 17px), linear-gradient(var(--fe-barn), var(--fe-barn-dark)); }
.fe-barn::after { inset: 5.5% 6.5% 0; background: #fffaf0; }
.fe-barn-loft { position: absolute; left: 50%; top: 13%; z-index: 2; width: 17%; aspect-ratio: 1; margin-left: -8.5%; border-radius: 50%; background:
        linear-gradient(45deg, transparent 44%, #fffaf0 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, #fffaf0 44% 56%, transparent 56%), #5b2a16;
    box-shadow: 0 0 0 4px #fffaf0, 0 0 0 9px var(--fe-barn-dark); }
.fe-barn-photo { position: absolute; left: 12%; right: 12%; top: 36%; bottom: 0; z-index: 1; overflow: hidden; border-radius: 6px 6px 0 0; background: var(--fe-paper); }
.fe-barn-photo img, .fe-initial { display: block; width: 100%; height: 100%; object-fit: cover; }
.fe-initial { display: grid; place-items: center; font-family: var(--inv-font-heading); font-weight: 700; font-size: 5rem; color: var(--inv-primary); }

/* ---------- Navigation ---------- */
.fe-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 6; display: flex; justify-content: center; padding: 18px; }
.fe-nav .kit-nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; list-style: none; margin: 0; padding: 0; }
.fe-nav .kit-nav-links a { font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; color: var(--inv-text); padding: 6px 0; border-bottom: 2px solid transparent; }
.fe-nav .kit-nav-links a:hover, .fe-nav .kit-nav-links a.is-current { border-color: var(--inv-primary); color: var(--inv-primary); }
.fe-nav .kit-nav-brand { font-family: var(--inv-font-heading); font-weight: 700; font-size: 1.5rem; line-height: 1; color: var(--inv-primary); text-decoration: none; }
.fe-nav.is-stuck { justify-content: space-between; align-items: center; padding: 8px 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(--fe-line); }
.ferma .kit-to-top { background: var(--inv-surface); color: var(--inv-primary); border: 1px solid var(--fe-line); }
@media (max-width: 899px) {
    .fe-nav { justify-content: flex-end; padding: 12px; }
    .fe-nav .kit-nav-toggle { width: 46px; height: 46px; border-radius: 50%; background: var(--inv-surface); color: var(--inv-primary); border: 1px solid var(--fe-line); font-size: 1.2rem; }
    .fe-nav .kit-nav-links { display: none; }
    .fe-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: 18px; background: var(--inv-surface); box-shadow: var(--fe-shadow);
    }
    .fe-nav.is-stuck { padding: 6px 12px; }
}

/* ---------- Hero: the barn, the hens on its left and the donkey round the corner ---------- */
.fe-hero { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 110px 16px 70px; overflow: hidden; overflow: clip; }
.fe-sun { position: absolute; right: -14%; top: -18%; width: min(980px, 160vw); aspect-ratio: 1; border-radius: 50%; pointer-events: none;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--inv-accent) 85%, transparent), transparent 72%); }
.fe-dark .fe-sun { background: radial-gradient(closest-side, color-mix(in srgb, var(--inv-primary) 16%, transparent), transparent 72%); }
.fe-hero-inner { position: relative; z-index: 1; width: min(1060px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 40px; text-align: center; }
.fe-yard { position: relative; width: min(240px, 54vw); margin: 0 12% 22% 12%; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.kit-js .fe-barn--hero { animation: fe-rise 1.1s cubic-bezier(.3, 1.3, .5, 1) .1s both; }
@keyframes fe-rise { from { opacity: 0; translate: 0 30px; scale: .94; } to { opacity: 1; translate: 0 0; scale: 1; } }
.fe-flock { position: absolute; left: -46%; bottom: -24%; width: 84%; z-index: 3; }
.kit-js .fe-flock img { animation: fe-in-l 1.2s cubic-bezier(.3, 1.2, .5, 1) .9s both; }
@keyframes fe-in-l { from { opacity: 0; translate: -30px 10px; } to { opacity: 1; translate: 0 0; } }
.fe-donkey { position: absolute; right: -44%; bottom: -16%; width: 64%; z-index: 3; transform-origin: 50% 100%; }
.kit-js .fe-donkey img { animation: fe-in-r 1.2s cubic-bezier(.3, 1.2, .5, 1) 1.15s both; }
@keyframes fe-in-r { from { opacity: 0; translate: 34px 6px; } to { opacity: 1; translate: 0 0; } }
.fe-yard.is-pecking .fe-flock { animation: fe-hop .75s cubic-bezier(.3, 1.4, .5, 1) 2; }
@keyframes fe-hop { 0%, 100% { translate: 0 0; } 30% { translate: 0 -14px; } 55% { translate: 0 0; } 75% { translate: 0 -5px; } }
.fe-yard.is-pecking .fe-donkey { animation: fe-twitch .9s ease-in-out 1; }
@keyframes fe-twitch { 0%, 100% { rotate: 0deg; } 25% { rotate: -4deg; } 50% { rotate: 3deg; } 75% { rotate: -2deg; } }
/* the feathers that float off the hens */
.fe-feathers { position: absolute; left: -30%; bottom: 4%; width: 60%; height: 40%; z-index: 4; pointer-events: none; }
.fe-feathers i { position: absolute; left: calc(12% + var(--f) * 14%); bottom: 10%; width: 9px; height: 22px; border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%; opacity: 0;
    background: linear-gradient(90deg, transparent 46%, rgba(120, 70, 30, .5) 46% 54%, transparent 54%), linear-gradient(#fff8ea, #e9c38c); }
.fe-feathers i:nth-child(3n) { background: linear-gradient(90deg, transparent 46%, rgba(90, 40, 20, .5) 46% 54%, transparent 54%), linear-gradient(#e7a45a, #a45a26); }
.fe-yard.is-pecking .fe-feathers i { animation: fe-feather 2.2s ease-out 1 both; animation-delay: calc(var(--f) * .08s); }
@keyframes fe-feather {
    0% { opacity: 0; translate: 0 0; rotate: 0deg; }
    15% { opacity: 1; }
    100% { opacity: 0; translate: calc((var(--f) - 2.5) * 22px) -150px; rotate: calc(120deg + var(--f) * 50deg); }
}

.fe-hero-text { display: grid; justify-items: center; width: 100%; min-width: 0; }
.ferma .fe-name { font-family: var(--inv-font-heading); font-weight: 700; font-size: clamp(3rem, 13vw, 5rem); line-height: 1; color: var(--inv-primary); overflow-wrap: anywhere; text-wrap: balance; margin: 0 0 16px; }
.fe-hero-date { font-family: var(--inv-font-heading); font-weight: 600; font-size: 1.35rem; margin: 0 0 4px; }
.fe-hero-place { font-size: .72rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--fe-soft); margin: 0; }
.ferma .fe-subtitle { max-width: 44ch; margin: 16px auto 0; color: var(--fe-soft); }
@keyframes fe-up { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
.kit-js .fe-hero-text > * { animation: fe-up 1s ease .8s both; }
.kit-js .fe-hero-text > :nth-child(n+3) { animation-delay: 1.1s; }
@media (min-width: 900px) {
    .fe-hero { padding-top: 140px; }
    .fe-hero-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 60px; text-align: left; align-items: center; }
    .fe-hero-text { justify-items: start; order: -1; }
    .ferma .fe-subtitle { margin-left: 0; }
    .fe-yard { width: min(290px, 25vw); margin: 40px clamp(100px, 10vw, 140px) 90px clamp(100px, 9vw, 130px); }
    .fe-flock { left: -36%; }
}

/* ---------- Sections ---------- */
.fe-main { width: min(1080px, 100%); margin: 0 auto; padding: 0 16px; }
.fe-section { padding-top: clamp(84px, 11vw, 128px); overflow-x: clip; }
.fe-title { margin: 0 auto clamp(26px, 4vw, 42px); text-align: center; }
.fe-title h2 { font-size: clamp(2rem, 5.6vw, 2.8rem); color: var(--inv-primary); text-wrap: balance; }
/* the little picket fence: four pointed pickets on a rail, a daisy at its end */
.fe-fence { position: relative; display: block; width: 64px; height: 34px; margin: 0 auto 10px; }
.fe-fence i { position: absolute; bottom: 0; width: 9px; height: 30px; background: var(--fe-wood); clip-path: polygon(50% 0, 100% 22%, 100% 100%, 0 100%, 0 22%); transform-origin: 50% 100%; }
.fe-fence i:nth-child(1) { left: 2px; }
.fe-fence i:nth-child(2) { left: 16px; height: 33px; }
.fe-fence i:nth-child(3) { left: 30px; }
.fe-fence i:nth-child(4) { left: 44px; height: 32px; }
.fe-fence b { position: absolute; left: 0; right: 10px; bottom: 9px; height: 5px; border-radius: 2px; background: var(--fe-wood-dark); transform-origin: 0 50%; }
.fe-fence em { position: absolute; right: -2px; bottom: 6px; width: 14px; height: 14px; border-radius: 50%;
    background: radial-gradient(circle, #f5c430 0 28%, transparent 30%), conic-gradient(from 0deg, #fff 0 10%, transparent 10% 12.5%, #fff 12.5% 22.5%, transparent 22.5% 25%, #fff 25% 35%, transparent 35% 37.5%, #fff 37.5% 47.5%, transparent 47.5% 50%, #fff 50% 60%, transparent 60% 62.5%, #fff 62.5% 72.5%, transparent 72.5% 75%, #fff 75% 85%, transparent 85% 87.5%, #fff 87.5% 97.5%, transparent 97.5%);
    filter: drop-shadow(0 0 1px rgba(120, 100, 40, .6)); }
.kit-js .fe-title .fe-fence i { scale: 1 0; }
.kit-js .fe-title .fe-fence b { scale: 0 1; }
.kit-js .fe-title .fe-fence em { scale: 0; rotate: -90deg; }
.kit-js .fe-title.is-visible .fe-fence i { scale: 1 1; transition: scale .45s cubic-bezier(.3, 1.6, .5, 1); }
.kit-js .fe-title.is-visible .fe-fence i:nth-child(2) { transition-delay: .1s; }
.kit-js .fe-title.is-visible .fe-fence i:nth-child(3) { transition-delay: .2s; }
.kit-js .fe-title.is-visible .fe-fence i:nth-child(4) { transition-delay: .3s; }
.kit-js .fe-title.is-visible .fe-fence b { scale: 1 1; transition: scale .4s ease .45s; }
.kit-js .fe-title.is-visible .fe-fence em { scale: 1; rotate: 0deg; transition: scale .6s cubic-bezier(.3, 1.6, .5, 1) .75s, rotate .8s ease .75s; }

/* Welcome, from the leaping lambs */
.fe-welcome { display: grid; gap: 14px; justify-items: center; text-align: center; max-width: 820px; margin: 0 auto; }
.fe-welcome p { font-size: 1.05rem; }
.fe-hello { width: min(250px, 64vw); }
.kit-js .fe-welcome .fe-hello img { opacity: 0; translate: 0 34px; transition: opacity .8s ease, translate 1.2s cubic-bezier(.3, 1.6, .5, 1); }
.kit-js .fe-welcome.is-visible .fe-hello img { opacity: 1; translate: 0 0; }
.ferma .fe-welcome-title { font-family: var(--inv-font-heading); font-weight: 700; font-size: clamp(2.2rem, 7.4vw, 3.2rem); line-height: 1.05; color: var(--inv-primary); margin-bottom: 12px; }
.fe-quote-author { font-weight: 800; color: var(--inv-primary); }
@media (min-width: 760px) {
    .fe-welcome { grid-template-columns: auto minmax(0, 1fr); gap: 50px; text-align: left; align-items: center; }
    .fe-hello { width: 280px; }
}

/* The birthday child: the portrait in the hub of a cart wheel (the pony and her foal stand past it) */
.fe-star { overflow-x: clip; padding-bottom: 30px; }
.fe-star-grid { display: grid; gap: 60px; justify-items: center; text-align: center; max-width: 900px; margin: 0 auto; }
.fe-portrait { position: relative; width: min(230px, 58vw); }
.fe-wheel { position: relative; margin: 0; aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(closest-side, transparent 86%, var(--fe-wood-dark) 86.5% 89%, var(--fe-wood) 89.5% 97%, var(--fe-wood-dark) 97.5%);
    filter: drop-shadow(0 22px 26px color-mix(in srgb, var(--inv-text) 36%, transparent)); }
/* twelve spokes between the hub and the rim */
.fe-spokes { position: absolute; inset: 6%; border-radius: 50%;
    background: repeating-conic-gradient(from -3deg, var(--fe-wood) 0 6deg, transparent 6deg 30deg);
    -webkit-mask: radial-gradient(closest-side, transparent 60%, #000 61%); mask: radial-gradient(closest-side, transparent 60%, #000 61%); }
.fe-wheel-photo { position: absolute; inset: 21%; border-radius: 50%; overflow: hidden; background: var(--fe-paper); box-shadow: 0 0 0 7px var(--fe-wood), 0 0 0 10px var(--fe-wood-dark); }
.fe-wheel-photo img, .fe-wheel-photo .fe-initial { display: block; width: 100%; height: 100%; object-fit: cover; }
.fe-wheel-photo .fe-initial { font-size: 3rem; }
.kit-js .fe-star-grid .fe-spokes { rotate: -90deg; transition: rotate 1.8s cubic-bezier(.3, 1, .4, 1); }
.kit-js .fe-star-grid.is-visible .fe-spokes { rotate: 0deg; }
.fe-buddy { position: absolute; right: -52%; bottom: -16%; width: 74%; z-index: 3; }
.kit-js .fe-star-grid .fe-buddy img { opacity: 0; translate: 24px 0; transition: opacity .8s ease .5s, translate 1.1s cubic-bezier(.3, 1.3, .5, 1) .5s; }
.kit-js .fe-star-grid.is-visible .fe-buddy img { opacity: 1; translate: 0 0; }
.fe-star-name { font-family: var(--inv-font-heading); font-weight: 700; font-size: 1.9rem; color: var(--inv-primary); margin-bottom: 0; }
.fe-age { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 0 0 10px; color: var(--fe-soft); }
.fe-age strong { font-family: var(--inv-font-heading); font-weight: 700; font-size: 4.4rem; line-height: 1; color: var(--inv-primary); }
.fe-age small { font-size: 1.1rem; font-weight: 800; }
.fe-star-message { font-size: 1.08rem; max-width: 38ch; margin-left: auto; margin-right: auto; }
@media (min-width: 760px) {
    .fe-star-grid { grid-template-columns: auto minmax(0, 1fr); gap: 130px; text-align: left; align-items: center; }
    .fe-portrait { width: 250px; }
    .fe-age { justify-content: flex-start; }
    .fe-star-message { margin-left: 0; }
}

/* The theme on a wooden sign: planks in a frame, hanging from two strings tied to a nail */
.fe-sign-wrap { position: relative; max-width: 620px; margin: 0 auto; padding: 70px 14px 14px; }
.fe-strings { position: absolute; left: 50%; top: 0; width: 64%; height: 82px; translate: -50% 0; }
.fe-strings::before, .fe-strings::after { content: ""; position: absolute; top: 8px; width: 2px; height: 96px; background: #9c7a50; }
.fe-strings::before { left: 50%; transform-origin: 0 0; rotate: 58deg; }
.fe-strings::after { right: 50%; transform-origin: 100% 0; rotate: -58deg; }
.fe-sign-wrap::before { content: ""; position: absolute; left: 50%; top: 2px; z-index: 2; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #e6e1d6, #6d675c); box-shadow: 0 2px 3px rgba(0, 0, 0, .3); }
.fe-sign { position: relative; padding: clamp(34px, 6vw, 46px) clamp(24px, 6vw, 48px) 34px; text-align: center; border-radius: 12px;
    background: var(--inv-surface);
    box-shadow: 0 0 0 10px var(--fe-wood), 0 0 0 12px var(--fe-wood-dark), 0 30px 40px -24px color-mix(in srgb, var(--inv-text) 60%, transparent); transform-origin: 50% -70px; }
.kit-js .fe-theme .fe-sign { rotate: -8deg; }
.kit-js .fe-theme.is-visible .fe-sign { rotate: 0deg; transition: rotate 2s cubic-bezier(.3, 1.9, .5, 1) .2s; }
.fe-sign h3 { font-size: clamp(1.6rem, 5vw, 2rem); color: var(--inv-primary); margin-bottom: 10px; }
.fe-sign p { font-size: 1.07rem; }
.fe-sign p:last-child { margin-bottom: 0; }

/* Programme: an animal beside every moment */
.fe-trail { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; display: grid; gap: 34px; }
.fe-stop { display: grid; justify-items: center; }
.fe-stop-art { width: min(170px, 46vw); margin-bottom: -16px; z-index: 2; }
.fe-stop-card { width: 100%; display: grid; justify-items: center; gap: 2px; padding: 30px clamp(20px, 5vw, 36px) 22px; text-align: center; }
.kit-js .fe-stop .fe-stop-card { opacity: 0; translate: 0 26px; transition: opacity .7s ease, translate .9s ease; }
.kit-js .fe-stop .fe-stop-art img { opacity: 0; translate: 0 24px; transition: opacity .6s ease .3s, translate .9s cubic-bezier(.3, 1.6, .5, 1) .3s; }
.kit-js .fe-stop.is-visible .fe-stop-card { opacity: 1; translate: 0 0; }
.kit-js .fe-stop.is-visible .fe-stop-art img { opacity: 1; translate: 0 0; }
.fe-stop-time { font-family: var(--inv-font-heading); font-weight: 700; font-size: 1.9rem; line-height: 1; color: var(--inv-primary); margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.fe-stop-card h3 { font-size: clamp(1.35rem, 4vw, 1.6rem); margin-bottom: 4px; }
.fe-stop-place { font-weight: 800; margin: 0; }
.fe-stop-address, .fe-stop-notes { color: var(--fe-soft); margin: 0; }
.fe-stop-notes { font-style: italic; margin-top: 6px; }
.fe-stop .kit-event-actions { margin-top: 14px; justify-content: center; }
@media (min-width: 760px) {
    .fe-stop { grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 0; }
    .fe-stop-art { width: 190px; margin: 0 -30px 0 0; }
    .fe-stop:nth-child(even) { grid-template-columns: minmax(0, 1fr) 190px; }
    .fe-stop:nth-child(even) .fe-stop-art { order: 2; margin: 0 0 0 -30px; }
    .fe-stop-card { justify-items: start; text-align: left; padding-left: 52px; }
    .fe-stop:nth-child(even) .fe-stop-card { padding-left: 36px; padding-right: 52px; }
    .fe-stop .kit-event-actions { justify-content: flex-start; }
}
.ferma .kit-button { border-radius: 999px; border: 2px solid var(--inv-primary); color: var(--inv-primary); background: transparent; font-size: .8rem; font-weight: 800; padding: 7px 18px; text-decoration: none; }
.ferma .kit-button:hover { background: var(--inv-primary); color: var(--inv-bg); }

/* Countdown: each number on a speckled egg, the four eggs sitting in a nest of straw */
.fe-countdown { text-align: center; overflow-x: clip; }
.fe-nest { position: relative; display: inline-block; max-width: 100%; margin-top: 36px; padding: 0 clamp(10px, 3vw, 26px) 10px; }
.fe-countdown .kit-countdown { position: relative; z-index: 1; display: flex; justify-content: center; flex-wrap: wrap; gap: 18px clamp(10px, 3vw, 22px); }
.fe-countdown .kit-countdown-unit { position: relative; width: clamp(64px, 18vw, 92px); min-width: 0; aspect-ratio: .8; padding: 0 0 6%; display: flex; flex-direction: column; align-items: center; justify-content: center; isolation: isolate;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: radial-gradient(circle at 30% 30%, rgba(140, 90, 40, .18) 0 2px, transparent 2.5px) 0 0 / 17px 19px,
        radial-gradient(circle at 70% 60%, rgba(140, 90, 40, .14) 0 1.5px, transparent 2px) 0 0 / 13px 15px,
        radial-gradient(circle at 34% 28%, #fffdf6, #f3e3c4 62%, #dcc39a);
    box-shadow: inset -4px -6px 10px rgba(120, 80, 30, .2), 0 10px 14px -10px rgba(80, 50, 20, .6); }
.fe-countdown .kit-countdown-unit:nth-child(2) { background-color: transparent; filter: hue-rotate(-12deg) saturate(1.3); }
.fe-countdown .kit-countdown-value { font-family: var(--inv-font-heading); font-weight: 700; font-size: clamp(1.25rem, 5vw, 1.7rem); line-height: 1; color: #5c3b16; font-variant-numeric: tabular-nums; }
.fe-countdown .kit-countdown-label { opacity: 1; color: #84603a; font-size: .5rem; font-weight: 800; letter-spacing: .1em; margin-top: 2px; }
.fe-straw { position: absolute; left: 0; right: 0; bottom: -6px; height: 34%; z-index: 2; border-radius: 0 0 50% 50% / 0 0 70% 70%; pointer-events: none;
    background: repeating-linear-gradient(12deg, transparent 0 5px, rgba(160, 110, 30, .55) 5px 6px, transparent 6px 11px),
        repeating-linear-gradient(-14deg, transparent 0 7px, rgba(255, 240, 190, .55) 7px 8px, transparent 8px 13px), linear-gradient(#e7c56d, #c79a3c);
    -webkit-mask: linear-gradient(transparent, #000 34%); mask: linear-gradient(transparent, #000 34%); }
.kit-js .fe-countdown .kit-countdown-unit { opacity: 0; translate: 0 -40px; transition: opacity .5s ease, translate .9s cubic-bezier(.3, 1.5, .5, 1); }
.kit-js .fe-countdown .kit-countdown-unit:nth-child(2) { transition-delay: .14s; }
.kit-js .fe-countdown .kit-countdown-unit:nth-child(3) { transition-delay: .28s; }
.kit-js .fe-countdown .kit-countdown-unit:nth-child(4) { transition-delay: .42s; }
.kit-js .fe-countdown.is-visible .kit-countdown-unit { opacity: 1; translate: 0 0; animation: fe-wobble 3.6s ease-in-out 1.4s infinite; }
.kit-js .fe-countdown.is-visible .kit-countdown-unit:nth-child(even) { animation-delay: 2.2s; }
@keyframes fe-wobble { 0%, 80%, 100% { rotate: 0deg; } 85% { rotate: -5deg; } 90% { rotate: 4deg; } 95% { rotate: -2deg; } }

/* Gallery: every photo behind two red barn shutters that swing open */
.fe-gallery-grid.kit-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 3vw, 30px); }
.fe-gallery-grid.kit-gallery a { position: relative; display: block; aspect-ratio: 1; padding: 7px; border-radius: 6px; background: #fffaf0; perspective: 700px;
    box-shadow: 0 0 0 4px var(--fe-barn-dark), 0 18px 30px -18px rgba(0, 0, 0, .5); transition: translate .5s ease; }
.fe-gallery-grid.kit-gallery a:hover { translate: 0 -4px; }
.fe-gallery-grid.kit-gallery img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.fe-gallery-grid.kit-gallery a::before, .fe-gallery-grid.kit-gallery a::after { content: ""; position: absolute; top: 7px; bottom: 7px; width: calc(50% - 7px); z-index: 2; pointer-events: none;
    background: linear-gradient(32deg, transparent 47%, #fffaf0 47% 53%, transparent 53%), repeating-linear-gradient(90deg, transparent 0 13px, rgba(0, 0, 0, .14) 13px 15px), var(--fe-barn);
    box-shadow: inset 0 0 0 4px #fffaf0; backface-visibility: hidden; transition: rotate 1.2s cubic-bezier(.3, 1.2, .5, 1); }
.fe-gallery-grid.kit-gallery a::before { left: 7px; transform-origin: 0 50%; }
.fe-gallery-grid.kit-gallery a::after { right: 7px; transform-origin: 100% 50%;
    background: linear-gradient(-32deg, transparent 47%, #fffaf0 47% 53%, transparent 53%), repeating-linear-gradient(90deg, transparent 0 13px, rgba(0, 0, 0, .14) 13px 15px), var(--fe-barn); }
.fe-gallery-grid.kit-gallery a::before, .fe-gallery-grid.kit-gallery a::after { rotate: y 100deg; }
.kit-js .fe-gallery .fe-gallery-grid a::before { rotate: y 0deg; }
.kit-js .fe-gallery .fe-gallery-grid a::after { rotate: y 0deg; }
.kit-js .fe-gallery.is-visible .fe-gallery-grid a::before { rotate: y -100deg; }
.kit-js .fe-gallery.is-visible .fe-gallery-grid a::after { rotate: y 100deg; }
.kit-js .fe-gallery.is-visible .fe-gallery-grid a:nth-child(2)::before, .kit-js .fe-gallery.is-visible .fe-gallery-grid a:nth-child(2)::after { transition-delay: .15s; }
.kit-js .fe-gallery.is-visible .fe-gallery-grid a:nth-child(3)::before, .kit-js .fe-gallery.is-visible .fe-gallery-grid a:nth-child(3)::after { transition-delay: .3s; }
.kit-js .fe-gallery.is-visible .fe-gallery-grid a:nth-child(4)::before, .kit-js .fe-gallery.is-visible .fe-gallery-grid a:nth-child(4)::after { transition-delay: .45s; }
.kit-js .fe-gallery.is-visible .fe-gallery-grid a:nth-child(5)::before, .kit-js .fe-gallery.is-visible .fe-gallery-grid a:nth-child(5)::after { transition-delay: .6s; }
.kit-js .fe-gallery.is-visible .fe-gallery-grid a:nth-child(n+6)::before, .kit-js .fe-gallery.is-visible .fe-gallery-grid a:nth-child(n+6)::after { transition-delay: .75s; }
@media (min-width: 760px) { .fe-gallery-grid.kit-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* RSVP, with the alpaca and her baby peeking over the top of the card */
.fe-reply-wrap { position: relative; max-width: 700px; margin: 0 auto; padding-top: 110px; }
.fe-watch { position: absolute; top: 0; right: 7%; width: clamp(150px, 34vw, 190px); z-index: 0; }
.kit-js .fe-reply-wrap .fe-watch img { translate: 0 80px; transition: translate 1.1s cubic-bezier(.3, 1.3, .5, 1) .3s; }
.kit-js .fe-reply-wrap.is-visible .fe-watch img { translate: 0 0; }
.fe-reply { z-index: 1; padding: clamp(40px, 6vw, 56px) clamp(24px, 6vw, 56px) clamp(32px, 5vw, 48px); }
.ferma .inv-rsvp__intro { font-size: 1.1rem; font-weight: 600; }
.ferma .inv-rsvp__deadline { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--inv-primary); }
.fe-info-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.fe-info-item { padding: 30px 24px 20px; text-align: center; }
.fe-info-item h3 { font-size: 1.35rem; color: var(--inv-primary); margin-bottom: 8px; }
.fe-faq { max-width: 720px; margin: 46px auto 0; text-align: center; display: grid; gap: 12px; }
.fe-faq details { text-align: left; }
.fe-faq summary { cursor: pointer; list-style: none; padding: 17px 56px 17px 22px; position: relative; font-weight: 800; font-size: 1.02rem; }
.fe-faq summary::-webkit-details-marker { display: none; }
/* a little egg that tips over when the answer opens */
.fe-faq summary::after { content: ""; position: absolute; right: 20px; top: 50%; width: 17px; height: 22px; margin-top: -11px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: radial-gradient(circle at 34% 28%, #fffdf6, #f0dcb6 70%); box-shadow: inset -2px -3px 4px rgba(120, 80, 30, .25), 0 0 0 1px rgba(120, 80, 30, .25); transition: rotate .5s cubic-bezier(.3, 1.6, .5, 1); }
.fe-faq details[open] summary::after { rotate: 90deg; }
.fe-faq summary:focus-visible { outline: 2px solid var(--inv-primary); outline-offset: 2px; border-radius: 22px; }
.fe-faq details p { padding: 0 22px; color: var(--fe-soft); }
.fe-faq details p:last-child { padding-bottom: 16px; }
.fe-contact { text-align: center; }
.fe-contact-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px 60px; }
.fe-contact-person a { text-decoration: none; font-weight: 700; }

/* ---------- Footer: the scarecrow waving beside the hens on the coop ---------- */
.fe-footer { text-align: center; padding: clamp(90px, 13vw, 140px) 16px 40px; overflow: hidden; overflow: clip; }
.fe-footer-message { font-size: 1.2rem; font-weight: 600; color: var(--fe-soft); max-width: 36ch; margin: 0 auto 6px; }
.ferma .fe-footer-name { font-family: var(--inv-font-heading); font-weight: 700; font-size: clamp(3rem, 11vw, 4.4rem); line-height: 1.05; color: var(--inv-primary); margin: 4px 0 10px; }
.fe-hashtag { font-weight: 700; letter-spacing: .06em; color: var(--inv-primary); }
.fe-farewell { position: relative; width: min(560px, 100%); margin: 30px auto 0; display: grid; grid-template-columns: .8fr 1fr; align-items: end; gap: 0; }
.fe-scarecrow { width: 112%; margin-right: -12%; z-index: 2; transform-origin: 50% 100%; }
.fe-coop { width: 100%; }
.kit-js .fe-footer .fe-farewell .fe-art img { opacity: 0; translate: 0 30px; transition: opacity .8s ease, translate 1.1s cubic-bezier(.3, 1.3, .5, 1); }
.kit-js .fe-footer .fe-farewell .fe-scarecrow img { transition-delay: .3s; }
.kit-js .fe-footer.is-visible .fe-farewell .fe-art img { opacity: 1; translate: 0 0; }
.kit-js .fe-footer.is-visible .fe-scarecrow { animation: fe-sway 4s ease-in-out 1.6s infinite; }
@keyframes fe-sway { 0%, 100% { rotate: 0deg; } 50% { rotate: 2.5deg; } }

@media (prefers-reduced-motion: reduce) {
    .kit-js .fe-barn--hero, .kit-js .fe-flock img, .kit-js .fe-donkey img, .kit-js .fe-hero-text > *, .kit-js .fe-footer.is-visible .fe-scarecrow, .kit-js .fe-countdown.is-visible .kit-countdown-unit { animation: none; }
    .kit-js .fe-title .fe-fence i, .kit-js .fe-title .fe-fence b, .kit-js .fe-title .fe-fence em { scale: 1; rotate: 0deg; transition: none; }
    .kit-js .fe-welcome .fe-hello img, .kit-js .fe-star-grid .fe-buddy img, .kit-js .fe-star-grid .fe-spokes, .kit-js .fe-theme .fe-sign, .kit-js .fe-stop .fe-stop-card,
    .kit-js .fe-stop .fe-stop-art img, .kit-js .fe-countdown .kit-countdown-unit, .kit-js .fe-reply-wrap .fe-watch img, .kit-js .fe-footer .fe-farewell .fe-art img { opacity: 1; translate: 0 0; rotate: 0deg; scale: 1; transition: none; }
    .kit-js .fe-gallery .fe-gallery-grid a::before { rotate: y -100deg; transition: none; }
    .kit-js .fe-gallery .fe-gallery-grid a::after { rotate: y 100deg; transition: none; }
}
