/* ============================================================
   PORTAFOLIO MULTIMEDIA — GAMING / CYBERPUNK HUD (CSS puro)
   Rich Black #060A0F · Oxford Blue #072968 · Azure #017EFE
   Bright Cyan #00CAFA · White Smoke #F7F7F7
   ============================================================ */

:root {
  --radius: 0.25rem;
  --rich-black: #060a0f;
  --oxford: #072968;
  --azure: #017efe;
  --neon: #00cafa;
  --smoke: #f7f7f7;

  --background: var(--rich-black);
  --foreground: var(--smoke);
  --primary: var(--azure);
  --secondary: var(--oxford);
  --accent: var(--neon);
  --muted-foreground: #a8b6c8;
  --border: rgba(74, 122, 194, 0.45);

  --font-display: "Oxanium", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;

  --gradient-atmos: radial-gradient(1200px 600px at 15% -10%, rgba(1, 126, 254, 0.22), transparent 60%),
    radial-gradient(900px 500px at 95% 10%, rgba(0, 202, 250, 0.12), transparent 60%),
    linear-gradient(180deg, var(--rich-black), var(--rich-black));
  --gradient-hud: linear-gradient(160deg, rgba(7, 41, 104, 0.55), rgba(6, 10, 15, 0.8));
  --shadow-neon: 0 0 0 1px rgba(0, 202, 250, 0.45), 0 0 18px -4px rgba(0, 202, 250, 0.55);
  --shadow-azure: 0 18px 50px -20px rgba(1, 126, 254, 0.7);
}

/* Alto contraste */
html.hc {
  --background: #000;
  --foreground: #fff;
  --muted-foreground: #f2f2f2;
  --border: #6ee7ff;
  --secondary: #06214f;
  --shadow-neon: 0 0 0 2px var(--neon);
}

* {
  box-sizing: border-box;
  border-color: var(--border);
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--gradient-atmos);
  background-attachment: fixed;
  color: var(--foreground);
  font-family: var(--font-sans);
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  margin: 0;
}
img,
video,
iframe {
  max-width: 100%;
}
audio,
video {
  color-scheme: dark;
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
}
body.cursor-fx,
body.cursor-fx a,
body.cursor-fx button {
  cursor: none;
}

/* ---------- Bordes biselados / paneles ---------- */
.chamfer {
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.chamfer-sm {
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.hud-panel {
  background: var(--gradient-hud);
  border: 1px solid var(--border);
  position: relative;
}
.neon-glow {
  box-shadow: var(--shadow-neon);
}

/* ---------- Scanlines ---------- */
.scanlines {
  position: relative;
}
.scanlines::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 202, 250, 0.07) 0 1px, transparent 1px 4px);
  opacity: 0.35;
  mix-blend-mode: screen;
}

/* ---------- Keyframes ---------- */
@keyframes neon-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(0, 202, 250, 0.35), 0 0 10px -4px rgba(0, 202, 250, 0.4);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(0, 202, 250, 0.8), 0 0 26px -2px rgba(0, 202, 250, 0.75);
  }
}
@keyframes glitch-x {
  0%,
  100% {
    transform: translate(0);
    clip-path: inset(0 0 0 0);
  }
  20% {
    transform: translate(-2px, 1px);
    clip-path: inset(12% 0 58% 0);
  }
  40% {
    transform: translate(2px, -1px);
    clip-path: inset(62% 0 12% 0);
  }
  60% {
    transform: translate(-1px, 0);
    clip-path: inset(35% 0 40% 0);
  }
  80% {
    transform: translate(1px, 1px);
    clip-path: inset(78% 0 6% 0);
  }
}
@keyframes crt-flash {
  0% {
    opacity: 0;
    transform: scaleX(0.2);
  }
  35% {
    opacity: 1;
    transform: scaleX(1);
  }
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}
@keyframes scan-sweep {
  0% {
    transform: translateY(-110%);
  }
  100% {
    transform: translateY(410%);
  }
}
@keyframes float-bot {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}
.animate-neon {
  animation: neon-pulse 2.6s ease-in-out infinite;
}

/* ---------- Glitch en textos ---------- */
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.glitch:hover::before,
.glitch:focus-visible::before {
  color: var(--neon);
  opacity: 0.9;
  animation: glitch-x 0.5s steps(2, end) 1;
}
.glitch:hover::after,
.glitch:focus-visible::after {
  color: var(--azure);
  opacity: 0.8;
  animation: glitch-x 0.5s steps(2, end) reverse 1;
}

/* ---------- Items HUD ---------- */
.hud-item {
  position: relative;
  overflow: hidden;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.hud-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--neon);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hud-item:hover::before,
.hud-item:focus-visible::before,
.hud-item[data-active="true"]::before {
  transform: scaleY(1);
}
.hud-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0, 202, 250, 0.3), transparent);
  opacity: 0;
  transform-origin: left;
  pointer-events: none;
}
.hud-item:hover::after,
.hud-item:focus-visible::after {
  animation: crt-flash 0.45s ease-out 1;
}
.hud-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 22%;
  background: linear-gradient(180deg, transparent, rgba(0, 202, 250, 0.1), transparent);
  animation: scan-sweep 7s linear infinite;
  pointer-events: none;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Cursor personalizado ---------- */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  pointer-events: none;
  display: none;
}
body.cursor-fx .cursor {
  display: block;
}
.cursor-ring,
.cursor-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 999px;
}
.cursor-ring {
  width: 30px;
  height: 30px;
  border: 1px solid var(--neon);
  transition: width 0.15s ease, height 0.15s ease, background-color 0.15s ease;
}
.cursor.is-hot .cursor-ring {
  width: 44px;
  height: 44px;
  background: rgba(0, 202, 250, 0.15);
  box-shadow: var(--shadow-neon);
}
.cursor-dot {
  width: 4px;
  height: 4px;
  background: var(--neon);
}

/* ---------- Panel accesibilidad ---------- */
.a11y {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}
.a11y-btn {
  width: 3rem;
  height: 3rem;
  font-size: 1.25rem;
  color: var(--accent);
  background: var(--gradient-hud);
  cursor: pointer;
}
.a11y-panel {
  width: 15rem;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.a11y-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.a11y-row input {
  accent-color: var(--neon);
  width: 1rem;
  height: 1rem;
}
.a11y-hint {
  margin: 0.2rem 0 0;
  font-size: 0.68rem;
  color: var(--muted-foreground);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  left: -999px;
  top: 1rem;
  z-index: 95;
  background: var(--secondary);
  border: 1px solid var(--accent);
  padding: 0.5rem 1rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
}
.skip-link:focus {
  left: 1rem;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  height: 190vh;
}
.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 1.5rem;
}
.hero-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-kicker {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.hero-title {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 13vw;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
}
@media (min-width: 640px) {
  .hero-title {
    font-size: 9rem;
  }
}
.hero-copy {
  margin-top: 1.5rem;
  max-width: 36rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.hero-bot {
  position: absolute;
  bottom: 0;
  height: 42vh;
  max-height: 420px;
  width: auto;
  pointer-events: none;
  filter: drop-shadow(0 0 45px rgba(1, 126, 254, 0.6));
}
.animate-float-bot {
  animation: float-bot 5s ease-in-out infinite;
}
.cta {
  margin-top: 2rem;
  border: 1px solid rgba(0, 202, 250, 0.6);
  padding: 0.65rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Layout de 3 columnas ---------- */
.layout {
  margin: 0 auto;
  width: 100%;
  max-width: 100rem;
  display: grid;
  gap: 1.5rem;
  padding: 0 1rem 4rem;
}
@media (min-width: 1024px) {
  .layout {
    grid-template-columns: 15rem minmax(0, 1fr) 15rem;
    padding: 0 1.5rem 4rem;
  }
}
.hud-col {
  display: none;
}
@media (min-width: 1024px) {
  .hud-col {
    display: block;
  }
}
.hud-box {
  position: sticky;
  top: 1.5rem;
  overflow: hidden;
  padding: 1rem;
}
.hud-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}
.dot {
  width: 6px;
  height: 6px;
  display: inline-block;
}
.dot-accent {
  background: var(--accent);
}
.dot-primary {
  background: var(--primary);
}
.hud-title {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}
.hud-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hud-list a,
.hud-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.hud-list a:hover {
  color: var(--foreground);
}
.hud-list a[data-active="true"] {
  color: var(--accent);
  background: rgba(0, 202, 250, 0.1);
}
.hud-num {
  font-family: var(--font-display);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}
.phase-mark {
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  border: 1px solid var(--border);
}
.phase-done .phase-mark {
  border-color: var(--accent);
  background: var(--accent);
}
.phase-done {
  color: var(--foreground);
}
li[data-active="true"] {
  color: var(--accent) !important;
}
.hud-progress {
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* ---------- Secciones de documentación ---------- */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}
.doc {
  scroll-margin-top: 6rem;
}
.doc-header {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}
.doc-num {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: rgba(1, 126, 254, 0.7);
}
.doc-titlewrap {
  flex: 1;
  min-width: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}
.doc-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
.doc-card {
  overflow: hidden;
  box-shadow: var(--shadow-azure);
}
.doc-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 41, 104, 0.4);
  padding: 0.6rem 1rem;
}
.doc-label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.doc-body {
  padding: 0.75rem;
}
@media (min-width: 640px) {
  .doc-body {
    padding: 1rem;
  }
}
.doc-frame {
  height: 70vh;
  min-height: 420px;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--background);
}
.doc-video,
.doc-img {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--background);
  display: block;
}
.doc-img {
  max-height: 420px;
  width: auto;
  margin: 0 auto;
  padding: 0.75rem;
}
.audio-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}
.audio-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
}
.audio-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(6, 10, 15, 0.4);
  backdrop-filter: blur(4px);
  padding: 1.5rem;
}
.audio-title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.audio-inner audio {
  width: 100%;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
}
.site-footer .name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin: 0;
}
.site-footer .meta {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.site-footer .tag {
  margin: 0.25rem 0 0;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* ---------- Movimiento reducido ---------- */
html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation: none !important;
  transition-duration: 0.01ms !important;
}
html.reduce-motion .reveal {
  opacity: 1;
  transform: none;
}
html.reduce-motion .hud-scan,
html.reduce-motion .scanlines::after {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

[hidden] {
  display: none !important;
}
