/*
 * Bewegung & Hover für alle drei Entwürfe – nach den Animations-Skills (emilkowalski/skills):
 * nur transform-Eigenschaften und opacity, starkes ease-out, UI unter 300 ms, Hover nur bei echter Maus,
 * Scroll-Reveal einmalig mit Stagger, reduzierte Bewegung = sanftes Einblenden statt gar nichts.
 * Bewegt wird über `translate`/`scale`, damit vorhandene `transform: rotate()` der Entwürfe erhalten bleiben.
 */
:root {
  --fx-out: cubic-bezier(0.23, 1, 0.32, 1);
  --fx-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

@keyframes fx-rise { from { opacity: 0; translate: 0 18px; } }
@keyframes fx-fade { from { opacity: 0; } }
@keyframes fx-pop { from { opacity: 0; scale: 0.96; } }
@keyframes fx-drop { from { opacity: 0; translate: 0 -8px; } }
@keyframes fx-float { 50% { translate: 0 -10px; } }

/* ── Scroll-Reveal (Marketingseite, einmalig) ──
   Die Liste muss zu REVEAL in effekte.js passen. */
.fx :is(
  .hero-copy > *, .hero-art, .visual-flower, .visual-note,
  main h2, .section-heading, main .ornament,
  .questions li, .feeling-list li, .check-list li, blockquote,
  .wish > *, .signpost, .steps article, .formats article, .four article,
  .process li, main table, .about-flower, .portrait, .about-visual, .about-grid p,
  .contact > *, .contact-copy, .trust > div, .tile, .split-copy > p, .split-copy > a,
  .format-card, .price-card, .additional-prices, .contact form, .boundary
):not([data-visible]) {
  opacity: 0;
}

.fx [data-visible] {
  animation: fx-rise 700ms var(--fx-out) backwards;
  animation-delay: var(--fx-delay, 0ms);
}

/* Hero-Bild schwebt nach dem Einblenden sanft weiter */
.fx :is(.visual-flower, .hero-art)[data-visible] {
  animation: fx-rise 900ms var(--fx-out) backwards, fx-float 8s ease-in-out 1.4s infinite;
  animation-delay: var(--fx-delay, 0ms), 1.4s;
}

/* Formular in Entwurf 1 erscheint statt aufzuspringen */
.form-area:not([hidden]) { animation: fx-rise 400ms var(--fx-out) backwards; }

/* ── Feedback beim Drücken ── */
.button {
  transition: background-color 0.2s ease, transform 0.2s var(--fx-out), box-shadow 0.2s ease, scale 160ms var(--fx-out);
}
button:not(.button) { transition: scale 160ms var(--fx-out); }
.button:active, button:active { scale: 0.97; }

/* ── Dialog (Impressum/Datenschutz) und Handy-Menü ── */
dialog[open] { animation: fx-pop 220ms var(--fx-out); }
dialog[open]::backdrop { animation: fx-fade 220ms ease-out; }
header nav.open { animation: fx-drop 200ms var(--fx-out); }

/* ── Hover nur mit echter Maus (Touch löst sonst falsche Hover aus) ── */
@media (hover: hover) and (pointer: fine) {
  /* Navigation: Unterstrich wächst von links */
  header nav a:not(.button) { position: relative; }
  header nav a:not(.button)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 1.5px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 220ms var(--fx-out);
  }
  header nav a:not(.button):hover::after { transform: scaleX(1); }

  /* Karten heben sich leicht an (Entwurf 2 & 3; Entwurf 1 hat das schon) */
  .tile, .format-card, .price-card {
    transition: translate 260ms var(--fx-out), box-shadow 260ms ease;
  }
  .tile:hover, .format-card:hover, .price-card:hover {
    translate: 0 -5px;
    box-shadow: 0 18px 34px -22px rgba(23, 59, 75, 0.45);
  }

  /* Icons reagieren mit, wenn die Karte gehovert wird */
  .tile-icon, .format-icon, .steps article svg, .formats article svg, .four article svg {
    transition: scale 260ms var(--fx-out);
  }
  .tile:hover .tile-icon, .format-card:hover .format-icon,
  .steps article:hover svg, .formats article:hover svg, .four article:hover svg {
    scale: 1.08;
  }

  /* Bilder in Über mich bewegen sich minimal */
  .about-visual img, .portrait {
    transition: scale 400ms var(--fx-out);
  }
  .about-visual:hover img, .portrait:hover { scale: 1.02; }

  /* Textlinks: Pfeil/Text rückt ein Stück nach rechts */
  .text-link { display: inline-block; transition: translate 200ms var(--fx-out); }
  .text-link:hover { translate: 3px 0; }
}

/* ── Reduzierte Bewegung: sanft einblenden, nichts verschieben ── */
@media (prefers-reduced-motion: reduce) {
  .fx [data-visible],
  .fx :is(.visual-flower, .hero-art)[data-visible],
  .form-area:not([hidden]),
  dialog[open],
  header nav.open {
    animation: fx-fade 250ms ease-out backwards;
    animation-delay: 0ms;
  }
  .button:active, button:active { scale: none; }
  .tile:hover, .format-card:hover, .price-card:hover, .text-link:hover { translate: none; }
  .tile:hover .tile-icon, .format-card:hover .format-icon,
  .steps article:hover svg, .formats article:hover svg, .four article:hover svg,
  .about-visual:hover img, .portrait:hover { scale: none; }
}
