/* ============== ANIMATIONS & ENHANCEMENTS ============== */

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }
.reveal.delay-5 { transition-delay: 0.40s; }

/* gradient noise overlay */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* custom cursor */
.cursor-dot, .cursor-ring {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transition: transform 0.12s ease, opacity 0.2s, width 0.2s, height 0.2s, border-color 0.2s;
  top: 0; left: 0;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  margin: -3px 0 0 -3px;
}
.cursor-ring {
  width: 32px; height: 32px;
  border: 1px solid var(--accent);
  margin: -16px 0 0 -16px;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.2s, height 0.2s;
}
.cursor-ring.hover {
  width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
  background: rgba(232,176,74,0.12);
}
@media (max-width: 880px), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* hero canvas */
.hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 2; }

/* hero terminal */
.hero-terminal {
  display: inline-flex;
  flex-direction: column;
  background: rgba(20, 37, 68, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 13px;
  margin-bottom: 8px;
  overflow: hidden;
  box-shadow: 0 24px 64px -32px rgba(0,0,0,0.6);
}
.hero-terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
}
.hero-terminal-dots { display: flex; gap: 6px; }
.hero-terminal-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.hero-terminal-dots span:nth-child(1) { background: #ff5f57; }
.hero-terminal-dots span:nth-child(2) { background: #febc2e; }
.hero-terminal-dots span:nth-child(3) { background: #28c840; }
.hero-terminal-title {
  color: var(--ink-mute);
  font-size: 11px;
  margin-left: 8px;
}
.hero-terminal-body {
  padding: 14px 18px;
  min-width: 380px;
}
.hero-terminal-line { display: flex; gap: 8px; align-items: center; }
.hero-terminal-line .prompt { color: var(--accent); }
.hero-terminal-line .cmd { color: var(--ink); }
.hero-terminal-out {
  color: var(--ink-dim);
  margin-top: 4px;
  font-size: 12px;
}
.hero-terminal-out b { color: var(--accent); font-weight: 500; }
.hero-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* magnetic button */
.magnet { display: inline-block; transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* hero title shimmer */
.hero-accent {
  background: linear-gradient(90deg, var(--accent) 0%, #fff2cc 50%, var(--accent) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* counters */
.stat-n { font-variant-numeric: tabular-nums; }

/* marquee */
.marquee {
  background: var(--accent);
  color: #1a1208;
  overflow: hidden;
  border-top: 1px solid rgba(0,0,0,0.1);
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.marquee-track {
  display: flex;
  gap: 48px;
  padding: 14px 0;
  white-space: nowrap;
  animation: marquee 28s linear infinite;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.marquee-track span { display: inline-flex; align-items: center; gap: 48px; }
.marquee-track .sep {
  width: 6px; height: 6px;
  background: #1a1208;
  border-radius: 50%;
  display: inline-block;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* funnel animated */
.funnel-bar {
  transform-origin: center;
  transform: scaleX(0);
  transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: linear-gradient(90deg, var(--primary-2) 0%, var(--primary-2) 100%);
}
.funnel.in .funnel-bar { transform: scaleX(1); }
.funnel.in .funnel-step:nth-child(1) .funnel-bar { transition-delay: 0s; }
.funnel.in .funnel-step:nth-child(3) .funnel-bar { transition-delay: 0.15s; }
.funnel.in .funnel-step:nth-child(5) .funnel-bar { transition-delay: 0.30s; }
.funnel.in .funnel-step:nth-child(7) .funnel-bar { transition-delay: 0.45s; }
.funnel.in .funnel-step:nth-child(9) .funnel-bar { transition-delay: 0.60s; }
.funnel-step.is-highlight .funnel-bar {
  background: linear-gradient(90deg, var(--accent-deep) 0%, var(--accent-2) 50%, var(--accent-deep) 100%);
  background-size: 200% 100%;
  animation: gold-flow 3s linear infinite;
}
@keyframes gold-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* mentor cards animated */
.mentor-card {
  position: relative;
  overflow: hidden;
}
.mentor-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(120deg, transparent 0%, rgba(232,176,74,0.08) 50%, transparent 100%);
  transition: left 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.mentor-card:hover::before { left: 100%; }
.mentor-avatar {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mentor-card:hover .mentor-avatar { transform: scale(1.08) rotate(-3deg); }
.mentor-card .mentor-id {
  position: absolute;
  top: 16px; right: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  opacity: 0.5;
}

/* phase pill active glow */
.phase-pill.is-active.is-accent {
  box-shadow: 0 8px 24px -8px rgba(232,176,74,0.5);
}

/* phase card transitions */
.phase-card-l, .phase-card-r {
  animation: phase-fade 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes phase-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CTA spots animated */
.cta-progress-bar {
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cta-deadline.in .cta-progress-bar { transform: scaleX(1); }

/* glowing dots / particles */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
  opacity: 0.4;
  z-index: 0;
}
.hero-orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--primary-2), transparent 70%);
  top: -100px; left: -100px;
  animation: orb-float-1 18s ease-in-out infinite;
}
.hero-orb-2 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  bottom: -80px; right: -80px;
  animation: orb-float-2 22s ease-in-out infinite;
}
@keyframes orb-float-1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(80px, 60px); }
}
@keyframes orb-float-2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-100px, -40px); }
}

/* hero side widgets */
.hero-widgets {
  position: absolute;
  right: 4vw;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  pointer-events: none;
}
@media (max-width: 1180px) { .hero-widgets { display: none; } }
.hero-widget {
  background: rgba(20, 37, 68, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  pointer-events: auto;
  transition: transform 0.3s, border-color 0.3s;
  animation: float-y 6s ease-in-out infinite;
}
.hero-widget:hover { border-color: var(--accent); transform: translateX(-4px); }
.hero-widget:nth-child(2) { animation-delay: -2s; }
.hero-widget:nth-child(3) { animation-delay: -4s; }
.hero-widget-label { color: var(--ink-mute); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.hero-widget-val { color: var(--ink); font-size: 14px; font-weight: 500; }
.hero-widget-val .accent { color: var(--accent); }
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* section eyebrows w/ animated dot */
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 12px;
  transform-origin: left;
}

/* hover lift */
.lift { transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.lift:hover { transform: translateY(-3px); }

/* code rain background for pain section */
.code-rain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.06;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  z-index: 0;
}
.code-rain-col {
  position: absolute;
  top: -100%;
  white-space: pre;
  animation: rain linear infinite;
  writing-mode: vertical-rl;
}
@keyframes rain {
  from { transform: translateY(-100%); }
  to { transform: translateY(200vh); }
}
.pain { position: relative; overflow: hidden; }
.pain .wrap { position: relative; z-index: 1; }

/* scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 100;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.05s linear;
}

/* tilt */
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* glitch on hover (subtle) */
.brand-mark {
  position: relative;
  overflow: hidden;
}
.brand-mark::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.brand:hover .brand-mark::after { transform: translateX(100%); }

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
