/*
Theme Name: Alberth Ruiz Portfolio 1.2.1
Theme URI: https://github.com/alberth-ruiz/portfolio
Author: Alberth Jesús Corrales Ruíz
Author URI: https://www.linkedin.com/in/alberth-ruiz/
Description: Tema minimalista monocromo de alto impacto para WordPress, con escena 3D interactiva en Three.js, animación cinematográfica por scroll con GSAP ScrollTrigger y rendimiento optimizado.
Version: 1.3.0
Tested up to: 6.7
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: alberth-portfolio
Tags: portfolio, one-column, custom-colors, full-width-template, theme-options
*/

/* ==========================================================================
   Variables y Configuración Global
   ========================================================================== */
:root {
  --ink: #ffffff;
  --panel: #f4f4f3;
  --line: #e2e2e0;
  --fg: #0d0d0d;
  --body: #3d3d3d;
  --muted: #7a7a7a;
  --accent: #a3a3a3;
  --warm: #0d0d0d;
  --glass: rgba(255, 255, 255, 0.82);
  --f-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --f-serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --gutter: clamp(16px, 5vw, 64px);
  color-scheme: light;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  margin: 0;
  padding: 0;
}

body {
  background: var(--ink);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--fg);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--warm);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Preloader Animado (Estilo CodeGrid GSAP Page Reveal)
   ========================================================================== */
body.is-loading {
  overflow: hidden !important;
  height: 100vh;
}

.preloader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  user-select: none;
  overflow: hidden;
}

.preloader-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  z-index: 1;
  pointer-events: none;
}

.preloader-overlay .bar {
  flex: 1;
  height: 100%;
  background: #000000;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  transform-origin: top;
  will-change: height, transform;
}

.preloader-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fafafa;
  padding: 24px;
  will-change: transform, opacity;
}

.counter-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
}

.preloader .counter {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(4.5rem, 15vw, 10rem);
  line-height: 0.88;
  letter-spacing: -0.05em;
  margin: 0;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.preloader .counter-symbol {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.8rem);
  color: #707070;
  margin-top: clamp(4px, 1vw, 12px);
}

.preloader-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
}

.preloader-author {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #9c9c9c;
}

.preloader-role {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #555555;
}

.preloader-line {
  width: 140px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin-top: 22px;
  position: relative;
  overflow: hidden;
}

.preloader-line i {
  position: absolute;
  inset: 0;
  background: #ffffff;
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ==========================================================================
   Fondos 3D y Efectos
   ========================================================================== */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(255, 255, 255, 0.7) 100%);
}

main {
  position: relative;
  z-index: 2;
}

.wrap {
  padding-inline: var(--gutter);
  max-width: 1280px;
  margin-inline: auto;
}

/* ==========================================================================
   Navegación y Barra de Progreso
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gutter) 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  mix-blend-mode: difference;
  color: #fff;
  transition: top 0.3s ease;
}

/* Soporte para barra de administración de WordPress */
body.admin-bar .nav {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .nav {
    top: 46px;
  }
}

.nav a {
  text-decoration: none;
  color: inherit;
}

.nav ul, .nav .menu {
  display: flex;
  gap: clamp(12px, 2.5vw, 28px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav ul li, .nav .menu li {
  margin: 0;
  padding: 0;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: #fff;
  mix-blend-mode: difference;
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 21;
}

body.admin-bar .progress {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .progress {
    top: 46px;
  }
}

@media (max-width: 640px) {
  .nav ul li:not(:last-child),
  .nav .menu li:not(:last-child) {
    display: none;
  }
}

/* ==========================================================================
   Sección Cinematográfica (Film Scroll Canvas)
   ========================================================================== */
.film {
  position: relative;
  background: #000;
  color: #f2f2f2;
  z-index: 3;
}

.film-stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: #000;
}

.film-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.film-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.25) 38%, transparent 60%),
              linear-gradient(0deg, rgba(0, 0, 0, 0.6), transparent 30%);
}

.film-copy {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ch {
  position: absolute;
  left: var(--gutter);
  top: 50%;
  translate: 0 -50%;
  width: min(470px, 40vw);
  display: grid;
  gap: 16px;
  pointer-events: auto;
}

.ch .k {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8f8f8f;
}

.ch h1, .ch h2 {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.9;
  margin: 0;
  color: #fafafa;
  text-wrap: balance;
}

.ch h1 {
  font-size: clamp(3rem, 7.4vw, 7rem);
}

.ch h1 span {
  font-weight: 300;
  color: #9a9a9a;
}

.ch h2 {
  font-size: clamp(2.2rem, 4.6vw, 4.2rem);
}

.ch h2 span {
  font-weight: 300;
  color: #9a9a9a;
}

.ch p {
  margin: 0;
  color: #bdbdbd;
  font-size: clamp(0.98rem, 1.2vw, 1.08rem);
  max-width: 40ch;
}

.ch .tl {
  display: grid;
  border-top: 1px solid #2a2a2a;
}

.ch .tl div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding-block: 10px;
  border-bottom: 1px solid #2a2a2a;
  font-size: 15px;
}

.ch .tl span {
  font-family: var(--f-mono);
  font-size: 12px;
  color: #8f8f8f;
  font-variant-numeric: tabular-nums;
}

.ch .acts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ch .btn {
  background: transparent;
  color: #f2f2f2;
  border-color: #3a3a3a;
}

.ch .btn.primary {
  background: #f2f2f2;
  color: #000;
  border-color: #f2f2f2;
}

.film-meta {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7d7d7d;
  pointer-events: none;
}

.film-bar {
  flex: 1;
  max-width: 280px;
  height: 1px;
  background: #2b2b2b;
  position: relative;
}

.film-bar i {
  position: absolute;
  inset: 0;
  background: #f2f2f2;
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.film-meta .tc {
  font-variant-numeric: tabular-nums;
}

.ch:not(:first-child) {
  visibility: hidden;
}

/* Modo estático para accesibilidad / reducción de movimiento */
.film.static .film-stage {
  height: auto;
  min-height: 0;
  aspect-ratio: 16/9;
  max-height: 80svh;
}

.film.static .film-meta {
  display: none;
}

.film.static .film-copy {
  position: static;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 40px;
  padding: 48px var(--gutter) 64px;
}

.film.static .ch {
  position: static;
  translate: none;
  width: auto;
  visibility: visible;
}

/* Pantallas verticales (móvil / tablet en vertical): figura arriba, texto debajo */
@media (max-aspect-ratio: 10/9) {
  .film-shade {
    background: linear-gradient(0deg, #000 0%, #000 30%, rgba(0, 0, 0, 0.6) 40%, transparent 52%);
  }
  .ch {
    top: auto;
    bottom: calc(52px + env(safe-area-inset-bottom, 0px));
    translate: none;
    right: var(--gutter);
    width: auto;
    gap: 10px;
  }
  .ch h1 {
    font-size: clamp(2.4rem, 11.5vw, 4.4rem);
  }
  .ch h2 {
    font-size: clamp(2rem, 9vw, 3.4rem);
  }
  .ch p {
    font-size: 14.5px;
    max-width: 46ch;
  }
  .ch .tl div {
    font-size: 14px;
    padding-block: 8px;
  }
  .ch .btn {
    padding: 12px 16px;
    font-size: 14px;
  }
  .film-meta {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .film-bar {
    max-width: none;
  }
}

@media (max-width: 420px) {
  .film-meta .tc {
    display: none;
  }
  .film-bar {
    display: block;
  }
}

/* ==========================================================================
   Sección Sobre Mí + Carnet Colgante 3D (Lanyard & Badge Verlet Physics)
   ========================================================================== */
.about {
  position: relative;
  padding-block: 0 16vh;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.9fr) minmax(0, 0.75fr);
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}

.about-copy {
  padding-top: clamp(120px, 16vh, 190px);
  display: grid;
  gap: 20px;
  min-width: 0;
}

.hello {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  letter-spacing: -0.045em;
  line-height: 0.92;
  text-wrap: balance;
}

.hello em {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.about-copy p {
  margin: 0;
  color: var(--body);
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  max-width: 52ch;
}

.about-copy p.sm {
  color: var(--muted);
  font-size: 15px;
}

.about-copy .acts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.btn.dark {
  background: var(--fg);
  color: var(--ink);
  border-color: var(--fg);
}

.facts {
  margin: 0;
  padding-top: clamp(150px, 19vh, 220px);
  display: grid;
  align-content: start;
  min-width: 0;
}

.facts div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.facts div:first-child {
  border-top: 1px solid var(--line);
}

.facts dt {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: center;
}

.facts dd {
  margin: 0;
  text-align: right;
  color: var(--fg);
  font-weight: 500;
}

.facts .quote {
  margin: 22px 0 0;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--body);
}

/* Badge Rig y Física de Cuerda (Lanyard) */
.badge-rig {
  position: relative;
  height: 720px;
  clip-path: inset(0 -60vw -40vh -60vw);
  touch-action: pan-y;
}

.lanyard {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.lanyard .strap {
  fill: none;
  stroke: #141414;
  stroke-width: 17;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lanyard .strap-edge {
  fill: none;
  stroke: #3a3a3a;
  stroke-width: 17;
  stroke-linecap: round;
  stroke-dasharray: 1 5;
  opacity: 0.35;
}

.lanyard text {
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: 0.32em;
  fill: #cfcfcf;
  text-transform: uppercase;
}

.clasp {
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 34px;
  margin: -26px 0 0 -13px;
  z-index: 3;
  pointer-events: none;
  transform-origin: 50% 26px;
}

.clasp::before {
  content: "";
  position: absolute;
  inset: 0 3px 10px;
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(90deg, #9a9a9a, #f2f2f2 45%, #a8a8a8 60%, #d9d9d9);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
}

.clasp::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 0;
  height: 14px;
  border: 3px solid #b5b5b5;
  border-top: 0;
  border-radius: 0 0 9px 9px;
}

.badge {
  position: absolute;
  left: 0;
  top: 0;
  width: 250px;
  height: 396px;
  z-index: 2;
  cursor: grab;
  perspective: 1100px;
  touch-action: none;
  will-change: transform;
  outline: none;
}

.badge.grab {
  cursor: grabbing;
}

.badge:focus-visible .face {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

.badge-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  background: #fbfbfa;
  border: 1px solid #dcdcda;
  box-shadow: 0 30px 50px -22px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  color: #0d0d0d;
}

.face.back {
  transform: rotateY(180deg);
}

.face .slot {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 44px;
  height: 9px;
  margin-left: -22px;
  border-radius: 9px;
  background: var(--ink);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.b-head {
  background: #0d0d0d;
  color: #f2f2f2;
  padding: 30px 18px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.b-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #4a4a4a;
  display: grid;
  place-items: center;
  font: 600 11px/1 var(--f-mono);
  letter-spacing: 0.04em;
  flex: none;
}

.b-head b {
  display: block;
  font: 600 11px/1.2 var(--f-mono);
  letter-spacing: 0.18em;
}

.b-head small {
  display: block;
  font: 400 9.5px/1.3 var(--f-mono);
  letter-spacing: 0.1em;
  color: #9a9a9a;
  margin-top: 3px;
}

.b-photo {
  margin: 18px auto 0;
  width: 118px;
  height: 148px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #d6d6d4;
  background: #111;
  position: relative;
}

.b-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0.2) contrast(1.04);
}

.b-name {
  text-align: center;
  margin-top: 12px;
  font: 800 15px/1.1 var(--f-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.b-role {
  text-align: center;
  margin-top: 4px;
  font-size: 11.5px;
  color: #6e6e6e;
}

.b-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 14px 16px 0;
  border-top: 1px solid #e3e3e1;
  padding-top: 10px;
}

.b-meta div {
  display: grid;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 600;
}

.b-meta small {
  font: 400 8.5px/1 var(--f-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.b-foot {
  margin-top: auto;
  padding: 0 16px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.barcode {
  height: 30px;
  flex: 1;
  max-width: 140px;
  background: repeating-linear-gradient(90deg, #0d0d0d 0 2px, transparent 2px 4px, #0d0d0d 4px 5px, transparent 5px 8px, #0d0d0d 8px 11px, transparent 11px 12px, #0d0d0d 12px 13px, transparent 13px 16px);
}

.seal {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  background: conic-gradient(from var(--ha, 0deg), #d9d9d9, #ffffff, #a9a9a9, #f0f0f0, #bdbdbd, #d9d9d9);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.holo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent calc(var(--hx, 50%) - 22%), rgba(255, 255, 255, 0.55) var(--hx, 50%), transparent calc(var(--hx, 50%) + 22%));
  mix-blend-mode: soft-light;
  z-index: 3;
}

.b-back {
  padding: 30px 18px 16px;
  display: grid;
  gap: 12px;
  align-content: start;
  flex: 1;
}

.b-back h4 {
  margin: 0;
  font: 600 11px/1 var(--f-mono);
  letter-spacing: 0.18em;
  color: #0d0d0d;
}

.b-back dl {
  margin: 0;
  display: grid;
  gap: 9px;
}

.b-back dl div {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid #e7e7e5;
  padding-bottom: 8px;
}

.b-back dt {
  font: 400 8.5px/1 var(--f-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.b-back dd {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.b-sign {
  margin-top: auto;
  font: italic 400 26px/1 var(--f-serif);
  color: #2a2a2a;
  border-bottom: 1px solid #cfcfcd;
  padding-bottom: 4px;
}

.b-sign + small {
  font: 400 8.5px/1 var(--f-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.badge-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  }
  .facts {
    grid-column: 1 / -1;
    padding-top: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    column-gap: 32px;
  }
  .facts .quote {
    grid-column: 1 / -1;
  }
  .facts div:nth-child(-n+3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-copy {
    padding-top: 72px;
  }
  .badge-rig {
    height: 600px;
  }
  .badge {
    width: 224px;
    height: 355px;
  }
  .b-head {
    padding: 28px 14px 12px;
  }
  .b-photo {
    width: 104px;
    height: 130px;
    margin-top: 14px;
  }
  .facts div:nth-child(-n+3) {
    border-top: 0;
  }
  .facts div:first-child {
    border-top: 1px solid var(--line);
  }
}

/* ==========================================================================
   Manifiesto
   ========================================================================== */
.manifesto {
  padding-block: 22vh;
}

.manifesto p {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 4.6vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0;
  max-width: 22ch;
  text-wrap: balance;
}

.manifesto .w {
  opacity: 0.22;
  transition: none;
}

.manifesto em {
  font-style: normal;
  color: var(--warm);
}

/* ==========================================================================
   Resultados medibles (Stats)
   ========================================================================== */
.results {
  margin-block: 0 18vh;
}

.results-box {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(20px, 3vw, 40px);
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.25);
}

.results-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: baseline;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.results-head h2 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

.results-head h2 span {
  font-weight: 300;
  color: var(--accent);
}

.results-head small {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
  padding: 28px clamp(14px, 2vw, 28px) 6px;
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.stat + .stat {
  border-left: 1px solid var(--line);
}

.stat:first-child {
  padding-left: 0;
}

.stat .cat {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat .num {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(3rem, 5.6vw, 5.2rem);
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.stat .num i {
  font-style: normal;
  font-weight: 300;
  font-size: 0.5em;
  color: var(--accent);
  margin-top: 0.06em;
}

.meter {
  height: 3px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  background: var(--fg);
  transform-origin: 0 50%;
  transform: scaleX(var(--v));
}

.ticks {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
}

.ticks i {
  height: 3px;
  border-radius: 3px;
  background: var(--fg);
}

.ticks i.off {
  background: var(--line);
}

.stat p {
  margin: 0;
  color: var(--body);
  font-size: 14.5px;
  line-height: 1.45;
  max-width: 26ch;
}

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat:first-child {
    padding-left: clamp(14px, 2vw, 28px);
  }
  .stat:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
  .stat:nth-child(n+3) {
    border-top: 1px solid var(--line);
    margin-top: 22px;
  }
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .stat {
    padding-left: 0 !important;
    border-left: 0 !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 16px;
  }
  .stat + .stat {
    border-top: 1px solid var(--line);
    margin-top: 18px;
  }
  .stat .cat,
  .stat .meter,
  .stat .ticks,
  .stat p {
    grid-column: 1 / -1;
  }
  .stat .num {
    font-size: 3.4rem;
  }
}

/* ==========================================================================
   Cabeceras de Sección
   ========================================================================== */
.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.sec-head h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 5.6rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
  margin: 0;
}

.sec-head h2 span {
  font-weight: 300;
  color: var(--accent);
}

.sec-head .meta {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ==========================================================================
   Experiencia (Scroll Horizontal)
   ========================================================================== */
.xp {
  padding-block: 12vh;
}

.xp-track {
  display: flex;
  gap: 24px;
  width: max-content;
  padding-inline: var(--gutter);
}

.job {
  width: min(78vw, 620px);
  flex: none;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: clamp(22px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.job-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.job-top .now {
  color: var(--warm);
}

.job h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.035em;
  margin: 0;
  line-height: 1;
}

.job ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.job li {
  position: relative;
  padding-left: 22px;
  color: var(--body);
  font-size: 15px;
}

.job li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 10px;
  height: 1px;
  background: var(--accent);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.tag {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.xp-end {
  width: min(60vw, 360px);
  flex: none;
  display: grid;
  align-content: center;
  font-family: var(--f-display);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 300;
  color: var(--muted);
  line-height: 1.15;
}

.xp-end b {
  color: var(--fg);
  font-weight: 800;
}

@media (max-width: 899px) {
  .xp-track {
    flex-direction: column;
    width: auto;
    max-width: 1280px;
    margin-inline: auto;
  }
  .job {
    width: 100%;
  }
  .xp-end {
    width: 100%;
    padding-block: 24px;
  }
}

/* ==========================================================================
   Proyectos (Tilt 3D)
   ========================================================================== */
.projects {
  padding-block: 14vh;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  perspective: 1100px;
}

.proj {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(244, 244, 243, 0.94));
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 28px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform-style: preserve-3d;
  will-change: transform;
  overflow: hidden;
  min-width: 0;
}

.proj .glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(0, 0, 0, 0.06), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s;
}

.proj:hover .glare {
  opacity: 1;
}

.proj .kind {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--warm);
  transform: translateZ(30px);
}

.proj h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0;
  transform: translateZ(50px);
}

.proj p {
  margin: 0;
  color: var(--body);
  font-size: 15px;
  transform: translateZ(24px);
}

.proj .tags {
  transform: translateZ(36px);
}

.proj svg {
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 170px;
  height: 170px;
  opacity: 0.35;
  transform: translateZ(10px);
}

@media (max-width: 900px) {
  .proj-grid {
    grid-template-columns: 1fr;
  }
  .proj {
    min-height: 0;
  }
}

/* ==========================================================================
   Stack Tecnológico & Marquee
   ========================================================================== */
.stack {
  padding-block: 14vh;
}

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: 18px;
  margin-bottom: 56px;
  background: var(--glass);
}

.marquee-inner {
  display: flex;
  gap: 48px;
  width: max-content;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.marquee-inner span:nth-child(even) {
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
}

/* TABLA PERIÓDICA del stack */
.sec-head h2.h-pt {
  font-size: clamp(2.1rem, 4.6vw, 4.2rem);
  max-width: 16ch;
  text-wrap: balance;
}

.pt-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.pt-cats button {
  font: 500 13px/1 var(--f-body);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--body);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.pt-cats button i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.pt-cats button[aria-pressed="true"] {
  border-color: var(--fg);
  color: var(--fg);
}

.pt-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}

.ptable {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.el {
  aspect-ratio: 1;
  border-radius: 8px;
  padding: 8px 9px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  text-align: left;
  background: var(--c);
  color: var(--t);
  border: 1px solid var(--b, transparent);
  font: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.25s ease, box-shadow 0.2s ease;
  min-width: 0;
}

.el .n {
  font: 400 10px/1 var(--f-mono);
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.el .s {
  font: 800 clamp(1.05rem, 1.9vw, 1.75rem)/1 var(--f-display);
  letter-spacing: -0.03em;
  align-self: center;
}

.el .nm {
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.el:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -12px rgba(0, 0, 0, 0.4);
}

.el.on {
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--fg);
}

.ptable.filtering .el:not(.match) {
  opacity: 0.16;
}

.pdetail {
  position: sticky;
  top: 84px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  display: grid;
  gap: 14px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-width: 0;
}

.pbig {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--c);
  color: var(--t);
  border: 1px solid var(--b, transparent);
  padding: 12px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.pbig .n {
  font: 400 12px/1 var(--f-mono);
  opacity: 0.7;
}

.pbig .s {
  font: 800 3.4rem/1 var(--f-display);
  letter-spacing: -0.04em;
  align-self: center;
}

.pbig .c {
  font: 400 10px/1.2 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

.pdetail h3 {
  margin: 0;
  font: 800 1.7rem/1 var(--f-display);
  letter-spacing: -0.03em;
}

.pdetail p {
  margin: 0;
  color: var(--body);
  font-size: 15px;
}

.pdetail .use {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.pt-note {
  margin-top: 18px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .pt-wrap {
    grid-template-columns: 1fr;
  }
  .pdetail {
    position: static;
    order: -1;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }
  .pdetail .pbig {
    grid-row: span 3;
    width: 104px;
  }
  .pbig .s {
    font-size: 2.6rem;
  }
  .ptable {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .ptable {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .pdetail {
    padding: 16px;
  }
  .pdetail .pbig {
    width: 88px;
  }
  .pbig .s {
    font-size: 2.1rem;
  }
  .pdetail h3 {
    font-size: 1.35rem;
  }
}

/* ==========================================================================
   Educación y Certificaciones
   ========================================================================== */
.edu {
  padding-block: 10vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 48px;
}

.edu h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin: 0 0 16px;
}

.edu .deg {
  color: var(--muted);
}

.edu .deg b {
  display: block;
  color: var(--fg);
  font-size: 1.1rem;
  font-weight: 600;
}

.certs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.certs li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: baseline;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}

.certs li:first-child {
  border-top: 1px solid var(--line);
}

.certs .t {
  font-weight: 500;
}

.certs .s {
  color: var(--muted);
  font-size: 14px;
}

.certs .y {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--warm);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 820px) {
  .edu {
    grid-template-columns: 1fr;
  }
  .certs li {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .certs .s {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* ==========================================================================
   Contacto
   ========================================================================== */
.contact {
  min-height: 90svh;
  display: grid;
  align-content: center;
  padding-block: 14vh 10vh;
  text-align: left;
}

.contact .eyebrow {
  margin-bottom: 20px;
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 0 4px var(--panel);
}

.contact h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 10vw, 8.5rem);
  line-height: 0.88;
  letter-spacing: -0.05em;
  margin: 0;
  text-wrap: balance;
}

.contact h2 span {
  color: var(--accent);
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 44px;
  align-items: center;
}

.btn {
  font: 500 15px/1 var(--f-body);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
  will-change: transform;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover {
  border-color: var(--fg);
}

.btn.primary {
  background: var(--fg);
  color: var(--ink);
  border-color: var(--fg);
}

.btn .mono {
  font-family: var(--f-mono);
  font-size: 14px;
}

.copied {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--warm);
  min-width: 8ch;
}

.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: 28px;
  border-top: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
}

/* ==========================================================================
   Cursor Personalizado Magnético
   ========================================================================== */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid var(--warm);
  border-radius: 50%;
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  transition: width 0.25s, height 0.25s, margin 0.25s, background 0.25s;
}

.cursor.big {
  width: 70px;
  height: 70px;
  margin: -35px 0 0 -35px;
  background: rgba(0, 0, 0, 0.04);
}

@media (hover: none) {
  .cursor {
    display: none;
  }
}

/* ==========================================================================
   Plantillas WordPress Genéricas (Páginas, Entradas, 404)
   ========================================================================== */
.wp-container {
  min-height: 80vh;
  padding-top: calc(100px + env(safe-area-inset-top, 0px));
  padding-bottom: 80px;
}

.wp-card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(24px, 5vw, 64px);
  margin-top: 40px;
}

.wp-page-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 24px;
}

.wp-content {
  font-size: 17px;
  line-height: 1.7;
  color: var(--body);
}

.wp-content h1, .wp-content h2, .wp-content h3 {
  font-family: var(--f-display);
  font-weight: 700;
  color: var(--fg);
  margin-top: 1.8em;
  margin-bottom: 0.6em;
}

.wp-content p {
  margin-bottom: 1.5em;
}

.wp-content ul, .wp-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}

.wp-content li {
  margin-bottom: 0.5em;
}

.wp-content blockquote {
  border-left: 2px solid var(--fg);
  padding-left: 20px;
  margin: 2em 0;
  color: var(--muted);
  font-style: italic;
}

.wp-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* WordPress Core Alignment & Utilities */
.alignwide {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.aligncenter {
  clear: both;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.alignleft {
  float: left;
  margin-right: 1.5em;
  margin-bottom: 1.5em;
}

.alignright {
  float: right;
  margin-left: 1.5em;
  margin-bottom: 1.5em;
}

.wp-caption {
  margin-bottom: 1.5em;
  max-width: 100%;
}

.wp-caption-text {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

/* ==========================================================================
   Artículos y Conocimiento Técnico (CPT 'articulo')
   ========================================================================== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--fg);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.15);
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cat-pill {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--warm);
  background: var(--panel);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.time-read {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
}

.article-card h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
}

.article-card h3 a {
  color: inherit;
  text-decoration: none;
}

.article-card p {
  margin: 0;
  color: var(--body);
  font-size: 15px;
  line-height: 1.5;
}

.article-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
}

.read-more {
  color: var(--fg);
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s;
}

.article-card:hover .read-more {
  transform: translateX(4px);
}

@media (max-width: 900px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
}

/* Paginación WordPress */
.pagination, .nav-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 13px;
  margin-top: 40px;
}

.page-numbers {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--glass);
  text-decoration: none;
  color: var(--fg);
}

.page-numbers.current {
  background: var(--fg);
  color: var(--ink);
  border-color: var(--fg);
}

/* ==========================================================================
   Accesibilidad & Reducción de Movimiento
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .manifesto .w {
    opacity: 1 !important;
  }
  .proj, .chip, .btn {
    transition: none !important;
  }
}

/* ==========================================================================
   v1.2.2 · Artículos y páginas interiores: lectura en móvil
   ========================================================================== */

/* Menú sólido fuera de la portada (evita que se monte sobre el texto) */
body:not(.home) .nav {
  mix-blend-mode: normal;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

/* Contenido: imágenes y pies de foto */
.wp-content img { max-width: 100%; height: auto; border-radius: 10px; }
.wp-content figure { margin: 2em 0; }
.wp-content figcaption,
.wp-content .wp-element-caption {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 10px;
}
.wp-content h2 { font-size: clamp(1.6rem, 4.2vw, 2.3rem); line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.wp-content h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); line-height: 1.2; }
.wp-content strong { color: var(--fg); }

/* Tablas: escritorio */
.wp-content .wp-block-table { margin: 2em 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wp-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.45;
  background: var(--ink);
  font-variant-numeric: tabular-nums;
}
.wp-content th,
.wp-content td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
  border: 0;
  border-bottom: 1px solid var(--line);
  word-break: normal;
  overflow-wrap: normal;
  hyphens: manual;
}
.wp-content thead th {
  background: var(--fg);
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 0;
}
.wp-content tbody tr:last-child td { border-bottom: 0; }
.wp-content tbody tr:nth-child(even) td { background: #fafaf9; }
.wp-content td:first-child { color: var(--fg); }

/* Comentarios */
.comments-area, .comment-respond { margin-top: 48px; }
.comment-reply-title, .comments-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.comment-notes, .logged-in-as { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.comment-form { display: grid; gap: 16px; }
.comment-form p { margin: 0; }
.comment-form label {
  display: block;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  max-width: 100%;
  font: 16px/1.5 var(--f-body);
  color: var(--fg);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--fg);
  box-shadow: 0 0 0 3px rgba(13, 13, 13, 0.08);
}
.comment-form .comment-form-cookies-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--body);
}
.comment-form .comment-form-cookies-consent input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--fg); flex: none; }
.comment-form .comment-form-cookies-consent label {
  font-family: var(--f-body);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--body);
  margin: 0;
}
.comment-form .form-submit { margin-top: 4px; }
.comment-form input[type="submit"] {
  font: 600 15px/1 var(--f-body);
  background: var(--fg);
  color: var(--ink);
  border: 1px solid var(--fg);
  border-radius: 999px;
  padding: 15px 24px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.comment-form input[type="submit"]:hover { background: #2a2a2a; }
.comment-list { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 16px; }
.comment-list .comment-body { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: var(--ink); }
.comment-list .children { list-style: none; padding-left: 20px; margin-top: 16px; }
.comment-author { font-weight: 600; color: var(--fg); }
.comment-metadata { font-size: 13px; color: var(--muted); }
.comment-metadata a { color: inherit; text-decoration: none; }

/* Móvil */
@media (max-width: 720px) {
  .wp-container { padding-top: calc(76px + env(safe-area-inset-top, 0px)); padding-bottom: 48px; }
  .wp-card { padding: 22px 18px; margin-top: 16px; border-radius: 14px; }
  .wp-page-title { font-size: clamp(2rem, 9vw, 2.6rem); line-height: 1.05; text-wrap: balance; }
  .wp-content { font-size: 16.5px; line-height: 1.65; }
  .wp-content ul, .wp-content ol { padding-left: 1.2em; }
  .breadcrumbs { overflow-wrap: anywhere; }

  /* Tablas convertidas en tarjetas: cada fila es una tarjeta con etiquetas */
  .wp-content .wp-block-table { overflow: visible; }
  .wp-content table.is-stacked,
  .wp-content table.is-stacked tbody,
  .wp-content table.is-stacked tr,
  .wp-content table.is-stacked td { display: block; width: 100%; }
  .wp-content table.is-stacked { border: 0; border-radius: 0; background: transparent; overflow: visible; }
  .wp-content table.is-stacked thead { display: none; }
  .wp-content table.is-stacked tbody { display: grid; gap: 12px; }
  .wp-content table.is-stacked tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--ink);
    overflow: hidden;
  }
  .wp-content table.is-stacked tbody tr:nth-child(even) td { background: transparent; }
  .wp-content table.is-stacked td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    text-align: right;
  }
  .wp-content table.is-stacked td:last-child { border-bottom: 0; }
  .wp-content table.is-stacked td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    text-align: left;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.5;
  }
  .wp-content table.is-stacked td:first-child {
    display: block;
    text-align: left;
    background: #f4f4f3;
    font-weight: 700;
    font-size: 16px;
  }
  .wp-content table.is-stacked td:first-child::before { display: none; }

  /* Sin JavaScript: la tabla se desplaza en horizontal en vez de aplastarse */
  .wp-content table:not(.is-stacked) { min-width: 560px; }

  .comment-list .children { padding-left: 10px; }
}

/* ==========================================================================
   v1.3.0 · Botón de idioma ES / EN
   ========================================================================== */
.nav ul, .nav .menu { margin-left: auto; }
.lang-switch {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, color 0.2s;
}
.lang-switch:hover { opacity: 0.6; }
@media (max-width: 640px) {
  .nav { gap: 12px; }
  .lang-switch { min-width: 36px; height: 26px; padding: 0 8px; }
}
