/* ============================================================
   ONEART Motion · Studio-Layer · 2026-09-25
   Bewegung als Verfeinerung: Alle Inhalte bleiben ohne JavaScript
   und bei „Bewegung reduzieren" vollständig sichtbar und bedienbar.
   ============================================================ */

/* ---------- 1. Weiche Seitenwechsel (Chrome, Edge, Safari 18.2+) ---------- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: 240ms ease both oa-vt-out;
}

::view-transition-new(root) {
  animation: 520ms var(--ease-out) both oa-vt-in;
}

.site-header {
  view-transition-name: oa-header;
}

@keyframes oa-vt-out {
  to { opacity: 0; transform: translateY(-10px); }
}

@keyframes oa-vt-in {
  from { opacity: 0; transform: translateY(16px); }
}

/* ---------- 2. Header: Lesefortschritt + dezentes Ausblenden ---------- */
.site-header {
  transition: transform 460ms var(--ease-out), background-color 300ms ease;
}

.site-header::after {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  content: "";
  pointer-events: none;
  transform: scaleX(var(--oa-progress, 0));
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--signal), #fb5365);
}

.has-motion .site-header.is-tucked {
  transform: translateY(-101%);
}

/* ---------- 3. Scroll-Reveals ---------- */
@keyframes oa-rise {
  from { opacity: 0; translate: 0 0.55em; filter: blur(8px); }
  to { opacity: 1; translate: none; filter: none; }
}

.has-motion [data-reveal] {
  opacity: 0;
  translate: 0 2.2rem;
  transition:
    opacity 900ms var(--ease-out) var(--oa-delay, 0ms),
    translate 1100ms var(--ease-out) var(--oa-delay, 0ms);
}

.has-motion [data-reveal="scale"] {
  translate: none;
  scale: 0.94;
  transition:
    opacity 900ms var(--ease-out) var(--oa-delay, 0ms),
    scale 1200ms var(--ease-out) var(--oa-delay, 0ms);
}

.has-motion [data-reveal="clip"] {
  opacity: 1;
  translate: none;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1300ms var(--ease-out) var(--oa-delay, 0ms);
}

.has-motion [data-reveal="clip"] img {
  scale: 1.14;
  transition: scale 1700ms var(--ease-out) var(--oa-delay, 0ms);
}

.has-motion [data-reveal].is-in {
  opacity: 1;
  translate: none;
  scale: none;
  clip-path: inset(0 0 0 0);
}

.has-motion [data-reveal].is-in img {
  scale: none;
}

/* Headlines: Wort für Wort */
.oa-split .oa-w {
  display: inline-block;
}

.has-motion .oa-split .oa-w {
  opacity: 0;
  translate: 0 0.5em;
  filter: blur(9px);
  transition:
    opacity 800ms var(--ease-out),
    translate 950ms var(--ease-out),
    filter 800ms var(--ease-out);
  transition-delay: calc(var(--oa-delay, 0ms) + var(--i, 0) * 42ms);
}

.has-motion .oa-split.is-in .oa-w {
  opacity: 1;
  translate: none;
  filter: none;
}

/* Hero-Bereiche der Unterseiten und PHP-Vorlagen: reine CSS-Einblendung */
.has-motion .case-hero .container > *,
.has-motion .hub-hero .container > * {
  animation: oa-rise 900ms var(--ease-out) both;
}

.has-motion .case-hero .container > :nth-child(2),
.has-motion .hub-hero .container > :nth-child(2) { animation-delay: 70ms; }
.has-motion .case-hero .container > :nth-child(3),
.has-motion .hub-hero .container > :nth-child(3) { animation-delay: 140ms; }
.has-motion .case-hero .container > :nth-child(4),
.has-motion .hub-hero .container > :nth-child(4) { animation-delay: 210ms; }
.has-motion .case-hero .container > :nth-child(n + 5),
.has-motion .hub-hero .container > :nth-child(n + 5) { animation-delay: 280ms; }

/* ---------- 4. Startseite · Hero ---------- */
.oa-hero {
  --mx: 72%;
  --my: 32%;
}

.oa-hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(34rem circle at var(--mx) var(--my), rgba(251, 83, 101, 0.16), rgba(251, 83, 101, 0.05) 38%, transparent 64%);
  transition: opacity 700ms ease;
}

.oa-hero.is-lit::before {
  opacity: 1;
}

/* Feine Filmkörnung für Tiefe – statisch, daher ohne Scroll-Kosten */
.oa-hero__atmosphere::after,
.oa-contact::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.oa-contact {
  position: relative;
  isolation: isolate;
}

.oa-contact::before {
  z-index: -1;
  opacity: 0.1;
}

.has-motion .oa-hero h1 .oa-line {
  animation: oa-rise 1000ms var(--ease-out) var(--d, 0ms) both;
}

.has-motion .oa-hero h1 .eyebrow { animation: oa-rise 800ms var(--ease-out) both; }
.has-motion .oa-hero__lead { animation: oa-rise 900ms var(--ease-out) 300ms both; }
.has-motion .oa-hero__copy .button-row { animation: oa-rise 900ms var(--ease-out) 400ms both; }
.has-motion .oa-hero__person { animation: oa-rise 900ms var(--ease-out) 500ms both; }
.has-motion .oa-hero__bottom { animation: oa-rise 900ms var(--ease-out) 650ms both; }

/* Unterstreichung, die sich unter „mit Charakter." zeichnet */
.oa-hero h1 em {
  position: relative;
  display: inline-block;
  padding-right: 0.08em;
}

.oa-hero h1 em::after {
  position: absolute;
  right: 0.05em;
  bottom: -0.02em;
  left: 0;
  height: 0.28em;
  content: "";
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' preserveAspectRatio='none'%3E%3Cpath d='M3 17C60 7 132 4 200 8c34 2 64 5 96 10' fill='none' stroke='%23fb5365' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
  clip-path: inset(0 0 0 0);
}

.has-motion .oa-hero h1 em::after {
  animation: oa-draw 1100ms var(--ease-out) 750ms both;
}

@keyframes oa-draw {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

/* Browserfenster: Auftritt, Schweben und Maus-Parallaxe (per translate, ohne die Rotation zu überschreiben) */
.has-motion .oa-stage__main {
  animation: oa-stage-main 1300ms var(--ease-out) 120ms backwards;
}

.has-motion .oa-stage__detail {
  animation: oa-stage-detail 1400ms var(--ease-out) 320ms backwards;
}

.has-motion .oa-stage__word {
  animation: oa-word-in 1600ms var(--ease-out) 200ms backwards;
}

.has-motion .oa-stage__note,
.has-motion .oa-stage__mark {
  animation: oa-rise 900ms var(--ease-out) 900ms backwards;
}

@keyframes oa-stage-main {
  from { translate: 0 3.5rem; rotate: -4deg; scale: 0.94; }
}

@keyframes oa-stage-detail {
  from { opacity: 0; translate: -2rem 4rem; rotate: 6deg; }
}

@keyframes oa-word-in {
  from { opacity: 0; translate: 3rem 0; }
}

.oa-stage__word {
  transition: rotate 200ms linear;
}

/* ---------- 5. Kunden-Logoband ---------- */
.oa-clients {
  position: relative;
  overflow: hidden;
  padding-block: 2.1rem 2.4rem;
  border-bottom: 1px solid #ffffff14;
  background: #11100f;
}

.oa-clients__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.7rem;
}

.home-art .oa-clients__head .eyebrow {
  margin: 0;
}

.oa-clients__head > span {
  color: #8f877e;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.oa-clients__marquee {
  display: flex;
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

.oa-clients__track {
  --gap: clamp(2.8rem, 5vw, 4.8rem);
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--gap);
  margin: 0;
  padding: 0 calc(var(--gap) / 2);
  list-style: none;
  animation: oa-marquee 52s linear infinite;
}

.oa-clients__track img {
  width: calc(var(--w) * 1px);
  max-width: none;
  height: auto;
  opacity: 0.6;
  transition: opacity 300ms ease;
}

.oa-clients__track li:hover img {
  opacity: 1;
}

.oa-clients__marquee:hover .oa-clients__track {
  animation-play-state: paused;
}

@keyframes oa-marquee {
  to { transform: translateX(-100%); }
}

/* ---------- 6. Kinetisches Wortband ---------- */
.oa-kinetic {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2.4rem, 5vw, 4.4rem);
  border-top: 1px solid #ffffff12;
  background: #11100f;
  -webkit-user-select: none;
  user-select: none;
}

.oa-kinetic__row {
  display: flex;
  width: max-content;
}

.oa-kinetic__set {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.42em;
  padding-right: 0.42em;
  color: #f1ede6;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8.4vw, 8.2rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.02;
  white-space: nowrap;
  animation: oa-marquee 42s linear infinite;
}

.oa-kinetic__set em {
  color: #fb5365;
  font-family: var(--font-accent);
  font-size: 1.08em;
  font-style: italic;
  font-weight: 420;
  letter-spacing: -0.025em;
}

.oa-kinetic__set .is-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(241, 237, 230, 0.55);
}

.oa-kinetic__set i {
  width: 0.34em;
  height: 0.34em;
  display: inline-block;
  flex-shrink: 0;
  background: var(--signal);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}

/* ---------- 7. Leistungen: Zeilen-Hover + schwebende Projektvorschau ---------- */
.oa-services__list article {
  position: relative;
  isolation: isolate;
}

.oa-services__list article::before {
  position: absolute;
  inset: 0 calc(var(--gutter) * -0.5);
  z-index: -1;
  content: "";
  transform: scaleY(0);
  transform-origin: 50% 100%;
  background: #e8e1d6;
  transition: transform 600ms var(--ease-out);
}

.oa-services__list h3,
.oa-services__list .oa-index {
  transition: translate 600ms var(--ease-out), color 300ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .oa-services__list article:hover::before {
    transform: scaleY(1);
  }

  .oa-services__list article:hover h3 {
    translate: 0.6rem 0;
  }

  .oa-services__list article:hover .oa-index {
    color: var(--signal);
  }
}

.oa-float-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  width: clamp(16rem, 22vw, 21rem);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 30px 70px rgba(17, 16, 15, 0.35);
  translate: var(--fx, -100vw) var(--fy, 0);
  scale: 0.55;
  rotate: -8deg;
  transition: opacity 280ms ease, scale 550ms var(--ease-out), rotate 550ms var(--ease-out);
}

.oa-float-preview.is-on {
  opacity: 1;
  scale: 1;
  rotate: -3deg;
}

.oa-float-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* ---------- 8. Ablauf: Linie füllt sich Schritt für Schritt ---------- */
.oa-process__steps li {
  position: relative;
}

.oa-process__steps li::before {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  content: "";
  transform: scaleX(1);
  transform-origin: 0 50%;
  background: var(--signal);
  transition: transform 1100ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 240ms + 250ms);
}

.has-motion .oa-process__steps:not(.is-in) li::before {
  transform: scaleX(0);
}

/* ---------- 9. Cursor-Bubble über Projektbildern ---------- */
.oa-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9000;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  display: grid;
  place-items: center;
  padding: 0.6rem;
  border-radius: 50%;
  pointer-events: none;
  background: #c51024;
  color: #fff;
  font: 750 0.7rem/1.15 var(--font-body);
  letter-spacing: 0.02em;
  text-align: center;
  translate: var(--cx, -200px) var(--cy, -200px);
  scale: 0;
  transition: scale 380ms var(--ease-out), background-color 200ms ease;
}

.oa-cursor.is-on {
  scale: 1;
}

.oa-cursor-target,
.oa-cursor-target * {
  cursor: none;
}

/* ---------- 10. Magnetische Buttons & Glow-Karten ---------- */
.oa-magnetic {
  transition: translate 550ms var(--ease-out), transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.home-art .home-prices .price-card {
  position: relative;
  isolation: isolate;
}

.home-art .home-prices .price-card::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(20rem circle at var(--gx, 50%) var(--gy, 0%), rgba(251, 83, 101, 0.13), transparent 62%);
  transition: opacity 400ms ease;
}

.home-art .home-prices .price-card:hover::after {
  opacity: 1;
}

/* ---------- 11. FAQ öffnet weich (Chrome 131+, sonst sofort) ---------- */
@supports (interpolate-size: allow-keywords) {
  :root {
    interpolate-size: allow-keywords;
  }

  .faq-item::details-content {
    block-size: 0;
    overflow: clip;
    transition: block-size 480ms var(--ease-out), content-visibility 480ms allow-discrete;
  }

  .faq-item[open]::details-content {
    block-size: auto;
  }
}

/* ---------- 12. Sofortkontakt erscheint erst nach dem ersten Scrollen ---------- */
.has-motion .quick-contact {
  transition: opacity 420ms ease, translate 650ms var(--ease-out);
}

.has-motion.oa-qc-idle .quick-contact {
  opacity: 0;
  pointer-events: none;
  translate: 0 140%;
}

/* ---------- 13. Mobile Feinschliff ---------- */
@media (max-width: 800px) {
  .oa-clients__head > span {
    display: none;
  }

  .oa-clients__track img {
    width: calc(var(--w) * 0.8px);
  }

  .oa-kinetic__set {
    animation-duration: 30s;
  }
}

/* ---------- 14. Bewegung reduzieren: alles ruhig, nichts versteckt ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  .oa-clients__marquee {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .oa-clients__track {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 1.6rem;
    animation: none;
  }

  .oa-clients__track[aria-hidden="true"],
  .oa-kinetic__set[aria-hidden="true"] {
    display: none;
  }

  .oa-kinetic__set {
    animation: none;
  }

  .oa-float-preview,
  .oa-cursor {
    display: none;
  }
}
