/* =========================================================================
   Fuentes locales (subset latino, SIL OFL 1.1 — ver assets/fonts/LICENSES.md)
   ========================================================================= */
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/anton-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ========================================================================
   FERR — Neon Tech palette
   Pure-black canvas · Cyan primary · Magenta secondary · Lime accent
   ======================================================================== */

:root {
  /* Colors — Neon tech */
  --color-neon-cyan:    #00f0ff;
  --color-neon-magenta: #ff2bd6;
  --color-neon-lime:    #b5ff3a;
  --color-neon-violet:  #8a5cff;

  /* Surfaces — near-black with cool tint */
  --surface-void:       #050510;   /* page canvas */
  --surface-card:       #0c0c1a;   /* card surface */
  --surface-deep:       #07070f;   /* deepest recessed */
  --surface-line:       #1a1a2e;   /* hairline borders */

  /* Text on dark */
  --text-primary:       #e6f7ff;   /* near-white with cyan tint */
  --text-secondary:     #8fa4b8;   /* muted blue-grey */
  --text-faint:         #74869e;   /* dim labels (contraste AA ≥ 4.5:1 sobre las tarjetas) */

  /* Fonts */
  --font-display: 'Anton', 'Bebas Neue', 'Druk Wide', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Radii */
  --radius-cards: 4px;
  --radius-pill:  9999px;

  /* Layout */
  --page-max: 1440px;
  --gutter:  clamp(20px, 4vw, 64px);

  /* Neon glow tokens */
  --glow-cyan:    0 0 12px rgba(0, 240, 255, 0.45), 0 0 28px rgba(0, 240, 255, 0.18);
  --glow-magenta: 0 0 12px rgba(255, 43, 214, 0.45), 0 0 28px rgba(255, 43, 214, 0.18);
  --glow-lime:    0 0 12px rgba(181, 255, 58, 0.45), 0 0 28px rgba(181, 255, 58, 0.18);
  --glow-soft:    0 0 8px rgba(0, 240, 255, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--surface-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0.01em;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;

  /* Subtle grid background — like a circuit board */
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    radial-gradient(ellipse at 20% 0%, rgba(255, 43, 214, 0.08), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(0, 240, 255, 0.08), transparent 50%);
  background-size: 48px 48px, 48px 48px, 100% 100%, 100% 100%;
  background-attachment: fixed;
}

/* Scanline overlay — barely visible */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 3px,
    rgba(0, 240, 255, 0.012) 3px,
    rgba(0, 240, 255, 0.012) 4px
  );
  mix-blend-mode: screen;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* =========================================================================
   Watermark layer — hexagonal/circuit silhouettes
   ========================================================================= */
.watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  color: var(--color-neon-cyan);
  opacity: 0.05;
  /* Recorta las formas que salen del viewport (evitaba scroll horizontal en móvil)
     y aísla su layout del resto de la página */
  overflow: hidden;
  contain: strict;
}

.watermark-leaf {
  position: absolute;
  width: 320px;
  height: 320px;
}

.watermark-leaf-1 {
  top: 6%;
  left: -60px;
  transform: rotate(0deg);
}
.watermark-leaf-2 {
  top: 45%;
  right: -100px;
  transform: rotate(15deg);
  color: var(--color-neon-magenta);
}
.watermark-leaf-3 {
  bottom: 8%;
  left: 35%;
  transform: rotate(-25deg);
  color: var(--color-neon-lime);
}

/* =========================================================================
   Top navigation
   ========================================================================= */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 5, 16, 0.85);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--surface-line);
  box-shadow: 0 1px 0 rgba(0, 240, 255, 0.12);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--color-neon-cyan);
  letter-spacing: 0.02em;
  line-height: 1;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--color-neon-cyan);
  color: var(--surface-void);
  font-weight: 700;
  font-size: 20px;
  box-shadow: var(--glow-cyan);
}

.brand-text {
  letter-spacing: 0.06em;
}

.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-btn,
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 17px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-neon-cyan);
  background: transparent;
  color: var(--color-neon-cyan);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  transition: background 160ms ease, color 160ms ease, box-shadow 200ms ease, transform 160ms ease;
}

.nav-btn:hover {
  background: rgba(0, 240, 255, 0.12);
  box-shadow: var(--glow-soft);
}

.nav-cta {
  background: var(--color-neon-cyan);
  color: var(--surface-void);
  border-color: var(--color-neon-cyan);
  box-shadow: var(--glow-cyan);
}

.nav-cta:hover {
  background: #4df5ff;
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.7), 0 0 36px rgba(0, 240, 255, 0.3);
}

@media (max-width: 760px) {
  .topnav-inner { flex-wrap: wrap; row-gap: 10px; }
  .nav { order: 3; width: 100%; justify-content: center; }
  .nav-cta { order: 2; }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 120px) var(--gutter) clamp(40px, 6vw, 80px);
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  z-index: 2;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--color-neon-cyan);
  text-transform: uppercase;
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: '>';
  color: var(--color-neon-magenta);
  text-shadow: 0 0 6px rgba(255, 43, 214, 0.7);
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.84;
  letter-spacing: -0.005em;
  color: var(--text-primary);
  font-size: clamp(96px, 18vw, 213px);
  text-transform: uppercase;
  margin: 0;
}

.display-line {
  display: block;
  color: var(--text-primary);
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.18);
}

.display-line.dim {
  color: transparent;
  -webkit-text-stroke: 2px var(--color-neon-magenta);
  text-shadow: 0 0 24px rgba(255, 43, 214, 0.4);
}

.display-section {
  font-size: clamp(72px, 12vw, 144px);
  line-height: 0.88;
  color: var(--text-primary);
  text-shadow: 0 0 28px rgba(0, 240, 255, 0.25);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 32px;
}

.hero-sub {
  max-width: 520px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.hero-sub-em {
  display: block;
  margin-top: 4px;
  color: var(--color-neon-lime);
  font-family: var(--font-mono);
  font-size: 13px;
  text-shadow: 0 0 8px rgba(181, 255, 58, 0.35);
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-portrait {
  position: absolute;
  top: 18%;
  right: var(--gutter);
  width: clamp(120px, 16vw, 220px);
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--surface-card);
  border: 2px solid var(--color-neon-cyan);
  box-shadow: var(--glow-cyan), inset 0 0 0 1px rgba(0, 240, 255, 0.2);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.1) saturate(1.1) hue-rotate(-8deg);
  position: relative;
  z-index: 1;
}

.portrait-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(255, 43, 214, 0.35) 0%, transparent 65%);
  z-index: 0;
  filter: blur(8px);
}

.hero-typing {
  margin-top: 48px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-neon-lime);
  opacity: 0.85;
  letter-spacing: 0;
  text-shadow: 0 0 6px rgba(181, 255, 58, 0.4);
}

.hero-typing span { color: var(--color-neon-magenta); }

.cursor {
  display: inline-block;
  animation: blink 1.1s steps(2) infinite;
  color: var(--color-neon-cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

@media (max-width: 720px) {
  .hero-portrait {
    position: relative; /* no static: así recorta el brillo y no genera scroll horizontal */
    margin: 24px 0 0;
    width: 110px;
  }
  .hero-meta { flex-direction: column; align-items: flex-start; }
}

/* =========================================================================
   Buttons (shared)
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--color-neon-cyan);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 200ms ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-neon-cyan);
  color: var(--surface-void);
  box-shadow: var(--glow-cyan);
}

.btn-primary:hover {
  background: #4df5ff;
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.8), 0 0 40px rgba(0, 240, 255, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--color-neon-cyan);
  border-color: var(--color-neon-cyan);
}

.btn-ghost:hover {
  background: rgba(0, 240, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: var(--glow-soft);
}

/* =========================================================================
   Sections
   ========================================================================= */
.section {
  position: relative;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) var(--gutter);
  z-index: 2;
}

.heading {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.005em;
  color: var(--text-primary);
  font-size: clamp(56px, 9vw, 130px);
  text-transform: uppercase;
  margin-bottom: 24px;
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.2);
}

.section-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 620px;
  margin-bottom: 32px;
}

.section-foot {
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

/* Dotted divider — neon */
.dotted {
  border: 0;
  border-top: 1px dashed var(--color-neon-cyan);
  max-width: var(--page-max);
  margin: 0 auto;
  opacity: 0.35;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

/* =========================================================================
   About / whoami
   ========================================================================= */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 32px;
  margin-top: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
}

.code-card {
  background: var(--surface-card);
  border-radius: var(--radius-cards);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-neon-cyan);
  box-shadow: var(--glow-soft);
}

.code-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface-deep);
  border-bottom: 1px solid var(--surface-line);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  display: inline-block;
}
.dot-r { background: #ff5f56; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #27c93f; }

.code-card-file {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-neon-cyan);
  opacity: 0.8;
}

.code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 18px 20px;
  color: var(--text-primary);
  white-space: pre;
  overflow-x: auto;
}

.c-key { color: var(--color-neon-magenta); }
.c-val { color: var(--color-neon-cyan); }

.about-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.lead {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-primary);
  max-width: 48ch;
}

.lead em {
  color: var(--color-neon-magenta);
  font-style: normal;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-size: 18px;
  text-transform: lowercase;
  text-shadow: 0 0 8px rgba(255, 43, 214, 0.4);
}

.lead strong {
  color: var(--color-neon-lime);
  font-weight: 700;
  text-shadow: 0 0 6px rgba(181, 255, 58, 0.3);
}

.about-list {
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bullet {
  color: var(--color-neon-cyan);
  margin-right: 8px;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.badge-gold {
  background: transparent;
  color: var(--color-neon-cyan);
  border: 1px solid var(--color-neon-cyan);
  box-shadow: var(--glow-soft);
}

.badge-red {
  background: transparent;
  color: var(--color-neon-magenta);
  border: 1px solid var(--color-neon-magenta);
  box-shadow: 0 0 8px rgba(255, 43, 214, 0.3);
}

/* =========================================================================
   Stack grid
   ========================================================================= */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.stack-tile {
  background: var(--surface-card);
  border-radius: var(--radius-cards);
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--surface-line);
  transition: transform 200ms ease, background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  position: relative;
  overflow: hidden;
}

.stack-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-neon-cyan), transparent);
  opacity: 0;
  transition: opacity 200ms ease;
}

.stack-tile:hover {
  transform: translateY(-3px);
  background: var(--surface-deep);
  border-color: var(--color-neon-cyan);
  box-shadow: var(--glow-soft);
}

.stack-tile:hover::before { opacity: 1; }

.stack-glyph {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1;
  color: var(--color-neon-cyan);
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.stack-name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.stack-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* =========================================================================
   Learning pills
   ========================================================================= */
.learning-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--color-neon-cyan);
}

.pill-gold {
  background: transparent;
  color: var(--color-neon-cyan);
  box-shadow: var(--glow-soft);
  transition: transform 160ms ease, box-shadow 200ms ease;
}

.pill-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
}

.pill-red {
  background: transparent;
  color: var(--color-neon-magenta);
  border-color: var(--color-neon-magenta);
  box-shadow: 0 0 10px rgba(255, 43, 214, 0.35);
}

.pill-red:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(255, 43, 214, 0.6);
}

/* =========================================================================
   Projects
   ========================================================================= */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--color-neon-cyan);
  color: var(--color-neon-cyan);
}

.project-title {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  display: inline-block;
}

.lang-js    { background: var(--color-neon-lime);    box-shadow: 0 0 6px rgba(181, 255, 58, 0.6); }
.lang-html  { background: var(--color-neon-magenta); box-shadow: 0 0 6px rgba(255, 43, 214, 0.6); }
.lang-mix   { background: var(--color-neon-cyan);    box-shadow: 0 0 6px rgba(0, 240, 255, 0.6); }

/* =========================================================================
   Stats
   ========================================================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 8px 0 24px;
}

.stat {
  background: var(--surface-card);
  border-radius: var(--radius-cards);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--surface-line);
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-neon-cyan), transparent);
}

.stat:nth-child(2)::before { background: linear-gradient(90deg, transparent, var(--color-neon-magenta), transparent); }
.stat:nth-child(3)::before { background: linear-gradient(90deg, transparent, var(--color-neon-lime), transparent); }
.stat:nth-child(4)::before { background: linear-gradient(90deg, transparent, var(--color-neon-violet), transparent); }

.stat-num {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 0.9;
  color: var(--color-neon-cyan);
  letter-spacing: 0.01em;
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.5);
}

.stat:nth-child(2) .stat-num { color: var(--color-neon-magenta); text-shadow: 0 0 14px rgba(255, 43, 214, 0.5); }
.stat:nth-child(3) .stat-num { color: var(--color-neon-lime);    text-shadow: 0 0 14px rgba(181, 255, 58, 0.5); }
.stat:nth-child(4) .stat-num { color: var(--color-neon-violet);  text-shadow: 0 0 14px rgba(138, 92, 255, 0.5); }

.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* =========================================================================
   Contact
   ========================================================================= */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.contact-foot {
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-neon-lime);
  opacity: 0.7;
  letter-spacing: 0.05em;
  text-shadow: 0 0 6px rgba(181, 255, 58, 0.3);
}

/* =========================================================================
   Footer
   ========================================================================= */
.footer {
  position: relative;
  z-index: 2;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 48px var(--gutter) 96px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-line {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--color-neon-cyan);
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.footer-line a {
  color: var(--color-neon-magenta);
  border-bottom: 1px dashed var(--color-neon-magenta);
  text-shadow: 0 0 6px rgba(255, 43, 214, 0.4);
}

.footer-fire { color: var(--color-neon-magenta); text-shadow: 0 0 10px rgba(255, 43, 214, 0.7); }

.footer-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* =========================================================================
   Floating back-to-top
   ========================================================================= */
.float-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--color-neon-cyan);
  color: var(--surface-void);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  border: 1px solid var(--color-neon-cyan);
  z-index: 60;
  transition: transform 160ms ease, box-shadow 200ms ease;
  box-shadow: var(--glow-cyan);
}

.float-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.8), 0 0 36px rgba(0, 240, 255, 0.3);
}

/* =========================================================================
   Selection
   ========================================================================= */
::selection {
  background: var(--color-neon-cyan);
  color: var(--surface-void);
  text-shadow: none;
}

/* =========================================================================
   Accesibilidad
   ========================================================================= */
.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: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--color-neon-cyan);
  color: var(--surface-void);
  font-family: var(--font-mono);
  font-weight: 700;
  border-radius: var(--radius-cards);
}

.skip-link:focus { top: 16px; }

:focus-visible {
  outline: 2px solid var(--color-neon-magenta);
  outline-offset: 3px;
  box-shadow: var(--glow-magenta);
}

main:focus,
section:focus { outline: none; box-shadow: none; }

/* Los ítems de grid no deben crecer por contenido ancho (p. ej. el <pre> de ferr.txt) */
.about-grid > * { min-width: 0; }

/* Listas que antes eran divs: sin viñetas ni sangría */
ul.stack-grid,
ul.learning-row,
.langs-list { list-style: none; padding: 0; }

/* =========================================================================
   Proyectos: toda la tarjeta es clickeable vía el enlace del título
   ========================================================================= */

.lang-py   { background: var(--color-neon-violet); box-shadow: 0 0 6px rgba(138, 92, 255, 0.6); }
.lang-java { background: #ff9f43;                 box-shadow: 0 0 6px rgba(255, 159, 67, 0.6); }

/* =========================================================================
   Stats propias (data.json)
   ========================================================================= */
.stats-grid dd { margin: 0; }
.stat { flex-direction: column-reverse; }

.langs-title {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 8px 0 12px;
}

.langs-note { color: var(--text-faint); letter-spacing: 0.05em; text-transform: none; }

.langs-bar {
  display: flex;
  height: 10px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--surface-line);
}

.langs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.langs-list li { display: inline-flex; align-items: center; gap: 8px; }

.langs-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
}

.langs-c0 { background: var(--color-neon-cyan); }
.langs-c1 { background: var(--color-neon-magenta); }
.langs-c2 { background: var(--color-neon-lime); }
.langs-c3 { background: var(--color-neon-violet); }
.langs-c4 { background: #ff9f43; }
.langs-c5 { background: var(--text-secondary); }

.stats-updated,
.stats-fallback {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.stats-fallback a {
  color: var(--color-neon-cyan);
  border-bottom: 1px dashed currentColor;
}

/* =========================================================================
   Movimiento reducido
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .stack-tile:hover,
  .float-btn:hover,
  .btn:hover { transform: none; }
}

/* =========================================================================
   Proyectos como casos: problema → solución → cómo se usó cada tecnología
   ========================================================================= */
.case-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  align-items: start;
}

.case {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 18px;
  background: var(--surface-card);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-cards);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.case::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--color-neon-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
  opacity: 0;
  transition: opacity 200ms ease;
}

.case:hover,
.case:focus-within { border-color: var(--color-neon-cyan); box-shadow: var(--glow-soft); }
.case:hover::before,
.case:focus-within::before { opacity: 1; }

.case-summary { display: grid; gap: 10px; margin: 0; }
.case-summary dt,
.case h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-neon-magenta);
}
.case-summary dd { margin: 4px 0 0; color: var(--text-secondary); line-height: 1.55; }

.case-stack {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.case-stack li {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--surface-line);
  color: var(--text-primary);
}

.case-details { border-top: 1px dashed var(--surface-line); padding-top: 10px; }
.case-details summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-neon-lime);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.case-details summary::-webkit-details-marker { display: none; }
.case-details summary::before { content: '▸'; transition: transform 160ms ease; }
.case-details[open] summary::before { transform: rotate(90deg); }

.case-body { display: grid; gap: 16px; margin-top: 14px; }
.case-body h4 { margin-bottom: 8px; }

.case-tech { display: grid; gap: 10px; margin: 0; }
.case-tech dt { font-weight: 700; color: var(--text-primary); }
.case-tech dd { margin: 2px 0 0; color: var(--text-secondary); line-height: 1.55; }

.case-decisions { padding-left: 18px; display: grid; gap: 6px; color: var(--text-secondary); line-height: 1.55; }
.case-decisions li::marker { color: var(--color-neon-magenta); }

.case-result {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-neon-lime);
}

.case code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-deep);
  color: var(--color-neon-cyan);
  white-space: nowrap;
}

.case-links { display: flex; gap: 16px; margin-top: auto; }
.case-link {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-neon-cyan);
  border-bottom: 1px dashed currentColor;
}
.case-link-demo { color: var(--color-neon-lime); }
.case-link:hover { color: var(--color-neon-magenta); }

.case-more { margin-top: 20px; font-family: var(--font-mono); font-size: 13px; }
.case-more a { color: var(--color-neon-cyan); border-bottom: 1px dashed currentColor; }

.case { scroll-margin-top: 96px; }

.case-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius-cards);
  border: 1px solid var(--surface-line);
  background: var(--surface-deep);
}

/* Selector de idioma ES / EN */
.lang-switch {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 6px 10px;
  border: 1px solid var(--color-neon-magenta);
  border-radius: var(--radius-pill);
  color: var(--color-neon-magenta);
}
.lang-switch:hover { background: rgba(255, 43, 214, 0.12); }

.nav-actions { display: flex; align-items: center; gap: 12px; }
