/* La fuente Instrument Sans / JetBrains Mono se carga desde index.html vía <link>,
   no aquí, para que el navegador la descubra y descargue antes. */

:root {
  --radius: 0rem;
  --background: oklch(0.145 0.012 260);
  --foreground: oklch(0.99 0 0);
  --surface: oklch(0.205 0.018 260);
  --muted-foreground: oklch(0.73 0.015 260);
  --accent: oklch(0.68 0.155 258);
  --accent-foreground: oklch(0.99 0 0);
  --border: oklch(0.28 0.022 260);
}

* {
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
}

.font-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

::selection {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

/* ---------- Fondo de cuadrícula ---------- */
.bg-grid-texture {
  background-image: linear-gradient(
      to bottom,
      color-mix(in oklab, var(--accent) 6%, transparent),
      transparent 55%
    ),
    linear-gradient(to right, color-mix(in oklab, var(--border) 45%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklab, var(--border) 45%, transparent) 1px, transparent 1px);
  background-size: 100% 100%, 56px 56px, 56px 56px;
  background-attachment: fixed, fixed, fixed;
}

.glow-accent {
  box-shadow:
    0 0 0 1px color-mix(in oklab, var(--accent) 30%, transparent),
    0 18px 60px -24px color-mix(in oklab, var(--accent) 55%, transparent);
}

/* ---------- Marquee de tecnologías ---------- */
@keyframes marquee-x {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.animate-marquee {
  animation: marquee-x 28s linear infinite;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  transition-delay: var(--delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Efecto holográfico ---------- */
.holo-card {
  position: relative;
  transition: transform 0.3s ease-out;
  will-change: transform;
  transform: perspective(1100px) rotateX(0deg) rotateY(0deg);
}

.holo-sheen,
.holo-scan {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.holo-card.is-active .holo-sheen,
.holo-card.is-active .holo-scan {
  opacity: 1;
}

.holo-sheen {
  mix-blend-mode: screen;
  background: radial-gradient(
    340px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in oklab, var(--accent) 26%, transparent),
    transparent 70%
  );
}

.holo-scan {
  mix-blend-mode: screen;
  background-image: repeating-linear-gradient(
    to bottom,
    color-mix(in oklab, var(--accent) 12%, transparent) 0px,
    color-mix(in oklab, var(--accent) 12%, transparent) 1px,
    transparent 1px,
    transparent 5px
  );
  animation: holo-scan-move 6s linear infinite;
}

@keyframes holo-scan-move {
  from {
    background-position-y: 0;
  }
  to {
    background-position-y: 100px;
  }
}

@keyframes holo-pulse {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.6;
  }
}

.animate-holo-pulse {
  animation: holo-pulse 4s ease-in-out infinite;
}

@keyframes holo-sweep {
  0% {
    transform: translateY(-120%);
  }
  100% {
    transform: translateY(520%);
  }
}

.animate-holo-sweep {
  animation: holo-sweep 7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .animate-marquee,
  .holo-scan,
  .animate-holo-pulse,
  .animate-holo-sweep {
    animation: none;
  }
  .holo-card {
    transform: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
