/* Keep the desktop grid and its following margins in their original flow. */
.page[data-page="main"] .hero__first-view,
.page[data-page="main"] .hero__entry-phrase {
  display: contents;
}

.page[data-page="main"] .hero__details,
.page[data-page="main"] .hero__achievement {
  display: none;
}

@media (max-width: 768px) {
  .page[data-page="main"] {
    --mobile-mv-header: 62px;
    --mobile-mv-gutter: 20px;
    --mobile-mv-extra-space: clamp(0px, calc(28svh - 196px), 52px);
    --mobile-mv-extra-photo: clamp(0px, calc(55svh - 385px), 110px);
    --mobile-mv-space: calc(clamp(46px, calc(10svh - 16px), 56px) + var(--mobile-mv-extra-space));
    --mobile-mv-photo-fade: 28px;
  }

  .page[data-page="main"] > header.site-header,
  .page[data-page="main"] .site-header .site-header__inner {
    height: var(--mobile-mv-header);
  }

  .page[data-page="main"] .hero[data-section="02-hero"] {
    padding: 0 var(--mobile-mv-gutter) 44px;
  }

  .page[data-page="main"] .hero__first-view {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-height: calc(100svh - var(--mobile-mv-header));
    padding: var(--mobile-mv-space) 0 16px;
  }

  /* Keep the silk folds behind the existing photo and copy. */
  .page[data-page="main"] .hero__first-view::before,
  .page[data-page="main"] .hero__first-view::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    background: url("../../../images/mobile-mv-silk.svg") center / 100% 100% no-repeat;
  }

  .page[data-page="main"] .hero__first-view::before {
    inset: 0 calc(-1 * var(--mobile-mv-gutter)) auto auto;
    width: clamp(180px, 61vw, 340px);
    height: clamp(98px, 34vw, 156px);
  }

  .page[data-page="main"] .hero__first-view::after {
    inset: auto auto 0 calc(-1 * var(--mobile-mv-gutter));
    width: clamp(165px, 58vw, 315px);
    height: clamp(76px, 28vw, 135px);
    transform: rotate(180deg);
    opacity: .82;
  }

  .page[data-page="main"] .hero__copy {
    text-align: center;
  }

  .page[data-page="main"] .hero[data-section="02-hero"] h1 {
    font-size: clamp(16px, 5.15vw, 24px);
    line-height: 1.55;
  }

  .page[data-page="main"] .hero .hero-h1-sub {
    font-size: clamp(17px, 5.65vw, 26px);
    line-height: 1.48;
    margin-top: 12px;
  }

  .page[data-page="main"] .hero[data-section="02-hero"] h1 em {
    margin-left: 0;
    padding: .28em .65em;
    border-radius: 999px;
  }

  .page[data-page="main"] .hero .hero__photo {
    width: calc(100% + 2 * var(--mobile-mv-gutter));
    margin: calc(var(--mobile-mv-space) + 14px) calc(-1 * var(--mobile-mv-gutter)) 0;
  }

  .page[data-page="main"] .hero .photo-frame {
    height: calc(clamp(245px, 69vw, 390px) + var(--mobile-mv-extra-photo));
    border-radius: 0;
    background: none;
    mask-image: linear-gradient(transparent, #000 var(--mobile-mv-photo-fade));
    animation: none;
  }

  /* Keep both faces clear of the badge without shifting the badge. */
  .page[data-page="main"] .hero .mv-slide[data-index="2"] img {
    --mobile-mv-headroom: clamp(40px, 10vw, 52px);
    height: calc(100% - var(--mobile-mv-headroom));
    margin-top: var(--mobile-mv-headroom);
    object-position: center top;
    mask-image: linear-gradient(transparent, #000 var(--mobile-mv-photo-fade));
  }

  .page[data-page="main"] .hero .photo-echo {
    display: none;
  }

  .page[data-page="main"] .hero .hero__panda {
    left: -8px;
    bottom: -14px;
    width: 100px;
  }

  .page[data-page="main"] .hero__achievement {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 2px;
    position: absolute;
    z-index: 2;
    top: -48px;
    right: 8px;
    width: clamp(100px, 27.5vw, 112px);
    aspect-ratio: 1;
    margin: 0;
    border: 1px solid #e6c795;
    border-radius: 50%;
    background: radial-gradient(ellipse at 40% 30%, #fff 32%, #fff5f8 64%, #fce4eb);
    box-shadow: 0 2px 8px rgba(132, 89, 60, .09);
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
  }

  .page[data-page="main"] .hero__achievement b {
    color: var(--accent-deep);
    font-family: var(--serif);
    font-size: clamp(30px, 8.4vw, 35px);
    letter-spacing: -.045em;
    font-style: italic;
    line-height: 1;
  }

  .page[data-page="main"] .hero__details {
    display: block;
    margin-top: 24px;
    text-align: center;
  }

  .page[data-page="main"] .hero__details .hero__label {
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.65;
  }

  .page[data-page="main"] .hero__details .hero__label-name {
    font-size: 18px;
    font-weight: 700;
  }

  .page[data-page="main"] .hero .hero__entry {
    margin: 24px 0 0;
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: 0;
  }

  .page[data-page="main"] .hero__entry-phrase {
    display: inline-block;
    max-width: 100%;
  }

  /* The in-page link remains reachable if the floating script cannot run. */
  .page[data-page="main"] .float-diag-wrap {
    position: relative;
    top: auto;
    width: fit-content;
    margin-left: auto;
  }

  .float-diag-wrap.is-floating.is-home-sequence {
    animation: none;
    transform: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    will-change: auto;
  }

  .float-diag-wrap.is-floating.is-home-sequence.is-past-home-hero {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .32s ease-out;
  }

  .float-diag-wrap.is-floating.is-home-sequence.is-colliding > .float-diag {
    visibility: hidden;
  }

  .float-diag-wrap.is-floating.is-home-sequence .float-diag__peek img {
    opacity: 1;
    translate: none;
    scale: none;
    animation: none;
  }
}

/* A short viewport keeps the photo tall and lets the content flow naturally. */
@media (max-width: 768px) and (max-height: 680px) {
  .page[data-page="main"] .hero .photo-frame {
    max-height: 258px;
  }
}

@media (max-width: 768px) {
  .page[data-page="main"] .hero .mv-slide[data-index="1"] img {
    object-position: center top;
  }
}

@media (max-width: 768px) and (min-height: 760px) {
  .page[data-page="main"] .hero .mv-slide[data-index="1"] img {
    object-position: 75% top;
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
  .page[data-page="main"] .hero__copy,
  .page[data-page="main"] .hero__photo,
  .page[data-page="main"] .hero__details .hero__label {
    animation: mobile-mv-enter .65s cubic-bezier(.23, 1, .32, 1) both;
  }

  .page[data-page="main"] .hero__photo {
    animation-delay: .25s;
  }

  .page[data-page="main"] .hero__details .hero__label {
    animation-delay: .5s;
  }

  /* Start the three-slide cycle after its first fade-in, so the photo group
     can reveal its actual first slide. Keep the slide and pan phases aligned. */
  .page[data-page="main"] .hero .mv-slide[data-index="1"] {
    --mobile-mv-slide-delay: -1.5s;
  }

  .page[data-page="main"] .hero .mv-slide[data-index="2"] {
    --mobile-mv-slide-delay: 7.5s;
  }

  .page[data-page="main"] .hero .mv-slide[data-index="3"] {
    --mobile-mv-slide-delay: 16.5s;
  }

  .page[data-page="main"] .hero .mv-slide[data-index],
  .page[data-page="main"] .hero .mv-slide[data-index] img {
    animation-delay: var(--mobile-mv-slide-delay);
  }

  @keyframes mobile-mv-enter {
    from { opacity: 0; translate: 0 8px; }
    to { opacity: 1; translate: 0 0; }
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .float-diag-wrap.is-floating.is-home-sequence.is-past-home-hero {
    transition: none;
  }
}
