/* =========================================================
   HUGO STUDIO · RESPONSIVE V30
   Solo actúa en tablet y móvil. El diseño de escritorio permanece intacto.
   ========================================================= */

@media (max-width: 1024px) {
  :root {
    --mobile-gutter: clamp(18px, 4vw, 34px);
    --mobile-nav-height: 76px;
    --title-hero: clamp(2.9rem, 7vw, 4.7rem);
    --title-section: clamp(2.7rem, 6.2vw, 4.2rem);
  }

  html {
    scroll-padding-top: 104px;
    scroll-snap-type: none !important;
  }

  body {
    overflow-x: hidden;
  }

  /* Navegación móvil/tablet */
  .navbar {
    top: 12px;
    width: calc(100% - 24px);
    min-height: var(--mobile-nav-height);
    padding: 10px 12px 10px 18px;
    grid-template-columns: 90px 1fr auto;
    gap: 12px;
    border-radius: 30px;
  }

  .brand {
    width: 66px;
    height: 48px;
  }

  .brand img {
    height: 42px;
  }

  .menu-button {
    display: grid;
    justify-self: end;
    width: 48px;
    height: 48px;
    place-content: center;
    gap: 7px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 24px rgba(47, 107, 255, 0.28);
    cursor: pointer;
  }

  .menu-button span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 220ms cubic-bezier(.22, 1, .36, 1);
  }

  .menu-button[aria-expanded="true"] span:first-child {
    transform: translateY(4.5px) rotate(45deg);
  }

  .menu-button[aria-expanded="true"] span:last-child {
    transform: translateY(-4.5px) rotate(-45deg);
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 24px;
    background: rgba(12, 12, 14, 0.985);
    box-shadow: 0 24px 54px rgba(0,0,0,.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px) scale(.985);
    transform-origin: top center;
    transition: opacity 220ms ease, transform 280ms cubic-bezier(.22,1,.36,1), visibility 220ms ease;
  }

  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .nav-links a {
    min-height: 48px;
    padding: 0 16px;
    justify-content: flex-start;
    border-radius: 14px;
    font-size: .94rem;
    opacity: .86;
  }

  .nav-links a::after {
    display: none;
  }

  .nav-links a:hover,
  .nav-links a:focus-visible,
  .nav-links a.is-current {
    background: rgba(255,255,255,.08);
    transform: none;
    opacity: 1;
  }

  .nav-links .mobile-nav-cta {
    margin-top: 4px;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    font-weight: 750;
    opacity: 1;
  }

  .nav-cta {
    display: none;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  /* Inicio */
  .hero {
    width: 100%;
    min-height: auto;
    padding: 124px var(--mobile-gutter) 72px;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 30px;
  }

  .hero-copy {
    width: min(100%, 720px);
  }

  .hero h1 {
    max-width: 12ch;
    font-size: var(--title-hero);
  }

  .hero h1 span,
  .hero-title-second-line {
    white-space: normal;
  }

  .hero-text {
    max-width: 560px;
    margin: 24px 0;
    font-size: 1rem;
  }

  .visual-composition {
    width: min(100%, 720px);
    min-height: 500px;
    margin: 0 auto;
  }

  /* Proyectos del index */
  .projects-experience {
    min-height: auto;
    padding: 112px 0 82px;
    display: block;
  }

  .projects-experience-inner {
    width: calc(100% - (var(--mobile-gutter) * 2));
    min-height: 0;
    gap: 28px;
  }

  .projects-experience-heading {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .projects-experience-heading h2 {
    max-width: 13ch;
    font-size: var(--title-section);
  }

  .projects-experience-heading > p {
    max-width: 560px;
    margin: 0;
  }

  .project-showcase {
    min-height: 0;
    margin-top: 18px;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .project-active-copy {
    width: 100%;
    max-width: none;
    padding: 30px;
  }

  .project-active-copy h3 {
    font-size: clamp(3rem, 9vw, 4.6rem);
  }

  .project-active-description {
    min-height: 0;
    max-width: 58ch;
  }

  .project-deck {
    position: relative;
    min-height: 0;
    width: 100%;
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 4px;
    padding: 8px 4px 20px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
  }

  .project-deck::-webkit-scrollbar {
    display: none;
  }

  .project-cover-card {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 clamp(138px, 28vw, 180px);
    width: clamp(138px, 28vw, 180px) !important;
    height: auto !important;
    aspect-ratio: 0.68;
    opacity: .72 !important;
    filter: saturate(.82) brightness(.78) !important;
    transform: translate3d(0,0,0) scale(.96) !important;
    pointer-events: auto !important;
    scroll-snap-align: center;
    border-radius: 22px;
    transition: opacity 260ms ease, filter 260ms ease, transform 300ms cubic-bezier(.22,1,.36,1), box-shadow 300ms ease;
  }

  .project-cover-card.is-active {
    opacity: 1 !important;
    filter: none !important;
    transform: translate3d(0,-4px,0) scale(1) !important;
  }

  .mosaic-cylinder {
    width: 180vw;
    opacity: .62;
  }

  /* Servicios */
  .services-section,
  .process-section,
  .studio-section,
  .contact-section {
    min-height: auto;
    display: block;
  }

  .section-shell {
    width: calc(100% - (var(--mobile-gutter) * 2));
  }

  .services-section {
    padding: 112px 0 82px;
  }

  .section-heading-split {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 20px;
  }

  .section-heading-split h2 {
    max-width: 14ch;
    font-size: var(--title-section);
  }

  .section-heading-split > p {
    max-width: 620px;
    margin: 0;
  }

  .services-grid {
    margin-top: 36px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .service-card {
    height: auto;
    min-height: 310px;
    padding: 26px;
  }

  .service-card h3 {
    margin: 34px 0 14px;
    white-space: normal;
    font-size: clamp(1.85rem, 4.5vw, 2.55rem);
  }

  .service-card p {
    font-size: .91rem;
  }

  .services-note {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 24px;
  }

  .services-note a {
    width: fit-content;
  }

  /* Proceso */
  .process-section {
    padding: 112px 0 82px;
  }

  .process-heading h2 {
    max-width: 14ch;
    font-size: var(--title-section);
  }

  .process-grid {
    margin-top: 38px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
  }

  .process-step {
    min-height: 260px;
    padding: 28px;
  }

  .process-step h3 {
    margin: 52px 0 12px;
    font-size: clamp(1.8rem, 4vw, 2.35rem);
  }

  /* Estudio */
  .studio-section {
    padding: 132px 0 84px;
  }

  .studio-card {
    width: 100%;
    padding: 210px 24px 24px;
    overflow: visible;
  }

  .studio-person {
    top: -86px;
    left: 50%;
    width: min(230px, 45vw);
    transform: translateX(-50%);
    z-index: 1;
  }

  .studio-card-header {
    position: relative;
    z-index: 2;
    min-height: 0;
    padding: 0;
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }

  .studio-title-group h2 {
    max-width: 18ch;
    margin-inline: auto;
    font-size: clamp(2.35rem, 6vw, 3.5rem);
  }

  .studio-role {
    margin: 0;
    text-align: center;
    white-space: normal;
    font-size: clamp(1.45rem, 3.2vw, 2rem);
  }

  .studio-dark-panel {
    position: relative;
    z-index: 3;
    margin-top: 26px;
    padding: 28px;
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .studio-panel-copy > p {
    max-width: 58ch;
    margin-inline: auto;
    text-align: center;
  }

  .studio-actions {
    justify-content: center;
  }

  .studio-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
  }

  .studio-fact {
    min-height: 154px;
  }

  /* Contacto */
  .contact-section {
    padding: 112px 0 64px;
  }

  .contact-heading h2 {
    max-width: 13ch;
    font-size: var(--title-section);
  }

  .contact-options {
    margin-top: 38px;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .contact-card {
    min-height: 0;
    padding: 30px;
  }

  .contact-card h3 {
    margin: 34px 0 14px;
    font-size: clamp(2.1rem, 5vw, 3.2rem);
  }

  .contact-details {
    gap: 14px 28px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 20px;
  }

  .footer-inner nav,
  .footer-meta {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  :root {
    --mobile-gutter: 20px;
    --title-hero: clamp(2.65rem, 12vw, 3.55rem);
    --title-section: clamp(2.55rem, 11vw, 3.35rem);
  }

  .navbar {
    width: calc(100% - 20px);
    min-height: 70px;
    grid-template-columns: 72px 1fr auto;
    border-radius: 26px;
  }

  .brand {
    width: 58px;
  }

  .brand img {
    height: 38px;
  }

  .menu-button {
    width: 46px;
    height: 46px;
  }

  .hero {
    padding-top: 112px;
    padding-bottom: 56px;
    gap: 20px;
  }

  .hero h1 {
    max-width: 10.5ch;
  }

  .hero-text {
    font-size: .96rem;
  }

  .hero-actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .hero-actions .button {
    min-height: 50px;
    padding-inline: 18px;
  }

  .visual-composition {
    min-height: 390px;
    transform: scale(.94);
    transform-origin: center top;
  }

  .visual-card-logo {
    top: 31%;
    left: 26%;
    width: 48%;
  }

  .visual-card-micoope,
  .visual-card-click,
  .visual-card-deportito,
  .visual-card-vape {
    width: 35%;
  }

  .projects-experience {
    padding: 104px 0 68px;
  }

  .projects-experience-heading h2 {
    max-width: 10.5ch;
  }

  .project-active-copy {
    padding: 26px 22px 28px;
    border-radius: 24px;
  }

  .project-active-index {
    margin-bottom: 26px;
  }

  .project-active-copy h3 {
    font-size: clamp(2.7rem, 14vw, 4.1rem);
  }

  .project-active-description {
    font-size: .9rem;
  }

  .project-cover-card {
    flex-basis: 130px;
    width: 130px !important;
    border-radius: 20px;
  }

  .mosaic-cylinder {
    width: 250vw;
    opacity: .52;
  }

  .services-section,
  .process-section,
  .contact-section {
    padding-top: 102px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: 0;
    padding: 24px;
  }

  .service-card h3 {
    margin-top: 28px;
    font-size: clamp(1.95rem, 9vw, 2.65rem);
  }

  .services-note {
    padding: 22px;
  }

  .process-grid {
    grid-template-columns: 1fr;
    border-radius: 24px;
  }

  .process-step {
    min-height: 0;
    padding: 26px;
  }

  .process-step h3 {
    margin: 36px 0 10px;
    font-size: 2rem;
  }

  .studio-section {
    padding-top: 124px;
  }

  .studio-card {
    padding: 196px 18px 18px;
    border-radius: 26px;
  }

  .studio-person {
    top: -68px;
    width: 210px;
  }

  .studio-title-group h2 {
    font-size: clamp(2.15rem, 10vw, 2.8rem);
  }

  .studio-dark-panel {
    padding: 22px;
    border-radius: 22px;
  }

  .studio-panel-copy > p {
    font-size: .96rem;
    line-height: 1.65;
  }

  .studio-actions {
    flex-direction: column;
  }

  .studio-actions .button {
    width: 100%;
  }

  .studio-facts {
    grid-template-columns: 1fr;
  }

  .studio-fact {
    min-height: 136px;
  }

  .contact-card {
    padding: 26px 24px;
    border-radius: 24px;
  }

  .contact-card h3 {
    font-size: clamp(2rem, 9vw, 2.7rem);
  }

  .contact-card > div {
    display: grid;
    gap: 10px;
  }

  .contact-button {
    width: 100%;
  }

  .contact-details {
    display: grid;
    gap: 12px;
  }

  .footer-inner nav {
    gap: 14px 20px;
  }
}

/* Mantiene una composición cercana al escritorio en tablets anchas. */
@media (min-width: 760px) and (max-width: 1024px) {
  .contact-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-card {
    min-height: 330px;
  }
}

/* Ajuste final del retrato de Estudio: mantiene la superposición del escritorio
   sin cubrir el título en tablet ni teléfono. */
@media (max-width: 1024px) {
  .studio-card {
    padding: 36px 24px 24px;
  }

  .studio-person {
    top: -78px;
    left: 44px;
    width: auto;
    height: 350px;
    transform: none;
  }

  .studio-card-header {
    min-height: 220px;
    padding: 62px 0 0 170px;
    text-align: left;
    align-items: end;
  }

  .studio-title-group h2 {
    margin-inline: 0;
  }

  .studio-role {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .studio-card {
    padding: 22px 18px 18px;
  }

  .studio-person {
    top: -58px;
    left: 50%;
    width: auto;
    height: 280px;
    transform: translateX(-50%);
  }

  .studio-card-header {
    min-height: 0;
    padding: 230px 0 0;
    text-align: center;
  }

  .studio-title-group h2 {
    margin-inline: auto;
  }

  .studio-role {
    text-align: center;
  }
}
