/* ========================================================================
   JHON ALEX CORDERO — PORTAFOLIO v5
   Default: RED (estilo Gatzara) · Toggle: DARK (azul-noche con indigo)
   ======================================================================== */

:root,
[data-theme="light"] {
  /* ===== TEMA EDITORIAL VERDE — DEFAULT =====
     Cream cálido + emerald jewel-tone + terracotta/ámbar de soporte.
     Pensado para el sistema editorial (Fraunces + Inter + JetBrains):
     la tipografía manda, el verde sólo ancla jerarquía. */

  /* Surface — cream paper */
  --bg: #f4f0e6;
  --bg-soft: #e8e1cf;
  --bg-card: #ffffff;
  --bg-elev: #f9f5e8;
  --bg-dark: #0c1f17;

  --line: rgba(12, 31, 23, 0.10);
  --line-strong: rgba(12, 31, 23, 0.20);
  --line-soft: rgba(12, 31, 23, 0.05);

  --text: #0c1f17;
  --text-mid: #4a5d4f;
  --text-dim: #8a948d;
  --text-light: #f9f5e8;

  /* Accent system — emerald primario, terracotta + ámbar como soporte */
  --accent: #1b6e4a;        /* jewel emerald — principal */
  --accent-2: #0d4d31;      /* deep forest emerald — hover/press */
  --accent-3: #b8442c;      /* terracotta — status dot, secondary highlights */
  --accent-4: #b08820;      /* amber gold — chips, highlights */
  --accent-soft: rgba(27, 110, 74, 0.12);

  --radius: 20px;
  --radius-lg: 32px;
  --radius-xl: 40px;
  --radius-sm: 12px;

  --shadow-sm: 0 1px 2px rgba(12, 31, 23, 0.05), 0 2px 8px rgba(12, 31, 23, 0.05);
  --shadow-md: 0 4px 12px rgba(27, 110, 74, 0.10), 0 12px 32px rgba(12, 31, 23, 0.08);
  --shadow-lg: 0 12px 40px rgba(27, 110, 74, 0.15), 0 24px 64px rgba(12, 31, 23, 0.10);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --grain-opacity: 0.03;
  --bg-glow-1: rgba(27, 110, 74, 0.18);
  --bg-glow-2: rgba(13, 77, 49, 0.14);
  --bg-glow-3: rgba(184, 68, 44, 0.08);
}

/* Compat: si quedó "red" en localStorage, lo tratamos como "light" en CSS */
[data-theme="red"] {
  /* hereda todo del bloque anterior vía :root — sin redefinir */
  color-scheme: light;
}

[data-theme="dark"] {
  /* ===== TEMA DARK — azul-noche con color indigo ===== */
  --bg: #0a0e1f;            /* azul-noche profundo — NO negro plano */
  --bg-soft: #0f1424;
  --bg-card: #141a30;        /* card un escalón arriba del bg */
  --bg-elev: #1a2040;
  --bg-dark: #050813;        /* fondo del CTA: aún más profundo */

  --line: rgba(180, 190, 230, 0.08);
  --line-strong: rgba(180, 190, 230, 0.16);
  --line-soft: rgba(180, 190, 230, 0.04);

  --text: #e8eaf5;           /* blanco cálido-azulado, no puro */
  --text-mid: #9aa1bd;
  --text-dim: #5d6585;
  --text-light: #f8f9fc;

  /* Acento indigo brillante — destaca sobre el fondo azul-noche */
  --accent: #818cf8;         /* indigo-400 */
  --accent-2: #6366f1;       /* indigo-500 */
  --accent-3: #22d3ee;       /* cyan-400 */
  --accent-4: #fbbf24;       /* ámbar cálido */
  --accent-soft: rgba(129, 140, 248, 0.14);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.20);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(99, 102, 241, 0.20);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45), 0 24px 64px rgba(99, 102, 241, 0.25);

  --grain-opacity: 0.04;
  --bg-glow-1: rgba(129, 140, 248, 0.22);
  --bg-glow-2: rgba(34, 211, 238, 0.14);
  --bg-glow-3: rgba(251, 191, 36, 0.08);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  text-rendering: optimizeSpeed;
  /* offset para que los anchor links no queden bajo la nav fija */
  scroll-padding-top: 80px;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  contain: layout;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

a { color: inherit; text-decoration: none; }

/* ========================================================================
   SKIP LINK — accesibilidad: saltar al contenido con teclado
   ======================================================================== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 9999;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--text-light);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; outline: 2px solid var(--text); outline-offset: 2px; }

/* Focus visible — outline moderno en todos los focusables por teclado */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
button:focus-visible,
.nav-cta:focus-visible,
.btn:focus-visible,
.theme-toggle:focus-visible,
.nav-burger:focus-visible { outline-offset: 4px; }
button { font-family: inherit; background: none; border: none; }
input, textarea, select { font-family: inherit; }

img, svg { max-width: 100%; display: block; }

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

/* ========================================================================
   NAV
   ======================================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: all 0.4s var(--ease);
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 0;
}
.nav-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.logo-mark {
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
  transition: color 0.4s var(--ease);
}
.nav-links {
  display: flex; gap: 36px;
  list-style: none;
}
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
  position: relative;
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="true"] {
  color: var(--accent);
}
.nav-links a[aria-current="true"]::after { transform: scaleX(1); }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  background: var(--text);
  color: var(--text-light);
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  transition: all 0.3s var(--ease);
}
.nav-cta:hover { background: var(--accent); transform: translateY(-1px); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mid);
  transition: all 0.3s var(--ease);
  box-shadow: var(--shadow-sm);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); }
.theme-toggle-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  display: grid; place-items: center;
  transition: background 0.4s var(--ease);
  flex-shrink: 0;
}
.theme-toggle-icon::before {
  content: '';
  width: 10px; height: 10px;
  background: var(--text-light);
  border-radius: 50%;
  transition: all 0.4s var(--ease);
}
[data-theme="dark"] .theme-toggle-icon::before {
  /* En dark, el punto central se ve mejor con un "moon" — dos círculos laterales */
  width: 8px; height: 8px;
  background: transparent;
  box-shadow: 4px -3px 0 0 var(--text-light), -4px 3px 0 0 var(--text-light);
}
.theme-toggle-label {
  letter-spacing: 0.02em;
}

.nav-burger {
  display: none;
  flex-direction: column; gap: 5px;
  padding: 8px;
}
.nav-burger span {
  width: 22px; height: 1.5px;
  background: var(--text);
  transition: 0.3s;
}
@media (max-width: 900px) {
  .nav-links, .nav-cta, .theme-toggle { display: none; }
  .nav-burger { display: flex; }
  .nav-links.mobile-open {
    display: flex;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(24px);
    padding: 24px 32px;
    border-bottom: 1px solid var(--line-soft);
    gap: 20px;
  }
  .theme-toggle.mobile-show { display: inline-flex; position: absolute; top: 100%; right: 32px; margin-top: 12px; z-index: 1001; }
}

/* ========================================================================
   CONTAINER & SECTIONS
   ======================================================================== */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 768px) { .container { padding: 0 20px; } }

.section {
  padding: 140px 0;
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: 1px 800px;
}
@media (max-width: 768px) { .section { padding: 80px 0; } }

.section-head { margin-bottom: 64px; max-width: 820px; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 20px;
  text-transform: uppercase;
}
.kicker::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--text-dim);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.section-head.in-view .kicker::before,
.section-head.head-in .kicker::before { transform: scaleX(1); }

.section-title {
  font-family: var(--serif);
  font-size: clamp(40px, 5.5vw, 68px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  transition: color 0.4s var(--ease);
}
.section-title em {
  font-style: italic;
  color: var(--accent);
}
.section-sub {
  color: var(--text-mid);
  font-size: 19px;
  margin-top: 24px;
  max-width: 600px;
  line-height: 1.5;
}

/* ========================================================================
   HERO
   ======================================================================== */
.hero {
  min-height: 100vh;
  position: relative;
  padding: 120px 32px 80px;
  overflow: hidden;
}
.hero-bg-layer {
  position: absolute; inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 85% 18%, var(--bg-glow-1), transparent 55%),
    radial-gradient(ellipse 55% 45% at 12% 85%, var(--bg-glow-2), transparent 55%),
    radial-gradient(ellipse 40% 35% at 60% 60%, var(--bg-glow-3), transparent 60%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--bg) 100%, white 4%) 0%,
      color-mix(in srgb, var(--accent-soft) 30%, var(--bg)) 50%,
      var(--bg-soft) 100%);
  pointer-events: none;
  transition: background 0.4s var(--ease);
}
.hero-bg-layer::after {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(26,13,13,var(--grain-opacity)) 3px, rgba(26,13,13,var(--grain-opacity)) 4px);
  pointer-events: none;
  mix-blend-mode: multiply;
  animation: grainShift 20s ease-in-out infinite;
}
@keyframes grainShift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-2px, 1px); }
}

.hero-split {
  position: relative; z-index: 2;
  max-width: 1320px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - 200px);
}
@media (max-width: 1024px) {
  .hero-split { grid-template-columns: 1fr; gap: 32px; }
}
.hero-left { max-width: 720px; }
.hero-right {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 600px;
  min-height: 460px;
  margin: 0 auto;
}
@media (max-width: 1024px) {
  .hero-right { max-width: 480px; aspect-ratio: 4 / 3; min-height: 380px; }
}

.hero-3d-wrapper {
  position: relative;
  width: 100%; height: 100%;
  min-height: 460px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 6%, var(--bg-card)) 0%, var(--bg-soft) 70%, var(--bg-soft) 100%);
  box-shadow:
    inset 0 0 0 1px var(--line-soft),
    0 30px 60px -20px color-mix(in srgb, var(--accent) 25%, transparent),
    0 12px 30px -10px color-mix(in srgb, var(--text) 15%, transparent);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
#hero-3d { display: block; width: 100% !important; height: 100% !important; cursor: grab; touch-action: none; }
#hero-3d:active { cursor: grabbing; }

.hero-3d-hint {
  position: absolute;
  bottom: 16px; left: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: color-mix(in srgb, var(--bg-card) 70%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-mid);
  font-weight: 500;
  pointer-events: none;
  animation: hintPulse 3s ease-in-out infinite;
}
@keyframes hintPulse { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }

.hero-3d-card {
  position: absolute;
  top: 20px; right: 20px;
  width: 200px;
  background: color-mix(in srgb, var(--bg-dark) 92%, transparent);
  color: var(--text-light);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.3);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  animation: floatCard 4s ease-in-out infinite;
  pointer-events: none;     /* no roba los mousedown al canvas — la rotación funciona en toda el área */
}
@keyframes floatCard {
  0%, 100% { transform: rotate(2deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-6px); }
}
.card-eyebrow {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.card-row { display: flex; gap: 6px; color: rgba(255,255,255,0.85); }
.card-row.dim { color: rgba(255,255,255,0.4); }
.d-ok { color: #30d158; }
.d-run { color: #5ac8fa; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mid);
  margin-bottom: 40px;
  box-shadow: var(--shadow-sm);
  transition: background 0.3s, border-color 0.3s;
}
.status-dot {
  width: 7px; height: 7px;
  background: var(--accent-3);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(40px, 6.4vw, 84px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: 48px;
  color: var(--text);
  font-variation-settings: 'opsz' 144;
  transition: color 0.4s var(--ease);
  overflow-wrap: break-word;
  word-break: break-word;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title em {
  font-style: italic;
  color: var(--accent);
}
.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 80px;
  min-width: 0;
}
.hero-subtitle {
  font-size: clamp(15px, 4vw, 19px);
  color: var(--text-mid);
  max-width: 640px;
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}
.hero-subtitle strong { color: var(--text); font-weight: 600; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: all 0.4s var(--ease);
  white-space: nowrap;
}
.btn-lg { padding: 16px 28px; font-size: 15px; }
.btn-primary {
  background: var(--text);
  color: var(--text-light);
  transition: transform 0.4s var(--ease), background 0.3s, box-shadow 0.3s, color 0.3s;
}
.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px color-mix(in srgb, var(--accent) 50%, transparent);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-card); border-color: var(--text); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  max-width: 100%;
}
@media (max-width: 640px) {
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stat {
  display: flex; flex-direction: column;
  padding: 0 24px;
  border-left: 1px solid var(--line);
  transition: transform 0.3s var(--ease);
  min-width: 0;
}
.stat:first-child { padding-left: 0; border-left: none; }
.stat:hover .stat-num { transform: translateY(-2px); }
.stat.pulse { animation: statPulse 0.6s var(--ease); }
@keyframes statPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@media (max-width: 640px) {
  .stat { padding: 0 16px 16px 0; border: none; }
  .stat:nth-child(3) { padding-top: 16px; border-top: 1px solid var(--line); }
  .stat:nth-child(4) { padding-top: 16px; border-top: 1px solid var(--line); }
}
.stat-num {
  font-family: var(--serif);
  font-size: 56px; font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  display: flex; align-items: baseline;
  font-variation-settings: 'opsz' 144;
  transition: transform 0.3s var(--ease);
}
.stat-plus {
  color: var(--accent);
  font-size: 40px;
  margin-left: 2px;
}
.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ========================================================================
   ABOUT
   ======================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: start;
}
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; gap: 48px; } }
.about-text .lead {
  font-size: 24px;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 24px;
  font-weight: 400;
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144;
}
.about-text p { color: var(--text-mid); font-size: 16px; margin-bottom: 18px; line-height: 1.65; }
.about-text strong { color: var(--text); font-weight: 600; }
.about-text em { font-style: normal; color: var(--accent); font-weight: 600; }
.about-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.tag {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-mid);
  transition: all 0.3s var(--ease);
  position: relative; overflow: hidden;
}
.tag:hover {
  background: var(--text);
  color: var(--text-light);
  border-color: var(--text);
  transform: translateY(-1px);
}
.ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  transform: translate(-50%, -50%) scale(0);
  width: 6px; height: 6px;
  animation: ripple 0.6s var(--ease) forwards;
  pointer-events: none;
}
@keyframes ripple {
  to { transform: translate(-50%, -50%) scale(40); opacity: 0; }
}

.about-info {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 8px 32px;
  box-shadow: var(--shadow-sm);
  transition: background 0.3s, border-color 0.3s;
}
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-soft);
  gap: 16px;
}
.info-row:last-child { border-bottom: none; }
.info-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  flex-shrink: 0;
}
.info-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  text-align: right;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ========================================================================
   BENTO GRID
   ======================================================================== */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(0, auto);
  gap: 20px;
}
@media (max-width: 900px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .bento { grid-template-columns: 1fr; } }
.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex; flex-direction: column;
  transition: transform 0.5s var(--ease), box-shadow 0.4s, border-color 0.3s, background 0.3s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  contain: layout paint;
}
.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--accent) 8%, transparent),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
  z-index: 0;
}
.bento-card:hover::before { opacity: 1; }
.bento-card > * { position: relative; z-index: 1; }
.bento-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  will-change: transform;
}
.bento-lg { grid-column: span 4; grid-row: span 2; }
.bento-md { grid-column: span 2; grid-row: span 1; }
.bento-sm { grid-column: span 2; grid-row: span 1; }
@media (max-width: 900px) {
  .bento-lg, .bento-md, .bento-sm { grid-column: span 2; }
  .bento-lg { grid-row: auto; }
}
@media (max-width: 500px) {
  .bento-lg, .bento-md, .bento-sm { grid-column: span 1; }
}

/* Shine effect exclusivo en bento-lg */
.bento-lg::after {
  content: '';
  position: absolute;
  width: 240px; height: 240px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 25%, transparent) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 1;
  left: var(--mx, 50%);
  top: var(--my, 50%);
}
.bento-lg:hover::after { opacity: 1; }

.bento-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
}
.bento-meta { flex: 1; }
.bento-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
  transition: background 0.3s, color 0.3s;
}
.bento-tag.subtle { background: var(--bg-soft); color: var(--text-mid); }
.bento-title {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 6px;
  color: var(--text);
  font-variation-settings: 'opsz' 144;
}
.bento-sub { color: var(--text-mid); font-size: 15px; line-height: 1.4; }
.bento-link {
  width: 36px; height: 36px;
  background: var(--text);
  color: var(--text-light);
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all 0.3s var(--ease);
}
.bento-link:hover { background: var(--accent); transform: rotate(45deg); }
.bento-title-sm {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
}
.bento-link-sm {
  width: 28px; height: 28px;
  background: var(--bg-soft);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px;
  color: var(--text-mid);
  transition: all 0.3s;
  flex-shrink: 0;
}
.bento-link-sm:hover { background: var(--text); color: var(--text-light); transform: rotate(45deg); }

.bento-visual {
  flex: 1;
  min-height: 280px;
  margin: 12px 0 20px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.mockup-window {
  width: 100%;
  background: var(--bg-dark);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px -12px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
}
.mockup-titlebar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: #2c2c2e;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mockup-titlebar .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #4a4a4a;
}
.mockup-titlebar .dot:first-child { background: #ff5f57; }
.mockup-titlebar .dot:nth-child(2) { background: #febc2e; }
.mockup-titlebar .dot:nth-child(3) { background: #28c840; }
.mockup-url {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
  padding: 3px 10px;
  border-radius: 4px;
  flex: 1;
  text-align: center;
  letter-spacing: 0.02em;
}
.mockup-body { background: #0a0a0a; }
.api-panel {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 280px;
}
@media (max-width: 500px) { .api-panel { grid-template-columns: 1fr; } }
.api-side {
  background: #111;
  padding: 16px 10px;
  border-right: 1px solid rgba(255,255,255,0.06);
  font-family: var(--mono);
  font-size: 10px;
}
.api-side-title {
  color: rgba(255,255,255,0.4);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  padding: 0 6px;
}
.api-endpoint {
  padding: 6px 8px;
  border-radius: 4px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 2px;
  display: flex; align-items: center; gap: 6px;
  transition: background 0.2s;
}
.api-endpoint.active, .api-endpoint:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.verb {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  min-width: 32px;
  text-align: center;
  font-family: var(--mono);
}
.verb.get { background: rgba(48,209,88,0.15); color: #30d158; }
.verb.post { background: rgba(41,151,255,0.15); color: #5ac8fa; }
.api-main { padding: 16px; overflow: hidden; }
.api-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.api-tab {
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  color: rgba(255,255,255,0.5);
}
.api-tab.active { background: rgba(48,209,88,0.15); color: #30d158; }
.api-code {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  color: #f5f5f7;
  background: #000;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  white-space: pre;
}
.c-b { color: #f5f5f7; }
.c-k { color: #5ac8fa; }
.c-s { color: #30d158; }
.c-n { color: #ff9f0a; }
.c-p { color: rgba(255,255,255,0.5); }

.bento-body { display: flex; flex-direction: column; gap: 16px; }
.bento-features {
  list-style: none;
  display: flex; flex-direction: column; gap: 10px;
}
.bento-features li {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.5;
  padding-left: 20px;
  position: relative;
}
.bento-features li::before {
  content: '';
  position: absolute;
  left: 0; top: 10px;
  width: 8px; height: 1px;
  background: var(--accent);
}
.bento-features strong { color: var(--text); font-weight: 600; }
.bento-features code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
}
.bento-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.bento-stack span {
  padding: 4px 10px;
  background: var(--bg-soft);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mid);
  transition: background 0.3s, color 0.3s;
}
.bento-text { font-size: 14px; color: var(--text-mid); line-height: 1.55; }
.bento-body-sm { margin-top: auto; padding-top: 16px; }
.bento-body-sm p { font-size: 13px; color: var(--text-mid); line-height: 1.5; margin-bottom: 12px; }

.bento-mini-visual {
  margin: 12px 0;
  flex: 1;
  min-height: 120px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
  position: relative;
  display: flex;
  transition: background 0.3s;
}
.mini-browser { flex-direction: column; }
.mini-bar {
  display: flex; gap: 4px;
  padding: 8px 10px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line-soft);
}
.mini-bar span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  opacity: 0.4;
}
.mini-content {
  flex: 1;
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.mini-line { height: 4px; background: var(--text); opacity: 0.2; border-radius: 2px; }
.mini-line.w60 { width: 60%; }
.mini-line.w80 { width: 80%; }
.mini-line.w50 { width: 50%; }
.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
  flex: 1;
}
.mini-grid > div { background: var(--text); opacity: 0.1; border-radius: 4px; }
.mini-pizza {
  flex-direction: column;
  background:
    linear-gradient(180deg, #fff5ea 0%, #f7e6d4 100%);
  padding: 0;
  overflow: hidden;
}
.mini-pizza-content {
  padding: 14px;
  gap: 12px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at top right, rgba(216, 49, 42, 0.10) 0%, transparent 60%);
}
.pizza-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: linear-gradient(135deg, #d8312a 0%, #f5b524 100%);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.pizza-logo {
  width: 28px; height: 28px;
  background: #fff8f5;
  color: #d8312a;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.pizza-lines { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.pizza-lines .mini-line { background: #fff8f5; opacity: 0.85; }
.pizza-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.pizza-grid > div {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  background: linear-gradient(135deg, #fef3e8, #f5dcc4);
  box-shadow:
    inset 0 0 0 1px rgba(216, 49, 42, 0.08),
    inset 0 6px 0 -4px rgba(216, 49, 42, 0.05);
  position: relative;
}
.pizza-grid > div::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 4px; height: 4px;
  background: #d8312a;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
}
[data-theme="dark"] .mini-pizza {
  background:
    linear-gradient(180deg, #2a1810 0%, #1a1008 100%);
}
[data-theme="dark"] .pizza-grid > div {
  background: linear-gradient(135deg, #3a2418, #2a1a10);
  box-shadow:
    inset 0 0 0 1px rgba(245, 181, 36, 0.12),
    inset 0 6px 0 -4px rgba(245, 181, 36, 0.08);
}
[data-theme="dark"] .pizza-grid > div::after { background: #f5b524; opacity: 0.6; }
.mini-grid-art {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 6px;
  padding: 12px;
}
.mini-grid-art > div { border-radius: 4px; background: var(--text); opacity: 0.12; }
.mini-grid-art > div:nth-child(1) { background: var(--accent); opacity: 0.7; }
.mini-grid-art > div:nth-child(4) { background: var(--accent-3); opacity: 0.7; }
.mini-grid-art > div:nth-child(6) { background: var(--accent-2); opacity: 0.7; }
.mini-battle {
  background:
    linear-gradient(180deg, #c8e0eb 0%, #8fbccd 100%);
  align-items: center; justify-content: center;
  position: relative;
  padding: 16px;
}
.mini-battle::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 14px, rgba(255,255,255,0.18) 14px, rgba(255,255,255,0.18) 15px),
    repeating-linear-gradient(90deg, transparent 0, transparent 14px, rgba(255,255,255,0.10) 14px, rgba(255,255,255,0.10) 15px);
  pointer-events: none;
}
.ocean {
  display: flex; gap: 10px;
  align-items: center; flex-wrap: wrap; justify-content: center;
  padding: 0;
  width: 100%;
  position: relative;
  z-index: 1;
}
.battle-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 3px;
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1 / 1;
  padding: 8px;
  background: rgba(255,255,255,0.35);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.04),
    0 4px 12px -2px rgba(0,0,0,0.10);
}
.battle-grid > span {
  background: rgba(255,255,255,0.55);
  border-radius: 2px;
  position: relative;
  transition: background 0.3s;
}
.battle-grid > span.ship {
  background: #2d4a5a;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}
.battle-grid > span.ship::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: linear-gradient(135deg, #3a5d72 0%, #1d3540 100%);
  border-radius: 1px;
}
.battle-grid > span.hit {
  background: #c93838;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
  animation: hitPulse 2.5s ease-in-out infinite;
}
.battle-grid > span.hit::before {
  content: '×';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
@keyframes hitPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
[data-theme="dark"] .mini-battle {
  background:
    linear-gradient(180deg, #1a2f3d 0%, #0d1b25 100%);
}
[data-theme="dark"] .mini-battle::before {
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 14px, rgba(129, 140, 248, 0.10) 14px, rgba(129, 140, 248, 0.10) 15px),
    repeating-linear-gradient(90deg, transparent 0, transparent 14px, rgba(129, 140, 248, 0.06) 14px, rgba(129, 140, 248, 0.06) 15px);
}
[data-theme="dark"] .battle-grid {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.10);
}
[data-theme="dark"] .battle-grid > span {
  background: rgba(255,255,255,0.10);
}
[data-theme="dark"] .battle-grid > span.ship {
  background: #818cf8;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
}
[data-theme="dark"] .battle-grid > span.ship::after {
  background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 100%);
}
[data-theme="dark"] .battle-grid > span.hit {
  background: #f43f5e;
}

/* ========================================================================
   SKILLS BENTO
   ======================================================================== */
.skills-bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .skills-bento { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .skills-bento { grid-template-columns: 1fr; } }
.sk-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.4s var(--ease);
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.sk-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 6%, transparent), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.sk-card:hover::before { opacity: 1; }
.sk-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.sk-card > * { position: relative; z-index: 1; }
.sk-lang { grid-column: span 2; }
.sk-back { grid-column: span 2; }
.sk-data { grid-column: span 2; }
.sk-tools { grid-column: span 3; }
.sk-learning { grid-column: span 3; background: var(--bg-dark); color: var(--text-light); border-color: rgba(255,255,255,0.08); }
@media (max-width: 900px) {
  .sk-lang, .sk-back, .sk-data, .sk-tools, .sk-learning { grid-column: span 2; }
}
@media (max-width: 500px) {
  .sk-lang, .sk-back, .sk-data, .sk-tools, .sk-learning { grid-column: span 1; }
}
.sk-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.sk-learning .sk-head { border-bottom-color: rgba(255,255,255,0.08); }
.sk-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
}
.sk-learning .sk-num { color: rgba(255,255,255,0.4); }
.sk-head h3 { font-family: var(--serif); font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.sk-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.sk-list li {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
}
.sk-name { font-size: 14px; color: var(--text); font-weight: 500; }
.sk-level {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  animation: badgeIn 0.6s var(--ease) both;
}
@keyframes badgeIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}
.sk-list li:nth-child(1) .sk-level { animation-delay: 0.1s; }
.sk-list li:nth-child(2) .sk-level { animation-delay: 0.18s; }
.sk-list li:nth-child(3) .sk-level { animation-delay: 0.26s; }
.sk-list li:nth-child(4) .sk-level { animation-delay: 0.34s; }
.sk-level.advanced { background: color-mix(in srgb, var(--accent-3) 18%, transparent); color: var(--accent-3); }
.sk-level.intermediate { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.sk-level.beginner { background: var(--bg-soft); color: var(--text-mid); }
.sk-learning-text {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  margin-bottom: 20px;
}
.learning-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.learn-tag {
  padding: 6px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  position: relative; overflow: hidden;
  transition: all 0.3s var(--ease);
}
.learn-tag:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-1px); }

/* ========================================================================
   CARRUSEL INFINITO DE TECNOLOGÍAS (autoscroll CSS, pausa al hover)
   ======================================================================== */
.tech-carousel {
  margin-top: 64px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  position: relative;
  box-shadow: var(--shadow-sm);
  user-select: none;
  overflow: hidden;
}
.tech-carousel::before,
.tech-carousel::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 48px;
  z-index: 2;
  pointer-events: none;
}
.tech-carousel::before { left: 0; background: linear-gradient(to right, var(--bg-card), transparent); }
.tech-carousel::after { right: 0; background: linear-gradient(to left, var(--bg-card), transparent); }

.tech-track-wrap {
  display: block;
  overflow: hidden;
  position: relative;
  width: 100%;
}
.tech-track {
  display: flex;
  gap: 24px;
  align-items: center;
  width: max-content;
  /* Animación CSS de respaldo — corre incluso si el JS no carga.
     El HTML tiene 3 sets idénticos: -33.3333% equivale a 1 set. */
  animation: techScroll 28s linear infinite;
  /* El JS (initTechCarousel) toma el control en cuanto carga y reemplaza
     este transform con translate3d(...) de píxeles reales. */
  will-change: transform;
}

@keyframes techScroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-33.3333%, 0, 0); }
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  width: 96px;
  padding: 12px 8px;
  border-radius: 12px;
  transition: background 0.3s, transform 0.3s;
}
.tech-item:hover { background: var(--bg-soft); transform: translateY(-2px); }
.tech-logo {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  color: var(--text);
  transition: color 0.3s, transform 0.4s var(--ease);
}
.tech-item:hover .tech-logo { color: var(--accent); transform: scale(1.15); }
.tech-logo svg,
.tech-logo img { width: 100%; height: 100%; object-fit: contain; }
.tech-name {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-align: center;
  white-space: nowrap;
  transition: color 0.3s;
}
.tech-item:hover .tech-name { color: var(--accent); }

/* ========================================================================
   PROCESO — 4 pasos
   ======================================================================== */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
}
@media (max-width: 900px) { .process-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .process-grid { grid-template-columns: 1fr; } }

.step {
  position: relative;
  padding: 32px 28px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.4s var(--ease), border-color 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line-strong));
  box-shadow: var(--shadow-md);
}
.step-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.step-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.step-icon {
  width: 22px; height: 22px;
  color: var(--accent);
  opacity: 0.85;
  flex-shrink: 0;
  transition: transform 0.4s var(--ease), opacity 0.3s;
}
.step:hover .step-icon { transform: scale(1.12) rotate(-4deg); opacity: 1; }
.step-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--text);
}
.step-desc {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.55;
  flex: 1;
}
.step-tag {
  display: inline-block;
  align-self: flex-start;
  margin-top: 8px;
  padding: 4px 10px;
  background: var(--bg-soft);
  color: var(--text-dim);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ========================================================================
   TIMELINE
   ======================================================================== */
.timeline {
  position: relative;
  padding-left: 40px;
}
.timeline::before {
  content: ''; position: absolute;
  left: 7px; top: 14px; bottom: 14px;
  width: 1px;
  background: var(--line-strong);
}
.timeline-item {
  position: relative;
  padding-bottom: 56px;
  transition: transform 0.4s var(--ease);
}
.timeline-item:hover { transform: translateX(8px); }
.tl-dot {
  position: absolute;
  left: -38px; top: 8px;
  width: 15px; height: 15px;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 50%;
  transition: all 0.3s var(--ease);
}
.timeline-item:hover .tl-dot {
  background: var(--accent);
  transform: scale(1.3);
}
.tl-year {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tl-content h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 144;
}
.tl-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.tl-content p { color: var(--text-mid); line-height: 1.65; max-width: 720px; }

/* ========================================================================
   CERTS
   ======================================================================== */
.certs-list {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.cert-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 28px 32px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.3s;
  position: relative;
  overflow: hidden;
}
.cert-row::before {
  content: '';
  position: absolute;
  left: -100%; top: 0; bottom: 0;
  width: 60%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 8%, transparent), transparent);
  transition: left 0.6s var(--ease);
}
.cert-row:hover::before { left: 100%; }
.cert-row:hover { background: var(--bg-elev); }
.cert-row:last-child { border-bottom: none; }
.cert-row.cert-featured { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent); }
@media (max-width: 700px) {
  .cert-row { grid-template-columns: 1fr; gap: 8px; padding: 20px; }
}
.cert-issuer {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.cert-row h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
  font-variation-settings: 'opsz' 144;
  transition: transform 0.3s var(--ease), color 0.3s;
}
.cert-row:hover h3 { transform: translateX(4px); color: var(--accent); }
.cert-platform { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }

/* ========================================================================
   CTA
   ======================================================================== */
.cta-card {
  position: relative;
  text-align: center;
  padding: 96px 48px;
  background: var(--bg-dark);
  border-radius: var(--radius-xl);
  overflow: hidden;
  color: var(--text-light);
  transition: background 0.4s var(--ease);
}
.cta-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 60%);
  pointer-events: none;
}
.cta-card .kicker { color: rgba(255,255,255,0.5); position: relative; z-index: 1; }
.cta-card .kicker::before { background: rgba(255,255,255,0.3); }
.cta-title {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 20px 0 24px;
  color: var(--text-light);
  position: relative; z-index: 1;
  font-variation-settings: 'opsz' 144;
}
.cta-title em { font-style: italic; color: color-mix(in srgb, var(--accent) 50%, white); }
.cta-sub {
  color: rgba(255,255,255,0.65);
  font-size: 18px;
  max-width: 580px;
  margin: 0 auto 48px;
  line-height: 1.55;
  position: relative; z-index: 1;
}
.cta-buttons {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.cta-card .btn-primary { background: var(--text-light); color: var(--text); }
.cta-card .btn-primary:hover { background: var(--accent); color: #fff; }
.cta-card .btn-ghost {
  background: transparent; color: var(--text-light);
  border-color: rgba(255,255,255,0.2);
}
.cta-card .btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--text-light);
}

/* ========================================================================
   FOOTER
   ======================================================================== */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  transition: background 0.4s var(--ease);
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 24px;
}
.footer-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 500;
  font-size: 14px;
}
.footer-copy { color: var(--text-dim); font-size: 13px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 13px; color: var(--text-mid); transition: color 0.3s; }
.footer-links a:hover { color: var(--text); }

/* ========================================================================
   REVEAL ANIMATIONS
   ======================================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal]:nth-child(2) { transition-delay: 0.08s; }
[data-reveal]:nth-child(3) { transition-delay: 0.16s; }
[data-reveal]:nth-child(4) { transition-delay: 0.24s; }
[data-reveal]:nth-child(5) { transition-delay: 0.32s; }

.hero-title .line {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.hero-title.in .line { opacity: 1; transform: translateY(0); }
.hero-title.in .line-2 { transition-delay: 0.1s; }
.hero-title.in .line-3 { transition-delay: 0.2s; }
.hero-title.in .line-4 { transition-delay: 0.3s; }

.section-head .section-title { position: relative; overflow: hidden; }
.section-head.head-in .section-title {
  animation: headSlide 0.9s var(--ease) both;
}
@keyframes headSlide {
  from { transform: translateY(20px); opacity: 0; filter: blur(8px); }
  to { transform: translateY(0); opacity: 1; filter: blur(0); }
}
.section-head.head-in .kicker { animation: kickerFade 0.6s var(--ease) both; }
@keyframes kickerFade {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* El carrusel se mueve SIEMPRE — el usuario lo pidió explícitamente */
  .tech-track { animation-duration: 28s !important; animation-iteration-count: infinite !important; }
  .hero-title .line { opacity: 1; transform: none; }
  [data-reveal] { opacity: 1; transform: none; }
}

@media (max-width: 480px) {
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .api-side { display: none; }
  .api-panel { grid-template-columns: 1fr; }
  .cta-card { padding: 64px 24px; }
  .section-head { margin-bottom: 40px; }
  .bento-card { padding: 24px; }
}

/* ========================================================================
   MOBILE — HERO & 3D MODEL (≤ 768px)
   ======================================================================== */
@media (max-width: 768px) {
  .hero { padding: 100px 16px 56px; min-height: auto; }
  .hero-split { gap: 40px; min-height: auto; }
  .hero-left { max-width: 100%; }
  .hero-right {
    max-width: 100%;
    aspect-ratio: 16 / 11;
    min-height: 240px;
  }
  .hero-3d-wrapper { min-height: 240px; }
  .hero-3d-card { display: none; }      /* overlay 200px: se come el canvas en mobile */
  .hero-3d-hint { display: none; }      /* "mueve el cursor" no aplica en touch */
  .hero-badge { font-size: 11px; padding: 6px 10px; margin-bottom: 24px; gap: 8px; }
  .hero-meta { gap: 24px; margin-bottom: 48px; }
  .hero-title { margin-bottom: 32px; }
  .hero-stats { padding-top: 28px; }
  .stat-num { font-size: 28px; }
}

/* ========================================================================
   MOBILE PEQUEÑO — teléfonos compactos (≤ 380px)
   ======================================================================== */
@media (max-width: 380px) {
  .hero { padding: 88px 14px 48px; }
  .container { padding: 0 18px; }
  .section { padding: 64px 0; }
  .hero-badge { font-size: 10px; padding: 5px 10px; }
  .hero-3d-wrapper { min-height: 200px; }
  .hero-right { min-height: 200px; }
  .stat-num { font-size: 24px; }
  .stat-label { font-size: 10px; }
  .section-title { letter-spacing: -0.03em; }
  .btn { padding: 12px 18px; font-size: 13px; }
  .btn-lg { padding: 13px 20px; font-size: 14px; }
  /* About info: stack label/value vertical para textos largos */
  .info-row { flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 0; }
  .info-value { text-align: left; }
}

/* ========================================================================
   DECORACIONES POR TEMA — usan var(--accent) y se adaptan a light/dark
   ======================================================================== */

/* Kicker dot — vive en ambos temas */
.kicker::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: 4px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Bento cards — borde del accent en hover */
.bento-card:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line-strong));
}

/* Section title em — gradiente del accent */
.section-title em {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}

/* Tag — fondo accent suave */
.tag {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--text);
}
.tag:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Skill levels */
.sk-level.advanced {
  background: color-mix(in srgb, var(--accent-3) 25%, transparent);
  color: var(--accent-3);
  border: 1px solid color-mix(in srgb, var(--accent-3) 30%, transparent);
}
.sk-level.intermediate {
  background: var(--accent);
  color: white;
}

/* Cert row issuer */
.cert-issuer {
  background: var(--accent);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
}

/* bento-tag destacado */
.bento-tag {
  background: var(--accent);
  color: white;
}

/* Hero badge */
.hero-badge {
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: var(--accent-soft);
}

/* Stat plus */
.stat-plus {
  color: var(--accent);
  text-shadow: 0 0 16px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Theme toggle — fondo del accent en ambos temas (legible en dark también) */
.theme-toggle {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.theme-toggle:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.theme-toggle-icon {
  background: white;
}
.theme-toggle-icon::before {
  background: var(--accent);
}

/* Botones primary */
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-2);
  box-shadow: 0 12px 24px -8px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* Tech items hover */
.tech-item:hover {
  background: var(--accent-soft);
}

/* CTA card — gradiente azul-noche con acento indigo */
.cta-card {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--accent-2) 140%);
}
.cta-card::before {
  background: radial-gradient(ellipse 60% 50% at 50% 0%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 60%);
}

/* Nav logo mark */
.logo-mark {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* En modo dark, la card del hero 3D y el CTA quedan más vivos con un glow extra */
[data-theme="dark"] .hero-3d-wrapper {
  background:
    radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 14%, var(--bg-card)) 0%, var(--bg-soft) 70%, var(--bg-soft) 100%);
  box-shadow:
    inset 0 0 0 1px var(--line-soft),
    0 30px 60px -20px color-mix(in srgb, var(--accent) 35%, transparent),
    0 12px 30px -10px rgba(0, 0, 0, 0.35);
}

/* ========================================================================
   FIX MODO DARK — botones con fondo claro/texto claro (invisibles)
   En light funcionan bien; en dark hay que invertir fondo↔texto.
   ======================================================================== */

/* Nav CTA (botón GitHub del navbar) */
[data-theme="dark"] .nav-cta {
  background: var(--text-light);
  color: var(--bg-dark);
}
[data-theme="dark"] .nav-cta:hover {
  background: var(--accent);
  color: var(--bg-dark);
}

/* Bento link (icono GitHub en card SmartGym) */
[data-theme="dark"] .bento-link {
  background: var(--text-light);
  color: var(--bg-dark);
}
[data-theme="dark"] .bento-link:hover {
  background: var(--accent);
  color: var(--bg-dark);
}

/* CTA card — botón de email (era claro-sobre-claro) */
[data-theme="dark"] .cta-card .btn-primary {
  background: var(--text-light);
  color: var(--bg-dark);
}
[data-theme="dark"] .cta-card .btn-primary:hover {
  background: var(--accent);
  color: var(--bg-dark);
}

/* El logo-mark en dark: el gradiente con accent queda bien, pero por si acaso */
[data-theme="dark"] .hero-3d-card {
  background: color-mix(in srgb, var(--bg-dark) 95%, transparent);
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Tag hover (claro-sobre-claro en dark) */
[data-theme="dark"] .tag:hover {
  background: var(--accent);
  color: var(--bg-dark);
}

/* Bento link pequeño hover */
[data-theme="dark"] .bento-link-sm:hover {
  background: var(--text-light);
  color: var(--bg-dark);
}

/* ════════════════════════════════════════════════════════════════
   BENTO: TostiBurguer (custom block)
   ════════════════════════════════════════════════════════════════ */

/* Brand-tinted tag (mostaza/ketchup sin azul) */
.bento-tag.brand {
  background: linear-gradient(135deg, #f5b524 0%, #d8312a 100%);
  color: #fff;
  border: none;
}

/* TostiBurguer card: borde y glow cálidos */
.bento-card.bento-tostiburguer {
  background:
    linear-gradient(180deg, var(--bg-soft) 0%, transparent 100%),
    radial-gradient(ellipse at top right, rgba(245,181,36,0.08) 0%, transparent 60%);
  border-color: rgba(245,181,36,0.25);
  position: relative;
  overflow: hidden;
}
.bento-card.bento-tostiburguer::before {
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 50%),
    rgba(245,181,36,0.10) 0%,
    transparent 60%
  );
}

/* Visual: 2 screens side-by-side dentro del mockup-window */
.tb-visual {
  min-height: 220px;
  margin: 8px 0 16px;
}
.tb-mockup {
  width: 100%;
}
.tb-screens {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
  background: #0a0a0a;
  position: relative;
}
.tb-screen {
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.06);
  aspect-ratio: 16/9;
  background: #1a1410;
}
.tb-screen:last-child { border-right: none; }
.tb-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
}
.bento-tostiburguer:hover .tb-screen img { transform: scale(1.04); }
.tb-label {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  padding: 4px 8px;
  background: rgba(14,10,8,0.85);
  color: #f5b524;
  border-radius: 3px;
  backdrop-filter: blur(6px);
  text-transform: uppercase;
  font-weight: 600;
}
@media (max-width: 600px) {
  .tb-screens { grid-template-columns: 1fr; }
  .tb-screen { aspect-ratio: 16/9; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .tb-screen:last-child { border-bottom: none; }
}

/* Botones de acción del bento (Repo + Live) */
.bento-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.bento-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0,0,0,0.12);
  transition: transform .2s, background .2s, color .2s, border-color .2s;
  cursor: pointer;
}
.bento-action:hover {
  transform: translateY(-2px);
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.bento-action.primary {
  background: linear-gradient(135deg, #f5b524 0%, #d8312a 100%);
  color: #fff;
  border: none;
  box-shadow: 0 8px 20px -8px rgba(216,49,42,0.5);
}
.bento-action.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(216,49,42,0.65);
  background: linear-gradient(135deg, #f5b524 0%, #d8312a 100%);
  color: #fff;
  border: none;
}
.bento-action svg { flex-shrink: 0; }

[data-theme="dark"] .bento-action {
  border-color: rgba(255,255,255,0.15);
  color: var(--text-light);
}
[data-theme="dark"] .bento-action:hover {
  background: var(--text-light);
  color: var(--bg-dark);
  border-color: var(--text-light);
}
