/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS.CSS — Cursor, noise texture, hover effects,
                    typing animation, cursor trail, misc FX
   ═══════════════════════════════════════════════════════════════ */

/* ── CURSOR TRAIL (desktop only) ──────────────────────────────── */
.cursor-dot {
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: calc(var(--z-toast) + 10);
  transform: translate(-50%, -50%);
  transition: width 0.15s, height 0.15s, background 0.2s;
}
.cursor-ring {
  width: 32px; height: 32px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: calc(var(--z-toast) + 9);
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, transform 0.08s linear, border-color 0.2s;
  opacity: 0.5;
}
body.cursor-hover .cursor-dot {
  width: 10px; height: 10px;
  background: var(--accent);
}
body.cursor-hover .cursor-ring {
  width: 52px; height: 52px;
  opacity: 0.25;
}
@media (hover: none) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ── NOISE TEXTURE OVERLAY ────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-toast);
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ── TYPING ANIMATION ─────────────────────────────────────────── */
.typing-text {
  display: inline-block;
  position: relative;
}
.typing-text::after {
  content: '|';
  color: var(--accent);
  animation: blink 0.9s step-end infinite;
  margin-left: 2px;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── STAGGERED CHILDREN ───────────────────────────────────────── */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.stagger-children.visible > *:nth-child(1)  { transition-delay: 0s; }
.stagger-children.visible > *:nth-child(2)  { transition-delay: 0.07s; }
.stagger-children.visible > *:nth-child(3)  { transition-delay: 0.14s; }
.stagger-children.visible > *:nth-child(4)  { transition-delay: 0.21s; }
.stagger-children.visible > *:nth-child(5)  { transition-delay: 0.28s; }
.stagger-children.visible > *:nth-child(6)  { transition-delay: 0.35s; }
.stagger-children.visible > *:nth-child(7)  { transition-delay: 0.42s; }
.stagger-children.visible > *:nth-child(8)  { transition-delay: 0.49s; }
.stagger-children.visible > *:nth-child(n+9){ transition-delay: 0.56s; }
.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ── MARQUEE / TICKER ─────────────────────────────────────────── */
.marquee-track {
  overflow: hidden;
  white-space: nowrap;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.marquee-inner {
  display: inline-flex;
  animation: marquee 28s linear infinite;
}
.marquee-inner:hover { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 2rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.marquee-item .sep {
  color: var(--accent);
  font-size: 0.6rem;
  margin: 0 0.25rem;
}

/* ── SECTION ENTRANCE ─────────────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── HERO TEXT REVEAL ─────────────────────────────────────────── */
.reveal-line {
  overflow: hidden;
  display: block;
}
.reveal-line .inner {
  display: block;
  transform: translateY(110%);
  animation: revealLine 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.reveal-line:nth-child(1) .inner { animation-delay: 0.1s; }
.reveal-line:nth-child(2) .inner { animation-delay: 0.18s; }
.reveal-line:nth-child(3) .inner { animation-delay: 0.26s; }
@keyframes revealLine {
  to { transform: translateY(0); }
}

/* ── MAGNETIC BUTTON EFFECT ───────────────────────────────────── */
.magnetic { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ── UNDERLINE HOVER ──────────────────────────────────────────── */
.underline-hover {
  position: relative;
  display: inline-block;
}
.underline-hover::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0%; height: 1px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.underline-hover:hover::after { width: 100%; }

/* ── CARD SHINE (on hover) ────────────────────────────────────── */
.card-shine {
  position: relative;
  overflow: hidden;
}
.card-shine::after {
  content: '';
  position: absolute;
  top: -50%; left: -75%;
  width: 50%; height: 200%;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,0.04) 50%,
    transparent 60%
  );
  transform: skewX(-10deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.card-shine:hover::after { left: 125%; }

/* ── COUNTER ANIMATION ────────────────────────────────────────── */
.count-up { display: inline-block; }

/* ── SKILL BAR (optional) ─────────────────────────────────────── */
.skill-bar-track {
  height: 3px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-top: 6px;
}
.skill-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-full);
  width: 0%;
  transition: width 1.2s cubic-bezier(0.34, 1.1, 0.64, 1);
}
.skill-bar-fill.animated { width: var(--fill); }

/* ── PAGE TRANSITION ──────────────────────────────────────────── */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--accent);
  z-index: calc(var(--z-toast) + 100);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.76, 0, 0.24, 1);
  pointer-events: none;
}
