/* ============================================================
   TECHYSYNC — ANIMATIONS
   ============================================================ */

/* --- SCROLL REVEAL --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal--left {
  transform: translateX(-24px);
}

.reveal--left.revealed {
  transform: translateX(0);
}

.reveal--right {
  transform: translateX(24px);
}

.reveal--right.revealed {
  transform: translateX(0);
}

.reveal--scale {
  transform: scale(0.94);
}

.reveal--scale.revealed {
  transform: scale(1);
}

/* Stagger delays */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* --- MASK REVEALS --- */
.reveal-mask {
  clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
  opacity: 0;
  transform: translateY(12px);
  transition: clip-path 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease, transform 0.8s ease;
}

.reveal-mask.revealed {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
  opacity: 1;
  transform: translateY(0);
}

.reveal-mask--up {
  clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
}

.reveal-mask--up.revealed {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* --- HERO ANIMATIONS --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes gentlePulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 0.8; transform: scale(1.06); }
}

@keyframes rotateOrbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes connectLine {
  0%   { stroke-dashoffset: 200; opacity: 0; }
  30%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0.4; }
}

@keyframes blinkDot {
  0%, 100% { opacity: 0.2; }
  50%       { opacity: 1; }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- HERO SEQUENCE --- */
.hero-anim-1 { animation: fadeInUp 0.8s ease both; animation-delay: 0.1s; }
.hero-anim-2 { animation: fadeInUp 0.8s ease both; animation-delay: 0.3s; }
.hero-anim-3 { animation: fadeInUp 0.8s ease both; animation-delay: 0.5s; }
.hero-anim-4 { animation: fadeInUp 0.8s ease both; animation-delay: 0.7s; }

/* --- GEOMETRIC VISUAL (Hero) --- */
.hero-visual {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1;
  margin: 0 auto;
}

.hero-visual__ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(43, 127, 255, 0.15);
}

.hero-visual__ring--1 {
  inset: 0;
  animation: rotateOrbit 20s linear infinite;
}

.hero-visual__ring--2 {
  inset: 15%;
  border-color: rgba(0, 180, 230, 0.12);
  animation: rotateOrbit 14s linear infinite reverse;
}

.hero-visual__ring--3 {
  inset: 30%;
  border-color: rgba(43, 127, 255, 0.1);
  animation: rotateOrbit 10s linear infinite;
}

.hero-visual__dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-cyan);
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 10px var(--color-cyan);
  animation: blinkDot 2s ease infinite;
}

.hero-visual__logo-wrap {
  position: absolute;
  inset: 38%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual__logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: gentlePulse 4s ease infinite;
}

/* --- APPROACH STEPS --- */
@keyframes stepAppear {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

.approach-line {
  width: 1px;
  background: linear-gradient(to bottom, var(--color-blue-2), var(--color-cyan), transparent);
  transform-origin: top;
}

/* --- BUTTON SHIMMER --- */
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.btn--primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: none;
}

.btn--primary:hover::before {
  animation: shimmer 0.6s ease;
}

/* --- TYPING CURSOR --- */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--color-cyan);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

/* --- GRID PATTERN BG --- */
.grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(43, 127, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 127, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* --- GLOW PULSE --- */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 180, 230, 0.1); }
  50%       { box-shadow: 0 0 40px rgba(0, 180, 230, 0.25); }
}

.glow-pulse { animation: glowPulse 3s ease infinite; }

/* --- SCROLL LINE DRAW --- */
.draw-line {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.draw-line.revealed {
  transform: scaleY(1);
}

/* --- MULTI-PANEL STAGGERED PAGE SWIPE OVERLAY --- */
.page-wipe-curtain {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  overflow: hidden;
}

.wipe-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: translateY(0%);
  transition: transform 0.65s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: transform;
}

.wipe-panel.panel-cyan {
  background: #00D4FF;
  z-index: 1;
}

.wipe-panel.panel-blue {
  background: #0052CC;
  z-index: 2;
}

.wipe-panel.panel-navy {
  background: #060A17;
  z-index: 3;
}

.wipe-content {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.4s ease, transform 0.45s ease;
  pointer-events: none;
}

/* WIPE OUT (REVEAL PAGE - Panels slide UP with staggered delays) */
.page-wipe-curtain.wipe-out .wipe-panel.panel-navy {
  transform: translateY(-100%);
  transition-delay: 0.05s;
}

.page-wipe-curtain.wipe-out .wipe-panel.panel-blue {
  transform: translateY(-100%);
  transition-delay: 0.15s;
}

.page-wipe-curtain.wipe-out .wipe-panel.panel-cyan {
  transform: translateY(-100%);
  transition-delay: 0.25s;
}

.page-wipe-curtain.wipe-out .wipe-content {
  opacity: 0;
  transform: translateY(-30px);
  transition-delay: 0s;
}

/* WIPE IN (COVER PAGE - Panels slide UP from bottom with staggered delays) */
.page-wipe-curtain.wipe-in .wipe-panel {
  transform: translateY(100%);
}

.page-wipe-curtain.wipe-in .wipe-content {
  opacity: 0;
  transform: translateY(30px);
}

.page-wipe-curtain.wipe-in.active .wipe-panel.panel-cyan {
  transform: translateY(0%);
  transition-delay: 0.0s;
}

.page-wipe-curtain.wipe-in.active .wipe-panel.panel-blue {
  transform: translateY(0%);
  transition-delay: 0.1s;
}

.page-wipe-curtain.wipe-in.active .wipe-panel.panel-navy {
  transform: translateY(0%);
  transition-delay: 0.2s;
}

.page-wipe-curtain.wipe-in.active .wipe-content {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.25s;
}

.page-wipe-brand {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.35em;
  color: #FFFFFF;
  text-shadow: 0 0 30px rgba(0, 212, 255, 0.8), 0 0 60px rgba(0, 102, 255, 0.5);
  text-transform: uppercase;
  user-select: none;
}

.page-wipe-sub {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: var(--color-cyan);
  text-transform: uppercase;
  margin-top: 1rem;
  opacity: 0.9;
}

/* --- PREFERS REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal, .reveal-mask {
    opacity: 1;
    transform: none;
    transition: none;
    clip-path: none;
  }
}
