/* The town's calendar: what the Πολιτεία wears through the year (inc/season.php). Loaded only while a season is on.
   Everything is the town's own card under the town's one light: lit fronts, shaded right halves, no gradients. The
   only colours the season adds are warm gold light and white; the logo's fuchsia and green carry the rest. */

/* ---------------------------------------------------------------- snow lying on the roofs, the hedge, the pavement */

.pp-snow { fill: #FFFFFF; }
.pp-snow--shade { fill: #EADDE3; }
.pp-sky--dusk .pp-snow { fill: #FFF5F8; } .pp-sky--dusk .pp-snow--shade { fill: #EFD3DF; }
.pp-sky--night .pp-snow { fill: #E9DCE3; } .pp-sky--night .pp-snow--shade { fill: #BBA2B0; }
.pp-night .pp-snow { fill: #D8C5CF; } .pp-night .pp-snow--shade { fill: #9E8191; }

/* ---------------------------------------------------------------- snow falling: paper flakes in four drifting sheets */

/* Four sheets from near to far, each holding its flakes twice, one copy above the other (pp_snowfall()). Each slides
   down one copy's height per fall while it sways, so the snow loops without a seam and the phone's graphics move four
   layers instead of every flake. The box clips the copy waiting above it. */
.pp-snowfall { position: absolute; container-type: size; overflow: hidden; pointer-events: none; }
.pp-snowsheet { position: absolute; left: 0; top: 0; width: 100%; height: 200%; transform: translateY(-50%); }
.pp-snowsheet i { position: absolute; width: var(--s); aspect-ratio: 1; }
.pp-snowfall b { display: block; width: 100%; height: 100%; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 1.5px rgb(var(--pp-shadow) / 0.2); }
/* A star flake is cut from its b's ::before, so its shadow follows the star's points. */
.pp-snowfall .is-star b { border-radius: 0; background: none; box-shadow: none; filter: drop-shadow(0 1px 1px rgb(var(--pp-shadow) / 0.22)); }
.pp-snowfall .is-star b::before { content: ""; display: block; width: 100%; height: 100%; background: #FFFFFF; clip-path: polygon(50% 0, 61% 31%, 93.3% 25%, 72% 50%, 93.3% 75%, 61% 69%, 50% 100%, 39% 69%, 6.7% 75%, 28% 50%, 6.7% 25%, 39% 31%); }
.pp-sky--night .pp-snowfall b, .pp-snowfall--night b { background: #F1E4EA; box-shadow: none; }
.pp-sky--night .pp-snowfall .is-star b, .pp-snowfall--night .is-star b { background: none; filter: none; }
.pp-sky--night .pp-snowfall .is-star b::before, .pp-snowfall--night .is-star b::before { background: #F1E4EA; }
/* The nearest sheet falls the box's height in 10 s, the farthest in 20 s, each swaying twice on the way down (sampled
   every eighth of a sway: a sheet's amplitude, as % of the box's width, is 1.6, 1.3, 1, 0.8 from near to far). */
@media (prefers-reduced-motion: no-preference) {
	.pp-snowsheet--1 { animation: pp-snow1 10s linear infinite; }
	.pp-snowsheet--2 { animation: pp-snow2 13s linear -4s infinite; }
	.pp-snowsheet--3 { animation: pp-snow3 16s linear -9s infinite; }
	.pp-snowsheet--4 { animation: pp-snow4 20s linear -13s infinite; }
}
@keyframes pp-snow1 {
	0% { transform: translate(0, -50%); } 6.25% { transform: translate(1.131%, -46.875%); } 12.5% { transform: translate(1.6%, -43.75%); } 18.75% { transform: translate(1.131%, -40.625%); }
	25% { transform: translate(0, -37.5%); } 31.25% { transform: translate(-1.131%, -34.375%); } 37.5% { transform: translate(-1.6%, -31.25%); } 43.75% { transform: translate(-1.131%, -28.125%); }
	50% { transform: translate(0, -25%); } 56.25% { transform: translate(1.131%, -21.875%); } 62.5% { transform: translate(1.6%, -18.75%); } 68.75% { transform: translate(1.131%, -15.625%); }
	75% { transform: translate(0, -12.5%); } 81.25% { transform: translate(-1.131%, -9.375%); } 87.5% { transform: translate(-1.6%, -6.25%); } 93.75% { transform: translate(-1.131%, -3.125%); }
	100% { transform: translate(0, 0); }
}
@keyframes pp-snow2 {
	0% { transform: translate(0, -50%); } 6.25% { transform: translate(0.919%, -46.875%); } 12.5% { transform: translate(1.3%, -43.75%); } 18.75% { transform: translate(0.919%, -40.625%); }
	25% { transform: translate(0, -37.5%); } 31.25% { transform: translate(-0.919%, -34.375%); } 37.5% { transform: translate(-1.3%, -31.25%); } 43.75% { transform: translate(-0.919%, -28.125%); }
	50% { transform: translate(0, -25%); } 56.25% { transform: translate(0.919%, -21.875%); } 62.5% { transform: translate(1.3%, -18.75%); } 68.75% { transform: translate(0.919%, -15.625%); }
	75% { transform: translate(0, -12.5%); } 81.25% { transform: translate(-0.919%, -9.375%); } 87.5% { transform: translate(-1.3%, -6.25%); } 93.75% { transform: translate(-0.919%, -3.125%); }
	100% { transform: translate(0, 0); }
}
@keyframes pp-snow3 {
	0% { transform: translate(0, -50%); } 6.25% { transform: translate(0.707%, -46.875%); } 12.5% { transform: translate(1%, -43.75%); } 18.75% { transform: translate(0.707%, -40.625%); }
	25% { transform: translate(0, -37.5%); } 31.25% { transform: translate(-0.707%, -34.375%); } 37.5% { transform: translate(-1%, -31.25%); } 43.75% { transform: translate(-0.707%, -28.125%); }
	50% { transform: translate(0, -25%); } 56.25% { transform: translate(0.707%, -21.875%); } 62.5% { transform: translate(1%, -18.75%); } 68.75% { transform: translate(0.707%, -15.625%); }
	75% { transform: translate(0, -12.5%); } 81.25% { transform: translate(-0.707%, -9.375%); } 87.5% { transform: translate(-1%, -6.25%); } 93.75% { transform: translate(-0.707%, -3.125%); }
	100% { transform: translate(0, 0); }
}
@keyframes pp-snow4 {
	0% { transform: translate(0, -50%); } 6.25% { transform: translate(0.566%, -46.875%); } 12.5% { transform: translate(0.8%, -43.75%); } 18.75% { transform: translate(0.566%, -40.625%); }
	25% { transform: translate(0, -37.5%); } 31.25% { transform: translate(-0.566%, -34.375%); } 37.5% { transform: translate(-0.8%, -31.25%); } 43.75% { transform: translate(-0.566%, -28.125%); }
	50% { transform: translate(0, -25%); } 56.25% { transform: translate(0.566%, -21.875%); } 62.5% { transform: translate(0.8%, -18.75%); } 68.75% { transform: translate(0.566%, -15.625%); }
	75% { transform: translate(0, -12.5%); } 81.25% { transform: translate(-0.566%, -9.375%); } 87.5% { transform: translate(-0.8%, -6.25%); } 93.75% { transform: translate(-0.566%, -3.125%); }
	100% { transform: translate(0, 0); }
}

/* In the opening, in town units: in front of Olympus and behind every building, like the balloon and the kite. */
.pp-snowfall--town { left: calc(380 * 0.05%); top: calc(230 * 0.1%); width: calc(1240 * 0.05%); height: calc(470 * 0.1%); }
/* On the street, behind the shop and the signposts; on its pale mint the flakes need a firmer edge. */
.pp-snowfall--street { inset: 0; }
.pp-snowfall--street b { box-shadow: 0 1px 2px rgb(var(--pp-shadow) / 0.32); }
.pp-snowfall--street .is-star b { box-shadow: none; filter: drop-shadow(0 1px 1.2px rgb(var(--pp-shadow) / 0.36)); }
/* At the end, only from the words down to the roofs, so it never falls across the text. */
.pp-snowfall--night { left: 0; right: 0; bottom: 0; height: calc(clamp(120px, 15vw, 210px) + clamp(48px, 7vw, 96px)); }

/* ---------------------------------------------------------------- lights: beads by day, lit and blinking from dusk */

.pp-xwire { fill: none; stroke: #5B3746; stroke-width: 0.9; stroke-linejoin: round; stroke-linecap: round; }
.pp-xbulb { fill: #FFD66B; stroke: rgb(91 55 70 / 0.5); stroke-width: 0.5; }
.pp-xbulb--warm { fill: #FFF6DC; }
/* Lit, they need no edge to show against the snow. Like the wheel's bulbs, they light by colour alone: no glow. */
:is(.pp-sky--dusk, .pp-sky--night, .pp-night) .pp-xbulb { stroke: none; }
/* From dusk every string swaps its gold and warm white every 1.2 s, each piece on its own beat (--k). The swap is a
   lit layer over the piece: the same bulbs in the other colours (pp_xlit() in inc/season.php), shown and hidden by
   the phone's graphics chip. A blinking fill on each bulb had its processor redraw the town on every frame instead. */
svg.pp-xlit { display: none; pointer-events: none; }
.pp-xlit__gold { fill: #FFD66B; }
.pp-xlit__warm { fill: #FFF6DC; }
/* At the end of the page the lit layer lies over the row of houses, to the same box (home.css .pp-night__town). */
.pp-night > .pp-xlit { position: absolute; left: 0; bottom: 0; width: 100%; height: max(clamp(120px, 15vw, 210px), 7.2vw); }
@media (prefers-reduced-motion: no-preference) {
	:is(.pp-sky--dusk, .pp-sky--night, .pp-night) svg.pp-xlit { display: block; animation: pp-xlit 2.4s steps(1) infinite; animation-delay: calc(var(--k) * -0.7s); }
}
@keyframes pp-xlit { 0% { opacity: 0; } 50% { opacity: 1; } }

/* The star on the logo's tree and on the wheel's hub: gold card with its right half in shade. */
.pp-xstar__lit { fill: #FFD66B; }
.pp-xstar__shade { fill: #E9B843; }

/* The wreath on the shop door, the garland over the awning. */
.pp-wreath__ring { fill: none; stroke: #24734A; }
.pp-garland__fir { fill: none; stroke: #24734A; stroke-width: 4.4; stroke-linecap: round; }
.pp-garland__tips { fill: none; stroke: #49A86F; stroke-width: 1.8; stroke-dasharray: 1.4 2.8; stroke-linecap: round; }

/* The lit stars on the street lamps. */
.pp-lampstar__line { fill: none; stroke: #FFD66B; stroke-width: 1.9; stroke-linejoin: round; }
.pp-lampstar__core { fill: #FFF6DC; }
.pp-sky--day .pp-lampstar__line { stroke: #E9B843; }

/* The καραβάκι in the shop window. */
.pp-xmast { fill: none; stroke: #5B3746; stroke-width: 1.4; stroke-linecap: round; }

/* ---------------------------------------------------------------- the κάλαντα at the shop door */

.pp-kid__arm { fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.pp-kid__arm--green { stroke: #24734A; }
.pp-kid__arm--blue { stroke: #66B9E3; }
.pp-kid__beater { fill: none; stroke: #7A5363; stroke-width: 1.2; stroke-linecap: round; }
.pp-kid__triangle { fill: none; stroke: #A8919C; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.pp-note__stem { fill: none; stroke: #5B3746; stroke-width: 1.2; stroke-linecap: round; }
/* Each note is a little drawing of its own (pp_kalanda_notes()), 12 × 14 units with its head at (4, 10): it floats
   6 units left and 16 up while turning about its head, so the graphics chip carries it, not the processor. */
.pp-note { transform-origin: 33.333% 71.429%; }
@media (prefers-reduced-motion: no-preference) {
	.pp-note { opacity: 0; animation: pp-note 3.6s ease-out infinite; }
}
@keyframes pp-note { 0% { opacity: 0; transform: translate(0, 0); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -114.286%) rotate(-10deg); } }

/* ---------------------------------------------------------------- the καλικάντζαρος: tap him and he ducks */

.pp-goblin { cursor: pointer; pointer-events: auto; }
.pp-goblin__hit { fill: transparent; }
.pp-goblin__fur { fill: #7A5363; }
.pp-goblin__shade { fill: #5B3746; }
.pp-goblin__ear { fill: #C98AA4; }
.pp-goblin__grin { fill: none; stroke: #3B1F2B; stroke-width: 1.3; stroke-linecap: round; }
.pp-sky--night .pp-goblin__fur { fill: #946A7D; } .pp-sky--night .pp-goblin__shade { fill: #6E4A5B; }
.pp-goblin__body { transition: transform 0.34s cubic-bezier(0.3, 1.5, 0.6, 1); }
.pp-goblin.is-ducking .pp-goblin__body { transform: translateY(20px); transition: transform 0.16s ease-in; }
/* He peeks as a whole drawing (his own piece, pp_goblin_box()), dipping 7 of his units: 19.444% of its 36. */
@media (prefers-reduced-motion: no-preference) {
	.pp-goblin-peek { animation: pp-peek 7s ease-in-out infinite; }
}
@keyframes pp-peek { 0%, 64%, 100% { transform: translateY(0); } 70%, 84% { transform: translateY(19.444%); } }

/* ---------------------------------------------------------------- New Year: the clock strikes, the sky bursts */

.pp-fireworks { position: absolute; inset: 0; pointer-events: none; }
.pp-burst { position: absolute; width: calc(100 * 0.05%); aspect-ratio: 1; overflow: visible; opacity: 0; transform: scale(0.2); }
.pp-burst path { fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; }
.pp-burst circle { fill: currentColor; }
.pp-burst--gold { color: #FFD66B; } .pp-burst--pink { color: #F48FB6; } .pp-burst--mint { color: #A6E3C0; } .pp-burst--white { color: #FFF6DC; }
@media (prefers-reduced-motion: no-preference) {
	.pp-fireworks.is-on .pp-burst { animation: pp-burst 2.6s cubic-bezier(0.15, 0.85, 0.3, 1) var(--d) 8 both; }
	.pp-hclock.is-striking { transform-box: fill-box; transform-origin: 50% 50%; animation: pp-strike 0.6s ease-in-out 6; }
}
@media (prefers-reduced-motion: reduce) {
	.pp-fireworks.is-on .pp-burst { opacity: 1; transform: none; }
}
@keyframes pp-burst { 0% { opacity: 0; transform: scale(0.15); } 10% { opacity: 1; } 62% { opacity: 1; } 100% { opacity: 0; transform: translateY(8%) scale(1.05); } }
@keyframes pp-strike { 50% { transform: scale(1.22); } }

/* ---------------------------------------------------------------- Easter: spring, Holy Week, the Holy Light, Bright Week */

/* Spring's swallows fly where the town's birds do (filled card, not the birds' strokes). */
.pp-birds .pp-swallow { fill: #3B1F2B; stroke: none; }

/* Holy Week: the town goes quiet. The balloon and the kite come down, the wheel and the carousel's pennant stop. */
:is(.pp-phase--quiet, .pp-phase--vigil, .pp-phase--anastasi) :is(.pp-balloon, .pp-kite) { visibility: hidden; }
:is(.pp-phase--quiet, .pp-phase--vigil, .pp-phase--anastasi) :is(.pp-hw__rotor, .pp-hw__cabin, .pp-hflag) { animation-play-state: paused; }
/* The rim's gold copy stops with the rim but keeps glowing. */
:is(.pp-phase--quiet, .pp-phase--vigil, .pp-phase--anastasi) .pp-hw__glow { animation-play-state: paused, running; }

/* Candle flames: the Επιτάφιος on Good Friday night, the light carried home on the night of the Resurrection. */
.pp-flame__fire { fill: #FFD66B; }
.pp-flame__core { fill: #FFF6DC; }
@media (prefers-reduced-motion: no-preference) {
	.pp-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: pp-flicker 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * -0.21s); }
	.pp-walk { animation: pp-walk 1.15s ease-in-out infinite; animation-delay: calc(var(--i) * -0.37s); }
}
@keyframes pp-walk { 50% { transform: translateY(-1.4px); } }

/* Holy Saturday from 23:00: every light in town is out, as in the church before midnight. */
.pp-phase--vigil :is(.pp-lamp, .pp-heart, .pp-frame) { fill: #2A1520; transition: none; }
.pp-phase--vigil :is(.pp-hw__bulb, .pp-bulb--marquee) { fill: #4A2937; animation: none; }
.pp-phase--vigil :is(.pp-hw__glow, .pp-hbulbs) { visibility: hidden; } /* Their gold layers: hidden, not stopped, so they stay in step. */
.pp-phase--vigil :is(.pp-flame, .pp-anastasi) { opacity: 0; }

/* Midnight: the light leaves the chapel door and passes from window to window across the town (season.js gives
   each its --d by its distance from the door), then the bell rings, «Χριστός Ανέστη!» unfolds and fireworks go up.
   Without scripts, or with reduced motion, the town is simply lit. */
.pp-phase--anastasi :is(.pp-lamp, .pp-heart, .pp-frame) { transition: fill 0.7s ease-out var(--d, 0s); }
.pp-phase--anastasi .pp-flame { transition: opacity 0.45s ease-out var(--d, 0s); }
@media (prefers-reduced-motion: no-preference) {
	.pp-js .pp-phase--anastasi:not(.is-lit) :is(.pp-lamp, .pp-heart, .pp-frame) { fill: #2A1520; }
	.pp-js .pp-phase--anastasi:not(.is-lit) :is(.pp-hw__bulb, .pp-bulb--marquee) { fill: #4A2937; animation: none; }
	.pp-js .pp-phase--anastasi:not(.is-lit) :is(.pp-hw__glow, .pp-hbulbs) { visibility: hidden; }
	.pp-js .pp-phase--anastasi:not(.is-lit) .pp-flame { opacity: 0; }
	.pp-js .pp-phase--anastasi:not(.is-lit) .pp-anastasi { opacity: 0; transform: rotateX(-90deg); }
	.pp-phase--anastasi .pp-anastasi { transition: transform 0.9s var(--pp-ease-pop) 4.4s, opacity 0.2s linear 4.4s; }
	.pp-phase--anastasi.is-lit .pp-hbell { transform-box: fill-box; transform-origin: 50% 0; animation: pp-ring 1.2s ease-in-out 0.5s 5; }
}
@keyframes pp-ring { 25% { transform: rotate(18deg); } 75% { transform: rotate(-18deg); } }

/* «Χριστός Ανέστη!»: a fuchsia paper ribbon with folded tails and a stitched edge, over the town. */
.pp-anastasi { position: absolute; left: calc(800 * 0.05%); top: calc(394 * 0.1%); width: calc(400 * 0.05%); transform-origin: 50% 100%; filter: drop-shadow(0 0.6cqh 0.5cqh rgb(0 0 0 / 0.28)); }
.pp-anastasi svg { display: block; width: 100%; overflow: visible; }
.pp-anastasi__stitch { fill: none; stroke: #F6B8CF; stroke-width: 1.6; stroke-dasharray: 5 4; }
.pp-anastasi__text { font: 800 25px/1 var(--pp-font); letter-spacing: 0.01em; fill: #FFFFFF; }

/* Bright Week: red eggs in a kraft basket. A tap knocks two of them together and one cracks. */
.pp-eggs { cursor: pointer; pointer-events: auto; }
.pp-eggs__hit { fill: transparent; }
.pp-egg { fill: #B8153A; }
.pp-egg__shade { fill: #8E0F2C; }
.pp-sky--night .pp-egg { fill: #9C1233; } .pp-sky--night .pp-egg__shade { fill: #730C26; }
.pp-egg__crack { fill: none; stroke: #FFF1D6; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity 0.12s; }
.pp-eggs.is-cracked-a .pp-egg-a .pp-egg__crack, .pp-eggs.is-cracked-b .pp-egg-b .pp-egg__crack { opacity: 1; }
.pp-eggs__handle { fill: none; stroke: #BF956B; stroke-width: 2.6; stroke-linecap: round; }
.pp-eggs__weave { fill: none; stroke: #BF956B; stroke-width: 1; }
.pp-egg-wrap { transform-box: fill-box; transform-origin: 50% 100%; }
@media (prefers-reduced-motion: no-preference) {
	.pp-eggs.is-knocking .pp-egg-a { animation: pp-knock 0.5s ease-in-out; }
	.pp-eggs.is-knocking .pp-egg-b { animation: pp-knocked 0.5s ease-in-out; }
}
@keyframes pp-knock { 0%, 100% { transform: none; } 42% { transform: translate(3px, -3px) rotate(16deg); } 55% { transform: translate(3.6px, -2px) rotate(12deg); } }
@keyframes pp-knocked { 0%, 40%, 100% { transform: none; } 55% { transform: rotate(5deg); } 75% { transform: rotate(-2deg); } }

/* Καθαρά Δευτέρα: more kites in the air layer, each tugging at its own string. */
.pp-kite2 { position: absolute; }
.pp-kite2 svg { display: block; width: 100%; overflow: visible; transform-origin: 50% 100%; }
@media (prefers-reduced-motion: no-preference) {
	.pp-kite2 svg { animation: pp-kite 4.6s ease-in-out var(--kd, 0s) infinite alternate; }
}
.pp-sky--night .pp-kite2 { display: none; }

/* ---------------------------------------------------------------- reduced motion: hung up and still */

@media (prefers-reduced-motion: reduce) {
	.pp-goblin__body { transition: none; }
}
