/* ==========================================================================
   Motion & graphic effects — masked headline reveal, staggered fade-ups,
   scroll reveals, dot-grid backdrops, scroll-lit statements, logo-style
   marquee, pulse dots and image hover zoom. Everything that hides content
   is gated behind html.fx (set by effects.js), so without JS the page
   renders fully static. prefers-reduced-motion switches all of it off.
   ========================================================================== */

:root {
  --ease-calm: cubic-bezier(0.22, 1, 0.36, 1);
  --dot-color: rgba(255, 255, 255, 0.13);
}

:root[data-theme="light"] {
  --dot-color: rgba(30, 30, 30, 0.16);
}

/* ---------- Hero entrance ---------- */

.reveal-mask {
  /* Clip only vertically, so the slide-up is masked but wide words aren't cut */
  overflow: visible clip;
  /* Room for descenders so the clip doesn't cut g/p/y */
  padding-bottom: 0.1em;
}

/* Slightly smaller in the split column so "Verteidigungsmarkt" fits on one line */
.reveal-mask > h1 {
  font-size: clamp(2rem, 2.6vw + 1rem, 3.2rem);
  overflow-wrap: break-word;
}

.hero-split__text > p {
  margin-top: var(--space-3);
}

.fx .hero .reveal-mask > h1 {
  animation: fx-line-up 1s var(--ease-calm) both;
}

.fx .hero-split__text > p,
.fx .hero__actions,
.fx .hero-media {
  animation: fx-fade-up 0.8s var(--ease-calm) both;
}

.fx .hero-split__text > p { animation-delay: 0.25s; }
.fx .hero__actions { animation-delay: 0.4s; }
.fx .hero-media { animation-delay: 0.3s; animation-duration: 1.1s; }

@keyframes fx-line-up {
  from { transform: translateY(105%); }
  to { transform: none; }
}

@keyframes fx-fade-up {
  from { opacity: 0.01; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* Slowly drifting glow behind the hero */
.fx .hero__bg-shape {
  animation: fx-drift 14s ease-in-out infinite alternate;
}

@keyframes fx-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-60px, 40px) scale(1.15); }
}

/* ---------- Dot-grid backdrops ---------- */

.dot-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1.2px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 45%, #000 15%, transparent 100%);
  mask-image: radial-gradient(70% 70% at 50% 45%, #000 15%, transparent 100%);
}

.dot-grid--hero {
  -webkit-mask-image: radial-gradient(60% 80% at 75% 40%, #000 10%, transparent 100%);
  mask-image: radial-gradient(60% 80% at 75% 40%, #000 10%, transparent 100%);
}

.has-dots {
  position: relative;
  overflow: hidden;
}

.has-dots > .container,
.hero > .container {
  position: relative;
}

/* ---------- Scroll reveal ---------- */

.fx [data-reveal] {
  opacity: 0.01;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-calm), transform 0.8s var(--ease-calm);
  transition-delay: var(--reveal-delay, 0s);
}

.fx [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Cards keep their own hover transform once revealed */
.fx .painpoint[data-reveal].is-visible,
.fx .person-card[data-reveal].is-visible {
  transition: opacity 0.8s var(--ease-calm), transform var(--transition-base),
    border-color var(--transition-fast), box-shadow var(--transition-base);
  transition-delay: var(--reveal-delay, 0s), 0s, 0s, 0s;
}

.fx .painpoint[data-reveal].is-visible:hover,
.fx .person-card[data-reveal].is-visible:hover {
  transform: translateY(-3px);
}

/* ---------- Scroll-lit statements ---------- */

.fx [data-light] {
  --light: 0%;
  -webkit-mask-image: linear-gradient(100deg, #000 calc(var(--light) - 38%), rgba(0, 0, 0, 0.18) var(--light));
  mask-image: linear-gradient(100deg, #000 calc(var(--light) - 38%), rgba(0, 0, 0, 0.18) var(--light));
}

/* ---------- Method banner as endless marquee ---------- */

.method-banner.is-marquee {
  display: block;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  padding: var(--space-3) 0;
}

.method-banner__track {
  display: flex;
  gap: var(--space-3);
  width: max-content;
  animation: fx-marquee 45s linear infinite;
}

.method-banner.is-marquee:hover .method-banner__track {
  animation-play-state: paused;
}

.method-banner.is-marquee .method-banner__tile {
  flex: 0 0 auto;
  width: clamp(200px, 24vw, 280px);
}

@keyframes fx-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - var(--space-3) / 2)); }
}

/* ---------- Pulse dot on eyebrows ---------- */

.closing-cta .eyebrow,
.contact-cta .eyebrow {
  position: relative;
  padding-left: 1.1em;
}

.closing-cta .eyebrow::before,
.contact-cta .eyebrow::before,
.closing-cta .eyebrow::after,
.contact-cta .eyebrow::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 0.5em;
  height: 0.5em;
  margin-top: -0.25em;
  border-radius: 50%;
  background: var(--color-accent);
}

.closing-cta .eyebrow::after,
.contact-cta .eyebrow::after {
  background: transparent;
  border: 1px solid var(--color-accent);
  animation: fx-breathe 2.4s ease-out infinite;
}

@keyframes fx-breathe {
  from { transform: scale(0.8); opacity: 0.9; }
  to { transform: scale(2.6); opacity: 0; }
}

/* ---------- Image hover zoom ---------- */

.person-card__photo img,
.method-banner__tile img,
.hero-media img {
  transition: transform 0.7s var(--ease-calm);
}

.person-card:hover .person-card__photo img,
.method-banner__tile:hover img {
  transform: scale(1.05);
}

.hero-media:hover img {
  transform: scale(1.02);
}

/* Buttons: arrow-free subtle lift + glow */
.btn-primary {
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -8px rgba(var(--color-accent-rgb), 0.65);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .fx *,
  .fx *::before,
  .fx *::after {
    animation: none !important;
    transition: none !important;
  }

  .fx [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .fx [data-light] {
    -webkit-mask-image: none;
    mask-image: none;
  }
}
