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

:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #151921;
  --bg-tertiary: #1f2430;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: rgba(0, 0, 0, 0.3);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============================================
   NAVEGACIÓN
   ============================================ */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(10, 14, 20, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

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

.nav-links li {
  margin: 0;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: 0.3s;
  display: block;
}

/* ============================================
   SECCIÓN HERO
   ============================================ */
.hero {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 2rem 4rem;
  position: relative;
}

.hero-content {
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text h1 {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.1;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text .subtitle {
  font-size: 1.75rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.hero-text p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 500px;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.875rem 1.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(88, 166, 255, 0.3);
  color: #000;
}

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

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
}

.hero-visual {
  position: relative;
}

.code-window {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px var(--shadow);
}

.window-header {
  background: var(--bg-tertiary);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.window-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red {
  background: #ff5f56;
}

.dot-yellow {
  background: #ffbd2e;
}

.dot-green {
  background: #27c93f;
}

.code-block {
  padding: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
}

.code-line {
  margin: 0.5rem 0;
  opacity: 0;
  animation: fadeIn 0.9s forwards;
  color: var(--text-primary);
}

.code-line:nth-child(1) {
  animation-delay: 0.2s;
}

.code-line:nth-child(2) {
  animation-delay: 0.4s;
}

.code-line:nth-child(3) {
  animation-delay: 0.6s;
}

.code-line:nth-child(4) {
  animation-delay: 0.8s;
}

.code-line:nth-child(5) {
  animation-delay: 1s;
}

.code-line:nth-child(6) {
  animation-delay: 1.2s;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.keyword {
  color: #ff7b72;
}

.function {
  color: #d2a8ff;
}

.string {
  color: #a5d6ff;
}

/* ============================================
   SECCIONES GENERALES
   ============================================ */
section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 2.75rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 700;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.25rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================
   SECCIÓN SOBRE MÍ
   ============================================ */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text h3 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
  font-weight: 600;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
  font-size: 1.05rem;
}

/* ============================================
   SECCIÓN HABILIDADES — rediseño
   ============================================ */

/* Título de sección */
.skills-title {
  text-align: center;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 48px;
  color: var(--text-primary);
}

/* Contenedor de tabs */
.skills-tabs {
  max-width: 900px;
  margin: 0 auto;
}

/* Botones de tab */
.tab-btns {
  display: flex;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 5px;
  width: fit-content;
  margin: 0 auto 40px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 28px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
  font-family: inherit;
  letter-spacing: 0.3px;
}

.tab-btn .tab-icon {
  font-size: 8px;
  opacity: 0;
  transition: opacity 0.25s ease;
  color: var(--accent);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(88, 166, 255, 0.08);
}

.tab-btn.active {
  background: var(--accent);
  color: #000;
  transform: none;
}

.tab-btn.active .tab-icon {
  opacity: 1;
  color: #000;
}

/* Paneles */
.tab-panel {
  display: none;
  animation: fadeUp 0.35s ease;
}
.tab-panel.active {
  display: block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Grid de cards */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* Card individual */
.skill-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

/* Línea de acento superior que aparece al hover */
.skill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--ic, #58a6ff);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--ic, #58a6ff) 40%, transparent);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}

/* Necesitamos --ic en el card para el ::before */
/* Tómalo del primer hijo que lo tiene y pásalo al padre en JS,
   o define un fallback por nombre de clase si prefieres. */

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

/* Fila superior: ícono + nombre + porcentaje */
.skill-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

/* Caja del ícono */
.skill-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ic, #58a6ff) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--ic, #58a6ff) 25%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--ic, #58a6ff);
  flex-shrink: 0;
  transition: transform 0.3s ease, background 0.3s ease;
}

.skill-card:hover .skill-icon-wrap {
  transform: scale(1.08) rotate(4deg);
  background: color-mix(in srgb, var(--ic, #58a6ff) 20%, transparent);
}

/* Nombre y porcentaje */
.skill-meta {
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.skill-meta h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.3px;
}

.skill-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--ic, #58a6ff);
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
}

/* Descripción */
.skill-card p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 16px;
}

/* Barra de progreso */
.skill-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0;                           /* empieza en 0 */
  background: var(--ic, #58a6ff);
  border-radius: 100px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estado animado — se agrega con JS al entrar en viewport */
.skill-fill.animated {
  width: var(--pct, 0%);
}

/* Responsive */
@media (max-width: 600px) {
  .skills-grid { grid-template-columns: 1fr; }
  .tab-btn { padding: 9px 18px; font-size: 13px; }
}
/* ============================================
   SECCIÓN PROYECTOS
   ============================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 16px 40px var(--shadow);
}

.project-card h3 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tech-tag {
  background: var(--bg-tertiary);
  color: var(--accent);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  font-weight: 500;
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  flex-grow: 1;
  line-height: 1.7;
  font-size: 0.95rem;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-links .btn {
  flex: 1;
  justify-content: center;
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
}

/* ============================================
   SECCIÓN EXPERIENCIA
   ============================================ */
.experience-timeline {
  position: relative;
  padding-left: 2.5rem;
}

.experience-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.experience-item {
  position: relative;
  margin-bottom: 3.5rem;
  padding-left: 2rem;
}

.experience-item::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 0.5rem;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--border);
}

.experience-item h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.experience-item .period {
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.experience-item>p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.7;
  font-size: 1rem;
}

.learning {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--accent);
  padding: 1.25rem;
  margin-top: 1rem;
  border-radius: 6px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.learning strong {
  color: var(--accent);
  font-weight: 600;
}

/* ============================================
   SECCIÓN CTA
   ============================================ */
.cta-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4rem 2rem;
  text-align: center;
}

.cta-section h2 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 700;
}

.cta-section p {
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.7;
  font-size: 1.1rem;
}

.contact-methods {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
/* HOBBIES */
.hobbis {
  text-align: center;
  padding: 50px 20px;
}

.hobbis h2 {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 40px;
}

.hobbies-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.hobby-card {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.3s ease-in-out;
}

.hobby-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  transition: transform 0.5s ease, filter 0.5s ease;
}

.hobby-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  padding: 20px;
  border-radius: 20px;
}

.hobby-overlay h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--accent);
}

.hobby-overlay p {
  font-size: 1rem;
  line-height: 1.4;
}

.hobby-card:hover img {
  transform: scale(1.2);
  filter: brightness(1.2);
}

.hobby-card:hover .hobby-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.social-links a {
  color: var(--text-secondary);
  font-size: 1.75rem;
  transition: all 0.3s;
  text-decoration: none;
}

.social-links a:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

footer p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 2rem;
    border-bottom: 1px solid var(--border);
    transition: left 0.3s;
    gap: 1rem;
  }

  .nav-links.active {
    left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .hero-content,
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  .hero-text .subtitle {
    font-size: 1.25rem;
  }

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

  section {
    padding: 4rem 1rem;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .carousel {
    padding: 2rem 0.5rem;
  }

  .carousel-control-prev,
  .carousel-control-next {
    width: 40px;
    height: 40px;
  }

  .carousel-control-prev {
    left: -10px;
  }

  .carousel-control-next {
    right: -10px;
  }

  .nav-pills {
    left: 0;
    transform: translateX(0);
  }

  /* Carnet responsive */
  .id-card {
    width: 340px;
    height: 500px;
  }

  .photo-container {
    width: 120px;
    height: 120px;
  }

  .nombre {
    font-size: 22px;
  }
}