/* =============================================
   PORTFOLIO v8.0 - CYBERSEC PROFESSIONAL
   Alejandro Orcajada - Junior SysAdmin & Ciberseguridad
   ============================================= */

/* --- VARIABLES --- */
:root {
  --bg-deepest: #050508;
  --bg-deep: #0a0a0f;
  --bg: #0d0d14;
  --bg-elevated: #12121a;
  --bg-card: #16161f;
  --bg-hover: #1a1a24;
  
  --accent: #00ffaa;
  --accent-dim: rgba(0, 255, 170, 0.15);
  --accent-glow: rgba(0, 255, 170, 0.4);
  
  --cyan: #00d4ff;
  --orange: #ff9f1a;
  --red: #ff5555;
  --green: #00ffaa;
  --purple: #bd93f9;
  
  --text-primary: #f8f8f2;
  --text-secondary: #a0a0b0;
  --text-muted: #6272a4;
  
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;
  
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 0.3s var(--ease-out);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) var(--bg-deep);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg-deep); }
a { color: inherit; text-decoration: none; }

/* --- BACKGROUND EFFECTS --- */
.noise {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: 
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, black 70%, transparent 100%);
}

.spotlight {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 2;
  transition: background 0.4s ease;
}

/* --- LAYOUT --- */
.layout {
  display: flex;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 64px;
  position: relative;
  z-index: 10;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 400px;
  flex-shrink: 0;
  padding: 64px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Avatar */
.avatar-container { margin-bottom: 32px; }

.avatar {
  position: relative;
  width: 80px;
  height: 80px;
}

.avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--cyan), var(--purple), var(--accent));
  animation: spin 8s linear infinite;
  opacity: 0.7;
}

@keyframes spin { to { transform: rotate(360deg); } }

.avatar-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-elevated);
}

.avatar-icon {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px;
}

.avatar-status {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-ping {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
  box-shadow: 0 0 12px var(--green);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* Identity */
.identity { margin-bottom: 32px; }

.name {
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 12px;
}

.name-line { display: block; color: var(--text-primary); }
.name-line.accent { color: var(--accent); }

.role-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.role-bracket {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
}

.role {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--cyan);
  display: flex;
  align-items: center;
}

.cursor {
  animation: blink 1s infinite;
  color: var(--accent);
  margin-left: 2px;
}

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

.tagline {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Terminal Widget */
.terminal-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 32px;
  transition: var(--transition);
}

.terminal-widget:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 40px rgba(0, 255, 170, 0.05);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-hover);
}

.terminal-dots span:first-child { background: var(--red); }
.terminal-dots span:nth-child(2) { background: var(--orange); }
.terminal-dots span:last-child { background: var(--green); }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.terminal-body {
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.terminal-line {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.prompt { color: var(--accent); }
.command { color: var(--text-primary); }

.terminal-output {
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 16px;
}

.terminal-output.success {
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-output.success i { font-size: 8px; animation: pulse 2s infinite; }

/* Navigation */
.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: var(--transition);
  position: relative;
}

.nav-number {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.5;
  transition: var(--transition);
}

.nav-indicator {
  width: 24px;
  height: 2px;
  background: var(--border-hover);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover .nav-number,
.nav-link.active .nav-number {
  color: var(--accent);
  opacity: 1;
}

.nav-link:hover .nav-indicator,
.nav-link.active .nav-indicator {
  width: 48px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Social Links */
.social-links {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 20px;
}

.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 16px;
  transition: var(--transition);
  position: relative;
}

.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 255, 170, 0.15);
}

/* Location Badge */
.location-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-muted);
  width: fit-content;
}

.location-badge i { color: var(--accent); font-size: 10px; }

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
  flex: 1;
  padding: 64px 0 64px 80px;
  min-width: 0;
}

.section {
  margin-bottom: 120px;
  scroll-margin-top: 64px;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-hover), transparent);
}

.section-intro {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 40px;
}

/* =============================================
   ABOUT SECTION
   ============================================= */
.about-content {
  margin-bottom: 48px;
}

.about-content p {
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.about-lead {
  font-size: 18px !important;
  color: var(--text-primary) !important;
}

.highlight {
  color: var(--text-primary);
  font-weight: 500;
}

.highlight-box {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 56px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
  opacity: 0;
  transform: translateY(20px);
}

.stat-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 255, 170, 0.1);
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Formation Section */
.formation-section { margin-top: 48px; }

.subsection-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 24px;
}

.subsection-title i { color: var(--accent); font-size: 14px; }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 28px;
  margin-bottom: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--purple));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 32px;
  opacity: 0;
  transform: translateX(-20px);
}

.timeline-item.animate-in {
  opacity: 1;
  transform: translateX(0);
  transition: all 0.5s var(--ease-out);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -32px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}

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

.timeline-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-org {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.timeline-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

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

.timeline-tags span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: 100px;
}

/* Certs Section */
.certs-section {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cert-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.cert-badge:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.cert-badge i { color: var(--accent); font-size: 14px; }

/* =============================================
   BENTO GRID - ESPECIALIDADES
   ============================================= */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: auto auto auto;
  gap: 16px;
}

.bento-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s var(--ease-out);
  opacity: 0;
  transform: translateY(30px);
}

.bento-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.bento-card[data-color="cyan"]::before { background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), transparent 60%); }
.bento-card[data-color="orange"]::before { background: linear-gradient(135deg, rgba(255, 159, 26, 0.1), transparent 60%); }
.bento-card[data-color="red"]::before { background: linear-gradient(135deg, rgba(255, 85, 85, 0.1), transparent 60%); }
.bento-card[data-color="green"]::before { background: linear-gradient(135deg, rgba(0, 255, 170, 0.1), transparent 60%); }
.bento-card[data-color="purple"]::before { background: linear-gradient(135deg, rgba(189, 147, 249, 0.1), transparent 60%); }

.bento-card:hover::before { opacity: 1; }

.bento-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.bento-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.bento-card[data-color="cyan"] .bento-glow { background: radial-gradient(circle at center, rgba(0, 212, 255, 0.15), transparent 40%); }
.bento-card[data-color="orange"] .bento-glow { background: radial-gradient(circle at center, rgba(255, 159, 26, 0.15), transparent 40%); }
.bento-card[data-color="red"] .bento-glow { background: radial-gradient(circle at center, rgba(255, 85, 85, 0.15), transparent 40%); }
.bento-card[data-color="green"] .bento-glow { background: radial-gradient(circle at center, rgba(0, 255, 170, 0.15), transparent 40%); }
.bento-card[data-color="purple"] .bento-glow { background: radial-gradient(circle at center, rgba(189, 147, 249, 0.15), transparent 40%); }

.bento-card:hover .bento-glow { opacity: 1; }

/* Bento Sizes */
.bento-large {
  grid-column: span 2;
  padding: 32px;
}

.bento-medium {
  padding: 24px;
}

.bento-small {
  padding: 20px;
}

.bento-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Bento Icon */
.bento-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
}

.bento-icon svg {
  width: 100%;
  height: 100%;
}

.bento-card[data-color="cyan"] .bento-icon { color: var(--cyan); }
.bento-card[data-color="orange"] .bento-icon { color: var(--orange); }
.bento-card[data-color="red"] .bento-icon { color: var(--red); }
.bento-card[data-color="green"] .bento-icon { color: var(--green); }
.bento-card[data-color="purple"] .bento-icon { color: var(--purple); }

.bento-icon-small {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 16px;
}

.bento-card[data-color="green"] .bento-icon-small { color: var(--green); }
.bento-card[data-color="purple"] .bento-icon-small { color: var(--purple); }

/* Bento Text */
.bento-text { margin-bottom: 16px; }

.bento-text h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.bento-card:hover .bento-text h3 { color: var(--accent); }

.bento-text p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.bento-small h4 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.bento-mini-stat {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* Bento Stats */
.bento-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.bento-stats strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Bento Tags */
.bento-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  margin-bottom: 16px;
}

.bento-tags span {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.bento-card:hover .bento-tags span {
  border-color: var(--border-hover);
}

/* Bento Arrow */
.bento-arrow {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  transition: var(--transition);
}

.bento-card:hover .bento-arrow {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-deep);
  transform: translate(4px, -4px);
}

.bento-small .bento-arrow { display: none; }

/* =============================================
   METHODOLOGY
   ============================================= */
.method-container {
  margin-bottom: 48px;
}

.method-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.method-step {
  position: relative;
  opacity: 0;
  transform: translateY(20px);
}

.method-step.animate-in {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.5s var(--ease-out);
}

.step-connector {
  position: absolute;
  top: 32px;
  left: 100%;
  width: 16px;
  height: 2px;
  background: var(--border-hover);
}

.method-step:last-child .step-connector { display: none; }

.step-number {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  color: var(--bg-hover);
  line-height: 1;
  margin-bottom: 16px;
  transition: color 0.3s ease;
}

.method-step:hover .step-number { color: var(--accent-dim); }

.step-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}

.method-step:hover .step-content {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 255, 170, 0.1);
}

.step-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 16px;
  margin-bottom: 16px;
}

.step-content h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.step-content p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Method Quote */
.method-quote {
  position: relative;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
}

.quote-mark {
  font-family: Georgia, serif;
  font-size: 64px;
  color: var(--accent);
  opacity: 0.3;
  line-height: 1;
  position: absolute;
  top: 16px;
  left: 24px;
}

.method-quote p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-style: italic;
  padding-left: 40px;
}

/* =============================================
   BLOG SECTION
   ============================================= */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.blog-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.4s var(--ease-out);
  opacity: 0;
  transform: translateY(20px);
}

.blog-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.blog-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.blog-card.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
}

.blog-card.featured::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.05), transparent 60%);
  pointer-events: none;
}

.blog-card-inner {
  position: relative;
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  background: var(--accent);
  color: var(--bg-deep);
  border-radius: 100px;
}

.blog-year {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 12px;
}

.blog-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.blog-card:hover .blog-title { color: var(--accent); }

.blog-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.blog-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.blog-meta i { margin-right: 4px; color: var(--text-muted); }

.blog-arrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.blog-card:hover .blog-arrow {
  color: var(--accent);
}

.blog-arrow i {
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-arrow i {
  transform: translateX(4px);
}

/* View All Link */
.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 12px 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.view-all-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.view-all-link i { transition: transform 0.3s ease; }
.view-all-link:hover i { transform: translateX(4px); }

/* =============================================
   CONTACT SECTION
   ============================================= */
.contact-container {
  max-width: 560px;
}

.contact-content { margin-bottom: 32px; }

.contact-overline {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 16px;
}

.contact-heading {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.contact-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Contact Actions */
.contact-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.contact-btn.primary {
  background: var(--accent);
  color: var(--bg-deep);
}

.contact-btn.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px var(--accent-glow);
}

.contact-btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.contact-btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Contact Details */
.contact-details {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.contact-detail i { color: var(--accent); font-size: 12px; }
.contact-detail a { color: var(--text-muted); transition: color 0.3s ease; }
.contact-detail a:hover { color: var(--accent); }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  margin-top: 64px;
}

.footer-content { text-align: center; }

.footer-credit {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-tech {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.7;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 16px;
  transition: var(--transition);
}

.footer-links a:hover { color: var(--accent); }

/* =============================================
   PANEL MODAL
   ============================================= */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.panel-overlay.active { opacity: 1; visibility: visible; }

.panel-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 9999;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s var(--ease-out);
}

.panel-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.panel-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: 85vh;
  overflow-y: auto;
}

.panel-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
}

.panel-close:hover {
  background: rgba(255, 85, 85, 0.2);
  border-color: var(--red);
  color: var(--red);
  transform: rotate(90deg);
}

.panel-header {
  padding: 32px 24px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.panel-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-icon svg {
  width: 100%;
  height: 100%;
}

.panel-modal[data-color="cyan"] .panel-icon { color: var(--cyan); }
.panel-modal[data-color="orange"] .panel-icon { color: var(--orange); }
.panel-modal[data-color="red"] .panel-icon { color: var(--red); }

.panel-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.panel-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.panel-body { padding: 24px; }

.panel-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.panel-section { margin-bottom: 20px; }
.panel-section:last-child { margin-bottom: 0; }

.panel-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.panel-section-title i { color: var(--accent); font-size: 10px; }

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

.panel-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: 100px;
}

.panel-skills {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-skills li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.panel-skills li i { color: var(--green); font-size: 10px; margin-top: 4px; }

.panel-tools { display: flex; flex-wrap: wrap; gap: 8px; }

.panel-tool {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.panel-tool i { color: var(--accent); }
.panel-tool:hover { border-color: var(--accent); }

.panel-footer { padding: 16px 24px 24px; }

.panel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: var(--accent);
  color: var(--bg-deep);
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.panel-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.panel-btn i { transition: transform 0.3s ease; }
.panel-btn:hover i { transform: translateX(4px); }

/* =============================================
   RESPONSIVE
   ============================================= */
/* =============================================
   ROLES - A QUÉ APUNTO
   ============================================= */
.roles-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.role-card {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 20px;
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.4s var(--ease-out);
  opacity: 0;
  transform: translateY(24px);
}

.role-card.animate-in { opacity: 1; transform: translateY(0); }

.role-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.role-card[data-color="red"]    .role-glow { background: linear-gradient(100deg, rgba(255,85,85,0.10), transparent 55%); }
.role-card[data-color="green"]  .role-glow { background: linear-gradient(100deg, rgba(0,255,170,0.10), transparent 55%); }
.role-card[data-color="cyan"]   .role-glow { background: linear-gradient(100deg, rgba(0,212,255,0.10), transparent 55%); }
.role-card[data-color="orange"] .role-glow { background: linear-gradient(100deg, rgba(255,159,26,0.10), transparent 55%); }
.role-card[data-color="purple"] .role-glow { background: linear-gradient(100deg, rgba(189,147,249,0.10), transparent 55%); }

.role-card:hover .role-glow { opacity: 1; }

.role-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(0,0,0,0.32);
}

.role-card[data-color="red"]:hover    { border-left-color: var(--red); }
.role-card[data-color="green"]:hover  { border-left-color: var(--green); }
.role-card[data-color="cyan"]:hover   { border-left-color: var(--cyan); }
.role-card[data-color="orange"]:hover { border-left-color: var(--orange); }
.role-card[data-color="purple"]:hover { border-left-color: var(--purple); }

.role-index {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding-top: 2px;
  min-width: 22px;
}

.role-icon {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 18px;
}

.role-card[data-color="red"]    .role-icon { color: var(--red); }
.role-card[data-color="green"]  .role-icon { color: var(--green); }
.role-card[data-color="cyan"]   .role-icon { color: var(--cyan); }
.role-card[data-color="orange"] .role-icon { color: var(--orange); }
.role-card[data-color="purple"] .role-icon { color: var(--purple); }

.role-body { position: relative; z-index: 1; flex: 1; }

.role-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.role-tier {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: 0.04em;
}

.role-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-tags span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  transition: var(--transition);
}

.role-card:hover .role-tags span {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

/* Mobile nav hidden on desktop */
.mnav-bar, .mnav-menu { display: none; }

@media (max-width: 1100px) {
  .layout { padding: 0 32px; }
  .main-content { padding-left: 48px; }
  .sidebar { width: 340px; }
  .method-track { grid-template-columns: repeat(2, 1fr); }
  .step-connector { display: none; }
}

@media (max-width: 900px) {
  html { scroll-padding-top: 72px; }

  .layout { flex-direction: column; padding: 72px 22px 0; }
  
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 24px 0;
  }
  .sidebar-content { height: auto; }
  
  .nav { display: none; }
  .terminal-widget { display: none; }
  
  .main-content { padding: 0 0 56px; }
  .section { margin-bottom: 72px; }
  
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-grid { grid-template-columns: 1fr; }
  .bento-large { grid-column: span 1; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-card.featured { grid-column: span 1; }
  .method-track { grid-template-columns: 1fr; }

  /* ---------- Barra superior móvil ---------- */
  .mnav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    padding: 0 16px 0 18px;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
  }
  .mnav-brand {
    display: flex; align-items: center; gap: 9px;
    font-family: var(--font-display);
    font-size: 14px; font-weight: 600;
    color: var(--text-primary);
  }
  .mnav-mono {
    font-family: var(--font-mono);
    font-size: 11px; font-weight: 700;
    color: var(--bg-deepest);
    background: var(--accent);
    padding: 3px 6px; border-radius: 5px;
  }
  .mnav-toggle {
    width: 44px; height: 44px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 5px;
    background: transparent; border: 0; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mnav-toggle span {
    width: 22px; height: 2px; border-radius: 2px;
    background: var(--text-primary);
    transition: transform .3s var(--ease-out), opacity .2s ease;
  }
  .mnav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mnav-toggle.open span:nth-child(2) { opacity: 0; }
  .mnav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ---------- Menú a pantalla completa ---------- */
  .mnav-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: fixed; inset: 0;
    z-index: 999;
    padding: 84px 28px 36px;
    overflow-y: auto;
    background: rgba(7, 7, 11, 0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0; visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .32s var(--ease-out), transform .32s var(--ease-out), visibility .32s;
  }
  .mnav-menu.open { opacity: 1; visibility: visible; transform: none; }
  .mnav-label {
    font-family: var(--font-mono);
    font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 18px;
  }
  .mnav-links { display: flex; flex-direction: column; }
  .mnav-links a {
    display: flex; align-items: baseline; gap: 16px;
    padding: 18px 0;
    font-family: var(--font-display);
    font-size: clamp(24px, 7vw, 30px); font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    transition: color .2s ease, padding-left .25s var(--ease-out);
  }
  .mnav-links a:active { color: var(--accent); padding-left: 8px; }
  .mnav-num {
    font-family: var(--font-mono);
    font-size: 13px; font-weight: 500;
    color: var(--accent);
    flex-shrink: 0;
  }
  .mnav-foot { display: flex; gap: 14px; margin-top: 30px; }
  .mnav-foot a {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 18px;
  }
  .mnav-foot a:active { color: var(--accent); border-color: var(--accent); }

  /* ---------- Ajustes de lectura ---------- */
  .avatar-container { margin-bottom: 22px; }
  .tagline { margin-top: 14px; }
  .social-links { margin-top: 22px; margin-bottom: 4px; }
  .about-content p { font-size: 16px; line-height: 1.75; }
  .about-lead { font-size: 17px !important; line-height: 1.6 !important; }
  .section-intro { font-size: 14.5px; margin-bottom: 26px; }
  .formation-section { margin-top: 36px; }
  .role-card { gap: 16px; }
  .role-desc { font-size: 13.5px; }
}

@media (max-width: 480px) {
  .layout { padding: 72px 16px 0; }
  .sidebar { padding: 20px 0; }
  .name { font-size: 32px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 16px; }
  .stat-number { font-size: 24px; }
  .contact-actions { flex-direction: column; }
  .contact-btn { width: 100%; justify-content: center; }
  .role-card { padding: 18px 16px; gap: 14px; }
  .role-index { display: none; }
  .section { margin-bottom: 60px; }
  .section-header { margin-bottom: 24px; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, .bento-card, .role-card, .blog-card, .timeline-item, .method-step, .stat-card {
    animation: none !important;
    transition: none !important;
  }
  
  .bento-card, .role-card, .blog-card, .timeline-item, .method-step, .stat-card {
    opacity: 1 !important;
    transform: none !important;
  }
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.subtitle {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 8px;
  margin-bottom: 16px;
}
/* =============================================
   MASONRY - ESPECIALIDADES
   ============================================= */
.masonry-row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.masonry-row:last-child {
  margin-bottom: 0;
}

.masonry-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  overflow: hidden;
  transition: all 0.4s var(--ease-out);
}

.masonry-large {
  flex: 1.5;
}

.masonry-small {
  flex: 1;
}

.masonry-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.masonry-card[data-color="red"]:hover { border-color: var(--red); }
.masonry-card[data-color="cyan"]:hover { border-color: var(--cyan); }
.masonry-card[data-color="green"]:hover { border-color: var(--green); }
.masonry-card[data-color="orange"]:hover { border-color: var(--orange); }

/* Glow */
.masonry-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.masonry-card[data-color="red"] .masonry-glow { background: linear-gradient(180deg, rgba(255, 85, 85, 0.12), transparent); }
.masonry-card[data-color="cyan"] .masonry-glow { background: linear-gradient(180deg, rgba(0, 212, 255, 0.12), transparent); }
.masonry-card[data-color="green"] .masonry-glow { background: linear-gradient(180deg, rgba(0, 255, 170, 0.12), transparent); }
.masonry-card[data-color="orange"] .masonry-glow { background: linear-gradient(180deg, rgba(255, 159, 26, 0.12), transparent); }

.masonry-card:hover .masonry-glow { opacity: 1; }

/* Content */
.masonry-content {
  position: relative;
  z-index: 1;
}

/* Icon */
.masonry-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 20px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.masonry-card[data-color="red"] .masonry-icon { color: var(--red); }
.masonry-card[data-color="cyan"] .masonry-icon { color: var(--cyan); }
.masonry-card[data-color="green"] .masonry-icon { color: var(--green); }
.masonry-card[data-color="orange"] .masonry-icon { color: var(--orange); }

.masonry-card:hover .masonry-icon {
  border-color: currentColor;
  transform: scale(1.05);
}

/* Title */
.masonry-card h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.masonry-card:hover h3 { color: var(--accent); }

/* Description */
.masonry-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

/* Responsive */
@media (max-width: 700px) {
  .masonry-row {
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
  }
  
  .masonry-large,
  .masonry-small {
    flex: 1;
  }
  
  .masonry-card {
    padding: 28px;
  }
  
  .masonry-card h3 {
    font-size: 17px;
  }
}
/* =============================================
   KNOWLEDGE BASE / BLOG EXPLORER
   ============================================= */

/* Stats row */
.kb-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.kb-stat {
  background: var(--bg-card);
  border: 1px solid var(--bg-elevated);
  border-radius: 10px;
  padding: 18px 12px;
  text-align: center;
  transition: border-color .25s, transform .25s;
}
.kb-stat:hover {
  border-color: rgba(0,255,170,.3);
  transform: translateY(-2px);
}
.kb-num {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 5px;
}
.kb-label {
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* Tabs */
.kb-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.kb-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--bg-card);
  border: 1px solid var(--bg-elevated);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.kb-tab i { font-size: .78rem; flex-shrink: 0; }
.kb-tab:hover { color: var(--text-primary); border-color: rgba(0,255,170,.2); }
.kb-tab.active {
  background: rgba(0,255,170,.08);
  border-color: var(--accent);
  color: var(--accent);
}
.kb-tab em {
  font-style: normal;
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  background: var(--bg-elevated);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 2px;
}
.kb-tab.active em {
  background: rgba(0,255,170,.12);
  color: var(--accent);
}

/* Panels */
.kb-panel { display: none; }
.kb-panel.active { display: block; }

/* Module accordion */
.kb-mod {
  border: 1px solid var(--bg-elevated);
  border-radius: 10px;
  margin-bottom: 6px;
  overflow: hidden;
  transition: border-color .2s;
}
.kb-mod:hover { border-color: rgba(0,255,170,.18); }
.kb-mod.open { border-color: rgba(0,255,170,.28); }

.kb-mod-hdr {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--bg-card);
  border: none;
  cursor: pointer;
  transition: background .18s;
  gap: 12px;
  text-align: left;
}
.kb-mod-hdr:hover,
.kb-mod.open .kb-mod-hdr { background: var(--bg-hover); }

.kb-mod-l {
  display: flex;
  align-items: center;
  gap: 13px;
  flex: 1;
  min-width: 0;
}
.kb-mod-l code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--accent);
  background: rgba(0,255,170,.1);
  border: 1px solid rgba(0,255,170,.2);
  padding: 4px 9px;
  border-radius: 5px;
  flex-shrink: 0;
}
.kb-mod-l strong {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.kb-mod-l span {
  display: block;
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.kb-mod-hdr > i {
  color: var(--text-muted);
  font-size: .72rem;
  transition: transform .25s, color .2s;
  flex-shrink: 0;
}
.kb-mod.open .kb-mod-hdr > i {
  transform: rotate(180deg);
  color: var(--accent);
}

/* Module body */
.kb-mod-body {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
  background: var(--bg-deep);
  margin: 0;
  padding: 0;
}
.kb-mod.open .kb-mod-body { max-height: 1000px; }

/* Entries */
.kb-mod-body li { border-bottom: 1px solid rgba(255,255,255,.04); }
.kb-mod-body li:last-child { border-bottom: none; }
.kb-mod-body a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 52px;
  text-decoration: none;
  transition: background .14s;
  position: relative;
}
.kb-mod-body a:hover { background: rgba(0,255,170,.04); }
.kb-mod-body a:hover s { color: var(--accent); }
.kb-mod-body a:hover span { color: var(--text-primary); }

/* misusing <s> as entry ID - no strikethrough, just styling hook */
.kb-mod-body s {
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  color: var(--text-muted);
  min-width: 32px;
  flex-shrink: 0;
  transition: color .14s;
}
.kb-mod-body span {
  flex: 1;
  font-size: .83rem;
  color: var(--text-secondary);
  transition: color .14s;
  min-width: 0;
}
.kb-mod-body em {
  font-style: normal;
  font-size: .64rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 640px) {
  .kb-stats { grid-template-columns: repeat(2, 1fr); }
  .kb-tab span { display: none; }
  .kb-mod-body a { padding-left: 16px; }
  .kb-mod-body em { display: none; }
}
