/* easystrasse.de – theme effects: sticker peel, setting sun, scene loops, postcard + postmarks */

/* ---------- peel: a corner lifts off like a sticker (clip-path + folded flap) */
@property --peel { syntax: '<length>'; inherits: true; initial-value: 0px; }

:where([data-peel]) { --peel: 0px; --peel-hover: 34px; position: relative; display: block; }
[data-peel] {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--peel)), calc(100% - var(--peel)) 100%, 0 100%);
  transition: --peel .55s var(--ease), transform .45s var(--bounce); }
[data-peel]::after { content: ''; position: absolute; right: 0; bottom: 0; width: var(--peel); height: var(--peel); pointer-events: none;
  background: linear-gradient(to bottom right, #CDB896 0%, #F2E8D6 52%, #FFFDF7 100%);
  clip-path: polygon(0 0, 100% 0, 0 100%); }
[data-peel]:hover, [data-peel]:focus-visible, [data-peel].is-peeled { --peel: var(--peel-hover); }

/* round stickers: the flap is the reflected circle segment */
.peel--round::after { right: auto; bottom: auto; width: var(--s); height: var(--s); border-radius: 50%;
  left: calc(var(--s) - var(--peel)); top: calc(var(--s) - var(--peel));
  clip-path: polygon(0 0, var(--peel) 0, 0 var(--peel));
  background: linear-gradient(to bottom right, #D3BF9E 0%, #F3EADA 40%, #FFFDF7 100%); }
.teaser__sticker { --peel-hover: 92px; }
.teaser__sticker.is-peeled { --peel: 150px; transform: rotate(16deg) translate(-6px, -8px); }
.teaser__sticker .sticker-art { display: block; width: 100%; height: 100%; }
.sticker-art__ring { font: 800 13.2px var(--f-body); letter-spacing: 2.2px; }
.sticker-art__ribbon text { font: 400 12px var(--f-script); letter-spacing: 1.5px; }

/* hero patch */
.patch { --peel-hover: 30px; display: grid; justify-items: start; gap: 2px; padding: 16px 22px 18px; min-width: 170px;
  background: var(--cream-2); border: 3px solid var(--ink); border-radius: 20px; color: var(--ink); text-decoration: none;
  animation: peel-hint 6s steps(120) 2.5s infinite; }
.patch::before { content: ''; position: absolute; inset: 6px; border: 2px dashed rgba(46, 26, 15, .28); border-radius: 14px; pointer-events: none; }
.patch:hover { color: var(--ink); animation: none; }
.patch__k { font: 700 .72rem/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--rust); }
.patch__v { font: 900 2.1rem/1.05 var(--f-display); font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.patch__s { font-size: .82rem; color: var(--muted); font-weight: 700; }
@keyframes peel-hint { 0%, 70%, 100% { --peel: 0px; } 80% { --peel: 26px; } 88% { --peel: 10px; } }

/* ---------- setting sun (index hero): --set 0..1 written by sunset.js on the section element only */
.arch__stripe { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-line 1.5s var(--ease) forwards; }
.arch__stripe.s1 { animation-delay: .1s; } .arch__stripe.s2 { animation-delay: .25s; } .arch__stripe.s3 { animation-delay: .4s; } .arch__stripe.s4 { animation-delay: .55s; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
.scene__sun { transform: translateY(calc(var(--set, 0) * 250px)); }
.scene__dusk { opacity: calc(var(--set, 0) * .95); }
.scene__stars { opacity: calc(var(--set, 0) * 1.7 - .55); }
/* loops inside the SVG repaint it, so they are stepped to ~12–20 fps */
.sun__halo { transform-box: fill-box; transform-origin: center; animation: halo 5s steps(70) infinite alternate; }
.sun__halo--2 { animation-delay: -2.5s; }
@keyframes halo { from { transform: scale(.94); } to { transform: scale(1.05); } }
.cloud { animation: cloud 24s steps(300) infinite alternate; }
.cloud--b { animation-duration: 31s; animation-direction: alternate-reverse; }
@keyframes cloud { from { transform: translateX(-30px); } to { transform: translateX(60px); } }
.van__drive { transform: translateX(calc(var(--set, 0) * -150px)); }
.van__body { animation: bob .5s steps(4) infinite alternate; }
@keyframes bob { to { transform: translateY(-2.5px); } }
.van__wind path { stroke-dasharray: 30; animation: wind .9s steps(14) infinite; }
.van__wind path:nth-child(2) { animation-delay: -.3s; } .van__wind path:nth-child(3) { animation-delay: -.6s; }
@keyframes wind { from { stroke-dashoffset: 60; opacity: 0; } 40% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 0; } }
.scene__dash { animation: dash-run 1.2s steps(18) infinite; }
@keyframes dash-run { to { stroke-dashoffset: -30; } }

@media (prefers-reduced-motion: reduce) {
  .arch__stripe { stroke-dashoffset: 0; }
  .patch { animation: none; }
  [data-peel] { transition: none; }
}
