:root {
  --primary: #0066cc;
  --primary-light: #3399ff;
  --dark-bg: #0a1428;
  --dark-bg-secondary: #0f172a;
  --dark-card: rgba(15, 23, 42, 0.6);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: #a8b8c8;
  --accent: #0ea5e9;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-bg-secondary) 100%);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 20, 40, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between; /* Empuja el título a la izquierda y el menú a la derecha */
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 40px; /* Espaciado interno generoso para que respire */
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.brand-name {
  color: #ffffff;
}

.brand-accent {
  color: var(--primary-light);
}

.site-nav {
  display: flex;
  gap: 30px; /* Espaciado elegante entre cada enlace */
  align-items: center;
}

/* Enlaces del menú */
.site-nav a {
  color: #e2e8f0;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  padding: 8px 0;
  position: relative;
  transition: color 0.3s ease;
}

.site-nav a:hover {
  color: #ffffff;
}

/* El efecto de línea azul en la sección activa */
.site-nav a.active {
  color: #ffffff;
}
.site-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px; /* Posiciona la línea justo debajo del texto */
  left: 0;
  width: 100%;
  height: 3px; /* Grosor de la línea */
  background-color: #3b82f6; /* El color azul del indicador */
  border-radius: 2px;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 300ms ease;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: 60px;
}

.hero-video-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 20, 40, 0.55);
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 800px;
  padding: 2rem;
  animation: fadeInUp 1s ease-out;
}

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

.hero-greeting {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

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

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

.hero-description {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  border-radius: 50px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 300ms ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  color: var(--dark-bg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

.btn-large {
  padding: 1.1rem 2rem;
  font-size: 1rem;
}

.hero-nav-arrows {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  display: flex;
  justify-content: space-between;
  padding: 0 2rem;
}

.arrow-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 300ms ease;
}

.arrow-btn:hover {
  border-color: var(--accent);
  background: rgba(14, 165, 233, 0.1);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

/* ============================================
   SECTIONS GENERAL
   ============================================ */

.section-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 2rem;
  text-align: center;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   SECCIÓN ACERCA DE MÍ (CALCADO AL PROTOTIPO - FOTO GRANDE RETORNADA)
   ========================================================================== */
.about {
  padding: 60px 0; /* Antes estaba en 100px 0 */
  background: linear-gradient(100deg, #061229 10%, #081b3b 50%, #004b9c 100%);
  color: #ffffff;
  overflow: hidden;
}

.about-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Reducimos el margen inferior del título para que la foto y el texto suban y queden más cerca */
.about .section-title {
  text-align: center;
  font-family: 'Manrope', sans-serif;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 30px; /* Antes estaba en 50px */
}
/* --- BLOQUE SUPERIOR --- */
.about-top-row {
  display: grid;
  grid-template-columns: 45% 55%; /* Mantiene las columnas equilibradas */
  align-items: center;
  gap: 1.5rem; 
  margin-bottom: 60px;
}

/* Contenedor de la foto de perfil */
.about-image-wrapper {
  display: flex;
  justify-content: flex-end; /* Alinea la foto a la derecha de su columna para acercarla a la línea */
  padding-right: 2.5rem;      /* Reducido para dar espacio perfecto al círculo grande */
}

.profile-circle {
  width: 350px;  /* ¡Regresamos al tamaño grande de 320px! */
  height: 350px; /* Proporción 1:1 exacta */
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #3b82f6; /* Borde azul brillante */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.profile-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Bloque de texto superior */
.about-text-wrapper {
  display: flex;
  align-items: center;
}

.vertical-divider-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: 2px solid #3b82f6; /* Grosor ideal de la línea */
  padding-left: 2.5rem;           /* Ajustado para que el texto respire sin salirse */
}

.vertical-divider-content p {
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.vertical-divider-content strong {
  color: #ffffff;
  font-weight: 700;
}

/* --- BLOQUE INFERIOR (Asimetría Cruzada) --- */
.about-bottom-row {
  display: flex;
  justify-content: flex-start;
  gap: 50px;
  margin-top: 40px;
}

/* Bloque izquierdo inferior */
.about-bottom-left {
  flex: 0 0 45%; 
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-left: 20px;
}

.about-bottom-left p {
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

/* Bloque derecho inferior: Tarjeta destacada */
.about-bottom-right {
  flex: 1;
  max-width: 520px;
}

.highlight-card {
  border-left: 2.5px solid #3b82f6;
  padding-left: 25px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.highlight-card p {
  margin: 0;
  font-family: 'Inter', sans-serif;
}

.card-question {
  font-size: 15px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
}

.card-bold {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.card-desc {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
}

.card-action {
  font-size: 15px;
  font-style: italic;
  font-weight: 600;
  color: #ffffff;
}

/* ============================================
   EXPERIENCE SECTION
   ============================================ */

.experience {
  padding: 5rem 0;
}

.experience-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.experience-card {
  padding: 2rem;
  background: var(--dark-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 300ms ease;
}

.experience-card:hover {
  border-color: var(--accent);
  background: rgba(14, 165, 233, 0.05);
  transform: translateY(-4px);
}

.experience-card h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.experience-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ============================================
   STACK SECTION
   ============================================ */

.stack {
  padding: 5rem 0;
  background: linear-gradient(135deg, rgba(10, 20, 40, 0.5), rgba(15, 23, 42, 0.5));
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
}

.stack-category {
  background: var(--dark-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
}

.stack-category-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.stack-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stack-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stack-item:last-child {
  border-bottom: none;
}

.tech-name {
  color: var(--text-primary);
  font-weight: 600;
}

.tech-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============================================
   PROJECTS SECTION
   ============================================ */

.projects {
  padding: 5rem 0;
}

.projects-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 300ms ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  color: var(--dark-bg);
  border-color: transparent;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.project-card {
  background: var(--dark-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 300ms ease;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(14, 165, 233, 0.15);
}

.project-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-info {
  padding: 1.5rem;
}

.project-info h3 {
  color: var(--text-primary);
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
}

.project-info p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

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

.project-tech span {
  font-size: 0.8rem;
  background: rgba(14, 165, 233, 0.1);
  color: var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

/* ============================================
   CERTIFICATIONS SECTION
   ============================================ */

.certifications {
  padding: 5rem 0;
  background: linear-gradient(135deg, rgba(10, 20, 40, 0.5), rgba(15, 23, 42, 0.5));
}

.certifications-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.cert-card {
  background: var(--dark-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 300ms ease;
}

.cert-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.cert-image {
  width: 100%;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.3);
}

.cert-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cert-card h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.cert-issuer {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.cert-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 300ms ease;
}

.cert-link:hover {
  color: var(--primary-light);
}

/* ============================================
   CONTACT SECTION
   ============================================ */

.contact {
  padding: 5rem 0;
  text-align: center;
}

.contact-card {
  max-width: 700px;
  margin: 0 auto;
}

.contact-card h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 1.5rem;
}

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

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  background: rgba(10, 20, 40, 0.5);
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
}

.site-footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ============================================
   MEDIA QUERIES (RESPONSIVO GENERAL)
   ============================================ */

@media (max-width: 1024px) {
  .about-grid,
  .stack-grid,
  .projects-grid,
  .certifications-grid {
    grid-template-columns: 1fr;
  }

  .experience-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-nav {
    margin-left: 1rem;
  }
}

/* Adaptación responsiva de la sección About */
@media (max-width: 992px) {
  .about-top-row {
    grid-template-columns: 1fr; /* Pasa a ser de una sola columna */
    text-align: center;
    gap: 30px;
  }

  .about-bottom-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 30px;
  }

  .about-image-wrapper {
    justify-content: center; /* Centra la foto en pantallas medianas */
    padding-right: 0;
  }

  .about-bottom-left {
    padding-left: 0;
    max-width: 100%;
  }

  .vertical-divider-content,
  .highlight-card {
    border-left: none;
    border-top: 1.5px solid #3b82f6; /* Se convierte en divisor superior */
    padding-left: 0;
    padding-top: 20px;
    text-align: center;
  }
}

@media (max-width: 868px) {
  .profile-circle {
    width: 260px;
    height: 260px;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0.8rem 1rem;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(10, 20, 40, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    gap: 0;
    margin: 0;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .menu-toggle {
    display: flex;
  }

  .hero {
    margin-top: 60px;
  }

  .hero-nav-arrows {
    display: none;
  }

  .about-image {
    display: none;
  }

  .profile-circle {
    width: 220px;
    height: 220px;
    margin: 0 auto;
  }

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

  .hero-cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .section-container {
    padding: 0 1rem;
  }

  .hero-title {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
  }

  .hero-greeting {
    font-size: 1.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .section-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }

  .projects-filters {
    flex-direction: column;
    gap: 0.5rem;
  }

  .filter-btn {
    width: 100%;
  }
}