/* AI visual system */
:root {
  --gradient-ai: linear-gradient(135deg, #3d5afe 0%, #00e5ff 50%, #7c4dff 100%);
  --gradient-ai-soft: linear-gradient(135deg, rgba(61, 90, 254, 0.12), rgba(0, 229, 255, 0.08));
  --gradient-mesh:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(61, 90, 254, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(0, 229, 255, 0.1), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 90%, rgba(124, 77, 255, 0.08), transparent 45%);
  --glow-ai: 0 0 40px rgba(61, 90, 254, 0.35), 0 0 80px rgba(0, 229, 255, 0.15);
  --glow-cyan: 0 0 24px rgba(0, 229, 255, 0.5);
}

.text-gradient {
  background: var(--gradient-ai);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: shimmer-text 6s linear infinite;
}

@keyframes shimmer-text {
  to { background-position: 200% center; }
}

/* Hero ambient */
.hero__mesh {
  position: absolute;
  inset: 0;
  background: var(--gradient-mesh);
  pointer-events: none;
  animation: mesh-drift 18s ease-in-out infinite alternate;
}

@keyframes mesh-drift {
  from { transform: scale(1) translateY(0); opacity: 0.85; }
  to { transform: scale(1.05) translateY(-2%); opacity: 1; }
}

.ai-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.55;
}

/* AI status pill */
.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.45rem 0.9rem;
  font-family: var(--font-en);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-ai);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(61, 90, 254, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.ai-status__dot {
  width: 6px;
  height: 6px;
  background: #00e5ff;
  border-radius: 50%;
  box-shadow: var(--glow-cyan);
  animation: pulse-dot 2s ease-in-out infinite;
}

.ai-status__text {
  font-variant-numeric: tabular-nums;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* Scan frame — casting AI HUD */
.ai-frame {
  position: relative;
}

.ai-frame::before,
.ai-frame::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(0, 229, 255, 0.85);
  pointer-events: none;
  animation: corner-pulse 3s ease-in-out infinite;
}

.ai-frame::before {
  top: 1rem;
  left: 1rem;
  border-right: none;
  border-bottom: none;
}

.ai-frame::after {
  bottom: 1rem;
  right: 1rem;
  border-left: none;
  border-top: none;
}

.ai-frame__corners {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.ai-frame__corners span {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(61, 90, 254, 0.7);
  animation: corner-pulse 3s ease-in-out infinite 0.5s;
}

.ai-frame__corners span:nth-child(1) { top: 1rem; right: 1rem; border-left: none; border-bottom: none; }
.ai-frame__corners span:nth-child(2) { bottom: 1rem; left: 1rem; border-right: none; border-top: none; }

@keyframes corner-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.6)); }
}

.ai-scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.ai-scan::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00e5ff, transparent);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.8);
  animation: scan-line 4s ease-in-out infinite;
}

.ai-scan::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(61, 90, 254, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 90, 254, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.6;
}

@keyframes scan-line {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.ai-hud {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-en);
  background: rgba(8, 12, 24, 0.72);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 4px;
  backdrop-filter: blur(8px);
}

.ai-hud--hero {
  top: 1.25rem;
  right: 1.25rem;
}

.ai-hud__tag {
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: rgba(0, 229, 255, 0.85);
}

.ai-hud__value {
  font-size: 1.125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

.ai-hud__meta {
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
}

/* Orbit ring */
.hero__orbit {
  position: absolute;
  top: 6%;
  right: 8%;
  z-index: 0;
  width: 100px;
  height: 100px;
  border: 1px dashed rgba(61, 90, 254, 0.35);
  border-radius: 50%;
  animation: orbit-spin 20s linear infinite;
}

.hero__orbit::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  background: #00e5ff;
  border-radius: 50%;
  box-shadow: var(--glow-cyan);
  transform: translateX(-50%);
}

.hero__orbit::after {
  content: "AI";
  position: absolute;
  bottom: -0.75rem;
  left: 50%;
  padding: 0.2rem 0.45rem;
  font-family: var(--font-en);
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #fff;
  background: var(--gradient-ai);
  border-radius: 3px;
  transform: translateX(-50%);
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

/* Marquee */
.ai-marquee {
  overflow: hidden;
  padding-block: 0.75rem;
  background: var(--color-main);
  border-block: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-marquee__track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marquee-scroll 28s linear infinite;
}

.ai-marquee__item {
  flex-shrink: 0;
  font-family: var(--font-en);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
  white-space: nowrap;
}

.ai-marquee__item strong {
  color: rgba(0, 229, 255, 0.9);
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
}

@keyframes marquee-scroll {
  to { transform: translateX(-50%); }
}

/* Floating animation */
.float-y {
  animation: float-y 6s ease-in-out infinite;
}

.float-y--delay {
  animation-delay: -3s;
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Hero stats glow */
.hero__stat-value {
  background: var(--gradient-ai);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__stat {
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.hero__stat:hover {
  background: rgba(61, 90, 254, 0.04);
  box-shadow: inset 0 0 0 1px rgba(61, 90, 254, 0.12);
}

/* Bento AI border pulse */
.bento--casting::before,
.bento--ai::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 2px;
  background: var(--gradient-ai);
  border-radius: inherit;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
  animation: border-glow 3s ease-in-out infinite;
}

.bento--casting:hover::before,
.bento--ai:hover::before {
  opacity: 1;
}

@keyframes border-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

.bento__tag--scan {
  position: relative;
  overflow: hidden;
}

.bento__tag--scan::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-100%);
  animation: tag-sweep 2.5s ease-in-out infinite;
}

@keyframes tag-sweep {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* Why us row — AI accent line */
.why-us__row {
  position: relative;
}

.why-us__row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gradient-ai);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.why-us__row.is-visible::before,
.why-us__row:hover::before {
  transform: scaleY(1);
}

.why-us__num {
  transition: color var(--transition-base), text-shadow var(--transition-base);
}

.why-us__row:hover .why-us__num {
  color: var(--color-ai);
  text-shadow: 0 0 20px rgba(61, 90, 254, 0.35);
}

/* Chip pulse */
.chip--ai {
  position: relative;
  animation: chip-glow 4s ease-in-out infinite;
}

@keyframes chip-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(61, 90, 254, 0); }
  50% { box-shadow: 0 0 16px rgba(61, 90, 254, 0.2); }
}

/* Button AI hover */
.btn--primary {
  position: relative;
  overflow: hidden;
  background: var(--color-main);
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-ai);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn--primary:hover::before { opacity: 1; }

.btn--primary:hover {
  box-shadow: var(--glow-ai);
}

.btn--primary > * {
  position: relative;
  z-index: 1;
}

/* Reveal variants */
.reveal--left {
  transform: translateX(-24px);
}

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

.reveal--left.is-visible,
.reveal--scale.is-visible {
  transform: none;
}

.reveal--blur {
  filter: blur(8px);
}

.reveal--blur.is-visible {
  filter: blur(0);
}

/* Cursor glow (desktop) */
.ai-cursor-glow {
  position: fixed;
  z-index: 9999;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 90, 254, 0.08), transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

body.is-ai-ready .ai-cursor-glow { opacity: 1; }

/* Contact footer AI grid */
.contact-cta {
  position: relative;
  overflow: hidden;
}

.contact-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: grid-shift 20s linear infinite;
  pointer-events: none;
}

@keyframes grid-shift {
  to { background-position: 48px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-canvas,
  .hero__mesh,
  .ai-cursor-glow,
  .hero__orbit,
  .ai-marquee__track,
  .ai-scan::before,
  .contact-cta::before {
    display: none;
  }

  .text-gradient,
  .ai-status__dot,
  .ai-frame::before,
  .ai-frame::after,
  .ai-frame__corners span,
  .float-y,
  .chip--ai,
  .bento--casting::before,
  .bento--ai::before,
  .bento__tag--scan::after {
    animation: none;
  }

  .reveal,
  .reveal--left,
  .reveal--scale,
  .reveal--blur {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}
