/* Shared styles for all pages (keeps Tailwind as primary styling) */

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #000000;
  color: #cbd5e1;
  overflow-x: hidden;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #000;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

canvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
}

.font-geist {
  font-family: 'Geist', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
}

.text-glow {
  text-shadow: 0 0 40px rgba(56, 189, 248, 0.3);
}

.text-glow-strong {
  text-shadow: 0 0 50px rgba(56, 189, 248, 0.5);
}

/* Scroll Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1), filter 1s cubic-bezier(0.16, 1, 0.3, 1);
  filter: blur(5px);
  will-change: transform, opacity;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

/* Stagger delays */
.delay-100 {
  transition-delay: 100ms;
}

.delay-200 {
  transition-delay: 200ms;
}

.delay-300 {
  transition-delay: 300ms;
}

/* CTA */
@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --gradient-angle-offset {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --gradient-percent {
  syntax: "<percentage>";
  initial-value: 20%;
  inherits: false;
}

@property --gradient-shine {
  syntax: "<color>";
  initial-value: #38bdf8;
  inherits: false;
}

.shiny-cta {
  --gradient-angle: 0deg;
  --gradient-angle-offset: 0deg;
  --gradient-percent: 20%;
  --gradient-shine: #38bdf8;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: #ffffff;
  background: linear-gradient(#0a0a0a, #0a0a0a) padding-box,
    conic-gradient(
        from calc(var(--gradient-angle) - var(--gradient-angle-offset)),
        transparent 0%,
        #0284c7 5%,
        var(--gradient-shine) 15%,
        #0284c7 30%,
        transparent 40%,
        transparent 100%
      )
      border-box;
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 1px #1a1818;
  border-radius: 9999px;
  transition: transform 0.3s, box-shadow 0.3s;
  animation: border-spin 2.5s linear infinite;
}

@keyframes border-spin {
  to {
    --gradient-angle: 360deg;
  }
}

.shiny-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

/* Sonar */
@keyframes sonar-pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

.sonar-circle {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  opacity: 0;
  pointer-events: none;
}

.animate-sonar {
  animation: sonar-pulse 3s infinite linear;
}

.delay-1000 {
  animation-delay: 1s;
}

.delay-2000 {
  animation-delay: 2s;
}

/* Card border beam */
.card-beam {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--gradient-angle), transparent 70%, #38bdf8 100%);
  -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 0.3s;
  animation: border-spin 3s linear infinite;
}

.group:hover .card-beam {
  opacity: 1;
}

/* Circuit lines */
.circuit-beam {
  stroke-dasharray: 20 300;
  stroke-dashoffset: 300;
  animation: beam-move 2s linear infinite;
}

@keyframes beam-move {
  to {
    stroke-dashoffset: 0;
  }
}

.pin-row {
  display: flex;
  gap: 4px;
  justify-content: center;
  position: absolute;
}

.pin-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  position: absolute;
}

.chip-leg {
  width: 4px;
  height: 8px;
  background-color: #475569;
  border-radius: 1px;
}

.chip-leg-h {
  width: 8px;
  height: 4px;
  background-color: #475569;
  border-radius: 1px;
}

/* Small fade-in used by some UI pieces */
.fade-in-up {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Chip pulse + scanner */
@keyframes chip-pulse {
  0%,
  100% {
    box-shadow: 0 0 50px -10px rgba(0, 0, 0, 1);
    border-color: rgba(30, 41, 59, 0.8);
  }
  50% {
    box-shadow: 0 0 60px -5px rgba(56, 189, 248, 0.25);
    border-color: rgba(56, 189, 248, 0.6);
  }
}

.chip-alive {
  animation: chip-pulse 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes core-scan {
  0% {
    transform: translateX(-150%) skewX(-20deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateX(150%) skewX(-20deg);
    opacity: 0;
  }
}

.core-scanner {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(56, 189, 248, 0.05) 40%,
    rgba(56, 189, 248, 0.5) 50%,
    rgba(56, 189, 248, 0.05) 60%,
    transparent
  );
  animation: core-scan 2.5s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* Timeline beams */
@keyframes timeline-flow {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes timeline-flow-vertical {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

.timeline-beam-h {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #38bdf8, transparent);
  opacity: 1;
  animation: timeline-flow 3s linear infinite;
  pointer-events: none;
}

.timeline-beam-v {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent, #38bdf8, transparent);
  opacity: 1;
  animation: timeline-flow-vertical 3s linear infinite;
  pointer-events: none;
}
