/* Global Mobile Layout Fixes & Animations */
:root {
  --app-height: 100vh;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

/* Base resets to prevent layout horizontal scroll */
img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .slide__title {
    font-size: clamp(1.8rem, 8vw, 2.5rem) !important;
  }

  /* Optimize backdrop filter on mobile to reduce lag */
  .nav, .nav__links, .brand, .nav__more {
    -webkit-backdrop-filter: blur(4px) saturate(120%) !important;
    backdrop-filter: blur(4px) saturate(120%) !important;
  }

  /* keep hero headline fixed on mobile to avoid overlap */
  .hero__overlay {
    gap: 1.2rem !important;
  }
  .hero__word--left,
  .hero__word--right {
    transform: translateX(0) !important;
  }
}

/* Mobile-only fallbacks for stacked sections (2 → 7)
   Turn the fixed, animated overlays into a simple vertical flow so
   nothing overlaps and scrolling stays smooth on phones. */
@media (max-width: 900px) {
  /* keep body scrollable even when JS toggles lock classes */
  body.section-three-open,
  body.section-four-open,
  body.section-five-open,
  body.section-six-open,
  body.section-seven-open,
  body.route-to-marketing {
    overflow: hidden !important;
  }

  .section-three,
  .section-four,
  .section-five,
  .section-six {
    position: fixed;
    inset: 0;
    height: auto;
    min-height: 100vh;
    transform: translateX(115%);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
  }

  .section-seven {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 55vh;
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
    box-shadow:
      0 -24px 48px rgba(0, 0, 0, 0.18),
      0 -12px 24px rgba(0, 0, 0, 0.18);
  }

  .section-three,
  .section-four,
  .section-five,
  .section-six {
    padding: clamp(2.2rem, 6vw, 3rem) clamp(1.2rem, 5vw, 1.9rem);
    min-height: 86vh;
  }

  /* Section 3 */
  .section-three__inner {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    align-items: start;
    justify-items: center;
    gap: 1.2rem;
    width: 100%;
    min-height: 100vh;
    padding: 0;
  }

  .section-three__copy {
    align-items: center;
    text-align: center;
    max-width: 520px;
    z-index: 2;
    margin-top: clamp(6vh, 8vh, 10vh);
  }

  .section-three__art {
    position: absolute;
    left: 45%;
    bottom: -8vh;
    transform: translateX(-55%);
    width: min(440px, 94vw);
    max-height: 88vh;
    aspect-ratio: 4 / 5;
    background-size: contain;
    background-position: center bottom;
    margin: 0;
    z-index: 0;
    pointer-events: none;
  }

  /* Section 4 */
  .section-four__inner {
    position: relative;
    grid-template-columns: minmax(0, 0.55fr) minmax(0, 0.45fr);
    grid-template-areas:
      "col copy"
      "statue statue";
    gap: clamp(0.6rem, 2vw, 1rem);
    align-items: start;
    text-align: left;
    padding: clamp(2.6rem, 8vh, 3.6rem) clamp(1rem, 5vw, 1.6rem) clamp(4rem, 11vh, 5rem);
    min-height: 92vh;
  }

  .section-four__column {
    grid-area: col;
    justify-items: flex-start;
    text-align: left;
    transform: translateX(-12vw);
  }

  .section-four__line {
    opacity: 1 !important;
    transform: translateY(0) !important;
    font-size: clamp(1.4rem, 5vw, 2.1rem);
  }

  .section-four__statue {
    grid-area: statue;
    position: absolute;
    left: 50%;
    bottom: -3cm;
    transform: translateX(-50%);
    width: min(400px, 90vw);
    min-height: clamp(360px, 58vh, 560px);
    background-size: contain;
    background-position: center bottom;
    margin: 0 auto;
    z-index: 0;
    pointer-events: none;
  }

  .section-four__copy {
    grid-area: copy;
    justify-content: flex-start;
    align-items: flex-start;
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    transform: none;
    margin-top: calc(clamp(28rem, 64vh, 42rem) - 3cm);
    margin-left: clamp(3cm, 9vw, 3.6cm);
    padding: 0;
    z-index: 2;
    max-width: min(72vw, 340px);
    text-align: left;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
  }

  .section-four__body {
    text-align: left;
    max-width: 100%;
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
    font-size: clamp(0.82rem, 2.4vw, 0.94rem);
    line-height: 1.42;
    display: block;
    word-break: break-word;
  }

  @media (max-width: 540px) {
    .section-four__copy {
      grid-column: 1 / span 2;
      margin-top: calc(clamp(26rem, 60vh, 38rem) - 3cm);
      margin-left: clamp(3cm, 9vw, 3.4cm);
      max-width: min(78vw, 360px);
    }

    .section-four__body {
      font-size: clamp(0.8rem, 2.6vw, 0.92rem);
      line-height: 1.42;
      max-width: 100%;
    }

    .section-four__statue {
      width: min(380px, 94vw);
      min-height: clamp(340px, 58vh, 560px);
      bottom: 0;
    }
  }

  /* keep statue fixed relative to viewport while section 4 is visible */
  .section-four.is-visible .section-four__statue {
    position: fixed;
    bottom: -3cm;
    transform: translateX(-50%);
  }

  .section-four.is-closing-right .section-four__statue,
  .section-four:not(.is-visible) .section-four__statue {
    position: absolute;
    bottom: -3cm;
    transform: translateX(-50%);
  }

  /* fallback: show paragraph only when JS not ready */
  html:not(.js-ready) .section-four__body:empty::before {
    content: attr(data-fulltext);
    display: block;
    color: inherit;
    text-align: inherit;
    line-height: 1.6;
  }

  /* keep side-entry feel */
  .section-three.is-visible,
  .section-four.is-visible,
  .section-five.is-visible,
  .section-six.is-visible {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .section-seven.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .section-three.is-closing-right,
  .section-four.is-closing-right,
  .section-five.is-closing-right,
  .section-six.is-closing-right {
    transform: translateX(14vw);
    opacity: 0;
    pointer-events: none;
  }

  .section-seven.is-closing-bottom {
    transform: translateY(120%);
    opacity: 0;
    pointer-events: none;
  }

  /* Section 5 */
  .section-five__inner {
    position: relative;
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    gap: 1.2rem;
    padding-top: clamp(1.6rem, 6vh, 3rem);
  }

  .section-five__statue {
    position: relative;
    left: auto;
    bottom: auto;
    transform: translateY(-10vh);
    width: min(420px, 88vw);
    min-height: clamp(400px, 62vh, 620px);
    background-size: contain;
    background-position: center bottom;
    margin: 0 auto 0;
    z-index: 0;
    pointer-events: none;
  }

  .section-five__copy {
    margin-left: 0;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    z-index: 2;
    margin-top: -5.6rem;
  }

  .section-five__headline,
  .section-five__body {
    text-align: center;
  }

  /* Section 6 */
  .section-six__inner {
    position: relative;
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    gap: 1.6rem;
  }

  .section-six__statue {
    position: absolute;
    left: 50%;
    bottom: -22vh;
    transform: translateX(-50%);
    width: min(420px, 90vw);
    min-height: clamp(440px, 68vh, 680px);
    background-size: contain;
    background-position: center bottom;
    margin: 0 auto;
    z-index: 0;
    pointer-events: none;
  }

  .section-six__copy,
  .section-six__links {
    align-items: center;
    position: relative;
    z-index: 2;
  }

  /* Section 2 (postflow) statue keep bottom aligned */
  .postflow {
    position: relative;
    overflow: hidden;
    min-height: calc(122vh - 3cm) !important;
    padding: 0 !important;
    padding-bottom: 0 !important;
  }

  .postflow__image {
    position: relative;
    grid-row: 2;
    width: 100%;
    height: clamp(340px, 62vh, 560px);
    margin-top: clamp(-9.2cm, -22vw, -4.8cm);
    background-position: calc(100% + 0.1cm) calc(100% + 1cm) !important;
    background-size: 108% auto !important;
    background-repeat: no-repeat;
    opacity: 0.9 !important;
    pointer-events: none;
    z-index: 0;
  }

  .postflow__content {
    grid-row: 1;
    position: relative;
    z-index: 2;
    padding: 0 !important;
    padding-bottom: 0 !important;
    padding-right: 0 !important;
    padding-left: clamp(1.4rem, 5vw, 2.3rem) !important;
    max-width: 90vw;
  }

  .postflow__copy,
  .postflow__title {
    position: relative;
    z-index: 2;
    max-width: 32ch;
  }

  /* Section 7 */
  .section-seven {
    height: auto;
    min-height: 0;
    margin-top: 0;
    padding: clamp(1rem, 4.5vw, 1.7rem) clamp(0.9rem, 4vw, 1.3rem) clamp(1.4rem, 5vw, 2rem);
    border-radius: 18px 18px 0 0;
    background:
      radial-gradient(circle at 10% -20%, rgba(224, 18, 140, 0.16), transparent 52%),
      linear-gradient(180deg, #f8f7fc 0%, #eef0f7 100%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 -14px 30px rgba(12, 16, 36, 0.16);
  }

  .section-seven__inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "contact"
      "groupA"
      "groupB";
    gap: 0.9rem;
    padding: 0.75rem;
    border-radius: 16px;
    text-align: left;
    align-items: start;
  }

  .section-seven__links,
  .section-seven__group {
    align-items: stretch;
    width: 100%;
  }

  .section-seven__contact {
    order: -1;
    width: 100%;
    align-self: stretch;
    grid-area: contact;
    padding: 0.95rem;
    border-radius: 14px;
    display: grid;
    gap: 0.5rem;
    text-align: left;
  }

  .section-seven__group:nth-of-type(1) {
    grid-area: groupA;
  }

  .section-seven__group:nth-of-type(2) {
    grid-area: groupB;
  }

  .section-seven__contact-text,
  .section-seven__contact-list {
    justify-content: flex-start;
    text-align: left;
  }

  .section-seven__contact-body {
    max-width: 100%;
  }

  .section-seven__contact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: lowercase;
  }

  .section-seven__clock {
    font-size: 0.86rem;
  }

  .section-seven__contact-list {
    gap: 0.46rem;
  }

  .section-seven__contact-item {
    padding: 0.58rem 0.68rem;
    border-radius: 10px;
  }

  .section-seven__link {
    padding: 0.58rem 0.68rem;
    border-radius: 10px;
  }

  @media (max-width: 540px) {
    .section-seven {
      padding: 0.9rem 0.7rem 1.5rem;
    }

    .section-seven__inner {
      grid-template-columns: 1fr;
      grid-template-areas:
        "contact"
        "groupA"
        "groupB";
      padding: 0.58rem;
    }

    .section-seven__contact {
      order: -1;
      padding: 0.85rem;
    }

    .section-seven__group,
    .section-seven__contact {
      text-align: left;
      align-items: stretch;
    }

    .section-seven__links {
      align-items: stretch;
    }
  }
}

/* GSAP/Reveal Initialization Classes */
.gsap-reveal {
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px);
  will-change: transform, opacity;
}
