:root {
  --accent-color: #4A90E2;
  --secondary-color: #1A1F2E;
  --dark-color: #0D1117;
  --grey-color: #2C3E50;
  --body-text-color: #E1E8ED;
  --light-text-color: #B8C5D6;
  --link-color: #4A90E2;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Nunito Sans', sans-serif;
  font-weight: 400;
  font-size: 19px;
  line-height: 1.65;
  color: var(--body-text-color);
  background-color: var(--secondary-color);
  margin: 0;
}

/* ───────────────────────────────────────────────
   Espaciado uniforme en todas las secciones
───────────────────────────────────────────────── */
section {
  padding: 32px 0;
  min-height: 40vh;
}

#home.py-4 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  min-height: 80vh;
}

#about,
#resume,
#portfolio,
#contact {
  padding: 32px 0;
}

.content-container>section {
  margin-bottom: 1rem;
}

section h1,
section h2 {
  margin-bottom: 0.6rem;
  position: relative;
  padding-bottom: 0.3rem;
}

section h1::after,
section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 70px;
  height: 3px;
  background: var(--accent-color);
  border-radius: 2px;
}

/* ───────────────────────────────────────────────
   Tipografía base
───────────────────────────────────────────────── */
h1,
.h1 {
  font-size: 4.4rem;
  font-weight: 800;
  margin: 0.3em 0;
}

h2,
.h2 {
  font-size: 2.6rem;
  font-weight: 700;
  margin: 0.7em 0 0.5em;
}

h3,
.h3 {
  font-size: 1.7rem;
  font-weight: 600;
}

h4,
.h4 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 1em 0 0.5em;
}

p {
  color: var(--light-text-color);
  font-size: 1.05rem;
  line-height: 1.75;
  text-align: justify;
}

.lead-paragraph {
  font-size: 1.3rem;
  line-height: 1.8;
  color: #d1d9e0;
  text-align: justify;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: #6aa8f5;
}

/* ───────────────────────────────────────────────
   Navegación vertical - SOLO iconos cambian color
───────────────────────────────────────────────── */
.navigation {
  position: fixed;
  left: 20px;
  top: 30px;
  /* distancia desde arriba */
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* alineado a la izquierda */
}

.nav-pills {
  background: transparent;
  padding: 1rem 0.6rem;
  border-radius: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  /* espacio entre iconos */
}

.nav-link {
  color: #6a829e;
  font-size: 2rem;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-color);
  background: transparent !important;
}

.nav-link i.ti {
  transition: all 0.32s ease;
}

.nav-link:hover i.ti,
.nav-link.active i.ti {
  transform: scale(1.25);
}

/* ───────────────────────────────────────────────
   Sidebar - visible en desktop, offcanvas en móvil
───────────────────────────────────────────────── */
.hero-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: 340px;
  height: 100vh;
  background: rgba(13, 17, 23, 0.94);
  backdrop-filter: blur(10px);
  border-left: 1px solid rgba(74, 144, 226, 0.14);
  z-index: 900;
  overflow-y: auto;
  color: #e1e8ed;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  scrollbar-width: thin;
  scrollbar-color: rgba(74, 144, 226, 0.25) transparent;
  /* No bloquear clics en el contenido principal */
  pointer-events: none;
}

.hero-sidebar::-webkit-scrollbar {
  width: 4px;
}

.hero-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.hero-sidebar::-webkit-scrollbar-thumb {
  background: rgba(74, 144, 226, 0.25);
  border-radius: 4px;
}

.hero-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

.hero-sidebar .hero-img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--accent-color);
  box-shadow: 0 0 30px rgba(74, 144, 226, 0.28);
  margin-bottom: 1.8rem;
  transition: transform 0.4s ease;
  pointer-events: auto;
  /* La imagen puede ser interactuada */
}

.hero-sidebar .hero-img:hover {
  transform: scale(1.06);
}

.hero-sidebar h2 {
  font-size: 1.95rem;
  margin: 0.6rem 0 0.4rem;
  color: white;
}

.hero-sidebar>p {
  color: rgba(225, 232, 237, 0.84);
  font-size: 1.08rem;
  margin-bottom: 2.2rem;
}

.social-icon {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
  margin: 1.8rem 0 3rem;
  position: relative;
  z-index: 999;
  pointer-events: auto;
  /* Restaurar clics en los iconos sociales */
}

.social-link {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: white;
  font-size: 1.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1000;
  pointer-events: auto;
  /* Asegurar que los links sean clickables */
}

.social-link:hover {
  background: var(--accent-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 22px rgba(74, 144, 226, 0.35);
}

/* Botón hamburguesa (solo móvil) */
.offcanvas-btn {
  display: none !important;
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 1001;
  display: none;
}

.offcanvas-btn i {
  font-size: 30px;
  color: var(--body-text-color);
  transition: color 0.3s ease;
}

.offcanvas-btn:hover i {
  color: var(--accent-color);
}


/* Contenido principal deja espacio para sidebar y nav izquierda */
.main-content {
  margin-right: 450px;
  margin-left: 220px;
  min-height: 100vh;
}

.content-container {
  max-width: 100% !important;
  padding: 0;
}

.content-wrapper {
  padding-left: 40px;
  padding-right: 150px;
}

/* ───────────────────────────────────────────────
   Habilidades
───────────────────────────────────────────────── */
.skills-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.4rem 2rem;
  margin: 2.5rem 0;
}

.skills-list h4 {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 16px 20px;
  background: rgba(74, 144, 226, 0.07);
  border: 1px solid rgba(74, 144, 226, 0.15);
  border-radius: 12px;
  color: var(--body-text-color);
  font-weight: 600;
  transition: all 0.3s ease;
}

.skills-list h4:hover {
  background: rgba(74, 144, 226, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.skills-list .ti {
  font-size: 2rem;
  color: var(--accent-color);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 1.4rem 2rem;
  align-items: stretch;
}

.service-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.8rem;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-color);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

.service-icon {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  background: rgba(74, 144, 226, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 1.4rem;
}

.service-card p {
  color: var(--light-text-color);
  line-height: 1.6;
  flex-grow: 1;
}

@media (max-width: 1024px) {
  .service-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  .service-grid {
    grid-template-columns: repeat(1, minmax(200px, 1fr));
  }
}


/* ───────────────────────────────────────────────
   Contacto
───────────────────────────────────────────────── */
.contact-list {
  padding: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: all 0.35s ease;
  
}

.contact-list:hover {
  transform: translateY(-8px);
  background: rgba(74, 144, 226, 0.09);
  border-color: var(--accent-color);
  
}

.contact-list i {
  font-size: 2.8rem;
  color: var(--accent-color);
  margin-bottom: 1.2rem;
  text-align: center;
}

.contact-paragraph.mt-2{
  text-align: center;
}

/* ───────────────────────────────────────────────
   Responsive
───────────────────────────────────────────────── */
@media (max-width: 1199px) {
  .hero-sidebar {
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    width: 320px;
  }

  .hero-sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-right: 0;
    margin-left: 0;
  }

  .content-container,
  .content-wrapper,
  section {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }

  section {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  #home {
    padding-top: 80px;
    padding-bottom: 60px;
  }
}

@media (max-width: 991px) {

  h1,
  .h1 {
    font-size: 3.6rem;
  }

  h2,
  .h2 {
    font-size: 2.3rem;
  }
}

@media (max-width: 576px) {

  h1,
  .h1 {
    font-size: 3rem;
  }

  .lead-paragraph {
    font-size: 1.15rem;
  }

  .skills-list {
    grid-template-columns: 1fr;
  }
}

.github-section__inner {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2.8rem;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.35);
}

.github-section .lead-paragraph a.github-link {
  font-weight: 600;
  color: var(--accent-color);
  text-decoration: underline;
}

.github-summary {
  font-size: 0.95rem;
  line-height: 1.6;
  min-height: 2.4rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.github-card {
  background: rgba(13, 17, 23, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.6rem;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  min-height: 220px;
}

.github-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.45);
}

.github-card h3 {
  margin-bottom: 0.6rem;
  font-size: 1.25rem;
}

.github-card h3 a {
  color: white;
  text-decoration: none;
}

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

.github-card p {
  color: var(--light-text-color);
  font-size: 0.95rem;
  line-height: 1.5;
  min-height: 48px;
}

.github-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  color: var(--light-text-color);
  font-size: 0.85rem;
  margin-top: 1rem;
}

.github-card-meta span {
  padding: 0.15rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.github-link:hover {
  text-decoration: none;
}

@media (max-width: 768px) {
  .github-section__inner {
    padding: 2rem;
  }
}



/* -----------------------------------------------------------------------------
   Off-Canvas Mobile Menu
   ----------------------------------------------------------------------------- */
.offcanvas-body {
  background-color: var(--secondary-color);
  color: var(--body-text-color);
}

/* -----------------------------------------------------------------------------
   Certificados & Diplomas - Premium Refactor
   ----------------------------------------------------------------------------- */
.cert-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.45s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  backdrop-filter: blur(10px);
}

.cert-card:hover {
  transform: translateY(-12px) scale(1.02);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-color);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.cert-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(74, 144, 226, 0.12), transparent 70%);
}

.cert-img-wrapper i {
  font-size: 4.5rem;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.4));
}

.cert-card:hover .cert-img-wrapper i {
  transform: scale(1.15) rotate(8deg);
  filter: drop-shadow(0 10px 30px var(--accent-color));
}

/* Premium Overlay Button */
.cert-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 17, 23, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.4s ease;
  backdrop-filter: blur(5px);
}

.cert-card:hover .cert-overlay {
  opacity: 1;
}

.cert-overlay .btn {
  background: var(--accent-color) !important;
  color: white !important;
  border: none !important;
  border-radius: 50px !important;
  padding: 0.7rem 1.6rem !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transform: translateY(25px);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4) !important;
}

.cert-card:hover .cert-overlay .btn {
  transform: translateY(0);
}

.cert-overlay .btn:hover {
  transform: scale(1.08) !important;
  background: #5a9ff2 !important;
}

.cert-info {
  padding: 2.5rem 2rem;
  text-align: center;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cert-info h4 {
  font-size: 1.25rem;
  color: white;
  margin-bottom: 0.6rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.cert-info p {
  font-size: 0.9rem;
  color: var(--accent-color);
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  opacity: 0.9;
}

.cert-link {
  text-decoration: none !important;
  display: block;
}

/* Off-Canvas Hamburguer Styled (Visible only on mobile/tablet) */
@media (max-width: 1199px) {
  .offcanvas-btn {
    display: flex !important;
    background: rgba(13, 17, 23, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(74, 144, 226, 0.4) !important;
    border-radius: 14px !important;
    padding: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
    transition: all 0.3s ease;
  }

  .offcanvas-btn:hover {
    transform: scale(1.05);
    border-color: var(--accent-color);
  }

  .offcanvas-btn i {
    font-size: 28px !important;
    color: white !important;
  }
}

/* Responsive Fixes */
@media (max-width: 991px) {
  .cert-overlay {
    opacity: 1;
    background: rgba(13, 17, 23, 0.4);
    backdrop-filter: none;
  }

  .cert-overlay .btn {
    transform: translateY(0);
    padding: 0.5rem 1rem !important;
    font-size: 0.75rem !important;
  }

  .cert-card:hover {
    transform: translateY(-8px);
  }
}


/* Button always visible in certificates */
.cert-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-color);
  color: white !important;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  margin-top: 1rem;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
  cursor: pointer;
  pointer-events: none;
  /* Let the parent link handle the click */
}

.cert-card:hover .cert-btn {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
  background: #5a9ff2;
}

.cert-link {
  text-decoration: none !important;
  display: block;
  height: 100%;
  position: relative;
  z-index: 1;
}

.cert-card {
  position: relative;
  z-index: 2;
}



/* -----------------------------------------------------------------------------
   Mobile Mini Menu (Bottom Nav)
   ----------------------------------------------------------------------------- */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(15px);
  border-top: 1px solid rgba(74, 144, 226, 0.2);
  z-index: 1000;
  padding: 10px 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.mobile-nav-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--light-text-color);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  transition: all 0.3s ease;
  gap: 4px;
}

.mobile-nav-link i {
  font-size: 1.4rem;
  transition: transform 0.3s ease;
}

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

.mobile-nav-link.active i {
  transform: translateY(-4px);
  text-shadow: 0 0 10px var(--accent-color);
}

/* -----------------------------------------------------------------------------
   Global Footer
   ----------------------------------------------------------------------------- */
.footer {
  background: rgba(13, 17, 23, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 30px 30px 0 0;
}

.footer-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-logo-img {
  height: 56px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.footer-logo-img:hover {
  opacity: 1;
}

.footer-socials a {
  color: var(--light-text-color);
  font-size: 1.5rem;
  margin: 0 12px;
  display: inline-block;
  transition: all 0.3s ease;
}

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

.text-primary-gradient {
  background: linear-gradient(90deg, var(--accent-color), #a2c7f5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer p {
  text-align: center;
}

/* Responsive adjust for footer on mobile */
@media (max-width: 1199px) {
  .footer {
    padding-bottom: 90px !important;
    /* Space for mobile nav */
  }
}

/* ───────────────────────────────────────────────
   Ajustes añadidos en la revisión
───────────────────────────────────────────────── */

/* Texto alineado a la izquierda en tarjetas (el justificado global abre huecos en columnas angostas) */
.service-card p,
.github-card p {
  text-align: left;
}

/* Foco visible para navegación con teclado */
:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}

/* Respeta a quien desactiva las animaciones en su sistema */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .service-card:hover,
  .github-card:hover,
  .contact-list:hover {
    transform: none;
  }
}
