/* Virtualis 20261123-mobile-r4 (v20.0.32) — versión móvil compacta. Inmutable: crear otra carpeta para cambios.
   Todo bajo max-width:720px; escritorio y tablet no cambian. */

/* Elementos añadidos por mobile.js: ocultos fuera de móvil. */
.m-top, .m-dots, .m-uptime-toggle, .m-more { display: none; }

@media (max-width: 720px) {
  /* 5. Ritmo: ~30 % menos de aire entre secciones. */
  #sobre-mi, #profesional, #musica, #virtualis, #contacto { padding-top: 56px !important; padding-bottom: 56px !important; }
  #proyectos { padding-top: 64px !important; padding-bottom: 44px !important; }
  .hero-grid { padding: 100px 0 40px !important; gap: 28px !important; }

  /* 1. Portada: tarjeta de perfil compacta (el avatar y el nombre ya están en el encabezado). */
  .hero-card .card-top, .hero-card .card-line, .hero-card .card-footer { display: none !important; }
  .hero-card { padding: 18px 20px !important; }
  .hero-card .status-row { margin: 0 0 8px !important; }
  .hero-card .quote { font-size: 20px !important; line-height: 1.3 !important; margin: 0 !important; }

  /* 3. Profesional: carrusel horizontal con scroll-snap. */
  #profesional .skill-grid {
    display: grid !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 84% !important;
    grid-auto-rows: auto !important;
    gap: 12px !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--m-gutter, 16px);
    margin-inline: calc(-1 * var(--m-gutter, 16px));
    padding: 4px var(--m-gutter, 16px) 6px;
    scrollbar-width: none;
  }
  #profesional .skill-grid::-webkit-scrollbar { display: none; }
  #profesional .skill-card { scroll-snap-align: start; grid-column: auto !important; grid-row: auto !important; min-width: 0; }
  /* Las tarjetas fuera de pantalla en horizontal nunca "entran" al viewport: mostrarlas siempre. */
  #profesional .skill-card.v-reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
  .m-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
  .m-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .22); transition: background .2s ease, transform .2s ease; }
  .m-dots span.is-on { background: #4da3ff; transform: scale(1.25); }

  /* 6. Sobre mí: vídeo apaisado y texto con "Leer más". */
  #sobre-mi .about-photo-card { aspect-ratio: 16 / 10 !important; overflow: hidden; }
  #sobre-mi .about-photo-card > video { height: 100% !important; object-fit: cover !important; object-position: 50% 45%; }
  #sobre-mi .about-copy:not(.m-about-open) > p.m-extra { display: none; }
  .m-more {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 4px; padding: 0 2px;
    border: 0; background: none; color: #9ecbff; font: 600 15px/1.2 "DM Sans", system-ui, sans-serif; cursor: pointer;
  }
  .m-more::after { content: "▾"; transition: transform .2s ease; }
  .m-more[aria-expanded="true"]::after { transform: rotate(180deg); }
  .m-more:focus-visible { outline: 2px solid #4da3ff; outline-offset: 2px; border-radius: 6px; }

  /* 7. Proyectos: ficha técnica en una fila y dos proyectos en carrusel. */
  #proyectos .lab-environment { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px !important; }
  #proyectos .lab-environment > div { grid-template-columns: 1fr !important; gap: 2px !important; padding-bottom: 10px !important; }
  #proyectos .lab-environment dt { font-size: 12px !important; }
  #proyectos .lab-environment dd { font-size: 15px !important; }
  #proyectos .lab-feature { gap: 20px !important; }
  #proyectos .lab-pair {
    display: grid !important; grid-template-columns: none !important; grid-auto-flow: column !important;
    grid-auto-columns: 84% !important; gap: 20px !important;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--m-gutter, 16px);
    margin-inline: calc(-1 * var(--m-gutter, 16px));
    padding: 24px var(--m-gutter, 16px) 20px !important;
    scrollbar-width: none;
  }
  #proyectos .lab-pair::-webkit-scrollbar { display: none; }
  #proyectos .lab-pair .lab-project { scroll-snap-align: start; }
  #proyectos .lab-pair .lab-project.v-reveal { opacity: 1 !important; transform: none !important; filter: none !important; }

  /* 4. Música: portada más baja y pistas en una sola fila. */
  #pbl-player .album-cover { height: 168px !important; aspect-ratio: auto !important; }
  #pbl-player .track {
    grid-template-columns: 24px minmax(0, 1fr) max-content max-content !important;
    grid-template-rows: auto !important;
    grid-template-areas: "number title duration actions" !important;
    align-items: center;
    row-gap: 0 !important;
    min-height: 48px;
  }
  #pbl-player .track .track-actions { grid-area: actions; }

  /* 2. Virtualis: monitoreo resumido con detalle desplegable. */
  #uptime-dashboard.m-collapsed #uptime-monitors { display: none !important; }
  #uptime-monitors { min-height: 0 !important; }
  #uptime-monitors .uptime-monitor-row.v-reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
  .m-uptime-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: calc(100% - 28px); margin: 0 14px 14px; padding: 12px 16px; min-height: 46px;
    border: 1px solid rgba(77, 163, 255, .35); border-radius: 12px;
    background: rgba(77, 163, 255, .08); color: #dbeaff;
    font: 600 14px/1.2 "DM Sans", system-ui, sans-serif; cursor: pointer;
  }
  .m-uptime-toggle::after { content: "▾"; transition: transform .2s ease; }
  .m-uptime-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
  .m-uptime-toggle:focus-visible { outline: 2px solid #4da3ff; outline-offset: 2px; }

  /* 5. Botón "volver arriba". */
  .m-top {
    display: block; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 900;
    width: 46px; height: 46px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .18); background: rgba(9, 11, 15, .88); color: #fff;
    font-size: 20px; line-height: 1; cursor: pointer;
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .m-top.is-visible { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .2s ease; }
  .m-top:focus-visible { outline: 2px solid #4da3ff; outline-offset: 3px; }
}

@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .m-top, .m-dots span, .m-uptime-toggle::after, .m-more::after { transition: none !important; }
}
