/**
 * @file        effects.css
 * @description Vivid visual layer for the SOS Strassenhunde MVP: glow blobs, aurora sections, button sheen, card tilt/glow,
 *              animated accents, smooth accordion, scroll progress — brand colours only, contrast rules kept (ColorTheme 4)
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @email       tom@synthetixmind.com
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         bfb0cd49-dd60-40b0-b4f5-df91aba88a97
 * @version     0.1.2.4
 * @created     2026-10-25
 * @updated     2026-11-07
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 *
 * WHY: no prefers-reduced-motion gate — owner decision 2026-10-22/23 (animations always run).
 *      Decorative layers sit behind text (z-index -1) and stay light, so text contrast never drops below AA.
 */

:root {
  /* Smooth height animation for <details> where supported (Chrome 129+); other browsers simply snap. */
  interpolate-size: allow-keywords;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --gradient-brand: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

::selection { background: var(--color-accent); color: var(--color-text); }

/* ---------------------------------------------------------------- Scroll progress + glass header */
.scroll-progress {
  position: fixed; inset: 0 0 auto 0; z-index: 160; height: 4px;
  background: var(--gradient-brand);
  transform-origin: 0 50%; transform: scaleX(var(--progress, 0));
  pointer-events: none;
}
.site-header { transition: background-color 300ms, border-color 300ms, box-shadow 300ms, backdrop-filter 300ms; }
.site-header.is-compact {
  background: rgba(251, 247, 244, 0.86);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
}
.brand img { transition: width 200ms, height 200ms, rotate 500ms var(--ease-spring); }
.brand:hover img { rotate: -10deg; }

/* Nav links: brand underline slides in from the left. */
.nav-toggle, .nav-link { position: relative; }
@media (min-width: 1024px) {
  .nav-toggle::after, .nav-link::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 8px; height: 3px; border-radius: 2px;
    background: var(--gradient-brand); transform: scaleX(0); transform-origin: left;
    transition: transform 300ms var(--ease-out);
  }
  .nav-toggle:hover::after, .nav-link:hover::after, .nav-toggle[aria-expanded="true"]::after { transform: scaleX(1); }
  .submenu a { transition: background-color 200ms, color 200ms, padding-left 250ms var(--ease-out); }
  .submenu a:hover { padding-left: var(--space-5); }
}

/* ---------------------------------------------------------------- Buttons: sheen, lift, glow */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.38) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 750ms var(--ease-out);
}
.btn:hover::after { transform: translateX(130%); }
.btn--primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #D11A21 100%);
  box-shadow: 0 6px 16px -6px rgba(231, 31, 38, 0.55);
}
.btn--primary:hover {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, #9E1016 100%);
  box-shadow: 0 14px 28px -10px rgba(231, 31, 38, 0.7);
  transform: translateY(-2px);
}
.btn--secondary, .btn--on-dark {
  background-image: linear-gradient(var(--color-secondary), var(--color-secondary));
  background-size: 0% 100%; background-repeat: no-repeat; background-position: left;
  transition: background-size 350ms var(--ease-out), color 250ms, transform 200ms, box-shadow 250ms;
}
.btn--secondary:hover { background-size: 100% 100%; transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(14, 74, 87, 0.6); }
.btn--on-dark { background-image: linear-gradient(var(--color-accent), var(--color-accent)); }
.btn--on-dark:hover { background-size: 100% 100%; background-color: transparent; transform: translateY(-2px); }
.btn--on-dark.is-copied { background-size: 100% 100%; color: var(--color-text); animation: pop 450ms var(--ease-spring); }

/* The hero's main call to action breathes with a soft red ring. */
.hero .btn--primary { animation: ring-pulse 2.8s ease-out infinite; }
@keyframes ring-pulse {
  0% { box-shadow: 0 6px 16px -6px rgba(231, 31, 38, 0.55), 0 0 0 0 rgba(231, 31, 38, 0.45); }
  70% { box-shadow: 0 6px 16px -6px rgba(231, 31, 38, 0.55), 0 0 0 16px rgba(231, 31, 38, 0); }
  100% { box-shadow: 0 6px 16px -6px rgba(231, 31, 38, 0.55), 0 0 0 0 rgba(231, 31, 38, 0); }
}
@keyframes pop { 0% { scale: 0.92; } 60% { scale: 1.06; } 100% { scale: 1; } }

/* Text links: arrow nudges, underline grows in brand gradient. */
.text-link { text-decoration: none; background: var(--gradient-brand) no-repeat left bottom / 0% 3px; transition: background-size 350ms var(--ease-out), color 200ms; }
.text-link:hover { background-size: 100% 3px; }
.section--dark .text-link { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- Hero: glow blobs, highlight, floating stage */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
/* Speed report A item 6 (07.11.2026): each blob was a disc with filter: blur(70px), re-blurred on every frame of the
   drift. Now the same soft disc is drawn once as a radial gradient: box enlarged by 2σ = 140 px per side (same centre),
   stops at the Gaussian falloff of a disc of radius R (1 → 0.98 → 0.84 → 0.5 at the old edge → 0.16 → 0). */
.hero-glow span { position: absolute; animation: blob-drift 16s ease-in-out infinite alternate; }
.hero-glow span:nth-child(1) {
  width: 700px; height: 700px; top: -300px; right: calc(8% - 140px);
  background: radial-gradient(closest-side, rgba(231, 31, 38, 0.2) 0%, rgba(231, 31, 38, 0.196) 20%, rgba(231, 31, 38, 0.168) 40%, rgba(231, 31, 38, 0.1) 60%, rgba(231, 31, 38, 0.032) 80%, rgba(231, 31, 38, 0) 100%);
}
.hero-glow span:nth-child(2) {
  width: 640px; height: 640px; bottom: -280px; left: -240px; animation-duration: 20s; animation-delay: -6s;
  background: radial-gradient(closest-side, rgba(242, 177, 52, 0.32) 0%, rgba(242, 177, 52, 0.313) 12.5%, rgba(242, 177, 52, 0.269) 34.4%, rgba(242, 177, 52, 0.16) 56.3%, rgba(242, 177, 52, 0.051) 78.1%, rgba(242, 177, 52, 0) 100%);
}
.hero-glow span:nth-child(3) {
  width: 580px; height: 580px; top: calc(35% - 140px); left: calc(42% - 140px); animation-duration: 24s; animation-delay: -12s;
  background: radial-gradient(closest-side, rgba(14, 74, 87, 0.12) 0%, rgba(14, 74, 87, 0.117) 3.4%, rgba(14, 74, 87, 0.101) 27.6%, rgba(14, 74, 87, 0.06) 51.7%, rgba(14, 74, 87, 0.019) 75.9%, rgba(14, 74, 87, 0) 100%);
}
@keyframes blob-drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -40px) scale(1.15); }
  100% { transform: translate(-40px, 30px) scale(0.92); }
}

.highlight {
  background: linear-gradient(transparent 60%, rgba(242, 177, 52, 0.6) 60%, rgba(242, 177, 52, 0.6) 92%, transparent 92%) no-repeat left / 100% 100%;
  transition: background-size 1000ms var(--ease-out) 450ms;
}
.js-motion [data-reveal]:not(.is-visible) .highlight { background-size: 0% 100%; }

.hero-media {
  box-shadow: 0 32px 64px -24px rgba(14, 74, 87, 0.45), 0 0 0 1px rgba(14, 74, 87, 0.08);
  animation: stage-float 7s ease-in-out infinite;
}
@keyframes stage-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

/* ---------------------------------------------------------------- Headings: animated brand bar */
.section-head h2::after {
  content: ""; display: block; width: 72px; height: 4px; margin-top: var(--space-3); border-radius: 2px;
  background: var(--gradient-brand); transform-origin: left;
  transition: transform 900ms var(--ease-out) 250ms;
}
.js-motion .section-head:not(.is-visible) h2::after { transform: scaleX(0); }

/* ---------------------------------------------------------------- Dark sections: moving aurora */
.section--dark, .site-footer { position: relative; overflow: hidden; isolation: isolate; }
.section--dark::before, .site-footer::before {
  content: ""; position: absolute; inset: -40%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(242, 177, 52, 0.16), transparent 32%),
    radial-gradient(circle at 80% 70%, rgba(231, 31, 38, 0.16), transparent 34%),
    radial-gradient(circle at 55% 15%, rgba(63, 110, 120, 0.5), transparent 38%);
  animation: aurora 22s ease-in-out infinite alternate;
}
@keyframes aurora {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(6%, -4%) rotate(8deg); }
  100% { transform: translate(-5%, 5%) rotate(-6deg); }
}
.site-footer::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--gradient-brand); }

.stat dd { text-shadow: 0 0 28px rgba(242, 177, 52, 0.45); }
.stat { transition: translate 300ms var(--ease-out); }
.stat:hover { translate: 0 -4px; }
@media (min-width: 768px) {
  .stat + .stat { border-left: 1px solid rgba(255, 255, 255, 0.18); }
}

/* ---------------------------------------------------------------- Cards: 3D tilt, cursor glow, image zoom */
.card { transition: transform 250ms var(--ease-out), box-shadow 300ms var(--ease-out); }
.card[data-tilt] {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
}
.card[data-tilt]:hover, .card[data-tilt]:focus-within {
  --lift: -6px;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift));
  box-shadow: 0 22px 44px -18px rgba(14, 74, 87, 0.4), 0 0 0 1px rgba(231, 31, 38, 0.18);
}
/* Soft yellow glow that follows the pointer (position set by motion.js). */
.card::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(242, 177, 52, 0.2), transparent 45%);
  opacity: 0; transition: opacity 300ms;
}
.card:hover::before { opacity: 1; }
/* WHY: explicit clip — Chrome does not clip the zoomed image to the rounded corners while the card is 3D-tilted. */
.card-media { overflow: hidden; clip-path: inset(0 round var(--radius-card) var(--radius-card) 0 0); }
.card-media img { transition: transform 900ms var(--ease-out), filter 600ms; }
.card:hover .card-media img { transform: scale(1.08); filter: saturate(1.15); }
.chip { transition: background-color 250ms, border-color 250ms, translate 250ms var(--ease-spring); }
.card:hover .chip { border-color: rgba(231, 31, 38, 0.35); }
.card:hover .chip:nth-child(1) { translate: 0 -2px; }
.card:hover .chip:nth-child(2) { translate: 0 -2px; transition-delay: 60ms; }

/* Info cards: colourful icon badges with a springy hover, a brand bar on top. */
.info-card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--gradient-brand); transform: scaleX(0); transform-origin: left;
  transition: transform 450ms var(--ease-out);
}
.info-card:hover::after { transform: scaleX(1); }
.info-icon { transition: transform 500ms var(--ease-spring), box-shadow 400ms; color: var(--color-white); }
.grid--4 > :nth-child(1) .info-icon { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); }
.grid--4 > :nth-child(2) .info-icon { background: linear-gradient(135deg, #3F6E78, var(--color-secondary)); }
.grid--4 > :nth-child(3) .info-icon { background: linear-gradient(135deg, var(--color-accent), #C98A1C); color: var(--color-text); }
.grid--4 > :nth-child(4) .info-icon { background: linear-gradient(135deg, var(--color-secondary), #082E37); }
.info-card:hover .info-icon { transform: rotate(-10deg) scale(1.12); box-shadow: 0 10px 20px -8px rgba(29, 43, 48, 0.45); }

/* News: the date sits on a pill. */
.news-date time {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: rgba(231, 31, 38, 0.08); color: var(--color-primary-dark);
}

/* ---------------------------------------------------------------- Steps: numbers pop, timeline draws itself */
.step-number {
  position: relative;
  background: linear-gradient(135deg, var(--color-secondary), #3F6E78);
  box-shadow: 0 8px 18px -8px rgba(14, 74, 87, 0.7);
  transition: transform 400ms var(--ease-spring), background 300ms;
}
.step:hover .step-number { transform: scale(1.12) rotate(-6deg); background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); }
.step.is-visible .step-number::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--color-accent);
  animation: ripple 1.4s ease-out calc(var(--i, 0) * 120ms + 300ms) both;
}
@keyframes ripple { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.9); } }
@media (min-width: 1024px) {
  .step:not(:last-child)::before {
    border-top: 0; height: 3px; border-radius: 2px;
    background: repeating-linear-gradient(90deg, rgba(14, 74, 87, 0.35) 0 8px, transparent 8px 14px);
    transform-origin: left; transition: transform 800ms var(--ease-out) calc(var(--i, 0) * 120ms + 400ms);
  }
  .js-motion .step:not(.is-visible)::before { transform: scaleX(0); }
}

/* ---------------------------------------------------------------- Split blocks: image wipe, popping checklist */
.split-media { overflow: hidden; border-radius: var(--radius-card); }
.split-media img { transition: transform 1200ms var(--ease-out); }
.split-media:hover img { transform: scale(1.04); }
.foster-card {
  position: relative;
  border: 2px solid transparent;
  background: linear-gradient(var(--color-white), var(--color-white)) padding-box, var(--gradient-brand) border-box;
}
.check { transition: scale 450ms var(--ease-spring); }
.js-motion .foster-card:not(.is-visible) .check { scale: 0; }
.checklist li:nth-child(1) .check { transition-delay: 350ms; }
.checklist li:nth-child(2) .check { transition-delay: 450ms; }
.checklist li:nth-child(3) .check { transition-delay: 550ms; }
.checklist li:nth-child(4) .check { transition-delay: 650ms; }
.checklist li:nth-child(5) .check { transition-delay: 750ms; }
.checklist li:nth-child(6) .check { transition-delay: 850ms; }
.checklist .check { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); }
.checklist--yes .check { background: var(--color-success); }

/* ---------------------------------------------------------------- Donation: glass account box, floating QR */
.account {
  background: rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.qr { box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.55); animation: stage-float 6s ease-in-out infinite; }

/* ---------------------------------------------------------------- FAQ: smooth open/close, active bar */
.faq details { position: relative; overflow: hidden; transition: box-shadow 300ms; }
.faq details::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
  transform: scaleY(0); transform-origin: top; transition: transform 350ms var(--ease-out);
}
.faq details:hover::before, .faq details[open]::before { transform: scaleY(1); }
.faq details[open] { box-shadow: 0 16px 32px -18px rgba(14, 74, 87, 0.45); }
.faq summary { transition: color 200ms; }
.faq summary:hover { color: var(--color-secondary); }
.faq details::details-content {
  block-size: 0; overflow: hidden;
  transition: block-size 350ms var(--ease-out), content-visibility 350ms allow-discrete;
}
.faq details[open]::details-content { block-size: auto; }

/* ---------------------------------------------------------------- Footer links, toast, cookie banner entrance */
.footer-links a { background: linear-gradient(var(--color-accent), var(--color-accent)) no-repeat left bottom 10px / 0% 2px; text-decoration: none; transition: background-size 300ms var(--ease-out), color 200ms, padding-left 300ms var(--ease-out); }
.footer-links a:hover { background-size: 100% 2px; padding-left: 4px; }
.footer-social a { transition: background-color 250ms, color 250ms, transform 400ms var(--ease-spring); }
.footer-social a:hover { background: var(--color-accent); color: var(--color-text); transform: translateY(-3px) rotate(-8deg); }
.toast.is-visible { animation: pop 400ms var(--ease-spring); }
.cookie-banner:not([hidden]) { animation: banner-in 600ms var(--ease-out) both 800ms; }
@keyframes banner-in { from { opacity: 0; translate: 0 40px; } to { opacity: 1; translate: 0 0; } }

/* Cards: the decorative button inside a clickable card reacts to the card hover (it has no pointer events itself). */
.card:hover .btn::after { transform: translateX(130%); }
.card:hover .btn--secondary { background-size: 100% 100%; color: var(--color-white); }
