/**********************************************************
= = = = = = = = =  E S C R I T O R I O  (≥ 769px)  = = = = = = = = =
**********************************************************/

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
}

.container {
  display: block;
  min-height: 100vh;
}

/* Sidebar fija en escritorio */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  overflow-y: auto;
  background-color: #111827;
  color: white;
  text-align: center;
  padding: 20px;
  z-index: 900;
}

.profile-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
}

.sidebar h1 {
  font-size: 20px;
  margin: 15px 0 5px;
}

.icon-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 20px;
}

.circle-icon,
.square-icon {
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 26px;
  height: 26px;
  padding: 4px;
  transition: transform 0.3s;
}

.circle-icon {
  border-radius: 50%;
}

.square-icon {
  border-radius: 6px;
}

.circle-icon img,
.square-icon img {
  width: 22px;
  height: 22px;
  filter: invert(1); /* iconos blancos */
}

.circle-icon:hover,
.square-icon:hover {
  transform: scale(1.1);
}

.nav {
  margin-top: 30px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  padding: 10px;
  transition: background 0.3s;
}

.nav a:hover {
  background: #1f2937;
  border-radius: 5px;
}

.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
}

/* -- Contenido principal (deja hueco a la sidebar fija) -- */
.content {
  margin-left: 260px;                 /* deja hueco a la sidebar fija */
  width: calc(100% - 260px);          /* <- evita la franja blanca derecha */
  overflow-y: auto;
  scroll-behavior: smooth;
  background-color: #ffffff;
  color: #111;
}

.section {
  min-height: 100vh;
  width: 100%;
  padding: 60px;
  box-sizing: border-box;
  border-bottom: 1px solid #e0e0e0;
}

.section h2 {
  margin-top: 0;
  margin-bottom: 30px;
  font-size: 32px;
  text-align: left;
  padding-left: 24px;
}

.section:nth-of-type(even) {
  background-color: #f9fafb;
}

/* PORTADA */
.home-section {
  background-image: url('shanghai.jpg');
  background-size: cover;
  background-position: center;
  position: relative;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  animation: fadeInBackground 2s ease-in-out;
}

.overlay {
  background-color: rgba(0, 0, 0, 0.55);
  padding: 50px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  animation: fadeInUp 1.5s ease-out;
}

.home-title {
  font-size: 60px;
  margin: 0;
  animation: fadeInUp 1s ease-out;
  font-weight: bold;
  letter-spacing: 2px;
}

.home-subtitle {
  font-size: 26px;
  margin-top: 14px;
  animation: fadeInUp 2s ease-out;
  font-weight: 300;
  color: #cce7ff;
}

/* ANIMACIONES */
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInBackground {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ABOUT */
.about-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: white;
}

.about-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  line-height: 1.8;
  font-size: 17px;
  color: #111;
}

/* CONTACTO */
.contact-buttons { color: #111; }

.contact-box {
  background-color: white;
  border: 1.5px solid black;
  border-radius: 14px;
  padding: 30px;
  max-width: 500px;
  margin: 0 auto;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 16px;
}

.contact-item a {
  color: #3498db;
  font-weight: 500;
  text-decoration: none;
}

.contact-item a:hover { text-decoration: underline; }
.contact-item .material-symbols-outlined { font-size: 22px; }

.contact-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 8px;
}
.contact-icon.white-icon { filter: invert(1); }

/* EDUCATION / EXPERIENCE */
.education-container { max-width: 900px; margin: 0 auto; }

.education-item {
  margin-bottom: 50px;
  background-color: #f9f9f9;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.education-item h3 { font-size: 22px; margin-bottom: 5px; color: #111827; }
.education-center { font-weight: 500; margin: 0; color: #555; }
.education-date { font-style: italic; color: #888; margin-bottom: 20px; }

.education-details { display: flex; flex-wrap: wrap; gap: 30px; }
.education-block { flex: 1 1 350px; }
.education-block h4 { margin-bottom: 10px; color: #0f172a; font-size: 16px; }
.education-block ul { padding-left: 18px; margin: 0; line-height: 1.6; color: #333; }
.education-block ul li { list-style: disc; }

.experience-container { max-width: 800px; margin: 0 auto; }
.experience-item {
  margin-bottom: 50px;
  background-color: #f9f9f9;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.experience-item h3 { font-size: 20px; color: #111827; margin-bottom: 5px; }
.experience-company { font-weight: 500; color: #555; margin-bottom: 4px; }
.experience-date { font-style: italic; color: #888; margin-bottom: 15px; }
.experience-item ul { padding-left: 20px; color: #333; line-height: 1.6; }
.experience-item ul li { list-style: disc; margin-bottom: 8px; }
.experience-summary { margin-top: 15px; font-style: italic; color: #444; }

/* === PORTFOLIO === */
.portfolio-wrapper { position: relative; max-width: 1100px; margin: 0 auto; }
.portfolio-scroller {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 8px 6px;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 6px;
  -webkit-overflow-scrolling: touch;
}

.project-card {
  flex: 0 0 320px;                 /* ancho de “item” tipo LazyRow */
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }

.project-cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  background: #0f172a;
}
.project-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.02); transition: transform .3s ease;
}

.project-content { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.project-content h3 { margin: 2px 0 0; font-size: 18px; color: #0f172a; }
.project-content p { margin: 0; color: #374151; line-height: 1.6; font-size: 14px; }

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 6px 0 0; }
.project-tags li {
  font-size: 12px; padding: 6px 10px; border: 1px solid #e5e7eb;
  border-radius: 999px; background: #fff; color: #1f2937;
}
.project-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #0f172a; }

.project-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.12); border-color: #d1d5db; }
.project-card:hover .project-cover img { transform: scale(1.06); }

.scroll-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  border: none; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(17,24,39,.9); color: #fff; cursor: pointer;
  display: grid; place-items: center; z-index: 2;
}
.scroll-btn.prev { left: -6px; }
.scroll-btn.next { right: -6px; }

.portfolio-hint { display: block; margin-top: 10px; color: #6b7280; text-align: center; font-size: 12px; }

/* Portada tipo logo para proyectos */
.project-cover.brand {
  background: #a41111;
  display: grid; place-items: center;
  aspect-ratio: 16/9;
  border-top-left-radius: 16px; border-top-right-radius: 16px; overflow: hidden;
}
.project-cover.brand .logo-img {
  width: 68%; height: 68%; object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.12));
}

/* ===== ESCRITORIO (≥769px): About como card centrada y Skills en cards ===== */
@media (min-width: 769px) {
  /* Card para ABOUT (solo cambia la caja, no la sección entera) */
  #about.section {
    /* un poco más de aire vertical que el .section base */
    padding-top: 96px;
    padding-bottom: 96px;
  }
   #about .about-container {
    text-align: left;              /* pasa de centrado a izquierda */
    max-width: 900px;              /* un pelín más ancho */
    margin: 0 auto;                /* centrada */
    background: #fff;
    padding: 32px 40px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 28px rgba(0,0,0,.06);
    line-height: 1.8;
    font-size: 17px;
  }
  /* Ajuste sutil del título de About */
  #about.section h2 {
    margin-bottom: 22px;
    padding-left: 24px;            /* mantienes ese “pelín” corrido */
  }

  /* Skills en cards */
  .skills-grid {
    max-width: 1100px;
    gap: 26px;                     /* más separación entre cards */
    padding: 0 8px;                /* aire lateral */
  }
  .skills-block {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 10px 24px rgba(0,0,0,.05);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  }
  .skills-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0,0,0,.08);
    border-color: #dbe2ea;
  }
  .skills-block h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #0f172a;
    border-bottom: 1px solid #eef2f7;  /* separador sutil */
    padding-bottom: 8px;
  }
  .chips { gap: 10px; }
  .chip {
    background: #fff;
    border: 1px solid #e5e7eb;
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* === MOBILE HAMBURGER HEADER (oculto en escritorio) === */
.mobile-header {
  display: none;
  background-color: #111827;
  color: white;
  padding: 14px 20px;
  position: fixed;
  top: 0; width: 100%;
  z-index: 1000;
}
.mobile-header-content { display: flex; align-items: center; justify-content: space-between; }
.mobile-header button { background: none; border: none; color: white; font-size: 26px; cursor: pointer; }
.mobile-name { font-size: 16px; font-weight: 500; }

/* === MOBILE MENU (estilos base, se refuerzan en móvil) === */
.mobile-menu {
  opacity: 0; pointer-events: none; transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  position: fixed; top: 60px; left: 0; width: 100%;
  background-color: #1f2937; color: white; z-index: 999;
  padding: 20px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.mobile-menu.active { opacity: 1; pointer-events: auto; transform: translateY(0); }
.mobile-menu ul { list-style: none; padding: 0; margin: 0; }
.mobile-menu ul li { margin: 15px 0; }
.mobile-menu ul li a { color: white; text-decoration: none; font-size: 18px; }
.mobile-menu ul li a:hover { text-decoration: underline; }
.mobile-profile-img {
  width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
  display: block; margin: 0 auto 20px;
}

/* === SKILLS === */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px; max-width: 1000px; margin: 0 auto;
}
.skills-block h3 { margin: 0 0 10px; font-size: 18px; color: #0f172a; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: #ffffff; border: 1px solid #e5e7eb; border-radius: 999px;
  padding: 8px 12px; font-size: 14px; line-height: 1; color: #1f2937;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02); transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.section:nth-of-type(even) .chip { background: #fff; }
.chip:hover { transform: translateY(-1px); border-color: #cbd5e1; }

/* Permite ocultar flechas con JS */
.scroll-btn[hidden] { display: none !important; }


 
/**********************************************************
= = = = = = = = = = =   M Ó V I L  (≤ 768px)   = = = = = = = = = =
**********************************************************/
@media (max-width: 768px) {

  :root {
    --mh: 56px;           /* altura de la barra fija */
    --title-offset: 16px; /* espacio extra entre separador y <h2> */
  }

  /* El scroll en móvil es el de la ventana */
  html, body { scroll-padding-top: 0; }
  /* (Opcional) suaviza el scroll de anclas en móvil */
  html { scroll-behavior: smooth; }

  /* ===== Barra superior ===== */
  .mobile-header {
    display: flex !important;
    height: var(--mh);
    background: #111827;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
  }
  .mobile-header-content {
    height: 100%;
    gap: 12px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .mobile-header button {
    font-size: 28px;
    line-height: 1;
    padding: 6px 8px;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
  }
  .mobile-brand { display: flex; align-items: center; gap: 8px; }
  .mobile-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
  .mobile-name { font-size: 15px; font-weight: 600; letter-spacing: .2px; line-height: 1; }

  /* ===== Menú desplegable ===== */
  .mobile-menu {
    position: fixed;
    top: calc(var(--mh) + 14px) !important;
    left: 0; right: 0;
    opacity: 0; pointer-events: none; transform: translateY(-10px);
    transition: opacity .3s ease, transform .3s ease;
    background-color: #1f2937; color: #fff; z-index: 999;
    padding: 24px 20px 20px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    box-shadow: 0 10px 22px rgba(0,0,0,.25);
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .mobile-menu.active { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .mobile-menu ul { list-style: none; padding: 0; margin: 12px 0 0; }
  .mobile-menu li { margin: 12px 0; }
  .mobile-menu a { color: #fff; text-decoration: none; font-size: 18px; }
  .mobile-menu a:hover { text-decoration: underline; }

  /* ===== Iconos sociales ===== */
  .mobile-social {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 16px 0 14px;
  }
  .mobile-social a {
    display: inline-flex;
    width: 32px; height: 32px;
    border-radius: 8px; background: #fff;
    align-items: center; justify-content: center;
  }
  .mobile-social img { width: 18px; height: 18px; display: block; filter: brightness(0); opacity: .95; }

  /* ===== Contenido y secciones ===== */
  .content {
    overflow: visible !important;       /* scroll en la ventana, no aquí */
    margin-left: 0 !important;
    width: 100vw !important;
    padding-top: var(--mh);             /* empuja contenido bajo la barra */
    box-sizing: border-box;
  }

  .section {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);

    /* separador superior que se alinea con la barra al anclar */
    border-top: 1px solid #e0e0e0;

    /* aire por encima del título */
    padding: calc(24px + var(--title-offset)) 16px 24px;

    /* cada sección ocupa la pantalla útil */
    min-height: calc(100svh - var(--mh));

    /* el ancla aterriza justo bajo la barra (en el separador) */
    scroll-margin-top: var(--mh);
  }

  /* La primera sección (home) no necesita separador arriba */
  .section:first-of-type { border-top: 0; }

  .section h2 {
    padding-left: 6px;
    font-size: clamp(22px, 5.6vw, 28px);
    margin-bottom: 20px;
    text-align: left;
  }

  /* Portada */
  .home-section { min-height: calc(100svh - var(--mh)); }
  .overlay { padding: clamp(20px, 6vw, 36px); margin: 0 12px; border-radius: 12px; }
  .home-title { font-size: clamp(28px, 8vw, 40px); letter-spacing: 1px; }
  .home-subtitle { font-size: clamp(14px, 4.2vw, 18px); margin-top: 8px; }

  /* About */
  .about-container { max-width: 680px; padding: 0 4px; font-size: 16px; line-height: 1.65; text-align: left; }

  /* Ocultar sidebar en móvil */
  .sidebar { display: none !important; position: static !important; height: auto !important; overflow: visible !important; }

  /* Portfolio */
  .project-card { flex-basis: 88%; }
  .portfolio-wrapper { padding: 0 6px; }

  /* Varios */
  html, body { overflow-x: hidden; }
  .scroll-btn { width: 32px; height: 32px; }
  .scroll-btn.prev { left: 6px; }
  .scroll-btn.next { right: 6px; }
  .nav { flex-direction: row; flex-wrap: wrap; justify-content: center; margin-top: 20px; }
  .nav a { padding: 8px 12px; font-size: 14px; }
  .contact-item { flex-direction: column; align-items: flex-start; gap: 4px; }
}

