/* ═══════════════════════════════════════════════════════════════
   FUENTES — autoalojadas
   Geist Variable da acceso al peso 450, el que usa la referencia
   para el cuerpo de texto.
   ═══════════════════════════════════════════════════════════════ */
@font-face {
  font-family: 'Geist';
  src: url('../fonts/Geist-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Pixel';
  src: url('../fonts/GeistPixel-Square.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ═══════════════════════════════════════════════════════════════
   TOKENS — Siddz Mono Minimal, calibrado contra la web real
   ═══════════════════════════════════════════════════════════════ */
:root {
  --primary: #000000;
  --ink: #0d0d0d;
  --body: #484848;
  --secondary: #6b6b6b;
  --tertiary: #222222;
  --neutral: #ffffff;
  --surface: #ffffff;
  --surface-2: #fcfcfc;
  --on-surface: #111111;
  --muted-surface: #f5f5f5;
  --border: rgba(0, 0, 0, 0.09);
  --border-soft: rgba(0, 0, 0, 0.05);
  --border-hover: rgba(0, 0, 0, 0.2);
  --success: #22c55e;
  --icon-tile: transparent;
  --icon-tile-pad: 0px;

  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Cambia a var(--font-sans) si prefieres el nombre sin pixel */
  --font-display: 'Geist Pixel', 'Geist', ui-sans-serif, system-ui, sans-serif;

  --sp-xs: 6px;
  --sp-sm: 14px;
  --sp-md: 24px;
  --sp-lg: 40px;
  --sp-xl: 80px;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-full: 9999px;

  --column: 860px;
  --gutter: 24px;

  color-scheme: light;
}

/* ── Modo oscuro ──
   Solo se invierte la escala de grises: la jerarquía, los radios y
   el espaciado no cambian. */
:root[data-theme='dark'] {
  --primary: #ffffff;
  --ink: #f4f4f4;
  --body: #a9a9a9;
  --secondary: #8b8b8b;
  --tertiary: #d8d8d8;
  --neutral: #0b0b0b;
  --surface: #0b0b0b;
  --surface-2: #131313;
  --on-surface: #ededed;
  --muted-surface: #191919;
  --border: rgba(255, 255, 255, 0.12);
  --border-soft: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.28);
  /* Los logos de marca son oscuros por diseño: sobre negro necesitan base */
  --icon-tile: #f1f1f1;
  --icon-tile-pad: 4px;

  color-scheme: dark;
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
   La base es monoespaciada: el texto pequeño de interfaz hereda el
   tono técnico y Geist se aplica solo donde se lee de verdad.
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.25s ease, color 0.25s ease;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

input, textarea, button, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }

::selection { background: var(--primary); color: var(--neutral); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: var(--r-sm); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -60px; left: 24px; z-index: 60;
  background: var(--primary); color: var(--neutral);
  font-family: var(--font-mono); font-size: 13px;
  padding: 8px 16px; border-radius: var(--r-sm);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; }

.column { max-width: var(--column); margin: 0 auto; padding: 0 var(--gutter); }

/* ═══════════════════════════════════════════════════════════════
   TIPOGRAFÍA
   ═══════════════════════════════════════════════════════════════ */
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 600; color: var(--ink); }

.display {
  font-family: var(--font-display);
  font-size: clamp(26px, 5.2vw, 34px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 400; line-height: 1;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: var(--sp-md);
}

/* Cuerpo: Geist a 450 y color de más contraste que el gris de UI */
.prose {
  font-family: var(--font-sans);
  font-size: 15px; font-weight: 450; line-height: 27.75px;
  color: var(--body);
}
.prose strong { color: var(--tertiary); font-weight: 550; }

section { padding-bottom: var(--sp-xl); }

/* ═══════════════════════════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.25s ease;
}
.topbar.scrolled { border-bottom-color: var(--border-soft); }

.topbar-inner {
  max-width: var(--column); margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-sm);
}

.topnav { display: flex; gap: 20px; min-width: 0; }

.topnav a {
  font-family: var(--font-mono); font-size: 14px;
  color: var(--secondary);
  transition: color 0.2s ease;
}
.topnav a:hover, .topnav a.active { color: var(--primary); }

.topbar-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Conmutador de idioma: dos mitades de una misma pastilla */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.lang-switch button {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em;
  padding: 5px 8px;
  color: var(--secondary);
  transition: background 0.2s ease, color 0.2s ease;
}
.lang-switch button:hover { color: var(--primary); }
.lang-switch button[aria-pressed='true'] { background: var(--muted-surface); color: var(--primary); }

.icon-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--secondary);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.icon-btn:hover { color: var(--primary); background: var(--muted-surface); }
.icon-btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.6; fill: none; }

/* Solo se ve el icono del tema opuesto al activo */
.icon-btn .sun { display: none; }
:root[data-theme='dark'] .icon-btn .sun { display: block; }
:root[data-theme='dark'] .icon-btn .moon { display: none; }

@media (max-width: 720px) {
  .topbar-inner { padding-right: 0; gap: 10px; }
  .topnav {
    gap: 16px; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { font-size: 13px; white-space: nowrap; }
  .topbar-tools { padding-right: var(--gutter); }
}

/* ═══════════════════════════════════════════════════════════════
   PERFIL
   ═══════════════════════════════════════════════════════════════ */
.profile { padding-top: var(--sp-lg); }

.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: var(--sp-sm); }

/* Avatar: la foto manda; el monograma es el respaldo si falta */
.avatar {
  position: relative;
  width: 58px; height: 58px; flex-shrink: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--ink);
  color: var(--neutral);
  display: flex; align-items: center; justify-content: center;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar img[hidden] { display: none; }

.avatar .fallback {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1;
}

.role-rotator {
  height: 26px;
  display: flex; align-items: center;
  margin-bottom: var(--sp-md);
  overflow: hidden;
}

.role-rotator .prefix {
  font-family: var(--font-mono); font-size: 14px;
  color: var(--secondary); margin-right: 10px; flex-shrink: 0;
}

.role-rotator .slot {
  font-family: var(--font-mono); font-size: 14px;
  color: var(--ink);
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.role-rotator .slot.swap { animation: roleSwap 0.5s ease; }

@keyframes roleSwap {
  0%   { opacity: 1; transform: translateY(0); }
  45%  { opacity: 0; transform: translateY(-9px); }
  55%  { opacity: 0; transform: translateY(9px); }
  100% { opacity: 1; transform: translateY(0); }
}

.meta-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-md);
  padding: var(--sp-md) 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: var(--sp-md);
}

.meta-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--secondary); margin-bottom: var(--sp-xs); line-height: 1.2;
}

.meta-value {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 450; line-height: 1.4;
  color: var(--tertiary);
}
.meta-value svg { width: 14px; height: 14px; flex-shrink: 0; stroke: var(--secondary); stroke-width: 1.5; fill: none; }
.meta-value a { transition: color 0.2s ease; }
.meta-value a:hover { color: var(--primary); }

@media (max-width: 560px) { .meta-grid { grid-template-columns: 1fr; gap: var(--sp-sm); } }

.profile .prose { margin-bottom: var(--sp-md); }

.socials { display: flex; gap: 4px; }

.socials a {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--secondary);
  transition: color 0.2s ease, background 0.2s ease;
}
.socials a:hover { color: var(--primary); background: var(--muted-surface); }
.socials svg { width: 17px; height: 17px; }

/* ═══════════════════════════════════════════════════════════════
   ICONOS DE TECNOLOGÍA — logos reales a color
   Son la única fuente de croma de la página.
   ═══════════════════════════════════════════════════════════════ */
.tech-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

.tech-grid img {
  width: 34px; height: 34px;
  object-fit: contain;
  background: var(--icon-tile);
  padding: var(--icon-tile-pad);
  border-radius: 7px;
  transition: transform 0.2s ease;
}
.tech-grid img:hover { transform: translateY(-2px); }

.tech-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

.tech-row img {
  width: 22px; height: 22px;
  object-fit: contain;
  background: var(--icon-tile);
  padding: var(--icon-tile-pad);
  border-radius: 5px;
}

.tech-row .plain {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.04em; color: var(--secondary); align-self: center;
}

/* Conceptos sin logo: línea de texto, no etiquetas */
.concepts {
  font-family: var(--font-mono);
  font-size: 12px; line-height: 2; letter-spacing: 0.04em;
  color: var(--secondary);
  margin-top: var(--sp-md); padding-top: var(--sp-sm);
  border-top: 1px solid var(--border-soft);
}
.concepts b { color: var(--tertiary); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-sm); }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 0.2s ease, background 0.25s ease;
}
.card:hover { border-color: var(--border-hover); }

.card-media {
  aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--muted-surface);
  border-bottom: 1px solid var(--border-soft);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.card-body { padding: 20px 24px 24px; display: flex; flex-direction: column; flex: 1; }

.card-title-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-sm); margin-bottom: 8px;
}

.card-title-row h3 {
  font-family: var(--font-sans);
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.3;
  color: var(--on-surface);
}

.card-links { display: flex; gap: 4px; flex-shrink: 0; }
.card-links a, .card-links span {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); color: var(--secondary);
  transition: color 0.2s ease, background 0.2s ease;
}
.card-links a:hover { color: var(--primary); background: var(--muted-surface); }
.card-links svg { width: 15px; height: 15px; }

.card-body p {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 450; line-height: 1.72;
  color: var(--body); margin-bottom: var(--sp-sm);
}

.card-body .tech-row { margin-top: auto; }

.card-status {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--secondary);
  display: inline-flex; align-items: center; gap: 7px;
  margin-bottom: 12px;
}
.card-status .dot { width: 6px; height: 6px; border-radius: var(--r-full); background: var(--secondary); }
.card-status.live .dot { background: var(--success); }

/* ═══════════════════════════════════════════════════════════════
   GALERÍA — arte generativo
   ═══════════════════════════════════════════════════════════════ */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 640px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--muted-surface);
  padding: 0;
  cursor: zoom-in;
  display: block;
}

.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.25s ease;
}
.gallery-item:hover img { transform: scale(1.04); }

/* Hueco: se ve solo mientras no haya imágenes */
.gallery-empty {
  aspect-ratio: 1 / 1;
  border: 1px dashed var(--border-hover);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; color: var(--secondary);
  text-align: center; padding: 10px;
}

.gallery-hint {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.04em; color: var(--secondary);
  margin-top: var(--sp-sm);
}

/* Visor a pantalla completa */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-md);
  background: rgba(8, 8, 8, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }

.lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 86vh;
  width: auto;
  border-radius: var(--r-md);
  object-fit: contain;
}

.lightbox-caption {
  position: absolute; left: 0; right: 0; bottom: 18px;
  text-align: center;
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.06em; color: #cfcfcf;
}

.lightbox-btn {
  position: absolute;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f0f0f0;
  transition: background 0.2s ease;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, 0.12); }
.lightbox-btn svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.6; fill: none; }

.lightbox-close { top: 18px; right: 18px; }
.lightbox-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 18px; top: 50%; transform: translateY(-50%); }

body.no-scroll { overflow: hidden; }

/* ═══════════════════════════════════════════════════════════════
   SPOTIFY — embed oficial, sin backend
   ═══════════════════════════════════════════════════════════════ */
.music-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-sm); }
@media (max-width: 700px) { .music-grid { grid-template-columns: 1fr; } }

.music-grid iframe { display: block; width: 100%; border: 0; border-radius: var(--r-lg); }

.music-empty {
  min-height: 352px;
  border: 1px dashed var(--border-hover);
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: var(--sp-md);
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.06em; line-height: 1.8; color: var(--secondary);
}

.spotify-placeholder {
  border: 1px dashed var(--border-hover);
  border-radius: var(--r-lg);
  padding: var(--sp-md);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.9;
  letter-spacing: 0.03em; color: var(--secondary);
}
.spotify-placeholder code {
  background: var(--muted-surface);
  border-radius: var(--r-sm);
  padding: 2px 6px;
  color: var(--tertiary);
}

/* ═══════════════════════════════════════════════════════════════
   EXPERIENCIA
   ═══════════════════════════════════════════════════════════════ */
.entry { position: relative; padding-left: 26px; padding-bottom: var(--sp-lg); }
.entry:last-child { padding-bottom: 0; }

.entry::before {
  content: ''; position: absolute;
  left: 3px; top: 14px; bottom: -6px; width: 1px;
  background: var(--border);
}
.entry:last-child::before { display: none; }

.entry::after {
  content: ''; position: absolute;
  left: 0; top: 8px; width: 7px; height: 7px;
  border-radius: var(--r-full); background: var(--secondary);
}
.entry.current::after { background: var(--success); }

.entry-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-sm); flex-wrap: wrap;
}

.entry-role {
  font-family: var(--font-sans);
  font-size: 15px; font-weight: 600; line-height: 1.5;
  color: var(--on-surface);
}
.entry-role .sep { color: var(--secondary); font-weight: 400; margin: 0 6px; }
.entry-role .company { font-weight: 450; color: var(--secondary); }

.entry-dates { font-family: var(--font-mono); font-size: 13px; color: var(--secondary); white-space: nowrap; }

.entry-place {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.04em; color: var(--secondary); margin-bottom: 12px;
}

.entry p {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 450; line-height: 1.75;
  color: var(--body); margin-bottom: 12px;
}

.entry ul { margin-bottom: var(--sp-sm); }

.entry li {
  position: relative; padding-left: 16px;
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 450; line-height: 1.7;
  color: var(--body); margin-bottom: 5px;
}
.entry li::before {
  content: ''; position: absolute; left: 0; top: 11px;
  width: 5px; height: 1px; background: var(--secondary); opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════════════
   CONTACTO
   ═══════════════════════════════════════════════════════════════ */
.contact-title {
  font-family: var(--font-sans);
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink); margin-bottom: 10px;
}

.contact-lead { max-width: 54ch; margin-bottom: var(--sp-md); }

.contact-list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-sm); margin-bottom: var(--sp-sm);
}
@media (max-width: 640px) { .contact-list { grid-template-columns: 1fr; } }

.contact-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  transition: border-color 0.2s ease, background 0.25s ease;
}
.contact-card:hover { border-color: var(--border-hover); background: var(--surface-2); }

.contact-card svg {
  width: 16px; height: 16px;
  stroke: var(--secondary); stroke-width: 1.5; fill: none;
  margin-bottom: 12px;
}

.contact-card .title {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 600; color: var(--on-surface);
  line-height: 1.4; margin-bottom: 4px;
}

.contact-card .sub {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.04em; color: var(--secondary);
  line-height: 1.5; word-break: break-word;
}

.contact-note {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.04em; color: var(--secondary);
  margin-bottom: var(--sp-lg);
}

.form-panel { border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-md); }

.form-panel h3 {
  font-family: var(--font-sans);
  font-size: 16px; font-weight: 600; color: var(--on-surface); margin-bottom: 6px;
}

.form-panel .hint {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 450; line-height: 1.7;
  color: var(--body); margin-bottom: var(--sp-md);
}

.field { margin-bottom: var(--sp-sm); }

.field label {
  display: block;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--secondary); margin-bottom: var(--sp-xs);
}

.field input, .field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-family: var(--font-sans);
  font-size: 15px; font-weight: 450; line-height: 1.6;
  color: var(--on-surface);
  transition: border-color 0.2s ease, background 0.25s ease;
}
.field input::placeholder, .field textarea::placeholder { color: var(--secondary); opacity: 0.75; }
.field input:focus, .field textarea:focus { border-color: var(--tertiary); outline: none; }
.field textarea { resize: vertical; min-height: 108px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 40px; padding: 8px 16px;
  background: var(--secondary); color: var(--neutral);
  font-family: var(--font-mono); font-size: 15px; font-weight: 450; line-height: 1.3;
  border-radius: var(--r-sm);
  transition: background 0.2s ease;
}
.btn:hover { background: var(--primary); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.5; fill: none; }

.form-status {
  font-family: var(--font-mono); font-size: 12px; line-height: 1.6;
  color: var(--secondary); margin-top: var(--sp-sm); min-height: 19px;
}
.form-status.ok { color: #16a34a; }
.form-status.err { color: #dc2626; }
:root[data-theme='dark'] .form-status.ok { color: #4ade80; }
:root[data-theme='dark'] .form-status.err { color: #f87171; }

/* ═══════════════════════════════════════════════════════════════
   CIERRE
   ═══════════════════════════════════════════════════════════════ */
.closing { text-align: center; padding-bottom: var(--sp-lg); }

.closing blockquote {
  font-family: var(--font-display);
  font-size: clamp(15px, 3.2vw, 19px);
  line-height: 1.6; color: var(--ink);
  max-width: 30ch; margin: 0 auto 14px;
}

.closing cite {
  font-family: var(--font-mono);
  font-size: 12px; font-style: normal; letter-spacing: 0.08em;
  color: var(--secondary);
}

.visitor {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.06em;
  color: var(--secondary);
  margin-top: var(--sp-lg);
  visibility: hidden;
}
.visitor.ready { visibility: visible; }
.visitor b { font-family: var(--font-display); font-weight: 400; color: var(--ink); }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
footer { border-top: 1px solid var(--border-soft); padding: var(--sp-md) 0 var(--sp-lg); }

.footer-inner {
  max-width: var(--column); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-md); flex-wrap: wrap;
}

.footer-inner span, .footer-inner a {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--secondary);
}
.footer-inner a { transition: color 0.2s ease; }
.footer-inner a:hover { color: var(--primary); }

.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ═══════════════════════════════════════════════════════════════
   INTERRUPTOR DE SONIDO
   ═══════════════════════════════════════════════════════════════ */
.icon-btn .sfx-off { display: none; }
.icon-btn[aria-pressed='false'] .sfx-on { display: none; }
.icon-btn[aria-pressed='false'] .sfx-off { display: block; }
.icon-btn[aria-pressed='true'] { color: var(--primary); background: var(--muted-surface); }

/* ═══════════════════════════════════════════════════════════════
   PÁGINA 404 + CONSOLA
   La consola es oscura en los dos temas: es un objeto, no una
   superficie de la interfaz.
   ═══════════════════════════════════════════════════════════════ */
.error-head { padding-top: var(--sp-lg); padding-bottom: var(--sp-lg); }

.error-code {
  font-family: var(--font-display);
  font-size: clamp(56px, 14vw, 104px);
  line-height: 1;
  color: var(--ink);
  margin-bottom: var(--sp-sm);
}

.error-head .prose { max-width: 46ch; margin-bottom: var(--sp-md); }

.error-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 40px; padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 15px; font-weight: 450;
  color: var(--secondary);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--primary); }

/* ── La consola ── */
.arcade {
  display: flex; justify-content: center;
  padding: var(--sp-lg) var(--gutter) var(--sp-xl);
}

.console {
  width: 100%; max-width: 372px;
  background: linear-gradient(180deg, #454f5c 0%, #333c47 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 34px;
  padding: 22px 22px 26px;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.7);
}

.console-screen {
  background: #0e1a12;
  border-radius: 14px;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

/* Líneas de barrido: el guiño de tubo, muy sutil */
.console-screen::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
}

.console-screen canvas {
  display: block; width: 100%; height: auto;
  border-radius: 6px;
  image-rendering: pixelated;
  touch-action: none;
}

.console-brand {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  padding: 12px 4px 16px;
}
.console-brand b { color: rgba(255, 255, 255, 0.72); font-weight: 500; }

.console-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-md);
}

/* Cruceta: rejilla 3x3, los botones ocupan la cruz */
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 38px);
  grid-template-rows: repeat(3, 38px);
  gap: 3px;
}

.dpad button {
  background: #232a33;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-mono); font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s ease, transform 0.08s ease;
}
.dpad button:hover { background: #2c343f; color: #fff; }
.dpad button:active { transform: scale(0.94); }

.dpad .up    { grid-area: 1 / 2; }
.dpad .left  { grid-area: 2 / 1; }
.dpad .down  { grid-area: 3 / 2; }
.dpad .right { grid-area: 2 / 3; }

.action-btn {
  width: 72px; height: 60px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f0603f 0%, #d8482c 100%);
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 4px 0 #a5341d;
  color: #fff;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.action-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a5341d; }

.console-hint {
  text-align: center;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 18px;
}

@media (max-width: 400px) {
  .console { max-width: 100%; padding: 16px 16px 20px; border-radius: 26px; }
  .dpad { grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(3, 34px); }
  .action-btn { width: 64px; height: 54px; }
}
