/* =========================================
   NOVA WORK — HyperFrames Animations
   Futuristic HUD / Cyberpunk / Tech UI
   ========================================= */

/* ── KEYFRAMES ── */
@keyframes hf-corner-draw {
  0%   { width: 0;   height: 0;   opacity: 0; }
  30%  { width: 20px; height: 0;  opacity: 1; }
  60%  { width: 20px; height: 20px; opacity: 1; }
  100% { width: 20px; height: 20px; opacity: 1; }
}
@keyframes hf-scan {
  0%   { top: 0%;    opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { top: 100%;  opacity: 0; }
}
@keyframes hf-pulse-ring {
  0%   { transform: scale(1);   opacity: .7; }
  100% { transform: scale(2.2); opacity: 0;  }
}
@keyframes hf-glitch-1 {
  0%,100% { clip-path: inset(50% 0 30% 0); transform: translate(-4px, 0); }
  20%     { clip-path: inset(10% 0 60% 0); transform: translate(4px, 0); }
  40%     { clip-path: inset(80% 0 5%  0); transform: translate(-2px, 0); }
  60%     { clip-path: inset(30% 0 50% 0); transform: translate(3px, 0); }
  80%     { clip-path: inset(5%  0 80% 0); transform: translate(-3px, 0); }
}
@keyframes hf-glitch-2 {
  0%,100% { clip-path: inset(30% 0 50% 0); transform: translate(4px, 0); color: #0ff; }
  25%     { clip-path: inset(60% 0 10% 0); transform: translate(-4px, 0); color: var(--red); }
  50%     { clip-path: inset(15% 0 70% 0); transform: translate(2px, 0); color: #0ff; }
  75%     { clip-path: inset(70% 0 20% 0); transform: translate(-2px, 0); color: var(--red); }
}
@keyframes hf-flicker {
  0%,19%,21%,23%,25%,54%,56%,100% { opacity: 1; }
  20%,22%,24%,55% { opacity: .4; }
}
@keyframes hf-data-stream {
  0%   { background-position: 0 0; }
  100% { background-position: 0 100%; }
}
@keyframes hf-border-trace {
  0%   { stroke-dashoffset: 1000; opacity: 0; }
  10%  { opacity: 1; }
  100% { stroke-dashoffset: 0;    opacity: 1; }
}
@keyframes hf-neon-pulse {
  0%,100% { box-shadow: 0 0 8px rgba(220,27,43,.4), 0 0 20px rgba(220,27,43,.2); }
  50%     { box-shadow: 0 0 16px rgba(220,27,43,.8), 0 0 40px rgba(220,27,43,.4), 0 0 60px rgba(220,27,43,.15); }
}
@keyframes hf-slide-in-left {
  from { opacity: 0; transform: translateX(-60px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes hf-slide-in-right {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes hf-slide-in-up {
  from { opacity: 0; transform: translateY(50px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hf-zoom-in {
  from { opacity: 0; transform: scale(.85); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes hf-spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes hf-orbit {
  from { transform: rotate(0deg) translateX(60px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(60px) rotate(-360deg); }
}
@keyframes hf-rgb-shift {
  0%,100% { text-shadow: 2px 0 0 rgba(255,0,60,.6), -2px 0 0 rgba(0,255,255,.6); }
  50%     { text-shadow: -2px 0 0 rgba(255,0,60,.6), 2px 0 0 rgba(0,255,255,.6); }
}
@keyframes hf-typing {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes hf-blink-cursor {
  0%,100% { border-right-color: var(--red); }
  50%     { border-right-color: transparent; }
}
@keyframes hf-grid-move {
  from { background-position: 0 0; }
  to   { background-position: 60px 60px; }
}
@keyframes hf-dash-march {
  to { stroke-dashoffset: -20; }
}
@keyframes hf-float-y {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-12px); }
}
@keyframes hf-crosshair-scale {
  0%,100% { transform: scale(1) rotate(0deg); }
  50%     { transform: scale(1.1) rotate(5deg); }
}
@keyframes hf-text-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

/* ── HERO: PARTICLE CANVAS ── */
#hf-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
}

/* ── HUD CORNER BRACKETS ── */
.hf-frame {
  position: relative;
}
.hf-frame::before,
.hf-frame::after,
.hf-frame .hf-corner-br,
.hf-frame .hf-corner-tl-inner {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-color: var(--red);
  border-style: solid;
  opacity: 0;
  transition: opacity .3s;
}
/* Top-left */
.hf-frame::before {
  top: -1px; left: -1px;
  border-width: 2px 0 0 2px;
  animation: hf-corner-draw .6s ease forwards;
}
/* Top-right */
.hf-frame::after {
  top: -1px; right: -1px;
  border-width: 2px 2px 0 0;
  animation: hf-corner-draw .6s ease .15s forwards;
}
/* Bottom-left via data attr */
.hf-frame[data-hf]::before { animation-delay: 0s; }
.hf-frame[data-hf]::after  { animation-delay: .1s; }

/* JS-injected bottom corners */
.hf-corner {
  position: absolute;
  width: 18px; height: 18px;
  border-color: rgba(220,27,43,.7);
  border-style: solid;
  pointer-events: none;
  animation: hf-corner-draw .6s ease forwards;
  opacity: 0;
}
.hf-corner.bl { bottom: -1px; left: -1px;  border-width: 0 0 2px 2px; animation-delay: .3s; }
.hf-corner.br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; animation-delay: .45s; }

/* Corner pulsing on hover */
.hf-frame:hover::before,
.hf-frame:hover::after {
  animation: hf-neon-pulse 1.5s ease-in-out infinite;
  opacity: 1;
}

/* ── SCAN LINE ── */
.hf-scan {
  position: relative;
  overflow: hidden;
}
.hf-scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(220,27,43,.1) 20%,
    rgba(220,27,43,.9) 50%,
    rgba(220,27,43,.1) 80%,
    transparent 100%);
  z-index: 10;
  pointer-events: none;
  animation: hf-scan 4s linear infinite;
  box-shadow: 0 0 8px rgba(220,27,43,.6);
}

/* ── GLITCH TEXT ── */
.hf-glitch {
  position: relative;
  display: inline-block;
}
.hf-glitch.active::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--red);
  animation: hf-glitch-1 .4s steps(1) forwards;
  z-index: 1;
}
.hf-glitch.active::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: #0ff;
  animation: hf-glitch-2 .4s steps(1) forwards;
  z-index: 2;
}

/* Hero title continuous rgb-shift */
.hf-rgb {
  animation: hf-rgb-shift 6s ease-in-out infinite;
}

/* ── NEON GLOW BORDER ── */
.hf-neon {
  animation: hf-neon-pulse 2.5s ease-in-out infinite;
}

/* ── SVG TRACE OVERLAY ── */
.hf-svg-trace {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.hf-trace-path {
  fill: none;
  stroke: rgba(220,27,43,.5);
  stroke-width: 1;
  stroke-dasharray: 8 4;
  animation: hf-dash-march .8s linear infinite;
}
.hf-trace-draw {
  fill: none;
  stroke: rgba(220,27,43,.4);
  stroke-width: 1.5;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: hf-border-trace 2s ease forwards;
}

/* ── FLOATING PARTICLES ── */
.hf-particle {
  position: absolute;
  border-radius: 50%;
  background: var(--red);
  pointer-events: none;
  animation: hf-pulse-ring 2.5s ease-out infinite;
}

/* ── DATA READOUT ── */
.hf-data-tag {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: rgba(220,27,43,.7);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hf-data-tag::before {
  content: '■';
  animation: hf-flicker 3s infinite;
  font-size: 8px;
}
.hf-data-line {
  height: 1px;
  background: linear-gradient(90deg, rgba(220,27,43,.6), transparent);
  margin: 8px 0;
  animation: hf-text-reveal 1s ease forwards;
}

/* ── TYPING EFFECT ── */
.hf-typing {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--red);
  width: 0;
  animation: hf-typing 2s steps(40) forwards, hf-blink-cursor .8s infinite;
}

/* ── ORBIT DOT ── */
.hf-orbit-wrap {
  position: relative;
  display: inline-block;
}
.hf-orbit-dot {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
  top: 50%; left: 50%;
  margin: -3px;
  box-shadow: 0 0 8px var(--red);
  animation: hf-orbit 3s linear infinite;
}

/* ── MOVING GRID BG ── */
.hf-moving-grid {
  background-image:
    linear-gradient(rgba(220,27,43,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(220,27,43,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: hf-grid-move 8s linear infinite;
}

/* ── ANIMATED STAT CARDS ── */
.hf-stat-glow .stat-number {
  text-shadow: 0 0 20px rgba(220,27,43,.5), 0 0 40px rgba(220,27,43,.2);
  animation: hf-rgb-shift 4s ease-in-out infinite;
}

/* ── FEATURE CARD TRACE ── */
.feature-card.hf-frame .hf-corner { animation-play-state: paused; }
.feature-card.hf-frame:hover .hf-corner { animation-play-state: running; animation: hf-corner-draw .3s ease forwards; opacity: 1; }
.feature-card.hf-frame:hover {
  box-shadow: 0 0 30px rgba(220,27,43,.15), inset 0 0 30px rgba(220,27,43,.03);
}

/* ── PLAN CARD HOLOGRAPHIC ── */
.plan-card.hf-frame:hover {
  background: linear-gradient(135deg,
    rgba(220,27,43,.08) 0%,
    rgba(30,34,41,1) 50%,
    rgba(220,27,43,.04) 100%);
}

/* ── SECTION DIVIDER ── */
.hf-divider {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(220,27,43,.2) 20%,
    rgba(220,27,43,.8) 50%,
    rgba(220,27,43,.2) 80%,
    transparent 100%);
  position: relative;
  overflow: visible;
  margin: 0;
}
.hf-divider::before {
  content: '◆';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--red);
  font-size: 10px;
  background: var(--darker);
  padding: 0 12px;
  animation: hf-spin-slow 8s linear infinite;
}

/* ── CROSSHAIR on hero badge ── */
.hero-badge::before {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px dashed rgba(220,27,43,.2);
  border-radius: 16px;
  animation: hf-crosshair-scale 3s ease-in-out infinite;
}

/* ── SCROLL REVEAL ENHANCEMENTS ── */
.hf-reveal-left   { opacity: 0; transform: translateX(-60px); transition: opacity .8s ease, transform .8s ease; }
.hf-reveal-right  { opacity: 0; transform: translateX(60px);  transition: opacity .8s ease, transform .8s ease; }
.hf-reveal-up     { opacity: 0; transform: translateY(50px);  transition: opacity .8s ease, transform .8s ease; }
.hf-reveal-zoom   { opacity: 0; transform: scale(.88);        transition: opacity .8s ease, transform .8s ease; }
.hf-reveal-left.hf-visible,
.hf-reveal-right.hf-visible,
.hf-reveal-up.hf-visible,
.hf-reveal-zoom.hf-visible {
  opacity: 1;
  transform: none;
}

/* Stagger children */
.hf-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}
.hf-stagger.hf-visible > *:nth-child(1) { opacity:1; transform:none; transition-delay: .0s; }
.hf-stagger.hf-visible > *:nth-child(2) { opacity:1; transform:none; transition-delay: .1s; }
.hf-stagger.hf-visible > *:nth-child(3) { opacity:1; transform:none; transition-delay: .2s; }
.hf-stagger.hf-visible > *:nth-child(4) { opacity:1; transform:none; transition-delay: .3s; }
.hf-stagger.hf-visible > *:nth-child(5) { opacity:1; transform:none; transition-delay: .4s; }
.hf-stagger.hf-visible > *:nth-child(6) { opacity:1; transform:none; transition-delay: .5s; }
.hf-stagger.hf-visible > *:nth-child(7) { opacity:1; transform:none; transition-delay: .6s; }
.hf-stagger.hf-visible > *:nth-child(8) { opacity:1; transform:none; transition-delay: .7s; }
.hf-stagger.hf-visible > *:nth-child(9) { opacity:1; transform:none; transition-delay: .8s; }

/* ── HUD OVERLAY (hero) ── */
.hf-hud-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.hf-hud-corner {
  position: absolute;
  width: 80px; height: 80px;
  border-color: rgba(220,27,43,.35);
  border-style: solid;
  animation: hf-corner-draw 1s ease forwards;
  opacity: 0;
}
.hf-hud-corner.tl { top: 40px; left: 24px; border-width: 2px 0 0 2px; animation-delay: .2s; }
.hf-hud-corner.tr { top: 40px; right: 24px; border-width: 2px 2px 0 0; animation-delay: .4s; }
.hf-hud-corner.bl { bottom: 40px; left: 24px; border-width: 0 0 2px 2px; animation-delay: .6s; }
.hf-hud-corner.br { bottom: 40px; right: 24px; border-width: 0 2px 2px 0; animation-delay: .8s; }

/* HUD status bar */
.hf-hud-status {
  position: absolute;
  bottom: 60px;
  right: 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.hf-hud-item {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: rgba(220,27,43,.6);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: hf-slide-in-right .6s ease forwards;
  opacity: 0;
}
.hf-hud-item:nth-child(1) { animation-delay: 1s; }
.hf-hud-item:nth-child(2) { animation-delay: 1.2s; }
.hf-hud-item:nth-child(3) { animation-delay: 1.4s; }
.hf-hud-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--red);
  animation: hf-flicker 2s infinite;
}

/* HUD top bar */
.hf-hud-top {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: rgba(220,27,43,.5);
  letter-spacing: 3px;
  text-transform: uppercase;
  white-space: nowrap;
  animation: hf-slide-in-up .8s ease 1.5s forwards;
  opacity: 0;
}

/* ── PLAN POPULAR HOLO ── */
.plan-card.popular .plan-popular-badge {
  animation: hf-flicker 4s infinite 2s;
}
.plan-card.popular::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--red), transparent, var(--red), transparent);
  background-size: 300% 300%;
  animation: hf-grid-move 3s linear infinite;
  z-index: -1;
  opacity: .3;
}

/* ── BUTTON RIPPLE ── */
.btn {
  position: relative;
  overflow: hidden;
}
.btn .hf-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  transform: scale(0);
  animation: hf-ripple-anim .6s linear;
  pointer-events: none;
}
@keyframes hf-ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* ── SECTION TAG PULSE ── */
.tag {
  animation: hf-neon-pulse 3s ease-in-out infinite;
}

/* ── MOBILE: reduce heavy effects ── */
@media (prefers-reduced-motion: reduce) {
  .hf-scan-line,
  .hf-glitch.active::before,
  .hf-glitch.active::after,
  .hf-orbit-dot,
  #hf-canvas { display: none !important; }
  .hf-corner, .hf-hud-corner { animation: none !important; opacity: 1 !important; }
}
@media (max-width: 640px) {
  .hf-hud-corner { width: 40px; height: 40px; }
  .hf-hud-status, .hf-hud-top { display: none; }
}
