@charset "UTF-8";
/*

  Con este reset vamos a resolver:
    👉 Unificar el uso de Custom Properties
    👉 Problemas de box-model más generales
    👉 Problemas con imagenes, vídeos e iconos svg
    👉 Problemas con tipografías y etiquetas input en formularios
    👉 Unificar la tipografía de todas las etiquetas de una web

*/
/* Aquí definimos las Custom properties */
:root {
  --negro: #393939;
  --blanco: #ffffff;
  /* Paleta Slate */
  --Slate-900: #0f172a;
  --Slate-700: #334155;
  --Slate-600: #475569;
  --Slate-500: #64748b;
  --Slate-400: #94a3b8;
  --Slate-300: #e2e8f0;
  --Slate-200: #e5e7eb;
  --Slate-100: #f1f5f9;
  /* Tipografía */
  --tipo-principal: Helvetica, Arial, sans-serif;
  --tipo-secundaria: Verdana;
}

/* Las adaptamos al modo oscuro */
@media (prefers-color-scheme: dark) {
  :root {
    --negro: #ececec;
  }
}
/* Opcional */
/* Configuramos si un usuario ha activado el modo alto contraste. (WD) */
/* Opcional */
/* Desactivamos los animations en el caso de que el usuario haya configurado el modo sin animation */
@media (prefers-reduced-motion: reduce) {
  * {
    -webkit-animation: none !important;
            animation: none !important;
    -webkit-transition: none !important;
    transition: none !important;
  }
}
/* Reseteamos los margin y paddings de todas las etiquetas */
* {
  margin: 0;
  padding: 0;
  border: 0;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  vertical-align: baseline;
}

/* Evitamos problemas con las imagenes */
img, picture, video, iframe, figure {
  max-width: 100%;
  width: 100%;
  display: block;
  /* opcional */
  -o-object-fit: cover;
     object-fit: cover;
  /* opcional */
  -o-object-position: center center;
     object-position: center center;
}

/* Reseteamos los enlaces para funcionar como cajas... */
a {
  display: block;
  text-decoration: none;
  color: inherit;
  font-size: inherit;
}

/* ... excepto los que se encuentran en párrafos */
p a {
  display: inline;
}

/* Quitamos los puntos de los <li> */
li {
  list-style-type: none;
}

/* Configuramos anclas suaves */
html {
  scroll-behavior: smooth;
}

/* Desactivamos estilos por defecto de las principales etiquetas de texto */
h1, h2, h3, h4, h5, h6, p, span, a, strong, blockquote, i, b, u, em {
  font-size: 1em;
  font-weight: inherit;
  font-style: inherit;
  text-decoration: none;
  color: inherit;
}

/* Evitamos problemas con los pseudoelementos de quotes */
blockquote:before, blockquote:after, q:before, q:after {
  content: "";
  content: none;
}

/* Configuramos el texto que seleccionamos */
::-moz-selection {
  background-color: var(--negro);
  color: var(--blanco);
}
::selection {
  background-color: var(--negro);
  color: var(--blanco);
}

/* Nivelamos problemas de tipografías y colocación de formularios */
form, input, textarea, select, button, label {
  font-family: inherit;
  font-size: inherit;
  -webkit-hyphens: auto;
      -ms-hyphens: auto;
          hyphens: auto;
  background-color: transparent;
  color: inherit;
  display: block;
  /* opcional */
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

/* Reseteamos las tablas */
table, tr, td {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Evitamos problemas con los SVG */
svg {
  width: 100%;
  display: block;
  fill: currentColor;
}

/* (Probándolo, no usar en producción) En el caso de añadir una  */
/* p svg{
  display: inline;
  width: initial;
} */
/* Configuramos la tipografía para toda la web */
body {
  min-height: 100vh;
  font-size: 100%;
  font-family: var(--tipo-principal);
  color: var(--negro);
  /* opcional */
  line-height: 1.4em;
  /* opcional */
  -webkit-hyphens: auto;
      -ms-hyphens: auto;
          hyphens: auto;
  /* opcional */
  font-smooth: always;
  /* opcional */
  -webkit-font-smoothing: antialiased;
  /* opcional */
  -moz-osx-font-smoothing: grayscale;
}

/* Evitar scroll del contenido cuando el menú móvil está abierto */
body.no-scroll {
  overflow: hidden;
}

@font-face {
  font-family: 'Outfit';
  src: url(../fonts/Outfit-VariableFont_wght.ttf) format('truetype');
}

/* ---------------------------- */
/* Base Styles */
/* ---------------------------- */
html {
  font-size: 62.5%;
}
body {
  font-size: 1.6rem;
  font-family: 'Outfit', sans-serif;
  color: var(--Slate-900);
}

section {
  max-width: 100%;
  padding: 4rem 20rem
}

h1, h2, h3 {
  margin: 0;
}

p {
  font-size: 1.6rem;
}

a {
  font-size: 1.6rem;
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------------------------- */
/* Layout Styles */
/* ---------------------------- */
.header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0rem 20rem;
  position: relative;
  /* Evitar jumps de altura al aplicar sticky: siempre reservar espacio del borde */
  border-bottom: 1px solid transparent;
}

.main {
  width: 100%;
  margin: auto;
}

.footer {
  background-color: var(--blanco);
  text-align: center;
  padding: 8rem 12rem;
  border-top: 1px solid var(--Slate-200);
}

/* ---------------------------- */
/* Module Styles */
/* ---------------------------- */
/* Hero */
.hero {
  order: 2;
}

.hero .avatar {
  border-radius: 50%;
  width: 9rem;
  height: 9rem;
  transition: transform 0.2s ease, width 0.2s ease, height 0.2s ease;
  will-change: transform, width, height;
}

.hero h1 {
  font-size: 3.2rem;
  margin: 1rem 0;
  transition: transform 0.2s ease, font-size 0.2s ease, line-height 0.2s ease;
  will-change: transform, font-size, line-height;
}

/* Nav */
.menu {
  order: 1;
  display: flex;
  align-self: self-end;
  padding: 1rem 2rem; /* Espaciado interno */
}

.menu a {
  margin-right: 2rem;
}
/* Botón hamburguesa (oculto en desktop) */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.8rem;
  margin-left: auto;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--Slate-900);
  margin: 5px 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Estilos generales para las cards */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  align-items: center;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background-color: #fff;
  text-align: center;
  border-radius: 2rem;
  padding: 1.6rem;
  width: 300px;
  box-shadow: 0 2.5rem 2.5rem rgba(0, 0, 0, 0.1);
}

.card h3 {
  color: var(--Slate-900);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  order: 2; /* Título en la segunda posición */
}

.card figure {
  order: 1; /* Imagen en la primera posición */
  margin: 0;
}

.card img {
  width: 100%;
  border-radius: 0.8rem;
}

.card figcaption {
  font-size: 0.9rem;
  color: var(--Slate-500);
}

.card p {
  order: 3; /* Descripción en la tercera posición */
  font-size: 1.5rem;
  color: var(--Slate-500);
  line-height: 1.4;
  letter-spacing: 0.02rem;
  padding: 0 1.6rem;
}

.buttons {
  order: 5; /* Enlace en la quinta posición */
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.card a {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  font-size: 1.2rem;
  background-color: var(--Slate-900);
  border: 0.1rem solid var(--Slate-900);
  color: var(--Slate-300);
  text-decoration: none;
  border-radius: 1.5rem;
  text-align: center;
  transition: background-color 0.3s ease;
}

.card .white {
  background-color: var(--Slate-300);
  border: 0.1rem solid var(--Slate-900);
  color: var(--Slate-900);
}

.card a:hover {
  background-color: var(--Slate-300);
  border: 0.1rem solid var(--Slate-900);
  color: var(--Slate-900);
}

.card .white:hover {
  background-color: var(--Slate-900);
  border: 0.1rem solid var(--Slate-900);
  color: var(--Slate-300);
}

.fa-brands,
.fa-solid {
  margin-right: 0.5rem;
}

/* Estilos para el badge (etiqueta) */
.badges {
  order: 4; /* Título en la cuarta posición */
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: 1rem;
  color: var(--Slate-900);
  background-color: #fff; /* Color por defecto (azul) */
  border: 0.1rem solid var(--Slate-900);
  border-radius: 1.2rem;
  text-align: center;
}

/* Variantes de colores */
.badge--success {
  background-color: #28a745; /* Verde */
}

.badge--warning {
  background-color: #ffc107; /* Amarillo */
  color: #000; /* Texto oscuro para mejor contraste */
}

.badge--error {
  background-color: #dc3545; /* Rojo */
}
/* ---------------------------- */
/* State Styles */
/* ---------------------------- */
.is-active {
  font-weight: bold;
  color: #007bff;
}

/* ---------------------------- */
/* Theme Styles */
/* ---------------------------- */
/* Tema oscuro (opcional) */
.theme-dark {
  background-color: #333;
  color: #fff;
}

.theme-dark .header {
  background-color: #222;
}

.theme-dark .footer {
  background-color: #111;
}

.portfolio {
  background-color: var(--blanco)
}

/* ---------------------------- */
/* Nuevas secciones y utilidades */
/* ---------------------------- */
.timeline {
  margin-top: 2rem;
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--Slate-300);
}
.timeline-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 1rem;
  position: relative;
  margin-bottom: 2rem;
}
.timeline-marker {
  grid-column: 1 / 2;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: var(--Slate-900);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--Slate-300);
  margin-top: 4px;
}
.timeline-content {
  grid-column: 2 / -1;
  background: #fff;
  border: 1px solid var(--Slate-300);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
}
.timeline-content h3 { font-size: 1.6rem; margin-bottom: 0.4rem; }
.timeline-content .meta { color: var(--Slate-600); font-size: 1.3rem; }
.timeline-content .meta .fa-solid { margin-right: 0.4rem; }
.timeline-content p { margin: 0.6rem 0; }
.timeline-content .bullets { margin: 0.4rem 0 0.2rem; padding-left: 1.2rem; }
.timeline-content .bullets li { list-style: disc; color: var(--Slate-700); margin: 0.2rem 0; }
.social-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.social-badges a img {
  height: 24px;
  width: auto;
  -o-object-fit: contain;
     object-fit: contain;
  -o-object-position: left center;
     object-position: left center;
}

.about-me {
  background: var(--blanco);
}

.notice {
  border: 1px solid var(--Slate-300);
  background: var(--Slate-100);
  border-radius: 0.8rem;
  padding: 1.2rem 1.6rem;
  margin: 1.6rem 0;
  color: var(--Slate-700);
}
.notice strong { color: var(--Slate-900); }
.notice.tip { border-left: 4px solid #22c55e; }
.notice.note { border-left: 4px solid #0ea5e9; }

.section-title {
  font-size: 2.4rem;
  margin-bottom: 2rem;
}

/* Tech stack grid */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.6rem;
}
.tech-card {
  background: #fff;
  border: 1px solid var(--Slate-300);
  border-radius: 1rem;
  padding: 1.2rem;
}
.tech-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}
.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.tech-badges img { height: 22px; }
.tech-badges img {
  width: auto;
  -o-object-fit: contain;
     object-fit: contain;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}
.stats-grid picture, .stats-grid img {
  width: 100%;
}

/* YouTube grid */
.yt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  justify-items: center;
}
.yt-grid img { max-width: 100%; height: auto; }

/* Footer social */
.social {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}
.social a { color: var(--Slate-700); }
.social a:hover { color: var(--Slate-900); text-decoration: underline; }

/* ---------------------------- */
/* Responsivo */
/* ---------------------------- */
@media (max-width: 1200px) {
  section { padding: 4rem 8rem; }
  .header { padding: 0 8rem; }
}
@media (max-width: 768px) {
  section { padding: 3rem 2rem; }
  .header { padding: 1rem 2rem; align-items: center; }
  /* Menú en móvil: oculto por defecto, desplegable */
  .menu {
    position: fixed;
    top: 56px; /* debajo del botón hamburguesa */
    right: 16px;
    left: 16px;
    display: none;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--Slate-300);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    z-index: 1500;
    max-height: calc(100vh - 72px);
    overflow: auto;
  }
  .menu.open { display: flex; }
  .menu a { margin: 0.4rem 0; }
  .menu-toggle {
    display: inline-block;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1600; /* por encima del panel del menú */
    background: #fff;
    border: 1px solid var(--Slate-300);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  }
  .hero { align-items: center; text-align: center; }
  .tech-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: 1fr; }
  .yt-grid { grid-template-columns: 1fr; }
}

/* Extender menú hamburguesa también a tablets */
@media (max-width: 1024px) {
  .menu {
    position: fixed;
    top: 56px; /* debajo del botón hamburguesa */
    right: 16px;
    left: 16px;
    /* Mantener padding constante para evitar reflows al hacer sticky */
    border-bottom: 1px solid var(--Slate-200);
    border: 1px solid var(--Slate-300);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    z-index: 1500;
    max-height: calc(100vh - 72px);
    overflow: auto;
  }
  .menu.open { display: flex; }
  .menu a { margin: 0.4rem 0; }
  .menu-toggle {
    display: inline-block;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1600; /* por encima del panel del menú */
    background: #fff;
    border: 1px solid var(--Slate-300);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  }
}

/* Hero alineado (desktop) */
@media (min-width: 769px) {
  .hero {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0 1.2rem;
    align-items: center;
  }
  .hero .avatar { grid-row: 1; grid-column: 1; }
  .hero h1 { grid-row: 1; grid-column: 2; margin: 0; }
  .hero p { grid-row: 2; grid-column: 2; }
  .hero .social-badges { grid-column: 1 / -1; margin-top: 1rem; }
}

/* Header sticky (desktop) */
@media (min-width: 1025px) {
  .header.is-sticky {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1200; /* por encima del menú desplegable */
    padding-top: 0.2rem;   /* más bajo */
    padding-bottom: 0.4rem;/* más bajo */
    border-bottom: 1px solid var(--Slate-200);
  }

  /* Reducir hero cuando el header es sticky */
  .header.is-sticky .hero {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto;
    align-items: center;
    gap: 0 0.4rem; /* más pegado al avatar */
  }
  .header.is-sticky .hero .avatar {
    /* Reducir tamaño real en lugar de solo escalar */
    width: 3.2rem;
    height: 3.2rem;
    transform: none;
    transform-origin: left center;
  }
  .header.is-sticky .hero h1 {
    /* Reducir tamaño real del texto */
    font-size: 1.8rem;
    line-height: 1.05; /* más compacto */
    transform: none;
    transform-origin: left center;
  }
  /* Ocultar elementos secundarios del hero en sticky para compactar */
  .header.is-sticky .hero p,
  .header.is-sticky .hero .social-badges {
    display: none;
  }

  /* Compactar un poco el menú en sticky */
  .header.is-sticky .menu {
    padding: 0.4rem 1.2rem; /* antes 1rem 2rem */
    transition: padding 0.2s ease;
  }
  .header.is-sticky .menu a {
    font-size: 1.4rem; /* antes 1.6rem */
    margin-right: 1.2rem; /* antes 2rem */
    line-height: 1.1; /* reduce altura de línea */
    transition: font-size 0.2s ease, margin 0.2s ease, line-height 0.2s ease;
  }
}

/* Botón Back-to-Top */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--Slate-900);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  box-shadow: 0 10px 20px rgba(0,0,0,0.12);
  cursor: pointer;
  z-index: 1700; /* por encima de menú (1500) y toggle (1600) */
}
.back-to-top.show { display: inline-flex; }
.back-to-top:hover { background: var(--Slate-700); }

/* En pantallas responsivas (<=1024px), que siempre sea visible */
@media (max-width: 1024px) {
  .back-to-top {
    display: inline-flex;
    /* Respetar áreas seguras en móviles con notch */
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}