/* ============================================================
   MESSENGER2050 — ANIMATIONS & EFFECTS
   ============================================================ */

/* ── PAGE LOAD ENTRANCE ── */
@keyframes heroTitleIn {
  0%   { opacity: 0; transform: translateY(40px) skewY(2deg); }
  100% { opacity: 1; transform: translateY(0) skewY(0); }
}
@keyframes heroBadgeIn {
  0%   { opacity: 0; transform: translateX(-20px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes heroStatsIn {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  0%   { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  0%   { opacity: 0; transform: translateX(-30px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  0%   { opacity: 0; transform: translateX(30px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  0%   { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── GLOW PULSE ── */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(0,229,255,0.3), 0 0 30px rgba(0,229,255,0.1); }
  50%       { box-shadow: 0 0 30px rgba(0,229,255,0.6), 0 0 60px rgba(0,229,255,0.2); }
}
@keyframes glowPulseMagenta {
  0%, 100% { box-shadow: 0 0 15px rgba(255,0,128,0.3), 0 0 30px rgba(255,0,128,0.1); }
  50%       { box-shadow: 0 0 30px rgba(255,0,128,0.6), 0 0 60px rgba(255,0,128,0.2); }
}

/* ── BORDER TRACE ── */
@keyframes borderTrace {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── FLOAT ── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-8px) rotate(2deg); }
}

/* ── SPIN ── */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes spinReverse {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}

/* ── GLITCH ── */
@keyframes glitch1 {
  0%   { clip-path: inset(40% 0 61% 0); transform: translateX(-4px); }
  20%  { clip-path: inset(92% 0 1% 0);  transform: translateX(4px); }
  40%  { clip-path: inset(43% 0 1% 0);  transform: translateX(-4px); }
  60%  { clip-path: inset(25% 0 58% 0); transform: translateX(4px); }
  80%  { clip-path: inset(54% 0 7% 0);  transform: translateX(-4px); }
  100% { clip-path: inset(58% 0 43% 0); transform: translateX(4px); }
}
@keyframes glitch2 {
  0%   { clip-path: inset(24% 0 29% 0); transform: translateX(4px) scaleX(1.02); }
  20%  { clip-path: inset(54% 0 21% 0); transform: translateX(-4px); }
  40%  { clip-path: inset(11% 0 77% 0); transform: translateX(4px); }
  60%  { clip-path: inset(69% 0 15% 0); transform: translateX(-4px) scaleX(0.98); }
  80%  { clip-path: inset(35% 0 39% 0); transform: translateX(4px); }
  100% { clip-path: inset(81% 0 3% 0);  transform: translateX(-4px); }
}

/* ── SCAN LINE ── */
@keyframes scanLine {
  0%   { top: -2px; opacity: 0; }
  5%   { opacity: 0.6; }
  95%  { opacity: 0.6; }
  100% { top: 100%; opacity: 0; }
}

/* ── DATA STREAM ── */
@keyframes dataStream {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.8; }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* ── SHIMMER ── */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ── BLINK CURSOR ── */
@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── HEX ROTATE ── */
@keyframes hexPulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.15; }
  50%       { transform: scale(1.05) rotate(3deg); opacity: 0.25; }
}

/* ── REVEAL LINE ── */
@keyframes revealLine {
  0%   { transform: scaleX(0); transform-origin: left; }
  100% { transform: scaleX(1); transform-origin: left; }
}

/* ── STAGGER HELPERS ── */
.stagger-1 { animation-delay: 0.05s !important; }
.stagger-2 { animation-delay: 0.12s !important; }
.stagger-3 { animation-delay: 0.20s !important; }
.stagger-4 { animation-delay: 0.28s !important; }
.stagger-5 { animation-delay: 0.36s !important; }
.stagger-6 { animation-delay: 0.44s !important; }

/* ── HERO ENTRANCE ANIMATIONS ── */
.hero-badge   { animation: heroBadgeIn  0.7s  cubic-bezier(0.4,0,0.2,1)  0.2s both; }
.hero-title   { animation: heroTitleIn  0.9s  cubic-bezier(0.4,0,0.2,1)  0.4s both; }
.hero-desc    { animation: fadeInUp     0.8s  cubic-bezier(0.4,0,0.2,1)  0.65s both; }
.hero-platforms { animation: fadeInUp   0.8s  cubic-bezier(0.4,0,0.2,1)  0.8s both; }
.hero-cta     { animation: fadeInUp     0.8s  cubic-bezier(0.4,0,0.2,1)  0.95s both; }
.hero-stats   { animation: heroStatsIn  0.8s  cubic-bezier(0.4,0,0.2,1)  1.15s both; }

/* ── PAGE HERO INNER ── */
.page-hero-inner > * {
  animation: fadeInUp 0.7s cubic-bezier(0.4,0,0.2,1) both;
}
.page-hero-inner > *:nth-child(1) { animation-delay: 0.1s; }
.page-hero-inner > *:nth-child(2) { animation-delay: 0.2s; }
.page-hero-inner > *:nth-child(3) { animation-delay: 0.3s; }
.page-hero-inner > *:nth-child(4) { animation-delay: 0.4s; }

/* ── GLITCH TITLE ── */
.glitch-wrap {
  position: relative;
  display: inline-block;
}
.glitch-wrap::before,
.glitch-wrap::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--accent-cyan);
}
.glitch-wrap::before {
  color: var(--accent-magenta);
  animation: glitch1 3.5s infinite linear;
  opacity: 0;
}
.glitch-wrap::after {
  color: var(--accent-cyan);
  animation: glitch2 3.5s infinite linear;
  opacity: 0;
}
.glitch-wrap:hover::before,
.glitch-wrap:hover::after { opacity: 0.7; }

/* ── SHIMMER BUTTON ── */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.25) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  background-position: -200% center;
  transition: background-position 0s;
}
.btn-primary:hover::after {
  background-position: 200% center;
  transition: background-position 0.5s ease;
}

/* ── PROGRESS BAR ── */
#readingProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(0,229,255,0.6);
}

/* ── PARTICLE CANVAS ── */
#particleCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ── FLOATING GEOMETRY (hero decor) ── */
.hex-decor {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
.hex-decor svg { animation: hexPulse 6s ease-in-out infinite; }
.hex-decor:nth-child(2) svg { animation-delay: -2s; }
.hex-decor:nth-child(3) svg { animation-delay: -4s; }

/* ── CARD ENTRANCE (scroll) ── */
.card,
.why-card,
.client-card,
.portfolio-card,
.process-step {
  transition:
    transform  0.35s cubic-bezier(0.4,0,0.2,1),
    border-color 0.35s ease,
    background  0.35s ease,
    box-shadow  0.35s ease;
}

/* ── NAV LOGO ICON PULSE ── */
.logo-icon {
  animation: glowPulse 3s ease-in-out infinite;
}

/* ── SECTION TAG REVEAL ── */
.section-tag {
  animation: fadeInLeft 0.6s cubic-bezier(0.4,0,0.2,1) both;
}

/* ── TECH PILL HOVER RIPPLE ── */
.tech-pill {
  position: relative;
  overflow: hidden;
}
.tech-pill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0,229,255,0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}
.tech-pill:hover::after { opacity: 1; }

/* ── CURSOR CUSTOM ── */
.custom-cursor {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--accent-cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, opacity 0.2s;
  box-shadow: var(--glow-cyan);
  mix-blend-mode: screen;
}
.custom-cursor-ring {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0,229,255,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease, width 0.2s, height 0.2s, border-color 0.2s;
}
.custom-cursor-ring.hover {
  width: 48px;
  height: 48px;
  border-color: var(--accent-magenta);
}

/* ── SCROLL INDICATOR ── */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 5;
  animation: fadeInUp 1s 1.5s both;
}
.scroll-mouse {
  width: 22px;
  height: 34px;
  border: 1px solid rgba(0,229,255,0.4);
  border-radius: 11px;
  position: relative;
}
.scroll-wheel {
  width: 3px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 2px;
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 1.8s ease-in-out infinite;
}
@keyframes scrollWheel {
  0%   { transform: translateX(-50%) translateY(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(14px); opacity: 0; }
}
.scroll-label {
  font-family: var(--font-small);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── TYPEWRITER ── */
.typewriter-text::after {
  content: '|';
  animation: blinkCursor 0.75s step-end infinite;
  color: var(--accent-cyan);
  margin-left: 2px;
}

/* ── NUMBER COUNTER ── */
.stat-num {
  background: linear-gradient(135deg, #fff 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── HERO VISUAL PANEL (right side) ── */
.hero-visual {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 46%;
  height: 70%;
  pointer-events: none;
  z-index: 1;
}
@media (max-width: 900px) { .hero-visual { display: none; } }

/* ── ORBITING RING ── */
.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0,229,255,0.12);
}
.orbit-ring:nth-child(1) { inset: 0; animation: spinSlow 18s linear infinite; }
.orbit-ring:nth-child(2) { inset: 12%; border-color: rgba(255,0,128,0.1); animation: spinReverse 12s linear infinite; }
.orbit-ring:nth-child(3) { inset: 24%; border-color: rgba(0,229,255,0.08); animation: spinSlow 8s linear infinite; }

.orbit-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: var(--glow-cyan);
}
.orbit-dot-magenta {
  background: var(--accent-magenta);
  box-shadow: var(--glow-magenta);
}

/* ── SECTION DIVIDER ── */
.divider-angle {
  width: 100%;
  height: 60px;
  background: inherit;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

/* ── MARQUEE (tech strip) ── */
.marquee-wrap {
  overflow: hidden;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
  background: var(--bg-dark);
}
.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marqueeScroll 28s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-item {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}
.marquee-item::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: var(--glow-cyan);
}

/* ── NOISE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  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)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9997;
  opacity: 0.4;
}

/* ── TOOLTIP ── */
[data-tip] {
  position: relative;
}
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-small);
  font-size: 0.7rem;
  white-space: nowrap;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.7rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 100;
}
[data-tip]:hover::after { opacity: 1; }

/* ── STATS BAND ── */
.stats-band {
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 3rem 0;
  position: relative;
  overflow: hidden;
}
.stats-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,0.03), transparent);
  animation: shimmer 4s ease-in-out infinite;
  background-size: 200% 100%;
}
.stats-band-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}
@media (max-width: 600px) {
  .stats-band-grid { grid-template-columns: repeat(2, 1fr); }
}
.stats-band-item {
  padding: 1.5rem;
  border-right: 1px solid var(--border-subtle);
}
.stats-band-item:last-child { border-right: none; }
.stats-band-num {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #fff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stats-band-label {
  font-family: var(--font-small);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ── ANIMATED BORDER CARD ── */
.card-glow {
  position: relative;
}
.card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta), var(--accent-cyan));
  background-size: 300% 300%;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
  animation: borderTrace 4s ease infinite;
  z-index: -1;
}
.card-glow:hover::before { opacity: 0.6; }

/* ── BACK TO TOP ── */
#backToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 500;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
}
#backToTop.visible {
  opacity: 1;
  transform: translateY(0);
}
#backToTop:hover {
  background: var(--accent-cyan);
  color: var(--bg-void);
  box-shadow: var(--glow-cyan);
}
