/* ============================================================================
   PORTFOLIO CIBERSEGURIDAD — Maxi Barcia
   ----------------------------------------------------------------------------
   Hoja de estilos principal (mobile-first, CSS Grid + Flexbox).

   Índice:
     01. Variables de tema (oscuro / claro) + tokens de color
     02. Reset & base tipográfica
     03. Utilidades (container, gradient-text, cards, buttons, tags)
     04. Barra de progreso de scroll
     05. Header / Nav / Buscador global / Menú móvil
     06. Hero (canvas, grid cyber, glows, typing)
     07. Reveal on scroll (Intersection Observer)
     08. Secciones: about · skills · projects · stats · ctf · cheatsheet · contact
     09. Footer
     10. Modals (writeup, CV) + estilos de impresión del CV
     11. Chat widget flotante
     12. Terminal overlay
     13. Botón "volver arriba"
     14. Accesibilidad: prefers-reduced-motion, focus-visible, skip-link
     15. Responsive (breakpoints 640 / 900 / 1200)
   ========================================================================== */

/* ==========================================================================
   01. VARIABLES DE TEMA
   --------------------------------------------------------------------------
   El tema oscuro es el valor por defecto (atributo data-theme="dark" en el
   <html>). El claro se activa con data-theme="light" y se persigue con
   localStorage desde app.js. Todas las superficies usan variables, así que
   cambiar de tema es un simple swap de variables. ========================================================================== */
:root {
  /* Tipografías */
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --font-code: 'Fira Code', 'JetBrains Mono', ui-monospace, monospace;

  /* Números de layout */
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --container: 1200px;
  --header-h: 68px;
  --transition: .25s cubic-bezier(.4, 0, .2, 1);
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, .55);
  --shadow-glow: 0 0 0 1px var(--border), 0 14px 44px -14px var(--accent-soft);

  /* ===== TEMA OSCURO (por defecto) ===== */
  --bg: #0a0a0f;
  --bg-alt: #0e0e15;
  --surface: #12121c;
  --surface-2: #171725;
  --border: #1e1e30;
  --border-strong: #2c2c46;
  --text: #e0e0e0;
  --text-strong: #ffffff;
  --muted: #9b9bb4;
  --muted-2: #6d6d8a;
  --accent: #00ffcc;
  --accent-2: #ff0055;
  --accent-soft: rgba(0, 255, 204, .10);
  --accent-2-soft: rgba(255, 0, 85, .10);
  --accent-ink: #032420;            /* para texto sobre el accent */
  --grad-base: linear-gradient(135deg, #00ffcc 0%, #00e5ff 45%, #ff0055 110%);
  --grad-cyan: linear-gradient(135deg, #00ffcc, #00e5b8);
  --grad-pink: linear-gradient(135deg, #ff0055, #ff6a9e);
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #fb5f5f;
  --code-bg: #0d0d15;
  --tooltip-bg: #1d1d30;

  color-scheme: dark;
}

/* ===== TEMA CLARO ===== */
[data-theme="light"] {
  --bg: #f4f6fa;
  --bg-alt: #eceef5;
  --surface: #ffffff;
  --surface-2: #f6f7fc;
  --border: #e2e5ef;
  --border-strong: #ccd2e2;
  --text: #23233c;
  --text-strong: #101022;
  --muted: #5d6080;
  --muted-2: #8b8fa8;
  --accent: #00a887;
  --accent-2: #e0004d;
  --accent-soft: rgba(0, 168, 135, .10);
  --accent-2-soft: rgba(224, 0, 77, .08);
  --accent-ink: #ffffff;
  --grad-base: linear-gradient(135deg, #009276 0%, #0277a8 45%, #d2004b 110%);
  --grad-cyan: linear-gradient(135deg, #009276, #00b29b);
  --grad-pink: linear-gradient(135deg, #d2004b, #ff6a8e);
  --ok: #16a34a;
  --warn: #b45309;
  --danger: #dc2626;
  --code-bg: #101020;
  --tooltip: #101020;
  --shadow: 0 18px 40px -18px rgba(30, 34, 70, .25);
  color-scheme: light;
}

/* ==========================================================================
   02. RESET & BASE
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  overflow-x: clip;
  transition: background var(--transition), color var(--transition);
}

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }

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

/* Scrollbar personalizada (WebKit) */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent), var(--accent-2));
  border-radius: 8px;
  border: 3px solid var(--bg-alt);
}

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; color: var(--text-strong); }

code, kbd {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .12em .42em;
}
kbd {
  font-size: .72rem;
  padding: .18em .5em;
  color: var(--muted);
}

/* ==========================================================================
   02. UTILIDADES
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.section { padding-block: clamp(4rem, 9vw, 7.2rem); position: relative; }

.section-head { max-width: 640px; margin-bottom: clamp(2rem, 5vw, 3.4rem); }

.section-kicker {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: .7rem;
}
.section-kicker::before { content: '/* '; color: var(--accent-2); }
.section-kicker::after { content: ' */'; color: var(--accent-2); }

.section-title {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: .8rem;
  white-space: nowrap;
}
.section-title i, .section-title .fa-layers { font-family: var(--font-mono); }

#tech-title {
  font-size: clamp(1.4rem, 4vw, 2.9rem);
}

.section-desc { color: var(--muted); font-size: 1.05rem; }

/* Texto con degradado neón */
.gradient-text {
  background: var(--grad-base);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.muted { color: var(--muted); }
.small { font-size: .9rem; }
.tiny { font-size: .78rem; }
.text-link { border-bottom: 1px dashed currentColor; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.card-title {
  font-size: 1.12rem;
  margin-bottom: .9rem;
  display: flex;
  gap: .55rem;
  align-items: center;
  color: var(--text-strong);
}
.card-title i { color: var(--accent); }

.subsection-title {
  font-size: 1rem;
  color: var(--text-strong);
  margin: 1.6rem 0 .6rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.subsection-title i { color: var(--accent-2); }

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-weight: 600;
  font-size: .95rem;
  padding: .72rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition), transform .12s ease;
  white-space: nowrap;
  position: relative;
}
.btn:active { transform: scale(.96); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--grad-base);
  background-size: 150% 150%;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 6px 24px -10px rgba(255, 0, 85, .45), 0 6px 24px -10px rgba(0, 255, 204, .3);
}
.btn-primary:hover {
  background-position: 100% 50%;
  color: #fff;
  transform: translateY(-2px);
}

.btn-outline {
  border-color: var(--border-strong);
  color: var(--text-strong);
  background: transparent;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.btn-ghost {
  border-color: var(--border);
  color: var(--muted);
  background: var(--bg-alt);
}
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }

.btn-block { width: 100%; }
.btn-sm { padding: .45rem .9rem; font-size: .82rem; }

/* Tags / chips */
.tag, .chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: var(--font-mono);
  font-size: .76rem;
  padding: .26rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--accent-soft);
  color: var(--text);
}
.chip { background: transparent; border-color: var(--border); color: var(--muted); }
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* Campos de formulario */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-size: .86rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .4rem;
}
.field label span { color: var(--accent-2); }
.field-input {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: .72rem 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-input::placeholder { color: var(--muted-2); }
textarea.field-input { resize: vertical; min-height: 110px; }

.field-error { display: block; color: var(--danger); font-size: .8rem; min-height: 1.1em; margin-top: .25rem; }
.field.has-error .field-input { border-color: var(--danger); }

/* Honeypot anti-spam (oculto a humanos) */
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; height: 1px; width: 1px; }

/* kbd general */
kbd { color: var(--muted); }

/* ==========================================================================
   03. BARRA DE PROGRESO DE SCROLL
   ========================================================================== */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  z-index: 1200;
  height: 3px;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent-soft), 0 0 12px var(--accent-2-soft);
}

/* ==========================================================================
   04. HEADER / NAVEGACIÓN
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 12px 32px -18px rgba(0, 0, 0, .6);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Logo */
.logo { display: inline-flex; align-items: center; gap: .55rem; flex-shrink: 0; }
.logo-mark {
  font-family: var(--font-code);
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--grad-base);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
.logo-text {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-strong);
  letter-spacing: -.02em;
}
.logo .accent { color: var(--accent); }

/* Menú desktop */
.main-nav { display: none; }
.nav-list { display: flex; gap: .3rem; align-items: center; }
.nav-link {
  display: block;
  padding: .5rem .85rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.nav-link:hover { color: var(--text-strong); background: var(--accent-soft); }
.nav-link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Acciones del header */
.header-actions { display: flex; align-items: center; gap: .5rem; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--muted);
  font-size: 1.02rem;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.icon-btn:hover { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.icon-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn-cv { padding: .5rem .9rem; font-size: .85rem; }

/* Hamburguesa móvil */
.burger { --burger-w: 22px; }
.burger-line {
  display: block;
  width: var(--burger-w);
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  margin: 5px auto;
  transition: transform .3s, opacity .2s, width .3s;
}
.burger.is-open .burger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open .burger-line:nth-child(2) { opacity: 0; }
.burger.is-open .burger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   05. PANEL DE BÚSQUEDA GLOBAL (dropdown del header)
   ========================================================================== */
.search-panel {
  position: absolute;
  top: var(--header-h);
  left: 0; right: 0;
  max-height: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid transparent;
  transition: max-height .35s ease, border-color .3s;
}
.search-panel.is-open { max-height: min(72vh, 620px); border-bottom-color: var(--border); }
.search-panel-inner { padding-block: 1.2rem .8rem; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .65rem 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box .search-icon { color: var(--accent); }
.search-box input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: .98rem;
}
.search-box input:focus { outline: none; }
.search-box input::placeholder { color: var(--muted-2); }

/* Resultados de la búsqueda global */
.global-results { margin-top: .6rem; max-height: 46vh; overflow-y: auto; }
.search-group + .search-group { margin-top: .4rem; }
.search-group-title {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: .6rem .3rem .2rem;
  display: flex; align-items: center; gap: .5rem;
}
.search-group-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.search-result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .65rem .8rem;
  border-radius: 10px;
  text-align: left;
  transition: background var(--transition), transform var(--transition);
}
.search-result:hover, .search-result.is-focus { background: var(--surface); transform: translateX(4px); }
.search-result .sr-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .9rem;
}
.search-result .sr-body { flex: 1; min-width: 0; }
.search-result .sr-title { display: block; color: var(--text-strong); font-weight: 600; font-size: .93rem; }
.search-result .sr-sub { display: block; color: var(--muted-2); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result .sr-go { color: var(--muted-2); font-size: .75rem; flex-shrink: 0; }
.search-empty { padding: 1.2rem; text-align: center; color: var(--muted); font-size: .9rem; }

/* ==========================================================================
   06. HERO
   ========================================================================== */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-h) + 30px);
  padding-bottom: 4rem;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(60% 50% at 20% 15%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    radial-gradient(50% 40% at 90% 75%, color-mix(in srgb, var(--accent-2) 9%, transparent), transparent 60%);
}

/* Canvas global de partículas (fijo al viewport, dibujado por JS) */
.bg-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Rejilla "cyber" sutil (solo decoración) */
.cyber-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent) 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 5%, transparent) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(70% 60% at 50% 40%, black, transparent 85%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, black, transparent 85%);
  opacity: .55;
}

/* Destellos de luz de fondo */
.glow {
  position: absolute; border-radius: 50%; filter: blur(90px); z-index: 0;
  opacity: .28; pointer-events: none;
}
.glow-cyan { width: 420px; height: 420px; background: var(--accent); top: -120px; left: -100px; animation: float 12s ease-in-out infinite; }
.glow-pink { width: 380px; height: 380px; background: var(--accent-2); bottom: -140px; right: -120px; animation: float 15s ease-in-out infinite reverse; }
@keyframes float { 0%,100% { transform: translate(0, 0); } 50% { transform: translate(24px, 18px); } }

.hero-content { position: relative; z-index: 1; max-width: 800px; }

.hero-badge {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-mono); font-size: .8rem;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px);
  padding: .42rem .95rem; border-radius: 999px;
  margin-bottom: 1.2rem;
}
.hero-badge strong { color: var(--accent); }

.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-prompt { font-family: var(--font-mono); font-size: .92rem; color: var(--muted-2); margin-bottom: .9rem; }
.hero-prompt .prompt-symbol { color: var(--accent); }
.hero-prompt .prompt-path { color: var(--accent-2); }

.hero-title {
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin-bottom: .9rem;
}
.hero-greeting { display: block; font-size: .45em; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-bottom: .2rem; }

.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  color: var(--accent);
  margin-bottom: 1.1rem;
  min-height: 2.2em;
}
.typed-cursor {
  color: var(--accent-2);
  animation: blink 1s steps(1) infinite;
  font-weight: 400;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-subtitle { max-width: 560px; color: var(--muted); font-size: 1.06rem; margin-bottom: 2rem; }
.hero-subtitle strong { color: var(--text-strong); }

.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; margin-bottom: 2.6rem; }

/* Contador de estadísticas del hero */
.hero-stats { display: flex; flex-wrap: wrap; gap: 1.6rem 2.6rem; }
.hero-stat .stat-num {
  font-family: var(--font-code);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 700;
  background: var(--grad-base);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.hero-stat .stat-label { display: block; color: var(--muted-2); font-size: .82rem; letter-spacing: .06em; }

/* Indicador de scroll */
.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 2; opacity: .7; transition: opacity var(--transition);
}
.scroll-hint:hover { opacity: 1; }
.mouse {
  width: 24px; height: 38px;
  border: 2px solid var(--muted-2);
  border-radius: 14px;
  display: block; position: relative;
}
.wheel { position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; background: var(--accent); border-radius: 2px; transform: translateX(-50%); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { top: 6px; opacity: 1; } 70% { top: 18px; opacity: 0; } 100% { opacity: 0; } }

/* ==========================================================================
   07. SCROLL REVEAL (Intersection Observer)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  --ease: cubic-bezier(.2, .65, .25, 1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   08. SECCIONES
   ========================================================================== */

/* ---------- Sobre mí ---------- */
.about-grid {
  display: grid;
  gap: 1.4rem;
}
.about-bio p { color: var(--muted); margin-bottom: 1.2rem; }
.facts-list li {
  display: flex; gap: .6rem; align-items: baseline;
  padding-block: .34rem;
  color: var(--muted);
  font-size: .94rem;
  border-bottom: 1px dashed var(--border);
}
.facts-list li i { width: 18px; color: var(--accent); font-size: .85rem; }
.facts-list li strong { color: var(--text-strong); font-weight: 600; }

.certs-inline { display: flex; flex-wrap: wrap; gap: .5rem; }
.certs-inline .chip {
  border-color: color-mix(in srgb, var(--accent-2) 40%, var(--border));
  color: var(--accent-2);
  background: var(--accent-2-soft);
}

/* Timeline (experiencia / educación) */
.timeline { position: relative; padding-left: 1.4rem; }
.timeline::before {
  content: '';
  position: absolute; left: 4px; top: 4px; bottom: 4px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
  border-radius: 2px;
  opacity: .55;
}
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute; left: -1.4rem; top: .55rem;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 12px var(--accent-soft);
}
.timeline-item h4 { font-size: 1rem; margin-bottom: .15rem; }
.timeline-item .tl-meta { font-family: var(--font-mono); font-size: .78rem; color: var(--accent); margin-bottom: .5rem; letter-spacing: .02em; }
.bullet-list li {
  position: relative;
  color: var(--muted);
  font-size: .9rem;
  padding-left: 1.1rem; margin-bottom: .35rem;
}
.bullet-list li::before { content: '▹'; position: absolute; left: 0; color: var(--accent-2); }

/* ---------- Skills ---------- */
.skills-grid { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
.skill-cat { padding: 1.4rem 1.5rem; }
.skill-cat h3 { font-size: 1rem; margin-bottom: 1.1rem; display: flex; align-items: center; gap: .55rem; }
.skill-cat h3 i { color: var(--accent-2); }
.skill-item { margin-bottom: .95rem; }
.skill-item:last-child { margin-bottom: 0; }
.skill-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .3rem; }
.skill-name { font-family: var(--font-mono); font-size: .87rem; color: var(--text-strong); }
.skill-pct { font-family: var(--font-mono); font-size: .75rem; color: var(--muted-2); }
.skill-bar {
  display: block; height: 6px; border-radius: 99px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  overflow: hidden;
}
.skill-fill {
  display: block; height: 100%; width: 0;
  border-radius: inherit;
  background: var(--grad-base);
  transition: width 1.1s cubic-bezier(.25, .8, .3, 1);
}

.skill-chips { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: .55rem; }

/* ---------- Proyectos ---------- */
.gh-status { margin-bottom: 1.1rem; font-size: .88rem; color: var(--muted); }
.gh-status.is-error { color: var(--warn); }

.projects-grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }

.project-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.project-cover {
  --c1: #0e2a26; --c2: #13132a;
  position: relative;
  height: 170px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  display: grid; place-items: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.project-cover::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, #ffffff 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, #ffffff 7%, transparent) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, black, transparent);
  -webkit-mask-image: linear-gradient(180deg, black, transparent);
}
.project-cover .cover-icon {
  position: relative; z-index: 1;
  width: 58px; height: 58px;
  display: grid; place-items: center;
  font-size: 1.6rem;
  color: #fff;
  border-radius: 18px;
  background: color-mix(in srgb, var(--c1) 55%, transparent);
  border: 1px solid color-mix(in srgb, #fff 25%, transparent);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .7);
  animation: coverFloat 5s ease-in-out infinite;
}
@keyframes coverFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.project-cover .cover-badge {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  font-family: var(--font-mono); font-size: .7rem;
  padding: .22rem .6rem; border-radius: 999px;
  background: rgba(0, 0, 0, .45); color: #fff; border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
}
.project-body { padding: 1.4rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.project-body h3 { font-size: 1.08rem; }
.project-body h3 i { color: var(--accent); font-size: .85em; }
.project-body p { color: var(--muted); font-size: .92rem; flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.project-links { display: flex; gap: .8rem; margin-top: .4rem; }
.project-links a { font-size: .84rem; font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; }
.stars { color: var(--accent); font-family: var(--font-mono); font-size: .72rem; }

/* ---------- Estadísticas (Chart.js) ---------- */
.stats-grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
.chart-card .chart-wrap { position: relative; height: 300px; }
.chart-card canvas { max-height: 300px; }

/* ---------- CTF ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 1rem 2.4rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.2rem;
}
.filter-group { display: flex; flex-direction: column; gap: .55rem; }
.filter-group-wide { flex-basis: 100%; }
.filter-label { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); }
.filter-options { display: flex; flex-wrap: wrap; gap: .45rem; }

.filter-badge {
  font-family: var(--font-mono); font-size: .8rem;
  padding: .34rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  background: var(--bg-alt);
  transition: all var(--transition);
}
.filter-badge:hover { border-color: var(--accent); color: var(--accent); }
.filter-badge.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-soft);
  font-weight: 700;
}
.filter-badge.is-active.bl-facil { background: var(--ok); color: #fff; border-color: var(--ok); box-shadow: 0 0 14px color-mix(in srgb, var(--ok) 45%, transparent); }
.filter-badge.is-active.bl-media { background: var(--warn); color: #fff; border-color: var(--warn); box-shadow: 0 0 14px color-mix(in srgb, var(--warn) 45%, transparent); }
.filter-badge.is-active.bl-dificil { background: var(--accent-2); color: #fff; border-color: var(--accent-2); box-shadow: 0 0 14px color-mix(in srgb, var(--accent-2) 45%, transparent); }

.ctf-toolbar {
  display: flex; flex-wrap: wrap; gap: .8rem; align-items: center;
  margin-bottom: 1.6rem;
}
.ctf-toolbar .field-input { flex: 1; min-width: 220px; }
.results-count { font-family: var(--font-mono); font-size: .82rem; color: var(--muted-2); }

.ctf-grid { display: grid; gap: 1.3rem; grid-template-columns: 1fr; }

.ctf-card {
  display: flex; flex-direction: column;
  overflow: hidden; padding: 0;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.ctf-card:hover .ctf-cover { transform: scale(1.03); }
.ctf-cover {
  position: relative;
  height: 120px;
  background: linear-gradient(135deg, var(--c1, #0e2a26), var(--c2, #131a2a));
  display: grid; place-items: center;
  transition: transform .5s cubic-bezier(.2, .8, .3, 1);
  overflow: hidden;
}
.ctf-cover .cover-glyph { font-size: 2.2rem; color: #fff; opacity: .85; text-shadow: 0 6px 20px rgba(0,0,0,.5); }
.ctf-level {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 600;
  padding: .24rem .7rem; border-radius: 999px;
  background: rgba(0,0,0,.5); color: #fff; border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(4px);
}
.ctf-level.d-Fácil { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.ctf-level.d-Media { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
.ctf-level.d-Difícil { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.ctf-card-body { padding: 1.25rem 1.35rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.ctf-card-body h3 { font-size: 1.06rem; }
.ctf-meta { font-family: var(--font-mono); font-size: .76rem; color: var(--muted-2); }
.ctf-desc { color: var(--muted); font-size: .9rem; flex: 1; }
.ctf-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.ctf-card .btn { margin-top: .4rem; }

.empty-state { text-align: center; color: var(--muted); padding: 2rem; }
.link-btn { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--accent-2); }

.ctf-more { text-align: center; margin-top: 2.2rem; }

/* Botón "copiar" dentro de bloques de código del modal */
.code-copy {
  position: absolute;
  top: .55rem; right: .55rem;
  width: 32px; height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted-2);
  font-size: .78rem;
  transition: all .2s;
}
.code-copy:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Cheatsheet ---------- */
.cheatsheet-toolbar { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.6rem; }
.cheat-cats { display: flex; flex-wrap: wrap; gap: .5rem; }

.cat-tab {
  font-family: var(--font-mono); font-size: .82rem;
  padding: .5rem 1rem; border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  transition: all var(--transition);
}
.cat-tab:hover { color: var(--accent); border-color: var(--accent); }
.cat-tab.is-active {
  background: var(--grad-base); color: #fff; font-weight: 600;
  border-color: transparent;
  box-shadow: 0 4px 18px -8px color-mix(in srgb, var(--accent-2) 60%, transparent);
}

.cheat-block { display: none; animation: fadeUp .4s ease; }
.cheat-block.is-active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.cheat-block .block-title {
  font-family: var(--font-mono); font-size: .86rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: .9rem; display: flex; align-items: center; gap: .6rem;
}
.cheat-block .block-title::before { content: '##'; color: var(--accent-2); }

.cheat-list { display: flex; flex-direction: column; gap: .7rem; }
.cheat-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .85rem 1.05rem;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
}
.cheat-item:hover { border-color: var(--accent); transform: translateX(5px); background: var(--bg-alt); }
.cheat-item .cheat-cmd {
  font-family: var(--font-code);
  font-size: .88rem;
  color: var(--accent);
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: .4rem .8rem; border-radius: 8px;
  flex: 1 1 260px;
  overflow-x: auto;
  white-space: nowrap;
}
.cheat-item .cheat-desc { flex: 2 1 300px; color: var(--muted); font-size: .88rem; }
.copy-btn {
  font-size: .8rem; color: var(--muted-2);
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.copy-btn.is-copied { color: var(--ok); border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }

mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text-strong); padding: 0 .2em; border-radius: 3px; }

/* ---------- Roadmap de certificaciones ---------- */
.roadmap-grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
.road-track { padding: 1.5rem; }
.road-certs { display: flex; flex-direction: column; gap: .65rem; }
.road-cert {
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: 12px;
  padding: .8rem 1rem;
  background: var(--bg-alt);
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
}
.road-cert:hover { border-left-color: var(--accent); transform: translateX(4px); }
.road-cert.st-done { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 5%, var(--bg-alt)); }
.road-cert.st-progress { border-left-color: var(--warn); }
.road-cert-head { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.road-cert-head strong { color: var(--text-strong); font-size: .94rem; }
.road-status {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .08em;
  text-transform: uppercase;
  padding: .2rem .6rem; border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted-2);
}
.road-cert.st-done .road-status { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.road-cert.st-progress .road-status { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.road-org { font-family: var(--font-mono); font-size: .76rem; color: var(--muted-2); margin-top: .3rem; }
.road-note { font-size: .84rem; color: var(--muted); margin-top: .3rem; }
.road-link { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; margin-top: .4rem; }
.roadmap-note { margin-top: 1.4rem; }

/* ---------- Sección MoneyPrinterTurbo ---------- */
.money-grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
.money-about p { color: var(--muted); font-size: .94rem; }
.mpt-features { margin-top: 1rem; }
.mpt-features li { display: flex; gap: .65rem; align-items: flex-start; color: var(--muted); font-size: .88rem; padding-block: .32rem; }
.mpt-features li i { color: var(--ok); margin-top: .28rem; }
.mpt-links { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.2rem; }
.money-setup .cheat-item { background: var(--bg-alt); }
.mpt-step {
  min-width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .78rem; font-weight: 700;
  flex-shrink: 0;
}

/* Enlaces "deshabilitados" (cuando falta un PDF en APP_CONFIG.cv) */
.is-disabled { opacity: .45; pointer-events: none; }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
.contact-list { display: flex; flex-direction: column; }
.contact-list li { border-bottom: 1px dashed var(--border); }
.contact-list li:last-child { border-bottom: 0; }
.contact-item {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem .4rem;
  color: var(--muted);
  border-radius: 10px;
  transition: background var(--transition), color var(--transition);
}
.contact-item:hover { background: var(--accent-soft); color: var(--text-strong); }
.contact-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.15rem;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.contact-item strong { color: var(--text-strong); font-size: .94rem; }
.contact-item small { color: var(--muted-2); }

.cv-card { margin-top: 1rem; }
.cv-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .6rem; }

.contact-form { display: flex; flex-direction: column; }
.form-footer { margin-top: .4rem; }
.form-status { min-height: 1.6em; font-size: .9rem; margin-top: .7rem; }
.form-status.is-error { color: var(--danger); }
.form-status.is-ok { color: var(--ok); }

/* ==========================================================================
   09. FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding-top: 3rem;
}
.footer-inner {
  display: grid; gap: 2rem;
  grid-template-columns: 1fr;
  padding-bottom: 2.4rem;
}
.footer-brand p { margin-top: .7rem; max-width: 300px; }
.footer-links h4, .footer-social h4 {
  font-family: var(--font-mono); font-size: .8rem;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: .9rem;
}
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: var(--muted); font-size: .92rem; }
.footer-links a:hover { color: var(--accent); }
.social-links { display: flex; gap: .6rem; }
.social-link {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 1.1rem;
  transition: all var(--transition);
}
.social-link:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 8px 20px -8px var(--accent-soft); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-block: 1.4rem;
  display: flex; flex-direction: column; gap: .3rem;
  align-items: center; text-align: center;
  color: var(--muted-2); font-size: .88rem;
}
.color-heart { color: var(--accent-2); }
.neon-heart { color: var(--accent-2); }
.btn-cv-header { padding: .45rem .95rem; font-size: .85rem; display: none; }

@media (min-width: 640px) { .btn-cv-header { display: inline-flex; } }

/* ==========================================================================
   10. MODALS (writeup + CV)
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1400;
  display: grid; place-items: center;
  padding: 1rem;
  background: rgba(5, 5, 10, .72);
  backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
[data-theme="light"] .modal-overlay { background: rgba(20, 24, 40, .45); }
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }

.modal {
  width: min(880px, 100%);
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent), 0 30px 80px -20px rgba(0, 0, 0, .6);
  transform: translateY(26px) scale(.97);
  transition: transform .32s cubic-bezier(.2, .9, .3, 1.05);
  overflow: hidden;
}
.modal-overlay.is-open .modal { transform: none; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.05rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.modal-title { font-size: 1.05rem; display: flex; align-items: center; gap: .6rem; margin: 0; }
.modal-title i { color: var(--accent); }
.modal-header-actions { display: flex; gap: .5rem; align-items: center; }

.modal-close {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; color: var(--muted); font-size: 1.05rem;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.modal-close:hover { color: var(--accent-2); border-color: var(--accent-2); transform: rotate(90deg); }

.modal-body {
  padding: 1.6rem 1.6rem 1.2rem;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: .9rem 1.4rem;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: .7rem;
  align-items: center;
  font-size: .86rem;
  color: var(--muted);
}
.modal.loading .modal-body { min-height: 260px; }

/* Spinner */
.spinner {
  display: grid; place-items: center; padding: 3rem 0; color: var(--muted-2);
}
.spinner i { font-size: 1.8rem; animation: spin 1s linear infinite; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Markdown body (writeup) */
.md-body { font-size: .95rem; color: var(--text); }
.md-body > :first-child { margin-top: 0; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { margin: 1.5em 0 .5em; scroll-margin-top: 100px; }
.md-body h1 { font-size: 1.55rem; }
.md-body h2 { font-size: 1.28rem; border-bottom: 1px solid var(--border); padding-bottom: .3em; }
.md-body h3 { font-size: 1.1rem; }
.md-body p, .md-body ul, .md-body ol { margin-bottom: 1em; }
.md-body ul { list-style: disc; padding-left: 1.4em; }
.md-body ol { list-style: decimal; padding-left: 1.4em; }
.md-body li { margin-bottom: .3em; color: var(--text); }
.md-body strong { color: var(--text-strong); }
.md-body blockquote { border-left: 3px solid var(--accent-2); padding: .4rem 1rem; margin: 1em 0; background: var(--accent-2-soft); border-radius: 0 8px 8px 0; color: var(--muted); }
.md-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 1em 0;
  position: relative;
}
.md-body pre code { background: none; border: 0; padding: 0; font-size: .84rem; line-height: 1.55; color: #cde4e0; }
[data-theme="light"] .md-body pre code { color: #1f2430; }
.md-body code:not(pre code) { color: var(--accent); }
.md-body a { border-bottom: 1px dashed currentColor; }
.md-body table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .88rem; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: .5rem .8rem; text-align: left; }
.md-body th { background: var(--bg-alt); font-family: var(--font-mono); font-weight: 600; color: var(--text-strong); }
.md-body img { border-radius: 10px; }
.md-body hr { border: 0; border-top: 1px solid var(--border); margin: 1.6em 0; }

/* ---------- CV ---------- */
.modal-wide { width: min(1000px, 100%); }
.cv-body { padding: 2rem; }
.cv { font-size: .92rem; color: var(--text); }

.cv-head { position: relative; display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center; justify-content: space-between; padding-bottom: 1.2rem; margin-bottom: .6rem; }
.cv-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--grad-base); }
.cv-head h2 { font-size: 1.9rem; letter-spacing: -.02em; background: var(--grad-base); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.cv-head .cv-role { color: var(--accent); font-family: var(--font-mono); font-size: .95rem; margin-top: .2rem; }
.cv-contact-line { display: flex; flex-wrap: wrap; gap: .9rem 1.4rem; color: var(--muted); font-size: .82rem; margin-top: .6rem; }
.cv-contact-line a { color: var(--muted); }
.cv-contact-line a:hover { color: var(--accent); }
.cv-contact-line i { color: var(--accent); width: 1em; }

.cv-section { margin-top: 1.8rem; }
.cv-section h3 {
  font-family: var(--font-mono); font-size: .85rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent-2);
  margin-bottom: .9rem; display: flex; align-items: center; gap: .6rem;
}
.cv-section h3::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.cv-item { margin-bottom: 1.1rem; }
.cv-item-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }
.cv-item-head strong { color: var(--text-strong); font-size: 1rem; }
.cv-item-head .cv-date { font-family: var(--font-mono); font-size: .78rem; color: var(--muted-2); }
.cv-item .cv-sub { color: var(--accent); font-size: .86rem; font-weight: 600; }
.cv-item p, .cv-item ul { color: var(--muted); font-size: .9rem; margin-top: .4rem; }
.cv-item ul { list-style: disc; padding-left: 1.3em; }
.cv-item li { margin-bottom: .25rem; }

.cv-skills { display: flex; flex-wrap: wrap; gap: .45rem; }

.cv-2col { display: grid; grid-template-columns: 1fr; gap: 2rem; }

/* Vista previa de impresión: solo el CV ocupa la página.
   js/app.js abre el modal del CV y llama a window.print() */
@media print {
  body * { visibility: hidden; }
  #cv-overlay, #cv-overlay * { visibility: visible; }
  #cv-overlay {
    position: static !important;
    display: block !important;
    padding: 0 !important;
    background: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  #cv-overlay .modal {
    position: static !important;
    max-height: none !important;
    transform: none !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
  }
  #cv-overlay .modal-body { overflow: visible !important; padding: 0 !important; }
  #cv-overlay .modal-header, #cv-overlay .modal-footer { display: none !important; }
  .site-header, .site-footer, .to-top, .chat-fab, .chat-window, .terminal-overlay { display: none !important; }
  .cv { font-size: 11pt; color: #111 !important; }
  @page { margin: 12mm; }
}

/* ==========================================================================
   11. CHAT WIDGET
   ========================================================================== */
.chat-fab {
  position: fixed; right: 1.3rem; bottom: 1.3rem; z-index: 1300;
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad-base); background-size: 160% 160%;
  color: #fff; font-size: 1.35rem;
  box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--accent-2) 55%, rgba(0,0,0,.5)), 0 6px 24px -8px var(--accent-soft);
  border: 2px solid rgba(255, 255, 255, .14);
  transition: transform .25s, box-shadow .25s;
}
.chat-fab:hover { transform: scale(1.08) rotate(6deg); }
.chat-fab i { transition: opacity .2s, transform .2s; }

.chat-window {
  position: fixed; right: 1rem; bottom: calc(1.3rem + 66px); z-index: 1290;
  width: min(370px, calc(100vw - 2rem));
  max-height: min(560px, calc(100vh - 120px));
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 40px -18px var(--accent-soft);
  transform-origin: bottom right;
  transform: scale(.9) translateY(14px);
  opacity: 0; pointer-events: none;
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.1), opacity .25s;
}
.chat-window.is-open { transform: none; opacity: 1; pointer-events: auto; }

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.1rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .92rem; color: var(--text-strong);
}
.chat-status { display: flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 400; color: var(--muted-2); font-family: var(--font-mono); }
.chat-status .pulse-dot { width: 7px; height: 7px; }
.chat-header-actions { display: flex; gap: .25rem; }
.chat-header-actions button {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--muted); font-size: .82rem;
  transition: background .2s, color .2s;
}
.chat-header-actions button:hover { background: var(--accent-soft); color: var(--accent); }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 1rem 1rem .4rem;
  display: flex; flex-direction: column; gap: .6rem;
  background: color-mix(in srgb, var(--bg) 60%, var(--surface));
}
.chat-msg {
  max-width: 85%;
  padding: .6rem .95rem;
  border-radius: 14px;
  font-size: .86rem;
  line-height: 1.5;
  animation: msgIn .28s cubic-bezier(.2, .8, .3, 1);
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.chat-msg.bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.chat-msg.bot a { word-break: break-all; }
.chat-msg.user {
  align-self: flex-end;
  background: var(--grad-base);
  color: #fff;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.chat-msg .msg-meta { font-size: .64rem; color: var(--muted-2); margin-top: .3rem; font-family: var(--font-mono); }

.chat-typing { display: inline-flex; gap: 4px; padding: .4rem 0; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: typingDots 1.2s infinite; }
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typingDots { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.chat-quick { display: flex; flex-wrap: wrap; gap: .45rem; padding: .6rem 1rem; border-top: 1px solid var(--border); }
.chat-quick button {
  font-size: .74rem; font-family: var(--font-mono);
  padding: .3rem .75rem; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--muted);
  transition: all .2s;
}
.chat-quick button:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.chat-input {
  display: flex; gap: .5rem; align-items: center;
  padding: .7rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.chat-input input {
  flex: 1;
  padding: .55rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: .86rem;
}
.chat-input input:focus { outline: none; border-color: var(--accent); }
.chat-input input::placeholder { color: var(--muted-2); }
.chat-input button {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--grad-base);
  color: #fff;
  display: grid; place-items: center;
  transition: transform .2s;
}
.chat-input button:hover { transform: scale(1.08); }
.chat-input button:disabled { opacity: .5; }
.chat-unread {
  position: absolute; top: -4px; right: -4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent-2);
  border: 2px solid var(--bg);
  animation: pulse 2s infinite;
}

/* ==========================================================================
   12. TERMINAL OVERLAY
   ========================================================================== */
.terminal-overlay {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(4, 6, 8, .92);
  backdrop-filter: blur(14px);
  display: grid; place-items: center;
  padding: 1.2rem;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.terminal-overlay.is-open { opacity: 1; pointer-events: auto; }

.terminal-window {
  width: min(900px, 100%);
  max-height: min(620px, 90vh);
  display: flex; flex-direction: column;
  background: #0b0e13;
  border-radius: 16px;
  border: 1px solid #1e293b;
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .9), 0 0 60px -30px var(--accent);
  overflow: hidden;
  transform: scale(.95) translateY(10px);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.05);
}
.terminal-overlay.is-open .terminal-window { transform: none; }

.terminal-bar {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 1.1rem;
  background: #111827;
  border-bottom: 1px solid #1e293b;
}
.terminal-bar .dots { display: flex; gap: 7px; }
.terminal-bar .dots span { width: 12px; height: 12px; border-radius: 50%; }
.terminal-bar .dots span:nth-child(1) { background: #f87171; }
.terminal-bar .dots span:nth-child(2) { background: #fbbf24; }
.terminal-bar .dots span:nth-child(3) { background: #34d399; }
.terminal-title {
  font-family: var(--font-mono); font-size: .82rem; color: #64748b;
  flex: 1; text-align: center;
}
.terminal-close {
  color: #64748b; font-size: 1rem;
  width: 30px; height: 30px; border-radius: 8px;
  transition: color .2s, background .2s;
}
.terminal-close:hover { color: #f87171; background: rgba(248, 113, 113, .12); }

.terminal-body {
  flex: 1; overflow-y: auto;
  padding: 1.1rem 1.2rem;
  font-family: var(--font-mono);
  font-size: .86rem;
  line-height: 1.65;
  color: #cbd5e1;
  background:
    radial-gradient(50% 30% at 50% 0%, rgba(0, 255, 204, .05), transparent 70%),
    #0b0e13;
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal-body::-webkit-scrollbar-thumb { background: #1e293b; }

.term-line { margin-bottom: .35rem; }
.term-prompt { color: var(--accent); margin-right: .5rem; }
.term-path { color: #38bdf8; }
.term-out-ok { color: #34d399; }
.term-out-warn { color: #fbbf24; }
.term-out-err { color: #f87171; }
.term-out-dim { color: #64748b; }
.term-out-magenta { color: #e879f9; }
.term-banner { color: #00ffcc; font-weight: 700; text-shadow: 0 0 18px rgba(0, 255, 204, .4); }

.terminal-prompt-line {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1.2rem;
  background: #0d1117;
  border-top: 1px solid #1e293b;
}
.terminal-input {
  flex: 1;
  background: transparent;
  border: 0;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: .9rem;
  caret-color: var(--accent);
}
.terminal-input:focus { outline: none; }
.terminal-hint { font-size: .88rem; color: #64748b; font-family: var(--font-mono); }

/* ==========================================================================
   13. VOLVER ARRIBA + extras
   ========================================================================== */
.to-top {
  position: fixed; left: 1.3rem; bottom: 1.3rem; z-index: 1200;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transform: translateY(12px);
  transition: all .3s;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

.skip-link {
  position: fixed; top: -60px; left: 1rem; z-index: 2000;
  background: var(--accent); color: var(--accent-ink);
  padding: .6rem 1.2rem; border-radius: 0 0 12px 12px;
  font-weight: 700; font-size: .9rem;
  transition: top .3s;
}
.skip-link:focus { top: 0; }

/* ==========================================================================
   14. RESPONSIVE (mobile-first: base + breakpoints)
   ========================================================================== */
@media (min-width: 640px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .ctf-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .cv-2col { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
  .cheatsheet-toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
  .cheatsheet-toolbar .search-box { flex: 1; max-width: 420px; }
  .roadmap-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  /* Navegación de escritorio visible */
  .burger { display: none; }
  .main-nav { display: block; }
  .search-panel { position: absolute; }

  .about-grid { grid-template-columns: 5fr 7fr; gap: 1.6rem; }
  .projects-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .ctf-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 6fr 6fr; gap: 1.8rem; }
  .filter-group-wide { flex-basis: auto; }
  .footer-inner { grid-template-columns: 2fr 1fr 1fr 1.4fr; }
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
  .money-grid { grid-template-columns: 5fr 7fr; gap: 1.8rem; }
}

@media (min-width: 1200px) {
  .skills-grid { grid-template-columns: repeat(3, 1fr); }
  .ctf-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Con más enlaces en el nav, permetir scroll horizontal en rangos medios */
@media (min-width: 900px) and (max-width: 1249px) {
  .main-nav { max-width: 44vw; overflow-x: auto; }
  .nav-list { flex-wrap: nowrap; }
}
.main-nav { scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }

/* ==========================================================================
   15. MODAL / MENÚ MÓVIL: nav como overlay
   ========================================================================== */
@media (max-width: 899px) {
  .main-nav {
    display: flex;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    max-height: 0;
    overflow: hidden;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
    transition: max-height .4s ease, border-color .3s;
  }
  .main-nav.is-open { max-height: 60vh; overflow-y: auto; border-bottom-color: var(--border); box-shadow: 0 30px 50px -20px rgba(0, 0, 0, .6); }
  .nav-list { flex-direction: column; align-items: stretch; padding: 1rem; gap: .2rem; }
  .nav-link { padding: .9rem 1.1rem; border-radius: 12px; font-size: 1rem; }
}

/* Goplo: barra que "respira" en los títulos de sección cuando se iluminan */
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.gradient-text {
  background-size: 200% 200%;
  animation: gradientShift 7s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .gradient-text { animation: none; background-size: 100% 100%; }
* { scroll-behavior: auto; }
  .bg-particles { display: none; }
  .pulse-dot, .wheel, .chat-unread { animation: none; }
}
/* ============================================================================
 * PÁGINAS MULTI-SITE — heroes de subpágina, explorar, blandas, publicaciones,
 * writeups (estilo GitHub Pages), lector de publicaciones (modales).
 * ========================================================================== */

/* ---------- Hero compacto de subpágina ---------- */
.page-hero {
  position: relative;
  padding: 9rem 0 3.2rem;
  text-align: center;
  overflow: hidden;
}
.page-hero .cyber-grid { opacity: .5; }
.page-title {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  position: relative;
  z-index: 2;
}
.page-title .gradient-text { background-size: 200% 200%; }
.page-sub {
  position: relative;
  z-index: 2;
  color: var(--muted);
  max-width: 640px;
  margin: .8rem auto 0;
  font-size: 1rem;
}

/* ---------- Explorar el sitio (index) ---------- */
.explore-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .explore-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .explore-grid { grid-template-columns: repeat(3, 1fr); } }

.explore-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  text-decoration: none;
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-alt);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.explore-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 14px 34px -18px color-mix(in srgb, var(--accent) 55%, rgba(0, 0, 0, .6));
}
.explore-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  font-size: 1.15rem;
  color: var(--accent);
  background: var(--accent-soft);
}
.explore-card:nth-child(2n) .explore-icon { color: var(--accent-2); background: var(--accent-2-soft); }
.explore-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-strong); }
.explore-card p { font-size: .88rem; color: var(--muted); flex: 1; }
.explore-go {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent);
  letter-spacing: .04em;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.explore-card:hover .explore-go i { transform: translateX(4px); }
.explore-go i { transition: transform var(--transition); }

/* ---------- Habilidades blandas ---------- */
.soft-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .soft-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .soft-grid { grid-template-columns: repeat(3, 1fr); } }

.soft-card {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-alt);
  transition: border-color var(--transition), transform var(--transition);
}
.soft-card:hover { border-color: var(--accent-2); transform: translateY(-3px); }
.soft-icon {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  font-size: 1rem;
  color: var(--accent-2);
  background: var(--accent-2-soft);
}
.soft-card h4 { font-size: .98rem; font-weight: 700; color: var(--text-strong); }
.soft-card p { font-size: .84rem; color: var(--muted); line-height: 1.5; }

/* ---------- Publicaciones (proyectos.html) ---------- */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 860px;
  margin-inline: auto;
}
.pub-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.2rem;
  align-items: center;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-alt);
  transition: border-color var(--transition), transform var(--transition);
}
.pub-item:hover { border-color: var(--accent); transform: translateY(-2px); }
@media (max-width: 620px) {
  .pub-item { grid-template-columns: 1fr; }
  .pub-cover { min-height: 110px; }
}
.pub-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--c1, #0e2a26), var(--c2, #0b1230));
}
.pub-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-cover.no-cover { display: grid; }
.pub-cover-icon { font-size: 2rem; color: var(--accent); opacity: .9; text-shadow: 0 0 24px color-mix(in srgb, var(--accent) 60%, transparent); }
.pub-body { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.pub-title { font-size: 1.08rem; font-weight: 700; color: var(--text-strong); line-height: 1.3; }
.pub-sub { font-size: .9rem; color: var(--muted); line-height: 1.5; }
.pub-meta { font-family: var(--font-mono); font-size: .74rem; color: var(--muted-2); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

/* ---- Lector de publicaciones (modal / bloques) ---- */
.md-body { display: flex; flex-direction: column; gap: .9rem; }
.md-h { font-size: 1.05rem; font-weight: 700; color: var(--text-strong); margin-top: .5rem; }
.md-p { color: var(--text); line-height: 1.65; font-size: .94rem; }
.md-list { display: flex; flex-direction: column; gap: .45rem; padding-left: 1.3rem; }
.md-list li { color: var(--text); font-size: .92rem; line-height: 1.55; list-style: disc; }
.md-list li::marker { color: var(--accent); }
.md-quote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  padding: .7rem 1rem;
  border-radius: 0 10px 10px 0;
  font-style: italic;
  font-size: .92rem;
}
.md-pre {
  position: relative;
  background: var(--surface-2, #0d0d15);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem 1rem;
  overflow-x: auto;
}
.md-pre code {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--accent);
  white-space: pre;
}
.md-figure { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.md-figure img { width: 100%; display: block; }
.md-figure figcaption { font-size: .76rem; color: var(--muted-2); padding: .45rem .8rem; background: var(--bg-alt); }

/* ============================================================================
 * WRITEUPS — estilo GitHub Pages / Chirpy (writeups.html)
 * ========================================================================== */
.wp-shell { padding-top: 1.6rem; }
.wp-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "avatar info social" "nav nav nav";
  gap: .4rem 1.2rem;
  align-items: center;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.4rem;
}
@media (max-width: 640px) {
  .wp-top { grid-template-columns: auto 1fr; grid-template-areas: "avatar info" "social social" "nav nav"; }
}
.wp-avatar {
  grid-area: avatar;
  width: 62px; height: 62px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-strong);
  background: var(--accent-soft);
  display: grid;
  place-items: center;
}
.wp-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wp-avatar-fallback { display: none; font-family: var(--font-mono); font-size: 1.6rem; color: var(--accent); font-weight: 700; }
.wp-avatar.no-img .wp-avatar-fallback { display: block; }
.wp-site-title {
  grid-area: info;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-strong);
  line-height: 1.2;
}
.wp-site-title::after { content: "™"; font-size: .6em; color: var(--accent); vertical-align: super; }
.wp-tagline { grid-area: info; color: var(--muted); font-size: .88rem; margin-top: .15rem; }
.wp-social { grid-area: social; display: flex; gap: .7rem; justify-content: flex-end; }
.wp-social a {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--muted);
  border: 1px solid var(--border);
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
  text-decoration: none;
  font-size: .92rem;
}
.wp-social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.wp-nav {
  grid-area: nav;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.1rem;
  padding-top: .6rem;
  margin-top: .3rem;
  border-top: 1px dashed var(--border);
}
.wp-nav a {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .1em;
  color: var(--muted-2);
  text-decoration: none;
  text-transform: uppercase;
  padding: .2rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.wp-nav a:hover, .wp-nav a.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* Toolbar: pills de categoría + contador (estilo CATEGORIES/TAGS del blog) */
.wp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-bottom: 1.3rem; }
.wp-live { display: flex; align-items: center; gap: .55rem; margin-left: auto; }
.wp-live-status { font-family: var(--font-mono); font-size: .76rem; color: var(--muted-2); }
.wp-refresh {
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--accent);
  cursor: pointer;
  font-size: .8rem;
  padding: .3rem .5rem;
  border-radius: 6px;
  transition: color .2s, border-color .2s;
}
.wp-refresh:hover { color: var(--accent-2); border-color: var(--accent-2); }
.wp-pills { display: flex; flex-wrap: wrap; gap: .45rem; }
.wp-pill {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: .3rem .85rem;
  background: var(--bg-alt);
  cursor: pointer;
  transition: all var(--transition);
}
.wp-pill:hover { color: var(--accent); border-color: var(--accent); }
.wp-pill.is-active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.wp-layout {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 960px) { .wp-layout { grid-template-columns: 1fr 300px; } }

/* Posts */
.wp-posts { display: flex; flex-direction: column; gap: 1.3rem; }
.wp-post {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-alt);
  transition: border-color var(--transition), transform var(--transition);
}
.wp-post:hover { border-color: var(--accent); transform: translateY(-2px); }
.wp-banner-wrap { position: relative; aspect-ratio: 21 / 9; background: linear-gradient(135deg, var(--c1, #0e2a26), var(--c2, #0b1230)); display: grid; place-items: center; }
.wp-banner-wrap::after {
  content: "\f126"; /* fa-microchip */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 2rem;
  color: var(--accent);
  opacity: .5;
}
.wp-banner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wp-banner-wrap.no-banner { display: grid; }
.wp-post-body { padding: 1.1rem 1.3rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; }
.wp-date { font-family: var(--font-mono); font-size: .74rem; color: var(--muted-2); }
.wp-title { font-size: 1.15rem; font-weight: 700; color: var(--text-strong); line-height: 1.35; }
.wp-post:hover .wp-title { color: var(--accent); }
.wp-excerpt { font-size: .9rem; color: var(--muted); line-height: 1.6; }
.wp-post-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.wp-post-body .btn { align-self: flex-start; margin-top: .3rem; }

/* Sidebar */
.wp-sidebar { display: flex; flex-direction: column; gap: 1.2rem; position: sticky; top: 90px; }
@media (max-width: 959px) { .wp-sidebar { position: static; } }
.wp-box { padding: 1.1rem 1.2rem; }
.wp-box h3 {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-family: var(--font-mono);
  margin-bottom: .8rem;
}
.wp-recent { display: flex; flex-direction: column; gap: .55rem; }
.wp-recent a {
  color: var(--text);
  font-size: .85rem;
  line-height: 1.45;
  text-decoration: none;
  border-left: 2px solid var(--border);
  padding-left: .65rem;
  transition: color var(--transition), border-color var(--transition);
}
.wp-recent a:hover { color: var(--accent); border-left-color: var(--accent); }
.wp-tagcloud { display: flex; flex-wrap: wrap; gap: .45rem; }
.wp-tag {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .22rem .65rem;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
}
.wp-tag sup { color: var(--accent-2); margin-left: .15rem; }
.wp-tag:hover, .wp-tag.is-active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.wp-links { display: flex; flex-direction: column; gap: .55rem; }
.wp-links a { color: var(--muted); font-size: .86rem; text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.wp-links a:hover { color: var(--accent); }
.wp-links i { width: 18px; text-align: center; color: var(--accent-2); }

/* ============================================================================
 * HABILIDADES � lista t�cnica (tech-list) + historia STAR (soft-story)
 * ========================================================================== */
.tech-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tech-item {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  padding: 1.2rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--transition), transform var(--transition);
}
.tech-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.tech-num {
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: .18rem .4rem;
  line-height: 1.2;
  flex: none;
}
.tech-body { display: flex; flex-direction: column; gap: .25rem; }
.tech-body strong { color: var(--text-strong); font-size: .98rem; }
.tech-text { color: var(--muted); font-size: .89rem; line-height: 1.6; }

.soft-intro { max-width: 640px; margin-bottom: 1.2rem; font-size: .95rem; }
.star-steps { display: grid; gap: .9rem; margin-bottom: 1.4rem; }
.star-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.star-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--accent);
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--accent-soft);
  border-radius: 6px;
  padding: .25rem .5rem;
  flex: none;
  margin-top: .1rem;
}
.star-body p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.soft-tags { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ============================================================================
 * CV � preview iframe + descarga (APP_CONFIG.cv)
 * ========================================================================== */
#cv-panel { display: flex; flex-direction: column; gap: 1rem; margin-top: .4rem; }
.cv-preview {
  position: relative;
  height: 420px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.cv-preview iframe { width: 100%; height: 100%; border: 0; display: block; }
.cv-preview.is-empty { background: var(--surface); }
.cv-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}
.cv-empty i { font-size: 2.2rem; color: var(--accent-2); }
.cv-empty p { font-size: .88rem; max-width: 320px; margin: 0; }
.cv-empty code { font-size: .78rem; }
.cv-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.cv-actions .btn { text-decoration: none; }

/* ============================================================================
 * TIMELINE RICA (experiencia) � subt�tulos de secci�n + vi�etas
 * ========================================================================== */
.exp-rich { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; gap: .4rem; }
.exp-subhead {
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: .8rem;
  padding-top: .8rem;
  border-top: 1px dashed var(--border);
}
.exp-subhead:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.exp-bullet { position: relative; padding-left: 1.15rem; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.exp-bullet::before {
  content: "�";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
}
.edu-group-title { display: flex; align-items: center; gap: .45rem; }
.edu-group-title i { color: var(--accent); }
.muted.tiny { font-size: .78rem; }
.text-link { color: var(--accent); text-decoration: underline dotted; }
.text-link:hover { color: var(--accent-2); }

/* ---------- Proyectos del CV (timeline, proyectos.html) ---------- */
.project-tl-item { position: relative; padding-left: 1.2rem; margin-bottom: 0; }
.project-tl-item::before {
  content: attr(data-idx);
  position: absolute; left: 0; top: .35rem;
  font-family: var(--font-mono); font-size: .68rem; font-weight: 700;
  color: var(--accent);
}
.project-tl-item + .project-tl-item { border-top: 1px dashed var(--border); padding-top: 1.4rem; }
.project-tl-item h4 { color: var(--text-strong); font-size: 1.02rem; margin-bottom: .15rem; }
.project-tl-item .tag { font-family: var(--font-mono); font-size: .68rem; color: var(--accent-2); }
.project-tl-item .text-link { display: inline-block; margin-top: .5rem; }
@media (max-width: 639px) { .project-tl-item { padding-left: 0; } .project-tl-item::before { display: none; } }
