/* Load in the head so the first frame already fits under the two-row header. */
:is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) > .hero {
  --home-header: 64px;
  --hero-space: calc(100svh - var(--home-header));
  box-sizing: border-box;
  height: var(--hero-space);
  min-height: 0;
  aspect-ratio: auto;
}

@media (min-width: 992px) {
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) > .hero { --home-header: 113px; }
}

@media (min-width: 768px) {
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) > .hero {
    --u: min(calc(100vw / 1024), calc(var(--hero-space) / 663));
    display: grid;
    grid-template-rows: repeat(3, auto);
    align-content: space-between;
    justify-items: start;
    gap: 8px;
    padding: calc(var(--hero-space) * .085) 3.3% clamp(12px, 3svh, 42px);
  }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero :is(.hero-title, .hero-intro, .hero-order) {
    position: relative;
    inset: auto;
  }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-title {
    width: 92%;
    font-size: calc(var(--u) * 108);
  }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-intro {
    font-size: calc(var(--u) * 34);
  }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-photo {
    object-fit: cover;
    object-position: right 64%;
  }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-order {
    width: min(64%, calc(var(--u) * 700));
  }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-action {
    font-size: max(23px, min(calc(var(--u) * 39), 52px));
  }
}

:is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-action {
  line-height: 1.08;
  white-space: normal;
}

@media (max-width: 767px) {
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) > .hero {
    display: grid;
    align-content: start;
    grid-template-rows: auto auto 1fr auto;
    padding: clamp(12px, 3svh, 28px) 20px clamp(12px, 2.5svh, 24px);
    min-height: 340px;
    gap: clamp(8px, 1.7svh, 18px);
  }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero :is(.hero-title, .hero-intro, .hero-order) {
    position: relative;
    inset: auto;
    width: auto;
    max-width: none;
  }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-title {
    font-size: clamp(28px, min(11.35vw, 8.2svh), 72px);
  }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-intro {
    font-size: clamp(18px, 3.55svh, 30px);
  }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-order { grid-row: 4; }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-action { font-size: clamp(21px, 6.45vw, 32px); }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-photo {
    width: auto;
    height: min(74%, 650px);
    left: auto;
    right: -30%;
    bottom: 60px;
    object-fit: contain;
    mask-image: linear-gradient(to bottom, transparent, #000 18% 81%, transparent);
  }
}
@media (max-width: 767px) and (max-height: 500px) {
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) > .hero {
    min-height: 0;
    padding-block: 8px;
    gap: 5px;
  }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-title {
    font-size: clamp(22px, min(11.35vw, 7.2svh), 36px);
  }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-intro {
    font-size: clamp(15px, 4.1svh, 18px);
  }
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-action { font-size: clamp(20px, 6vw, 24px); }
}
@media (min-width: 768px) and (max-aspect-ratio: 5/4) {
  :is(:is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section), body > #main.page) .hero-scene {
    top: 30%;
    mask-image: linear-gradient(to bottom, transparent, #000 25% 76%, transparent);
  }
}
body.common-home #content:has([data-am-home-block]) > section { margin: 0; padding: 0; }
.am-editorial[data-am-home-block] { container-type:inline-size }
@media(min-width:768px) {
  .am-editorial > .am-editorial-section { --u:calc(100cqw / 1024) }
}
body.common-home .am-editorial > .am-editorial-section { width:100%;max-width:none;margin-inline:0 }
/* The hero text gets its entrance from the first style calculation. */
@media (prefers-reduced-motion: no-preference) {
  html:not([data-am-static-hero]) :is(.am-editorial #am-editorial-main, .am-editorial .am-editorial-section, body > #main.page) > .hero[data-enter] {
    & :is(.title-line > span, .title-line > em) {
      animation: am-hero-line 2s ease both;
    }

    & .title-line:nth-child(2) > span { animation-delay: 160ms; }
    & .title-line:nth-child(3) > em { animation-delay: 320ms; }
    & .hero-intro { animation: am-hero-copy 1800ms 420ms ease both; }
    & .hero-order { animation: am-hero-copy 1600ms 560ms ease both; }
  }
}

@keyframes am-hero-line {
  from { opacity: 0; transform: translateY(20%); }
  to { opacity: 1; transform: none; }
}

@keyframes am-hero-copy {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
