/* =========================================================================
   NYAMTECHS — animations.css
   Stripe × Linear style — subtle, purposeful, GPU-accelerated
   ========================================================================= */

/* ── Animation Variables ── */
:root {
  --dur-fast:   150ms;
  --dur-base:   260ms;
  --dur-slow:   420ms;
  --dur-reveal: 600ms;

  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:    cubic-bezier(0.55, 0, 1, 0.45);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring:cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reduced Motion — global override ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal-left, .reveal-up, .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-animate { opacity: 1 !important; transform: none !important; }
  .ftag { animation: none !important; }
  .hero-grid-layer { animation: none !important; }
}

/* ═══════════════════════════════════════
   PAGE TRANSITIONS
═══════════════════════════════════════ */
.page-transition {
  animation: page-in var(--dur-base) var(--ease-out) both;
}
.page-exit {
  animation: page-out 200ms var(--ease-in) both;
}
@keyframes page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes page-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ═══════════════════════════════════════
   SCROLL REVEAL VARIANTS
═══════════════════════════════════════ */
.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity var(--dur-reveal) var(--ease-out),
              transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.reveal-left.in {
  opacity: 1;
  transform: translateX(0);
}

.reveal-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-reveal) var(--ease-out),
              transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.reveal-up.in {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity var(--dur-reveal) var(--ease-out),
              transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.reveal-scale.in {
  opacity: 1;
  transform: scale(1);
}

/* ═══════════════════════════════════════
   HERO ANIMATED GRID LAYER
═══════════════════════════════════════ */
.hero-grid-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.hero-grid-layer::before {
  content: "";
  position: absolute;
  inset: -50%;
  background-image:
    radial-gradient(circle, rgba(220,230,242,0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  animation: grid-drift 24s linear infinite;
  will-change: transform;
}
.hero-grid-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 60%, var(--navy) 100%),
    linear-gradient(to right, var(--navy) 0%, transparent 15%, transparent 85%, var(--navy) 100%);
  pointer-events: none;
}
@keyframes grid-drift {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(28px, 28px, 0); }
}

/* ═══════════════════════════════════════
   FLOATING TECH TAGS
═══════════════════════════════════════ */
.ftag {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border-radius: 2px;
  pointer-events: none;
  will-change: transform, opacity;
  user-select: none;
}
.ftag-light {
  color: rgba(220,230,242,0.70);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(220,230,242,0.12);
}
.ftag-teal {
  color: var(--teal-400);
  background: rgba(47,224,194,0.06);
  border: 1px solid rgba(47,224,194,0.18);
}
.ftag-coral {
  color: var(--coral-400);
  background: rgba(232,87,26,0.07);
  border: 1px solid rgba(232,87,26,0.18);
}

/* Pulse animations with staggered delays */
@keyframes ftag-pulse {
  0%,100% { opacity: 0.35; }
  50%      { opacity: 0.75; }
}
.ftag { animation: ftag-pulse 4s ease-in-out infinite; }
.ftag:nth-child(1)  { animation-delay: 0s;     animation-duration: 3.8s; }
.ftag:nth-child(2)  { animation-delay: 0.6s;   animation-duration: 4.2s; }
.ftag:nth-child(3)  { animation-delay: 1.1s;   animation-duration: 3.5s; }
.ftag:nth-child(4)  { animation-delay: 1.7s;   animation-duration: 4.6s; }
.ftag:nth-child(5)  { animation-delay: 0.3s;   animation-duration: 3.9s; }
.ftag:nth-child(6)  { animation-delay: 2.1s;   animation-duration: 4.1s; }
.ftag:nth-child(7)  { animation-delay: 0.9s;   animation-duration: 3.7s; }
.ftag:nth-child(8)  { animation-delay: 1.5s;   animation-duration: 4.4s; }
.ftag:nth-child(9)  { animation-delay: 2.5s;   animation-duration: 3.6s; }
.ftag:nth-child(10) { animation-delay: 0.4s;   animation-duration: 4.8s; }

/* ═══════════════════════════════════════
   HERO ENTRANCE ANIMATIONS
═══════════════════════════════════════ */
.hero-animate {
  opacity: 0;
  animation: hero-enter 0.7s var(--ease-out) forwards;
  will-change: opacity, transform;
}
.hero-animate[data-delay="0"]   { animation-delay: 0.05s; }
.hero-animate[data-delay="1"]   { animation-delay: 0.15s; }
.hero-animate[data-delay="2"]   { animation-delay: 0.28s; }
.hero-animate[data-delay="3"]   { animation-delay: 0.42s; }
.hero-animate[data-delay="4"]   { animation-delay: 0.56s; }
.hero-animate[data-delay="5"]   { animation-delay: 0.70s; }

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════
   CURSOR GLOW
═══════════════════════════════════════ */
.hero-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,87,26,0.10) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: transform;
  transition: opacity 400ms ease;
  z-index: 1;
}

/* ═══════════════════════════════════════
   CARD TILT 3D
═══════════════════════════════════════ */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 80ms linear, box-shadow 200ms ease;
}
.tilt-card:hover {
  box-shadow: var(--shadow-lg);
}
.tilt-card.tilt-reset {
  transition: transform 320ms var(--ease-out), box-shadow 320ms ease;
}

/* ═══════════════════════════════════════
   SERVICE CARDS HOVER
═══════════════════════════════════════ */
.svc {
  border-left: 3px solid transparent;
  transition: background 160ms ease, border-left-color 200ms ease;
  position: relative;
  overflow: hidden;
}
.svc:hover {
  border-left-color: var(--accent);
  background: var(--surface);
}
.svc:hover .svc-idx {
  color: var(--accent);
  font-size: 14px;
  transition: font-size 200ms var(--ease-out), color 200ms ease;
}
.svc-idx {
  transition: font-size 200ms ease, color 200ms ease;
}

/* ═══════════════════════════════════════
   NAV LINK HOVER — underline from left
═══════════════════════════════════════ */
.hdr-nav a {
  position: relative;
  overflow: hidden;
}
.hdr-nav a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: translateX(-105%);
  transition: transform 220ms var(--ease-out);
}
.hdr-nav a:hover::after,
.hdr-nav a.active::after {
  transform: translateX(0);
}
.hdr-nav a.active {
  color: var(--fg1);
}

/* ═══════════════════════════════════════
   BUTTON HOVER — arrow translate
═══════════════════════════════════════ */
.btn svg {
  transition: transform 180ms var(--ease-out);
}
.btn:hover svg {
  transform: translateX(3px);
}

/* ═══════════════════════════════════════
   FLOW STEPS HOVER — bg fill from left
═══════════════════════════════════════ */
.flow-step {
  position: relative;
  overflow: hidden;
  transition: padding-left 200ms ease;
}
.flow-step::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-soft);
  transform: translateX(-100%);
  transition: transform 280ms var(--ease-out);
  z-index: 0;
}
.flow-step:hover::before {
  transform: translateX(0);
}
.flow-step > * {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════
   ZF-MODULE HOVER — border-left teal
═══════════════════════════════════════ */
.zf-module {
  border-left: 3px solid transparent;
  transition: border-left-color 200ms ease, border-color 200ms ease, background 160ms ease;
}
.zf-module:hover {
  border-left-color: var(--teal-400);
  border-color: var(--tech-soft-bd);
  background: rgba(47,224,194,0.04);
}

/* ═══════════════════════════════════════
   SEC-ITEM HOVER — label teal, top accent bar via box-shadow
═══════════════════════════════════════ */
.sec-item {
  transition: background 160ms ease, box-shadow 200ms ease;
}
.sec-item:hover {
  background: var(--surface);
  box-shadow: inset 0 3px 0 var(--accent);
}
.sec-item:hover .sec-label {
  color: var(--tech-ink);
  transition: color 200ms ease;
}

/* ═══════════════════════════════════════
   SCROLL HINT
═══════════════════════════════════════ */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.45;
  animation: scroll-hint-bob 2.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 10;
}
.scroll-hint-line {
  width: 1px;
  height: 28px;
  background: rgba(220,230,242,0.4);
}
.scroll-hint-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(220,230,242,0.5);
  animation: scroll-hint-fall 2.4s ease-in-out infinite;
}
@keyframes scroll-hint-bob {
  0%,100% { opacity: 0.35; transform: translateX(-50%) translateY(0); }
  50%      { opacity: 0.6;  transform: translateX(-50%) translateY(6px); }
}
@keyframes scroll-hint-fall {
  0%   { opacity: 0; transform: translateY(-8px); }
  50%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(12px); }
}

/* ═══════════════════════════════════════
   PAGE HERO (inner pages)
═══════════════════════════════════════ */
.page-hero {
  background: var(--navy);
  padding: 80px 0 72px;
  overflow: hidden;
  position: relative;
}
.page-hero .hero-grid-layer { opacity: 0.6; }
.page-hero .eyebrow { color: var(--accent); }
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 800;
  color: var(--fg1-on-navy);
  margin: 18px 0 0;
}
.page-hero h1 .accent { color: var(--accent); }
.page-hero .lead {
  font-size: 18px;
  color: var(--fg2-on-navy);
  line-height: var(--lh-relaxed);
  margin-top: 20px;
  max-width: 560px;
}

/* ═══════════════════════════════════════
   PIPELINE STEPS
═══════════════════════════════════════ */
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
}
.pipeline-step {
  padding: 32px 28px;
  position: relative;
}
.pipeline-num {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  color: var(--border);
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}
.pipeline-step h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--fg1);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.pipeline-step p { font-size: 14px; color: var(--fg2); line-height: 1.62; }

/* ═══════════════════════════════════════
   TECH BADGE GRID
═══════════════════════════════════════ */
.tech-grid-section { background: var(--paper-alt); }
.tech-category { margin-bottom: 36px; }
.tech-category-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg3);
  margin-bottom: 14px;
  display: block;
}
.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tech-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 2px;
  border: 1px solid var(--tech-soft-bd);
  background: var(--tech-soft);
  color: var(--tech-ink);
  letter-spacing: 0.06em;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
  cursor: default;
}
.tech-badge:hover {
  background: rgba(47,224,194,0.14);
  border-color: var(--teal-500);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════
   KPI CARDS
═══════════════════════════════════════ */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: box-shadow 200ms ease, border-color 200ms ease;
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.kpi-large {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--fg1);
}
.kpi-large .accent { color: var(--accent); }
.kpi-large .teal   { color: var(--tech-ink); }

/* ═══════════════════════════════════════
   RESPONSIVE ANIMATIONS
═══════════════════════════════════════ */
@media (max-width: 900px) {
  .pipeline-grid { grid-template-columns: 1fr 1fr; }
  .pipeline-step::after { display: none; }
  .hero-glow { display: none; }
}
@media (max-width: 480px) {
  .pipeline-grid { grid-template-columns: 1fr; }
  .ftag { display: none; }
}
