/* ===========================================================================
 * Yaprakzade — Cinematic Motion System
 * Phase 509 (2026-06-10)
 *
 * Editorial restraint + modern show: 3D parallax, magnetic buttons,
 * scroll-reveal, image clip reveals, count-up stats, cursor spotlight.
 * Zero heavy deps — pure CSS + IntersectionObserver/JS.
 * =========================================================================== */

/* ============ MOTION TOKENS ============ */
:root {
  --yz-motion-ease: cubic-bezier(.22, 1, .36, 1);
  --yz-motion-snap: cubic-bezier(.16, 1, .3, 1);
  --yz-motion-slow: cubic-bezier(.7, 0, .3, 1);
}

/* ============ ACCESSIBILITY ============ */
@media (prefers-reduced-motion: reduce) {
  .yz-reveal,
  .yz-tilt,
  .yz-magnetic,
  .yz-clip-reveal,
  .yz-counter,
  .yz-float-leaf {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
    clip-path: none !important;
  }
}

/* ============ SCROLL-REVEAL ============ */
.yz-reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .9s var(--yz-motion-ease), transform .9s var(--yz-motion-ease);
  will-change: opacity, transform;
}
.yz-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}
.yz-reveal[data-yz-delay="1"] { transition-delay: .08s; }
.yz-reveal[data-yz-delay="2"] { transition-delay: .16s; }
.yz-reveal[data-yz-delay="3"] { transition-delay: .24s; }
.yz-reveal[data-yz-delay="4"] { transition-delay: .32s; }
.yz-reveal[data-yz-delay="5"] { transition-delay: .40s; }
.yz-reveal[data-yz-delay="6"] { transition-delay: .48s; }

/* ============ TEXT — line-by-line reveal ============ */
.yz-text-reveal {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.yz-text-reveal > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.1s var(--yz-motion-slow);
  will-change: transform;
}
.yz-text-reveal.is-in > span { transform: translateY(0); }
.yz-text-reveal[data-yz-delay="1"] > span { transition-delay: .12s; }
.yz-text-reveal[data-yz-delay="2"] > span { transition-delay: .24s; }
.yz-text-reveal[data-yz-delay="3"] > span { transition-delay: .36s; }

/* ============ CLIP REVEAL — image reveal as you scroll ============ */
.yz-clip-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.4s var(--yz-motion-slow);
  will-change: clip-path;
}
.yz-clip-reveal.is-in { clip-path: inset(0 0 0 0); }
.yz-clip-reveal--up {
  clip-path: inset(100% 0 0 0);
}
.yz-clip-reveal--up.is-in { clip-path: inset(0 0 0 0); }

/* ============ 3D TILT CARD ============ */
.yz-tilt {
  transform-style: preserve-3d;
  transition: transform .4s var(--yz-motion-ease);
  will-change: transform;
}
.yz-tilt-inner {
  transform: translateZ(0);
  transition: transform .4s var(--yz-motion-ease);
}
.yz-tilt:hover .yz-tilt-inner { transform: translateZ(20px); }

/* ============ MAGNETIC BUTTON ============ */
.yz-magnetic {
  display: inline-flex;
  transition: transform .25s var(--yz-motion-ease);
  will-change: transform;
}
.yz-magnetic-inner {
  display: inline-flex;
  transition: transform .25s var(--yz-motion-ease);
}

/* ============ FLOATING DECORATIVE LEAF ============ */
.yz-float-leaf {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: .12;
  will-change: transform;
  transition: transform 1.6s var(--yz-motion-slow);
}
.yz-float-leaf--1 { top: 18%; left: 8%; width: 120px; transform: rotate(-12deg); }
.yz-float-leaf--2 { top: 62%; right: 14%; width: 88px; transform: rotate(28deg); }
.yz-float-leaf--3 { bottom: 8%; left: 22%; width: 60px; transform: rotate(-45deg); }
@keyframes yz-leaf-sway {
  0%, 100% { transform: rotate(-12deg) translateY(0); }
  50% { transform: rotate(-15deg) translateY(-12px); }
}
.yz-float-leaf--1 { animation: yz-leaf-sway 9s ease-in-out infinite; }
@keyframes yz-leaf-sway2 {
  0%, 100% { transform: rotate(28deg) translateY(0); }
  50% { transform: rotate(32deg) translateY(-8px); }
}
.yz-float-leaf--2 { animation: yz-leaf-sway2 11s ease-in-out infinite; }
@keyframes yz-leaf-sway3 {
  0%, 100% { transform: rotate(-45deg) translateX(0); }
  50% { transform: rotate(-42deg) translateX(6px); }
}
.yz-float-leaf--3 { animation: yz-leaf-sway3 13s ease-in-out infinite; }

/* ============ HERO IMAGE PARALLAX TILT (3D) ============ */
.yz-hero-media.yz-3d-tilt {
  perspective: 1200px;
  perspective-origin: center;
}
.yz-hero-media.yz-3d-tilt > * {
  transition: transform .4s var(--yz-motion-ease);
  will-change: transform;
}
.yz-hero-media.yz-3d-tilt::before {
  transition: transform .4s var(--yz-motion-ease);
}

/* ============ CURSOR SPOTLIGHT ============ */
.yz-spotlight-host {
  position: relative;
  isolation: isolate;
}
.yz-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    circle 320px at var(--mx, 50%) var(--my, 50%),
    rgba(184, 136, 75, 0.18) 0%,
    rgba(184, 136, 75, 0.04) 40%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity .35s ease;
  mix-blend-mode: multiply;
}
.yz-spotlight-host:hover .yz-spotlight { opacity: 1; }

/* ============ COUNTER ANIMATION ============ */
.yz-counter { display: inline-block; }
.yz-counter-num {
  font-variant-numeric: tabular-nums;
  transition: opacity .3s ease;
}

/* ============ MARQUEE — Trust / Quote strip ============ */
.yz-marquee {
  overflow: hidden;
  white-space: nowrap;
  padding: 24px 0;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.yz-marquee-track {
  display: inline-flex;
  gap: 80px;
  animation: yz-marquee 38s linear infinite;
}
.yz-marquee:hover .yz-marquee-track { animation-play-state: paused; }
.yz-marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--yz-serif);
  font-variation-settings: "opsz" 36, "wght" 350;
  font-size: 22px;
  font-style: italic;
  color: var(--yz-ink);
  opacity: .72;
}
.yz-marquee-item::after {
  content: "✦";
  color: var(--yz-ochre);
  font-size: 18px;
  opacity: .6;
}
@keyframes yz-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============ CINEMATIC SECTION — Film grain + vignette ============ */
.yz-cinematic {
  position: relative;
  background: var(--yz-ink);
  color: var(--yz-paper);
  padding: var(--yz-s6) 0;
  overflow: hidden;
  isolation: isolate;
}
.yz-cinematic::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.55) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence baseFrequency='.92' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: cover, 180px;
  pointer-events: none;
  z-index: 0;
}
.yz-cinematic > .container { position: relative; z-index: 1; }
.yz-cinematic h2 {
  font-family: var(--yz-serif);
  font-variation-settings: "opsz" 144, "wght" 400;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  text-align: center;
  letter-spacing: -.02em;
  margin: 0 0 var(--yz-s4);
}
.yz-cinematic h2 em {
  font-style: italic;
  color: var(--yz-ochre-light);
  font-variation-settings: "opsz" 144, "wght" 300;
}

/* ============ ROTATING WORD ============ */
.yz-rotor {
  display: inline-flex;
  vertical-align: middle;
  height: 1.05em;
  overflow: hidden;
  vertical-align: top;
}
.yz-rotor-words {
  display: flex;
  flex-direction: column;
  animation: yz-rotor 9s steps(3, end) infinite;
}
@keyframes yz-rotor {
  0%, 30%   { transform: translateY(0%); }
  33%, 63%  { transform: translateY(-33.33%); }
  66%, 96%  { transform: translateY(-66.66%); }
  100%      { transform: translateY(-100%); }
}
.yz-rotor-words > span {
  display: block;
  height: 1.05em;
  color: var(--yz-moss);
  font-style: italic;
}

/* ============ HOVER SCROLL HINT ============ */
.yz-scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--yz-sans);
  font-size: 10.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--yz-smoke);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.yz-scroll-hint::after {
  content: "";
  width: 1px;
  height: 32px;
  background: linear-gradient(180deg, var(--yz-ochre), transparent);
  animation: yz-scroll-pulse 2.4s ease-in-out infinite;
}
@keyframes yz-scroll-pulse {
  0%, 100% { opacity: .4; transform: scaleY(.5); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}
