/* ==========================================================================
   PORTFOLIO DESIGN SYSTEM — Inspired by porfolio.dev (Midudev style)
   Autor: Adrián Burgos Tomé (reptilAndaluz)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Variable requerida para comprobación de aula */
  --anil: #6366f1;
  --anil-dark: #4f46e5;
  --anil-light: #818cf8;
  --anil-subtle: rgba(99, 102, 241, 0.15);
  --anil-glow: rgba(99, 102, 241, 0.35);

  /* Acentos */
  --emerald: #10b981;
  --emerald-subtle: rgba(16, 185, 129, 0.15);
  --cyan: #38bdf8;

  /* Superficies por defecto (Modo oscuro estilo porfolio.dev) */
  --bg-body: #030712;
  --bg-radial-1: rgba(99, 102, 241, 0.18);
  --bg-radial-2: rgba(3, 7, 18, 0);
  --bg-card: rgba(17, 24, 39, 0.65);
  --bg-card-hover: rgba(31, 41, 55, 0.75);
  --bg-pill: rgba(15, 23, 42, 0.85);
  --bg-mockup: #0f172a;
  --bg-conic-inner: #111827;
  --bg-dropdown: #0f172a;

  /* Bordes */
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(99, 102, 241, 0.4);

  /* Texto */
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --text-heading: #ffffff;
  --text-conic: #c7d2fe;

  /* Botones e interactivos */
  --btn-bg: rgba(255, 255, 255, 0.05);
  --btn-bg-hover: #ffffff;
  --btn-text-hover: #030712;
  --tag-bg: #0f172a;
  --tag-text: #e2e8f0;
  --timeline-border: rgba(255, 255, 255, 0.12);
  --shadow-mockup: 0 15px 35px -5px rgba(0, 0, 0, 0.6);
  --shadow-nav: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --banner-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
  --banner-border: rgba(99, 102, 241, 0.35);

  /* Tipografías */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;
}

/* ── Modo Claro con la paleta de colores de porfolio.dev (Midudev) ── */
[data-theme="light"] {
  /* Fondo porfolio.dev: gray-50 (#f9fafb) con halo radial amarillo/ámbar */
  --bg-body: #f9fafb;
  --bg-radial-1: rgba(251, 191, 36, 0.14);
  --bg-radial-2: rgba(255, 255, 255, 0.9);
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-pill: rgba(255, 255, 255, 0.85);
  --bg-mockup: #ffffff;
  --bg-conic-inner: #dcfce7;
  --bg-dropdown: rgba(255, 255, 255, 0.98);

  /* Bordes sutiles grises (Tailwind border-gray-100 / border-gray-200) */
  --border-subtle: #e5e7eb;
  --border-card: #f3f4f6;
  --border-hover: rgba(251, 191, 36, 0.4);

  /* Texto (porfolio.dev: text-black, text-gray-800, text-gray-600) */
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-dim: #9ca3af;
  --text-heading: #09090b;
  --text-conic: #166534;

  /* Botones estilo porfolio.dev: bg-gray-100 border-gray-300 text-gray-800 -> hover bg-gray-900 text-white */
  --btn-bg: #f3f4f6;
  --btn-border: #d1d5db;
  --btn-bg-hover: #111827;
  --btn-text-hover: #ffffff;
  --tag-bg: #f3f4f6;
  --tag-text: #374151;

  /* Línea y punto de la línea de tiempo (yellow-400 y border-black/20) */
  --timeline-border: rgba(0, 0, 0, 0.12);
  --timeline-dot: #f59e0b;
  --timeline-glow: rgba(251, 191, 36, 0.4);

  /* Sombras de porfolio.dev */
  --shadow-mockup: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-nav: 0 4px 15px -2px rgba(0, 0, 0, 0.06);

  /* Banner DWECL con reflejo ámbar */
  --banner-bg: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(255, 255, 255, 0.95) 100%);
  --banner-border: rgba(251, 191, 36, 0.35);

  /* Acento de porfolio.dev: amarillo/ámbar cálido */
  --accent-porfolio: #d97706;
  --accent-porfolio-hover: #b45309;
}

/* Reglas de componentes adaptadas fielmente a la paleta clara de porfolio.dev */
[data-theme="light"] .gradient-name {
  background: linear-gradient(135deg, #09090b 25%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero-description strong,
[data-theme="light"] .about-text-column strong {
  color: #d97706;
}

[data-theme="light"] .section-title-midu svg {
  color: #f59e0b;
}

[data-theme="light"] .accent-underline {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.7), transparent);
}

[data-theme="light"] .conic-animated-bg {
  background: conic-gradient(from 90deg at 50% 50%, #f59e0b 0%, #166534 50%, #f59e0b 100%);
}

[data-theme="light"] .timeline-dot {
  background: #f59e0b;
  box-shadow: 0 0 10px 2px rgba(251, 191, 36, 0.4);
}

[data-theme="light"] .timeline-role {
  color: #d97706;
}

[data-theme="light"] .timeline-link {
  color: #d97706;
}

[data-theme="light"] .timeline-link:hover {
  color: #b45309;
}

[data-theme="light"] .project-mockup-box {
  background: #ffffff;
  border-color: #e5e7eb;
}

[data-theme="light"] .project-card-midu:hover .project-mockup-box {
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 20px 60px -10px rgba(251, 191, 36, 0.2);
}

[data-theme="light"] .btn-project {
  border-color: #d1d5db;
}

[data-theme="light"] .btn-project-primary {
  background: #d97706;
  border-color: #f59e0b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

[data-theme="light"] .btn-project-primary:hover {
  background: #b45309;
}

[data-theme="light"] .nav-link:hover {
  color: #d97706;
  background: rgba(251, 191, 36, 0.12);
}

[data-theme="light"] .nav-link.active {
  color: #09090b;
  background: rgba(251, 191, 36, 0.2);
}

[data-theme="light"] .nav-link-special {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

[data-theme="light"] .nav-link-special:hover {
  background: #16a34a;
  color: #ffffff;
}

[data-theme="light"] .social-pill {
  border-color: #d1d5db;
}

[data-theme="light"] .social-pill-visor {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

[data-theme="light"] .social-pill-visor:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

[data-theme="light"] .theme-toggle-btn:hover {
  color: #d97706;
  background: rgba(251, 191, 36, 0.12);
}

[data-theme="light"] .theme-option-btn:hover {
  background: rgba(251, 191, 36, 0.12);
  color: #09090b;
}

[data-theme="light"] .theme-option-btn.active {
  background: rgba(251, 191, 36, 0.15);
  color: #d97706;
}

[data-theme="light"] .avatar-ambient-glow {
  background: rgba(251, 191, 36, 0.25);
}

[data-theme="light"] .avatar-img {
  border-color: #f59e0b;
}

[data-theme="light"] .about-photo-img {
  border-color: #e5e7eb;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.1), 0 0 20px rgba(251, 191, 36, 0.2);
}

[data-theme="light"] .unit-card,
[data-theme="light"] .exercise-card {
  background: #ffffff;
  border-color: #e5e7eb;
}

[data-theme="light"] .unit-card:hover,
[data-theme="light"] .exercise-card:hover {
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 10px 25px -5px rgba(251, 191, 36, 0.15);
}

[data-theme="light"] .unit-number,
[data-theme="light"] .exercise-num {
  color: #d97706;
  background: rgba(251, 191, 36, 0.15);
}

[data-theme="light"] .footer-links-row a:hover {
  color: #d97706;
}


/* ── Reset y base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 80% at 50% -20%, var(--bg-radial-1), var(--bg-radial-2)),
    radial-gradient(ellipse 60% 50% at 80% 60%, rgba(56, 189, 248, 0.05), transparent);
  background-attachment: fixed;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

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

/* ── Contenedor centralizado estilo porfolio.dev (max-w-4xl) ── */
.container {
  width: 100%;
  max-width: 896px; /* lg:max-w-4xl */
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Floating Pill Navbar (estilo porfolio.dev) ── */
.header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  z-index: 1000;
  pointer-events: none;
}

.header-nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-pill);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-nav);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.nav-link {
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--anil-light);
  background: var(--anil-subtle);
}

.nav-link.active {
  color: var(--text-heading);
  background: rgba(99, 102, 241, 0.25);
}

.nav-link-special {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 600;
}

.nav-link-special:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #fff;
}

/* ── Hero Section (estilo porfolio.dev) ── */
.hero-section {
  padding: 8rem 0 5rem 0;
}

.hero-avatar-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.avatar-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.avatar-ambient-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.4);
  filter: blur(18px);
  transform: scale(1.2);
}

.avatar-img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--anil-light);
}

/* Badge 'Disponible para trabajar' con rotación de gradiente cónico */
.status-badge-container {
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.status-badge-container:hover {
  transform: scale(1.05);
}

.conic-border-wrapper {
  position: relative;
  display: inline-flex;
  overflow: hidden;
  border-radius: 9999px;
  padding: 1px;
}

.conic-animated-bg {
  position: absolute;
  inset: -1000%;
  background: conic-gradient(from 90deg at 50% 50%, #818cf8 0%, #312e81 50%, #818cf8 100%);
  animation: spin 3s linear infinite;
}

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

.conic-inner-content {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: var(--bg-conic-inner);
  color: var(--text-conic);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 9999px;
  backdrop-filter: blur(12px);
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
  font-size: 2.85rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--text-heading);
  margin-bottom: 1.5rem;
}

.gradient-name {
  background: linear-gradient(135deg, #ffffff 40%, var(--anil-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 2rem;
}

.hero-description strong {
  color: var(--anil-light);
  font-weight: 600;
}

/* Botones / Pills de contacto y redes sociales */
.social-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--btn-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.social-pill svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.social-pill:hover {
  background: var(--btn-bg-hover);
  color: var(--btn-text-hover);
  border-color: var(--btn-bg-hover);
  transform: translateY(-2px);
}

.social-pill-visor {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}

.social-pill-visor:hover {
  background: var(--emerald);
  color: #fff;
  border-color: var(--emerald);
}

/* ── Encabezados de Sección con subrayado gradiente ── */
.section {
  padding: 5rem 0;
  scroll-margin-top: 5rem;
}

.section-title-midu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.025em;
}

.section-title-midu svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--anil-light);
  flex-shrink: 0;
}

.accent-underline {
  margin-top: 0.6rem;
  height: 1px;
  width: 5rem;
  background: linear-gradient(90deg, var(--anil), transparent);
}

/* ── Timeline de Formación / Experiencia (estilo porfolio.dev) ── */
.timeline-list {
  position: relative;
  list-style: none;
  margin-top: 3rem;
}

.timeline-item {
  position: relative;
  padding-left: 2.5rem;
  padding-bottom: 3.5rem;
  border-left: 2px solid var(--timeline-border);
}

.timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 1rem;
}

/* Punto indicador en la línea */
.timeline-dot {
  position: absolute;
  left: -7px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--anil-light);
  box-shadow: 0 0 10px 2px var(--anil-glow);
}

.timeline-dot.active::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.4);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.timeline-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .timeline-grid {
    grid-template-columns: 2fr 3fr;
    gap: 2rem;
  }
}

.timeline-role {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--anil-light);
}

.timeline-institution {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-top: 0.2rem;
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.timeline-desc {
  font-size: 0.96rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--anil-light);
}

.timeline-link:hover {
  color: #fff;
  transform: translateX(4px);
}

/* ── Proyectos Destacados (Tarjetas horizontales estilo porfolio.dev) ── */
.projects-column {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  margin-top: 3rem;
}

.project-card-midu {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  align-items: center;
}

@media (min-width: 768px) {
  .project-card-midu {
    flex-direction: row;
    gap: 2.5rem;
  }
}

.project-mockup-wrapper {
  width: 100%;
}

@media (min-width: 768px) {
  .project-mockup-wrapper {
    width: 50%;
  }
}

.project-mockup-box {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-mockup);
  box-shadow: var(--shadow-mockup);
  transition: all 0.4s ease;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
}

.project-card-midu:hover .project-mockup-box {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 20px 40px -10px var(--anil-glow);
}

.project-details-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 768px) {
  .project-details-box {
    width: 50%;
  }
}

.project-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

/* Tecnologías empleadas */
.tech-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem 0;
  list-style: none;
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--tag-bg);
  border: 1px solid var(--border-subtle);
  color: var(--tag-text);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
}

.project-summary {
  font-size: 0.96rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-project {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--btn-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.btn-project:hover {
  background: var(--btn-bg-hover);
  color: var(--btn-text-hover);
  border-color: var(--btn-bg-hover);
  transform: translateY(-2px);
}

.btn-project-primary {
  background: var(--anil);
  border-color: var(--anil-light);
  color: #fff;
  box-shadow: 0 4px 14px var(--anil-glow);
}

.btn-project-primary:hover {
  background: var(--anil-light);
  transform: translateY(-2px);
  color: #fff;
}

/* ── Banner Especial DWECL / Ejercicios de Repaso ── */
.dwecl-banner-card {
  margin-top: 4.5rem;
  background: var(--banner-bg);
  border: 1px solid var(--banner-border);
  border-radius: 1.25rem;
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-mockup);
}

@media (min-width: 768px) {
  .dwecl-banner-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.dwecl-banner-content h3 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.4rem;
}

.dwecl-banner-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 520px;
}

.dwecl-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ── Sección Sobre Mí (#sobre-mi) ── */
.about-content-layout {
  display: flex;
  flex-direction: column-reverse;
  gap: 2.5rem;
  align-items: center;
  margin-top: 3rem;
}

@media (min-width: 768px) {
  .about-content-layout {
    flex-direction: row;
    gap: 3.5rem;
  }
}

.about-text-column {
  flex: 1;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.about-text-column p {
  margin-bottom: 1.25rem;
}

.about-text-column strong {
  color: var(--anil-light);
  font-weight: 600;
}

.about-photo-wrapper {
  position: relative;
  flex-shrink: 0;
}

.about-photo-img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 1.25rem;
  transform: rotate(3deg);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6), 0 0 20px var(--anil-glow);
  transition: transform 0.3s ease;
}

.about-photo-img:hover {
  transform: rotate(0deg) scale(1.03);
}

/* ── Componentes de Unidades y Ejercicios DWECL ── */
.units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.unit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.75rem;
  transition: all 0.25s ease;
}

.unit-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px var(--anil-glow);
}

.unit-card.active {
  border-color: rgba(99, 102, 241, 0.4);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, var(--bg-card) 100%);
}

.unit-number {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--anil-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.unit-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.6rem;
}

.unit-items {
  list-style: none;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.unit-items li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.unit-items li::before {
  content: "•";
  color: var(--emerald);
  font-size: 1.1rem;
  line-height: 1;
}

/* Rejilla y tarjetas de Ejercicios de Repaso */
.exercises-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.85rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.exercise-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.5);
}

.exercise-top {
  margin-bottom: 1rem;
}

.exercise-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.exercise-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--anil-light);
  font-weight: 700;
  background: var(--anil-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
}

.exercise-cat {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.exercise-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
  line-height: 1.35;
}

.exercise-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.exercise-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

/* ── Footer ── */
.footer-midu {
  margin-top: 4rem;
  margin-bottom: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .footer-midu {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-links-row {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links-row a:hover {
  color: var(--anil-light);
  text-decoration: underline;
}

/* ── Selector de Tema (Pill Dropdown estilo porfolio.dev) ── */
.theme-dropdown-container {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 0.2rem;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.38rem 0.6rem;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.theme-toggle-btn:hover {
  color: var(--anil-light);
  background: var(--anil-subtle);
  border-color: var(--border-subtle);
}

.theme-toggle-btn svg {
  display: block;
  flex-shrink: 0;
}

.theme-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 140px;
  background: var(--bg-dropdown);
  border: 1px solid var(--border-subtle);
  border-radius: 0.85rem;
  padding: 0.35rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 1010;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.theme-dropdown-menu.hidden {
  display: none !important;
}

.theme-option-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.55rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.theme-option-btn:hover {
  background: var(--anil-subtle);
  color: var(--text-primary);
}

.theme-option-btn.active {
  background: var(--anil-subtle);
  color: var(--anil-light);
  font-weight: 600;
}

.theme-option-btn svg {
  flex-shrink: 0;
}

/* ── Funciones de Accesibilidad ── */

/* Skip Link para usuarios de teclado */
.skip-link {
  position: absolute;
  top: -120px;
  left: 1.5rem;
  background: var(--anil-dark);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.92rem;
  z-index: 99999;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  transition: top 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.skip-link:focus {
  top: 1.5rem;
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

/* Utilidad para lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Anillo de foco accesible universal para navegación con teclado */
:focus-visible {
  outline: 2px solid var(--anil-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Respeto a preferencia de movimiento reducido (WCAG 2.1) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .conic-animated-bg,
  .pulse-dot,
  .timeline-dot.active::before {
    animation: none !important;
  }
}
