/* ==========================================================================
   Modern Tech Design System with Dark Mode, Mobile Drawer & Spotlight Search
   ========================================================================== */

/* --- Variables de Tema (Light Mode por Defecto con Alto Contraste) --- */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, 'Courier New', monospace;

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-card-elevated: #ffffff;
  --bg-dark: #0b0f19;
  --bg-header-gradient: linear-gradient(135deg, #090d16 0%, #0f172a 50%, #1e293b 100%);
  --bg-hero-glow: radial-gradient(circle at 50% 20%, rgba(56, 189, 248, 0.15), transparent 70%);
  
  /* Fuentes oscurecidas para máxima legibilidad en Light Mode */
  --text-primary: #090d16;
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --text-inverse: #f8fafc;
  
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-glow: rgba(2, 132, 199, 0.25);
  --cyan-accent: #0284c7;
  --indigo-accent: #6366f1;
  --green-accent: #16a34a;
  
  --border-subtle: #cbd5e1;
  --border-strong: #94a3b8;
  --border-dark: #1e293b;
  
  --code-bg: #e2e8f0;
  --code-color: #090d16;
  --pre-bg: #090d16;
  --pre-color: #f8fafc;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.09), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
}

/* --- Modo Oscuro (Dark Theme) --- */
[data-theme="dark"] {
  --bg-main: #0b0f19;
  --bg-card: #111827;
  --bg-card-hover: #1e293b;
  --bg-card-elevated: #1e293b;
  
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-inverse: #090d16;
  
  --primary: #38bdf8;
  --primary-hover: #7dd3fc;
  --primary-glow: rgba(56, 189, 248, 0.3);
  --cyan-accent: #38bdf8;
  --indigo-accent: #818cf8;
  --green-accent: #22c55e;
  
  --border-subtle: #1e293b;
  --border-strong: #334155;
  
  --code-bg: #1e293b;
  --code-color: #38bdf8;
  --pre-bg: #030712;
  --pre-color: #f1f5f9;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* --- Reset Base & Tipografía Robusta --- */
* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
  scroll-behavior: smooth;
}

body,
.site-body,
.site-main,
.bg-near-white {
  background-color: var(--bg-main) !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-sans) !important;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading) !important;
  letter-spacing: -0.02em;
  font-weight: 750;
  color: var(--text-primary) !important;
  word-break: break-word;
}

strong, b {
  color: var(--text-primary);
  font-weight: 700;
}

/* --- Barra de Progreso de Lectura (Top) --- */
.reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3.5px;
  background: transparent;
  z-index: 1000;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 50%, #818cf8 100%);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
  transition: width 0.08s ease-out;
}

/* --- Barra de Navegación Moderna & Responsive --- */
.modern-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 0;
  width: 100%;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #ffffff !important;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.18rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-icon {
  font-size: 1.3rem;
}

.brand-accent {
  color: #38bdf8;
  margin: 0 3px;
}

.nav-desktop-menu {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.nav-link {
  color: #cbd5e1 !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link-active {
  color: #ffffff !important;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Botón de Búsqueda (Ctrl+K) */
.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.4);
}

.search-kbd {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  color: #cbd5e1;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Botón de Modo Oscuro / Claro */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f1f5f9;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  transform: rotate(15deg);
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}
[data-theme="dark"] .theme-icon-sun {
  display: inline-block;
  color: #fbbf24;
}
:root:not([data-theme="dark"]) .theme-icon-sun {
  display: none;
}
:root:not([data-theme="dark"]) .theme-icon-moon {
  display: inline-block;
  color: #cbd5e1;
}

.nav-socials {
  display: flex;
  gap: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  padding-left: 10px;
}

.social-icon-btn {
  color: #94a3b8 !important;
  font-size: 1.05rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
}

.social-icon-btn:hover {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.15);
  transform: translateY(-2px);
}

/* --- Botón Hamburguesa & Menú Drawer Mobile --- */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 0;
  transition: all 0.25s ease;
  z-index: 102;
  flex-shrink: 0;
}

.mobile-menu-toggle:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
}

.hamburger-line {
  display: block;
  width: 18px;
  height: 2px;
  background-color: #f1f5f9;
  border-radius: 2px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, width 0.2s ease;
}

.mobile-menu-toggle.is-active .line-1 {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.is-active .line-2 {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-toggle.is-active .line-3 {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Drawer */
.mobile-drawer {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: rgba(11, 15, 25, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  z-index: 99;
}

.mobile-drawer.drawer-open {
  max-height: 520px;
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-content {
  padding: 16px 20px 24px;
}

.mobile-nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: #e2e8f0 !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}

.mobile-nav-link i {
  font-size: 1.15rem;
  color: #38bdf8;
  width: 22px;
  text-align: center;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: rgba(56, 189, 248, 0.15);
  color: #ffffff !important;
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateX(4px);
}

.mobile-link-active {
  background: rgba(56, 189, 248, 0.2) !important;
  color: #ffffff !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
}

.mobile-drawer-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-socials-label {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.mobile-socials-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mobile-social-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1 !important;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.mobile-social-chip:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8 !important;
}

.mobile-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-drawer-backdrop.backdrop-open {
  opacity: 1;
  pointer-events: auto;
}

body.mobile-menu-lock {
  overflow: hidden !important;
}

/* --- Header & Hero Section --- */
.modern-header {
  background: var(--bg-header-gradient);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.modern-header-home {
  padding-bottom: 70px;
  background: var(--bg-header-gradient), var(--bg-hero-glow);
}

.hero-container {
  max-width: 960px;
  margin: 45px auto 0;
  padding: 0 20px;
  text-align: center;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
  max-width: 100%;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  flex-shrink: 0;
}

.hero-title {
  font-size: clamp(1.85rem, 5.5vw, 3.1rem);
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff !important;
  margin: 0 0 20px 0;
  word-break: break-word;
}

.gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.4vw, 1.22rem);
  line-height: 1.65;
  color: #cbd5e1;
  max-width: 760px;
  margin: 0 auto 34px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.btn-primary-hero {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 28px;
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  transition: all 0.25s ease;
}

.btn-primary-hero:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
}

.btn-secondary-hero {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-secondary-hero:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.hero-topics {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topics-label {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
}

.topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  color: #cbd5e1 !important;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.topic-pill:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.4);
}

/* --- Features Grid (4 Pilares) --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1240px;
  margin: 35px auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  text-align: left;
}

.feature-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
}

.feature-title {
  font-size: 1.2rem;
  margin: 0 0 10px 0;
  color: var(--text-primary) !important;
}

.feature-desc {
  font-size: 0.96rem;
  color: var(--text-secondary) !important;
  line-height: 1.65;
  margin: 0;
}

/* --- Cards Grid & Modern Card --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.modern-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.modern-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.card-image-wrap {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #0b0f19;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.modern-card:hover .card-image {
  transform: scale(1.06);
}

.card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}

.card-title {
  font-size: 1.24rem;
  font-weight: 750;
  line-height: 1.4;
  margin: 0 0 10px 0;
  color: var(--text-primary) !important;
}

.card-title-link {
  color: inherit !important;
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-title-link:hover {
  color: var(--primary) !important;
}

.card-description {
  font-size: 0.95rem;
  color: var(--text-secondary) !important;
  line-height: 1.65;
  margin: 0 0 16px 0;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.tag-chip {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--code-bg);
  color: var(--text-secondary) !important;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all 0.2s ease;
}

.tag-chip:hover {
  border-color: var(--primary);
  color: var(--primary) !important;
}

.card-readmore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary) !important;
  text-decoration: none;
  margin-top: auto;
}

.card-readmore:hover {
  gap: 10px;
}

/* ==========================================================================
   Single Post Layout & Lectura Optimizada (Darker Crisp Fonts)
   ========================================================================== */
.single-post-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 20px 80px;
  box-sizing: border-box;
}

.single-post-header {
  max-width: 880px;
  margin: 0 auto 35px;
}

.post-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.breadcrumb-link {
  color: var(--text-muted) !important;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-link:hover {
  color: var(--primary) !important;
}

.breadcrumb-separator {
  color: var(--border-strong);
}

.breadcrumb-current {
  color: var(--text-secondary) !important;
  font-weight: 600;
  max-width: 380px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.single-post-title {
  font-size: clamp(1.75rem, 5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary) !important;
  margin: 0 0 16px 0;
  word-break: break-word;
}

.single-post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.single-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.single-post-featured-image-wrap {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-top: 24px;
}

.single-post-featured-image {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  display: block;
}

/* Layout 2 Columnas */
.single-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 40px;
  align-items: start;
}

.single-post-content {
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--text-secondary) !important;
  overflow-wrap: break-word;
}

.single-post-content h1,
.single-post-content h2,
.single-post-content h3,
.single-post-content h4 {
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  scroll-margin-top: 100px;
  color: var(--text-primary) !important;
  font-weight: 750;
  word-break: break-word;
}

.single-post-content p {
  margin: 0 0 1.5em 0;
  color: var(--text-secondary) !important;
  font-size: 1.12rem;
  line-height: 1.85;
  font-weight: 400;
}

.single-post-content li {
  margin-bottom: 10px;
  color: var(--text-secondary) !important;
  font-size: 1.08rem;
  line-height: 1.75;
}

.single-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 20px 0;
}

.single-post-content blockquote {
  border-left: 4px solid var(--primary);
  background: var(--code-bg);
  padding: 16px 22px;
  margin: 24px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-primary) !important;
  font-size: 1.05rem;
}

.single-post-content hr {
  border: 0;
  height: 1px;
  background: var(--border-subtle);
  margin: 36px 0;
}

/* Código & Pre */
pre {
  background: var(--pre-bg) !important;
  color: var(--pre-color) !important;
  border-radius: var(--radius-md);
  padding: 20px !important;
  overflow-x: auto;
  font-family: var(--font-mono) !important;
  font-size: 0.94rem;
  box-shadow: var(--shadow-md);
  margin: 24px 0;
  border: 1px solid var(--border-subtle);
  position: relative;
  max-width: 100%;
}

code {
  font-family: var(--font-mono) !important;
}

code:not(pre code) {
  background: var(--code-bg);
  color: var(--code-color) !important;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.88em;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  word-break: break-word;
}

/* Botón de Copiar Código */
.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.code-copy-btn.copied {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.4);
}

/* Barra Lateral Sticky (ToC) */
.single-post-sidebar {
  position: relative;
}

.sticky-sidebar-content {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.toc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary) !important;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.toc-nav ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.toc-nav ul ul {
  padding-left: 14px;
}

.toc-nav li {
  margin: 6px 0;
}

.toc-nav a {
  color: var(--text-muted) !important;
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.45;
  display: block;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

.toc-nav a:hover {
  color: var(--text-primary) !important;
  background: var(--code-bg);
}

.toc-nav a.toc-active {
  color: var(--primary) !important;
  font-weight: 750;
  background: rgba(2, 132, 199, 0.1);
  border-left-color: var(--primary);
}

.sidebar-actions-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-sidebar-action {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary) !important;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-sidebar-action:hover {
  border-color: var(--primary);
  color: var(--primary) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Spotlight Live Search Modal (Ctrl + K)
   ========================================================================== */
.search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px 40px;
}

.search-modal.search-modal-open {
  display: flex;
}

.search-modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-hover);
  width: 100%;
  max-width: 640px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: searchPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes searchPop {
  0% { opacity: 0; transform: scale(0.96) translateY(-10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.search-input-header {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.search-input-icon {
  color: var(--primary);
  font-size: 1.2rem;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 1.05rem;
  font-family: var(--font-sans);
  color: var(--text-primary) !important;
  outline: none;
}

.search-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.esc-badge {
  font-size: 0.72rem;
  background: var(--code-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.search-results-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
}

.search-placeholder, .search-loading, .search-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
  margin-bottom: 4px;
}

.search-result-item:hover, .search-result-selected {
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.search-result-icon {
  font-size: 1.3rem;
  color: var(--primary);
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary) !important;
  margin-bottom: 4px;
}

.search-result-desc {
  font-size: 0.86rem;
  color: var(--text-secondary) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.search-result-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-tag {
  font-size: 0.72rem;
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.search-highlight {
  background: rgba(56, 189, 248, 0.3);
  color: var(--text-primary);
  padding: 0 2px;
  border-radius: 2px;
}

.search-result-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-modal-footer {
  padding: 10px 16px;
  background: var(--code-bg);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.search-hint kbd {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 700;
}

/* ==========================================================================
   CV / About Page Interactive Components
   ========================================================================== */
.cv-page-container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 20px 20px 60px;
  box-sizing: border-box;
}

/* Profile Hero Card */
.profile-hero-card {
  display: flex;
  align-items: center;
  gap: 36px;
  background: var(--bg-card);
  padding: 36px 40px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  margin: 20px 0 35px;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.profile-hero-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.profile-avatar-wrap {
  position: relative;
  width: 155px;
  height: 155px;
  flex: 0 0 155px;
}

.profile-avatar-img {
  width: 155px !important;
  height: 155px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 4px solid var(--bg-card) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 3px rgba(56, 189, 248, 0.4) !important;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease !important;
  cursor: pointer;
  display: block;
}

.profile-avatar-img:hover,
.profile-hero-card:hover .profile-avatar-img {
  transform: scale(1.08) !important;
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.25), 0 0 0 4px var(--primary) !important;
}

.profile-pulse-dot {
  position: absolute;
  bottom: 8px;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #22c55e;
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3), 0 2px 6px rgba(0, 0, 0, 0.15);
  animation: pulse-dot 2.2s infinite;
  z-index: 2;
}

.profile-details {
  flex: 1;
}

.profile-name {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary) !important;
  margin: 0 0 8px 0;
}

.profile-role {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary) !important;
  margin: 0 0 6px 0;
  line-height: 1.4;
}

.profile-tagline {
  font-size: 0.95rem;
  color: var(--text-secondary) !important;
  margin: 0 0 16px 0;
  font-weight: 500;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Stats Counter Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 45px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.stat-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.stat-number {
  font-size: 2.4rem;
  font-weight: 800;
  font-family: var(--font-heading);
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.stat-label {
  font-weight: 750;
  font-size: 1.05rem;
  color: var(--text-primary) !important;
  margin-bottom: 4px;
}

.stat-sub {
  font-size: 0.85rem;
  color: var(--text-muted) !important;
}

/* Secciones del CV */
.cv-section {
  margin-bottom: 50px;
}

.cv-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-subtle);
}

.section-icon {
  font-size: 1.4rem;
  color: var(--primary);
}

.cv-section-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-primary) !important;
}

.cv-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  box-shadow: var(--shadow-sm);
}

.cv-lead-text {
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--text-primary) !important;
  margin-bottom: 14px;
}

.cv-text {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-secondary) !important;
  margin: 0;
}

/* Company Intro Card */
.company-intro-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 25px;
  box-shadow: var(--shadow-sm);
}

.company-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.company-name {
  font-size: 1.3rem;
  margin: 0 0 4px 0;
  color: var(--text-primary) !important;
}

.company-location {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.company-badge {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(2, 132, 199, 0.12);
  color: var(--primary);
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.company-summary {
  font-size: 0.96rem;
  color: var(--text-secondary) !important;
  margin: 0;
}

/* Career Timeline */
.career-timeline {
  position: relative;
  padding-left: 32px;
}

.career-timeline::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 14px;
  width: 3px;
  background: linear-gradient(180deg, #0284c7 0%, #38bdf8 50%, #818cf8 100%);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 26px;
}

.timeline-marker {
  position: absolute;
  left: -32px;
  top: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--primary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  z-index: 2;
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.timeline-content:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.timeline-title {
  font-size: 1.18rem;
  font-weight: 750;
  color: var(--text-primary) !important;
  margin: 0 0 2px 0;
}

.timeline-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.timeline-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(2, 132, 199, 0.12);
  color: var(--primary);
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.timeline-desc {
  font-size: 0.95rem;
  color: var(--text-secondary) !important;
  line-height: 1.68;
  margin: 0 0 14px 0;
}

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

.timeline-pill {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--code-bg);
  color: var(--text-secondary) !important;
  border: 1px solid var(--border-subtle);
}

/* Achievements Grid */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.achievement-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.achievement-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #ffffff;
  flex-shrink: 0;
}

.icon-cyan { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.icon-blue { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.icon-purple { background: linear-gradient(135deg, #7c3aed, #c084fc); }
.icon-green { background: linear-gradient(135deg, #16a34a, #4ade80); }

.achievement-body {
  flex: 1;
}

.achievement-title {
  font-size: 1.08rem;
  font-weight: 750;
  margin: 0 0 6px 0;
  color: var(--text-primary) !important;
}

.achievement-desc {
  font-size: 0.92rem;
  color: var(--text-secondary) !important;
  line-height: 1.62;
  margin: 0;
}

/* Stack Tecnológico (Matriz) */
.tech-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.tech-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.tech-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.tech-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.tech-box-header h4 {
  font-size: 1.02rem;
  margin: 0;
  color: var(--text-primary) !important;
}

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

.skill-pill {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  color: var(--text-primary) !important;
  border: 1px solid var(--border-subtle);
}

.text-cyan { color: #0284c7; }
.text-blue { color: #2563eb; }
.text-purple { color: #7c3aed; }
.text-green { color: #16a34a; }

[data-theme="dark"] .text-cyan { color: #38bdf8; }
[data-theme="dark"] .text-blue { color: #60a5fa; }
[data-theme="dark"] .text-purple { color: #c084fc; }
[data-theme="dark"] .text-green { color: #4ade80; }

/* Competencies Grid */
.competencies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.competency-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-primary) !important;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.competency-item i {
  color: var(--green-accent);
  font-size: 0.9rem;
}

.competency-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

/* Education Card */
.education-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
}

.education-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.education-title {
  font-size: 1.25rem;
  margin: 0 0 4px 0;
  color: var(--text-primary) !important;
}

.education-inst {
  font-size: 0.92rem;
  color: var(--text-secondary) !important;
}

.education-badge {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(34, 197, 94, 0.12);
  color: var(--green-accent);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Cursos Grid */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.course-card h4 {
  font-size: 1.08rem;
  margin: 0 0 14px 0;
  color: var(--text-primary) !important;
}

.course-card ul {
  padding-left: 18px;
  margin: 0;
}

.course-card li {
  font-size: 0.92rem;
  color: var(--text-secondary) !important;
  margin-bottom: 8px;
  line-height: 1.45;
}

/* Canales de Contacto Grid */
.contact-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.channel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.channel-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.channel-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #ffffff;
  flex-shrink: 0;
}

.icon-email { background: linear-gradient(135deg, #ea4335, #c5221f); }
.icon-linkedin { background: linear-gradient(135deg, #0a66c2, #004182); }
.icon-github { background: linear-gradient(135deg, #24292e, #0d1117); }
.icon-whatsapp { background: linear-gradient(135deg, #25d366, #128c7e); }

.channel-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.channel-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.channel-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Contact Form & Page Wrapper */
.about-page-wrapper,
.page-content-wrapper {
  max-width: 1060px;
  margin: 0 auto;
  padding: 20px 20px 60px;
  box-sizing: border-box;
}

.contact-card-wrapper {
  max-width: 600px;
  margin: 30px auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}

.modern-contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-primary) !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-label i {
  color: var(--primary);
}

.form-input {
  background: var(--code-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary) !important;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-card);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-submit-btn {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
  cursor: pointer;
  border: none;
}

/* --- Footer Moderno --- */
.modern-footer {
  background: #090d16;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 50px 20px 30px;
  margin-top: 80px;
  width: 100%;
  box-sizing: border-box;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
  max-width: 380px;
}

.footer-logo {
  color: #ffffff !important;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  display: block;
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 0.92rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

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

.footer-link {
  color: #cbd5e1 !important;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #38bdf8 !important;
}

.footer-socials {
  display: flex;
  gap: 12px;
}

.footer-social-btn {
  color: #cbd5e1 !important;
  font-size: 1.2rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-social-btn:hover {
  color: #ffffff !important;
  background: var(--primary);
  transform: translateY(-2px);
}

.footer-bottom {
  max-width: 1280px;
  margin: 25px auto 0;
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* ==========================================================================
   MEDIA QUERIES (Mobile & Tablet Responsiveness)
   ========================================================================== */

@media (max-width: 992px) {
  /* Ocultar links y redes en la barra superior */
  .nav-desktop-menu {
    display: none !important;
  }
  
  .nav-socials {
    display: none !important;
  }
  
  /* Mostrar botón hamburguesa */
  .mobile-menu-toggle {
    display: flex !important;
  }

  /* Ocultar texto 'Ctrl K' en el botón de búsqueda para ahorrar espacio */
  .search-kbd {
    display: none !important;
  }

  .search-trigger-btn {
    padding: 7px 10px;
  }

  /* Layout 1 Columna para artículos */
  .single-post-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .single-post-sidebar {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 14px;
  }

  .nav-brand {
    font-size: 1.05rem;
  }

  .hero-container {
    margin: 30px auto 0;
    padding: 0 14px;
  }

  .hero-subtitle {
    font-size: 1.02rem;
    margin-bottom: 26px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 30px;
    gap: 12px;
  }

  .btn-primary-hero,
  .btn-secondary-hero {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    padding: 0 14px;
    margin: 20px auto;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    padding: 0 14px;
    gap: 20px;
  }

  .profile-hero-card {
    flex-direction: column;
    text-align: center;
    padding: 24px 18px;
    gap: 20px;
  }

  .profile-details {
    text-align: center;
  }

  .profile-badges {
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-box {
    padding: 16px 12px;
  }

  .stat-number {
    font-size: 1.85rem;
  }

  .career-timeline {
    padding-left: 24px;
  }

  .timeline-marker {
    left: -24px;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  .timeline-content {
    padding: 16px 18px;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
  }

  .tech-matrix-grid {
    grid-template-columns: 1fr;
  }

  .competencies-grid {
    grid-template-columns: 1fr;
  }

  .courses-grid {
    grid-template-columns: 1fr;
  }

  .contact-channels-grid {
    grid-template-columns: 1fr;
  }

  .contact-card-wrapper {
    padding: 24px 18px;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
    align-items: center;
    padding: 0 14px 20px;
  }

  .footer-links {
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .nav-brand .brand-text {
    font-size: 0.95rem;
  }

  .nav-actions {
    gap: 6px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-badge {
    font-size: 0.76rem;
    padding: 4px 10px;
  }
}

@media (max-width: 600px) {
  .nav-container {
    padding: 0 8px;
    gap: 6px;
  }

  .nav-brand {
    font-size: 0.88rem;
    gap: 5px;
    min-width: 0;
    flex-shrink: 1;
  }

  .brand-icon {
    font-size: 1.1rem;
  }

  .nav-actions {
    gap: 6px;
  }

  .search-trigger-btn,
  .theme-toggle-btn,
  .mobile-menu-toggle {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
  }
}
