/* ==========================================================================
   RESPONSIVE ADAPTATION — ALL 13 REQUIRED DESKTOP, TABLET & MOBILE VIEWPORTS
   Covers: 320x568 -> 430x932 -> 768x1024 -> 1024x768 -> 1280..1920
   ========================================================================== */

@media (max-width: 1180px) {
  :root {
    --hero-stage-h: clamp(500px, 82svh, 760px);
    --hero-side-gutter: clamp(20px, 4vw, 48px);
  }
}

/* Tablet Landscape / Small Laptop & Tablet Portrait (769px - 1024px) */
@media (max-width: 1024px) {
  :root {
    --hero-stage-h: clamp(480px, 76svh, 740px);
  }

  .nav-pill {
    padding: 8px 12px 8px 18px;
    gap: 16px;
  }

  .nav-whatsapp-action span {
    display: none;
  }

  .hero-typography-layer {
    padding-top: clamp(138px, 19svh, 210px);
  }

  .hero-lastname {
    font-size: clamp(4.4rem, 18vw, 11.4rem);
    letter-spacing: 0.08em;
  }

  .hero-editorial-block {
    max-width: 300px;
    bottom: clamp(44px, 7.5svh, 76px);
  }

  .about-editorial-top,
  .faq-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-visual-stage {
    max-width: 620px;
  }

  .about-journey-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .about-journey-card:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 10;
  }

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

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

/* Mobile Portrait (<= 768px — 430x932 down to 360x800) */
@media (max-width: 768px) {
  :root {
    --nav-top-offset: 12px;
    --hero-stage-h: clamp(340px, 58svh, 520px);
    --hero-side-gutter: 18px;
  }

  .preloader {
    padding: max(22px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
    text-align: center;
  }

  .preloader-brand {
    justify-self: center;
  }

  .preloader-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding-bottom: 22px;
  }

  .preloader-counter {
    text-align: center;
    min-width: 0;
    font-size: clamp(3.4rem, 17vw, 4.8rem);
  }

  .preloader-progress-track {
    left: 20px;
    right: 20px;
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .site-header {
    padding: 0 14px;
  }

  .nav-pill {
    width: 100%;
    padding: 4px 8px 4px 16px;
    gap: 12px;
  }

  .nav-divider,
  .nav-links,
  .nav-whatsapp-action {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero-typography-layer {
    padding-top: clamp(128px, 17.4svh, 168px);
  }

  .hero-name-lockup {
    max-width: 96vw;
    align-items: center;
  }

  .hero-lastname {
    font-size: clamp(3.95rem, 21.2vw, 6.6rem);
    letter-spacing: 0.055em;
    text-indent: 0.055em;
  }

  .about-transition-card {
    border-radius: 12px;
  }

  .about-transition-img {
    object-position: center 12%;
  }

  .hero-canvas-layer,
  .hero-character-layer {
    align-items: flex-end;
    padding-bottom: 16svh;
  }

  .hero-ui-layer::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 44svh;
    background: linear-gradient(
      to top,
      #000000 30%,
      rgba(0, 0, 0, 0.88) 64%,
      rgba(0, 0, 0, 0) 100%
    );
    pointer-events: none;
  }

  .hero-editorial-block {
    left: 18px;
    right: 18px;
    bottom: max(46px, calc(env(safe-area-inset-bottom) + 34px));
    max-width: none;
    gap: 10px;
  }

  .hero-role-label {
    font-size: 0.68rem;
  }

  .hero-tagline-sub {
    font-size: 0.86rem;
    line-height: 1.46;
  }

  .hero-cta-group {
    width: 100%;
    padding-top: 4px;
    gap: 10px;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .scroll-indicator {
    bottom: 10px;
  }

  .scroll-indicator-line {
    height: 20px;
  }

  .skip-intro-btn {
    right: 14px;
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  /* Mobile About Stage & Journey Grid (Zero Face Overlap) */
  .about-visual-stage {
    max-width: none;
    padding-bottom: 0;
    padding-right: 0;
  }

  .about-primary-figure {
    width: 100%;
    aspect-ratio: 4 / 3.8;
  }

  .about-overlap-figure {
    position: relative;
    right: auto;
    bottom: auto;
    width: 76%;
    margin: 16px 0 0 auto;
    aspect-ratio: 3 / 4;
    outline: none;
  }

  .about-journey-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .about-journey-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .about-journey-card {
    aspect-ratio: 1 / 1.06;
  }

  .about-journey-card:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 4 / 4.2;
  }

  .catalogue-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
  }

  .catalogue-heading {
    font-size: clamp(1.85rem, 8.2vw, 2.5rem);
  }

  .search-input {
    font-size: 1rem;
  }

  .toolbar-bar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .toolbar-action-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin-left: 0;
  }

  .toolbar-dropdown {
    width: 100%;
    min-width: 0;
  }

  .toolbar-control-btn {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.8rem;
    justify-content: space-between;
  }

  .toolbar-btn-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
  }

  .toolbar-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 250;
    background-color: rgba(0, 0, 0, 0.74);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.22s ease;
  }

  .toolbar-sheet-backdrop[hidden] {
    display: none !important;
  }

  .toolbar-sheet-backdrop.is-open {
    opacity: 1;
  }

  .toolbar-dropdown-panel,
  .toolbar-dropdown-panel--filter {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    min-width: 0;
    max-height: 75svh;
    z-index: 260;
    border-radius: 14px 14px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    transform: translateY(20px);
    opacity: 0;
  }

  .toolbar-dropdown-panel.is-open {
    transform: translateY(0);
    opacity: 1;
  }

  .toolbar-sheet-close {
    display: inline-flex;
  }

  .catalog-card-body {
    padding: 12px;
    gap: 6px;
  }

  .catalog-card-actions {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .catalog-btn-view,
  .catalog-btn-wa {
    min-height: 44px;
    width: 100%;
    justify-content: center;
  }

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

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

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

@media (max-width: 639px) {
  .why-grid {
    grid-template-columns: 1fr;
  }
}

/* Short Landscape Viewports (e.g. 1024x768 / short mobile landscape) */
@media (max-height: 780px) and (min-width: 769px) {
  .hero-typography-layer {
    padding-top: clamp(104px, 14svh, 150px);
  }
  .hero-editorial-block {
    bottom: 36px;
  }
}

/* Mobile Landscape / Short Height (<= 768px width & <= 640px height) */
@media (max-width: 768px) and (max-height: 640px) {
  :root {
    --hero-stage-h: clamp(270px, 76svh, 390px);
  }

  .hero-typography-layer {
    padding-top: clamp(78px, 13svh, 112px);
  }

  .hero-lastname {
    font-size: clamp(3.2rem, 15vw, 5.2rem);
  }

  .hero-canvas-layer,
  .hero-character-layer {
    padding-bottom: 6svh;
  }

  .hero-editorial-block {
    bottom: max(18px, env(safe-area-inset-bottom));
  }
}

/* Narrow Mobile (<= 359px, e.g. 320x568 iPhone SE 1st Gen) */
@media (max-width: 359px) {
  :root {
    --hero-stage-h: clamp(300px, 52svh, 400px);
    --hero-side-gutter: 14px;
  }

  .hero-typography-layer {
    padding-top: clamp(106px, 18.8svh, 132px);
  }

  .hero-lastname {
    font-size: clamp(3.35rem, 20.5vw, 4.3rem);
    letter-spacing: 0.045em;
    text-indent: 0.045em;
  }

  .hero-cta-group {
    flex-wrap: wrap;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    flex: 1 1 120px;
  }

  .catalogue-heading {
    font-size: 1.56rem;
    letter-spacing: -0.02em;
  }

  .hero-intro-prompt {
    bottom: max(70px, calc(env(safe-area-inset-bottom) + 64px));
  }

  .about-overlap-figure {
    width: 84%;
    margin: 14px 0 0 auto;
    outline: none;
  }

  .catalogue-grid,
  .related-grid,
  .about-journey-grid {
    grid-template-columns: 1fr;
  }

  .catalogue-cat-title {
    font-size: 1.38rem;
  }

  .toolbar-control-btn {
    padding: 10px 9px;
    gap: 5px;
    font-size: 0.76rem;
  }

  .about-journey-card:first-child {
    aspect-ratio: 4 / 4.4;
  }
}
