/*
   © 2026 Spinplay. Alle Rechte vorbehalten.
*/
/* =====================================================================
   ANIMATIONS — Keyframes, Reveal, Spezial-Effekte
   ===================================================================== */

/* ---------- Hintergrund ---------- */
@keyframes glowDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(4rem, 3rem, 0) scale(1.12); }
}

@keyframes cubeDrift {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  100% { transform: translate3d(0, -3.5rem, 0) rotate(90deg); }
}

@keyframes cubeSpin {
  0%   { transform: perspective(600px) rotateY(0deg) rotateX(0deg); }
  100% { transform: perspective(600px) rotateY(360deg) rotateX(360deg); }
}

@keyframes cubeSpin2 {
  0%   { transform: perspective(600px) rotateX(0deg) rotateZ(0deg); }
  100% { transform: perspective(600px) rotateX(360deg) rotateZ(-360deg); }
}

@keyframes scanDown {
  0%   { top: -40vh; opacity: 0; }
  8%   { opacity: .85; }
  92%  { opacity: .85; }
  100% { top: 105vh; opacity: 0; }
}

@keyframes grainShift {
  0%   { transform: translate3d(0, 0, 0); }
  20%  { transform: translate3d(-3%, 2%, 0); }
  40%  { transform: translate3d(2%, -3%, 0); }
  60%  { transform: translate3d(-2%, -2%, 0); }
  80%  { transform: translate3d(3%, 1%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.no-grain-anim .bg__grain { animation: none; }

/* ---------- Verlauf im Namen ---------- */
.grad-text { background-size: 220% 100%; }
.grad-text--shine { animation: shineGrad 7s linear infinite; }
@keyframes shineGrad {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* CRT-Scan über dem Namen */
@keyframes nameScan {
  0%        { transform: translateX(-120%); opacity: 0; }
  8%        { opacity: 1; }
  34%       { transform: translateX(120%); opacity: 0; }
  100%      { transform: translateX(120%); opacity: 0; }
}

/* ---------- Hero: gestaffelter Start ---------- */
@keyframes heroIn {
  0%   { opacity: 0; transform: translateY(20px); filter: blur(6px); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
[data-hero] {
  opacity: 0;
  animation: heroIn .85s var(--ease) forwards;
  animation-delay: var(--hd, 0ms);
}
.no-anim [data-hero] { opacity: 1; animation: none; }

/* ---------- Avatar ---------- */
@keyframes avatarIn {
  0%   { opacity: 0; transform: scale(1.12); filter: blur(8px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes spinSlow {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes ping {
  0%   { transform: scale(1);   opacity: .8; }
  70%  { transform: scale(3.4); opacity: 0; }
  100% { transform: scale(3.4); opacity: 0; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

/* ---------- Status ---------- */
.status__dot { animation: dotBlink 2.4s var(--ease-io) infinite; }
@keyframes dotBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}
.swap-in  { animation: swapIn .45s var(--ease) both; }
.swap-out { animation: swapOut .3s var(--ease) both; }
@keyframes swapIn  { 0% { opacity: 0; transform: translateY(6px); } 100% { opacity: 1; transform: none; } }
@keyframes swapOut { 0% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }

.typewriter__caret {
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---------- Text-Reveal ---------- */
.split { perspective: 700px; }
.split .split__char {
  display: inline-block;
  opacity: 0;
  transform: translateY(.42em) rotateX(-72deg);
  transition: opacity .5s var(--ease), transform .55s var(--ease);
}
.split .split__char--space { width: .3em; }
.split.is-in .split__char { opacity: 1; transform: none; }

/* ---------- Scroll-Reveal ---------- */
[data-reveal] {
  opacity: 0;
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  will-change: opacity, transform;
}
[data-reveal="up"]    { transform: translateY(26px); }
[data-reveal="scale"] { transform: scale(.96); }
[data-reveal="left"]  { transform: translateX(-34px); }
[data-reveal].is-in   { opacity: 1; transform: none; }
.no-anim [data-reveal] { opacity: 1 !important; transform: none !important; }

/* ---------- Wasserzeichen (optional sichtbar) ---------- */
.watermark {
  position: fixed;
  z-index: 5;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
  opacity: .32;
  pointer-events: none;
  user-select: none;
}
.watermark--br { right: 1.1rem; bottom: .7rem; }
.watermark--bl { left: 1.1rem; bottom: .7rem; }
.watermark--tr { right: 1.1rem; top: .8rem; }
.watermark--tl { left: 1.1rem; top: .8rem; }

/* ---------- Icons "zeichnen" sich ---------- */
[data-draw] :is(path, circle, rect, line, polyline, ellipse) {
  transition: stroke-dashoffset .8s var(--ease);
}
[data-draw].icons-on :is(path, circle, rect, line, polyline, ellipse),
[data-draw]:hover       :is(path, circle, rect, line, polyline, ellipse) {
  stroke-dashoffset: 0 !important;
}
[data-draw].icons-on :is(path, circle, rect, line, polyline, ellipse):nth-child(1) { transition-delay: 0s; }
[data-draw].icons-on :is(path, circle, rect, line, polyline, ellipse):nth-child(2) { transition-delay: .09s; }
[data-draw].icons-on :is(path, circle, rect, line, polyline, ellipse):nth-child(3) { transition-delay: .18s; }
[data-draw].icons-on :is(path, circle, rect, line, polyline, ellipse):nth-child(4) { transition-delay: .27s; }
[data-draw].icons-on :is(path, circle, rect, line, polyline, ellipse):nth-child(n+5) { transition-delay: .36s; }
.no-anim [data-draw] :is(path, circle, rect, line, polyline, ellipse) { stroke-dashoffset: 0 !important; }

/* ---------- Interaktionen ---------- */
@keyframes rippleOut {
  to { opacity: 0; transform: translate(-50%, -50%) scale(2.6) rotate(135deg); }
}
@keyframes pop {
  0%   { transform: scale(.6); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes pulseHeart {
  0%, 100% { transform: scale(1); }
  18%      { transform: scale(1.28); }
  32%      { transform: scale(.94); }
  46%      { transform: scale(1.12); }
}

/* ---------- Laufband ---------- */
.marquee__track--run { animation: marquee var(--marquee-speed, 34s) linear infinite; }
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ---------- Terminal-Preloader ---------- */
@keyframes logIn {
  0%   { opacity: 0; transform: translateX(-6px); }
  100% { opacity: 1; transform: none; }
}
.preloader__log .row { display: flex; gap: .55rem; }
.preloader__log .row .lead {
  flex: 1;
  min-width: 1rem;
  border-bottom: 1px dotted var(--line-2);
  transform: translateY(-3px);
}
.preloader__log .row .ok { color: var(--accent); }
.preloader__log .row .lbl { color: var(--text-2); }

/* ---------- Theme-Umschalter (Sonne/Mond) ---------- */
@keyframes themeBtnPop {
  0%   { transform: rotate(0deg)   scale(1); }
  45%  { transform: rotate(-28deg) scale(.82); }
  100% { transform: rotate(0deg)   scale(1); }
}
@keyframes themeIconSpin {
  0%   { transform: rotate(-200deg) scale(.15); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: rotate(0deg)   scale(1);  opacity: 1; }
}
.no-anim .theme-toggle.is-flipping,
.no-anim .theme-toggle.is-flipping svg { animation: none; }

/* ---------- Schnellzugriff (Command Palette) ---------- */
@keyframes paletteItemIn {
  from { opacity: 0; transform: translateY(9px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes paletteBtnPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(.93); }
  70%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.no-anim .palette-trigger.is-pressed { animation: none; }