/* Full-bleed moving art hero. The clip stays a plain rectangle so tile films can overlay it later. */
.a-hero {
  --hero-fg: var(--fg);
  --hero-ghost-bg: rgb(255 255 255 / 55%);
  --hero-ghost-border: var(--border);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(880px, 100svh);
  background: var(--hero-bg, var(--ink));
  color: var(--hero-fg);
}

.a-hero-art {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Optional wash so the copy stays readable over busy parts of the art. */
.a-hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--art-wash, none);
  pointer-events: none;
}

.a-hero-art :is(video, img) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--art-x, 50%) var(--art-y, 50%);
}

.a-hero-copy {
  position: relative;
  z-index: 1;
  max-width: calc(var(--edge) + 38rem);
  padding: clamp(7.5rem, 16vh, 10rem) var(--s-24) var(--s-80) var(--edge);
}

.a-hero-copy > * + * {
  margin-top: var(--s-24);
}

.a-hero h1 {
  font-size: var(--hero-h1, clamp(3.5rem, 7.2vw, 7.5rem));
  line-height: 0.92;
}

.a-hero .lead {
  max-width: 30rem;
  color: var(--hero-fg);
}

.a-hero .btn-ghost {
  border-color: var(--hero-ghost-border);
  background: var(--hero-ghost-bg);
  color: var(--hero-fg);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.a-hero .t-rating,
.a-hero .t-rating b {
  color: var(--hero-fg);
}

/* Wide screens only: light copy over dark art, and copy centered over the top of the art. */
@media (min-width: 901px) {
  .a-hero-night {
    --hero-fg: #ffffff;
    --hero-ghost-bg: rgb(255 255 255 / 10%);
    --hero-ghost-border: rgb(255 255 255 / 40%);
  }

  .a-hero-night .btn-ghost:hover {
    background: rgb(255 255 255 / 18%);
  }

  .a-hero-night .a-hero-copy {
    --ring: var(--ink-accent);
  }

  .a-hero-center .a-hero-copy {
    max-width: 58rem;
    margin-inline: auto;
    padding-inline: var(--gutter);
    text-align: center;
  }

  .a-hero-center .lead {
    max-width: 36rem;
    margin-inline: auto;
  }

  .a-hero-center :is(.row, .t-rating) {
    justify-content: center;
  }

  /* Every layout but the plain cover puts the copy first and the art in flow. */
  :is(.a-hero-stage, .a-hero-print, .a-hero-pano, .a-hero-split) .a-hero-copy {
    order: -1;
  }

  :is(.a-hero-stage, .a-hero-print, .a-hero-pano, .a-hero-split) .a-hero-art {
    position: relative;
    inset: auto;
  }

  /* Stage: copy first, then the art as a lit model whose edges fade into the hero ground. */
  .a-hero-stage {
    --stage-mask: radial-gradient(ellipse 50% 62% at 50% 62%, #000 60%, transparent 100%);
    --hero-h1: clamp(3rem, 5.4vw, 5.25rem);
    display: flex;
    flex-direction: column;
  }

  .a-hero-stage .a-hero-copy {
    padding-top: clamp(6.5rem, 13vh, 8.5rem);
    padding-bottom: 0;
  }

  .a-hero-stage .a-hero-art {
    flex: 1;
    min-height: 22rem;
  }

  /* The art rises a fifth of its own height above its box, so its empty sky sits under the copy at any size. */
  .a-hero-stage .a-hero-art :is(video, img) {
    position: absolute;
    inset: auto 0 0;
    height: 125%;
    width: auto;
    max-width: 100%;
    margin: auto;
    aspect-ratio: 16 / 9;
    -webkit-mask-image: var(--stage-mask);
    mask-image: var(--stage-mask);
  }

  /* Print: copy on the page ground, the art framed beside it like a print on a wall. */
  .a-hero-print {
    --hero-h1: clamp(3rem, 5.6vw, 6rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(44vw, 38rem);
    align-items: center;
    gap: clamp(var(--s-32), 5vw, var(--s-80));
    padding: clamp(6.5rem, 14vh, 8.5rem) var(--edge) var(--s-64);
    background: var(--bg);
  }

  .a-hero-print .a-hero-copy {
    max-width: none;
    padding: 0;
  }

  .a-hero-print .a-hero-art {
    aspect-ratio: 1;
    padding: clamp(10px, 1.6vw, 22px);
    border: 10px solid var(--print-frame, var(--fg));
    background: var(--print-mat, #faf8f3);
    box-shadow: 0 40px 70px -42px rgb(0 0 0 / 60%);
  }

  /* Pano: headline left and the rest right on the page ground, a wide film strip under both. */
  .a-hero-pano {
    --hero-h1: clamp(3rem, 5.4vw, 5.75rem);
    display: flex;
    flex-direction: column;
    gap: clamp(var(--s-32), 5vh, var(--s-48));
    min-height: 0;
    padding: clamp(6.5rem, 13vh, 8rem) var(--edge) var(--s-48);
    background: var(--bg);
  }

  .a-hero-pano .a-hero-copy {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: var(--s-24) clamp(var(--s-32), 5vw, var(--s-80));
    align-items: end;
    max-width: none;
    padding: 0;
  }

  .a-hero-pano .a-hero-copy > * {
    grid-column: 2;
    margin: 0;
  }

  .a-hero-pano .a-hero-copy > h1 {
    grid-column: 1;
    grid-row: 1 / span 3;
  }

  .a-hero-pano .a-hero-art {
    overflow: hidden;
    aspect-ratio: 2.1;
    min-height: 20rem;
    max-height: calc(100svh - 27rem);
    border-radius: var(--r-panel);
  }

  /* Split: copy on the page ground, the art filling the right side with a dry-brush left edge. */
  .a-hero-split {
    --brush-edge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M100,0H3.9H3.9V0.4H4.1V0.8H4.2V1.1H4.9V1.6H3.2V1.9H0.7V2.1H4.1V2.6H1.3V2.8H5.2V3.1H3.2V3.5H4.6V3.9H5.0V4.3H3.4V4.9H5.2V5.3H3.9V5.5H5.0V6.1H5.6V6.6H4.9V7.2H5.6V7.5H5.3V8.1H2.1V8.4H5.4V8.7H4.0V8.9H5.1V9.3H5.6V9.8H5.1V10.1H1.8V10.4H3.4V10.8H3.6V11.1H0.7V11.4H4.1V11.7H5.6V12.0H5.4V12.5H5.0V12.9H4.7V13.3H5.4V13.5H5.3V14.1H2.4V14.6H3.1V15.2H0.1V15.5H4.1V15.8H4.4V16.4H3.9V16.7H4.4V17.0H4.9V17.4H5.2V17.7H5.1V18.1H4.2V18.5H2.6V18.8H3.7V19.3H0.1V19.6H0.1V20.1H3.4V20.5H4.8V21.1H2.2V21.6H3.0V22.1H3.4V22.4H4.1V23.0H3.7V23.5H3.6V23.9H3.4V24.1H3.1V24.7H3.5V25.2H4.3V25.7H3.4V25.9H3.1V26.3H1.6V26.7H4.0V26.9H4.2V27.2H3.7V27.7H3.1V28.0H2.5V28.4H3.8V29.0H4.2V29.3H2.3V29.9H4.0V30.4H4.0V30.8H3.3V31.2H2.3V31.5H0.1V31.9H3.0V32.2H0.1V32.5H4.3V32.9H0.1V33.2H3.3V33.6H0.9V34.1H3.7V34.4H3.7V34.7H4.0V34.9H3.6V35.4H3.9V35.9H4.3V36.5H4.3V37.0H1.8V37.4H2.1V37.9H3.7V38.5H3.0V38.8H3.0V39.2H0.1V39.8H2.6V40.2H2.2V40.8H3.7V41.0H0.1V41.5H2.5V41.8H2.5V42.1H3.4V42.4H2.9V42.9H0.9V43.4H3.3V43.7H2.9V44.2H3.1V44.7H1.9V45.1H1.8V45.4H2.9V45.8H3.1V46.2H0.1V46.4H2.0V46.8H2.4V47.2H3.0V47.6H3.2V48.2H2.9V48.5H2.7V49.0H2.3V49.3H0.1V49.6H2.0V49.9H2.2V50.3H3.1V50.8H2.9V51.1H2.6V51.5H2.9V51.9H1.9V52.3H1.9V52.9H1.4V53.2H2.4V53.8H2.5V54.3H2.6V54.9H2.4V55.4H2.1V55.9H2.1V56.2H2.4V56.4H0.1V57.0H1.1V57.4H2.4V57.9H2.6V58.1H1.7V58.5H2.4V58.8H0.1V59.4H0.1V59.7H2.2V60.2H2.0V60.6H1.3V60.8H2.0V61.1H2.5V61.5H2.7V61.9H1.4V62.4H2.2V62.9H0.1V63.3H0.2V63.6H1.1V64.1H0.7V64.7H1.5V65.2H3.0V65.7H3.2V66.1H2.2V66.6H2.1V67.1H2.5V67.6H0.1V68.0H1.9V68.5H2.5V68.7H0.1V69.0H3.6V69.4H2.8V69.9H2.9V70.5H2.1V71.0H0.1V71.4H3.3V71.7H0.1V72.1H3.3V72.5H3.7V72.9H3.8V73.3H4.2V73.6H4.0V73.9H1.7V74.2H0.1V74.5H1.7V74.7H0.3V75.1H1.3V75.5H0.1V75.9H4.3V76.4H0.1V76.8H3.8V77.1H4.1V77.4H2.8V77.8H1.1V78.4H4.4V78.7H3.4V79.3H3.2V79.6H3.4V80.0H4.2V80.3H0.1V80.9H3.9V81.2H3.7V81.5H3.3V81.7H4.0V82.2H4.0V82.5H4.4V83.0H3.4V83.5H3.9V83.8H4.0V84.4H4.0V85.0H1.7V85.5H4.3V85.8H4.3V86.1H3.2V86.5H4.3V87.0H4.3V87.5H3.1V88.0H3.9V88.2H4.3V88.6H1.7V89.0H3.8V89.6H4.0V89.9H2.0V90.5H4.0V90.9H4.0V91.2H2.8V91.7H3.6V92.2H2.2V92.7H3.8V92.9H0.9V93.4H4.6V93.9H4.6V94.4H2.2V94.9H4.6V95.4H4.5V95.9H4.1V96.4H4.5V96.7H4.2V97.2H3.6V97.7H3.1V98.1H3.3V98.6H1.7V99.2H3.9V99.6H4.7V100.0H0.1V100.0H100Z'/%3E%3C/svg%3E");
    --hero-h1: clamp(3rem, 5.6vw, 6rem);
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    min-height: min(860px, 100svh);
    background: var(--bg);
  }

  .a-hero-split .a-hero-copy {
    max-width: none;
    padding: clamp(6.5rem, 14vh, 8.5rem) clamp(var(--s-24), 3vw, var(--s-48)) var(--s-64)
      var(--edge);
  }

  .a-hero-split .a-hero-art {
    align-self: stretch;
    -webkit-mask: var(--brush-edge) 0 0 / 100% 100% no-repeat;
    mask: var(--brush-edge) 0 0 / 100% 100% no-repeat;
  }
}

/* Split art below laptop width is too narrow for the card to clear the subject. */
@media (max-width: 1199px) {
  .a-hero-split .a-card-slot {
    display: none;
  }
}

/* A small piece of the product floating over the art. */
.a-card-slot {
  position: absolute;
  z-index: 2;
  left: var(--card-x, 44%);
  bottom: var(--s-48);
  width: max-content;
  max-width: min(330px, 80%);
}

.a-card {
  display: flex;
  align-items: center;
  gap: var(--s-12);
  padding: var(--s-12) var(--s-16) var(--s-12) var(--s-12);
  border-radius: var(--r-card);
  background: rgb(255 255 255 / 92%);
  color: var(--fg);
  font-size: var(--t-14);
  line-height: 1.4;
  box-shadow: 0 20px 44px -20px rgb(0 0 0 / 55%);
}

/* biome-ignore lint/style/noDescendingSpecificity: card text never sits inside the rating. */
.a-card b {
  display: block;
  font-size: var(--t-16);
}

.a-card svg {
  flex: none;
  width: 36px;
  height: 36px;
}

/* Pause control for the clip: aria-pressed true means stopped. It sits on art, so the ring uses the accent. */
.a-clip-toggle {
  --ring: var(--accent);
  position: absolute;
  z-index: 3;
  right: var(--s-16);
  bottom: var(--s-16);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 50%;
  background: rgb(20 30 24 / 45%);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.a-clip-toggle:hover {
  background: rgb(20 30 24 / 65%);
}

.a-clip-toggle svg {
  width: 18px;
  height: 18px;
}

.a-clip-toggle .icon-play,
.a-clip-toggle[aria-pressed="true"] .icon-pause {
  display: none;
}

.a-clip-toggle[aria-pressed="true"] .icon-play {
  display: block;
}

/* Phones: the art sits on top in its own box, the copy follows on the page ground. */
@media (max-width: 900px) {
  .a-hero {
    --hero-ghost-bg: transparent;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--bg);
  }

  .a-hero-art {
    position: relative;
    inset: auto;
    aspect-ratio: var(--art-ratio-phone, 4 / 3);
  }

  .a-hero-art::after {
    content: none;
  }

  .a-hero .btn-ghost {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .a-hero-art :is(video, img) {
    object-position: var(--art-x-phone, var(--art-x, 50%)) 50%;
  }

  .a-hero-copy {
    max-width: none;
    padding: var(--s-32) var(--gutter) var(--s-48);
  }

  .a-card-slot {
    left: var(--s-12);
    bottom: var(--s-12);
    max-width: calc(100% - 80px);
  }

  /* Stage and pano art keep their subject low or left in the frame, where the card would cover it. */
  :is(.a-hero-stage, .a-hero-pano) .a-card-slot {
    display: none;
  }

  .a-clip-toggle {
    right: var(--s-12);
    bottom: var(--s-12);
  }

  /* Pano keeps its rounded strip, starting below the menu so a head near the top stays clear. */
  .a-hero-pano {
    padding-top: calc(var(--bar-h) + var(--s-16));
  }

  .a-hero-pano .a-hero-art {
    overflow: hidden;
    margin-inline: var(--gutter);
    border-radius: var(--r-panel);
  }
}
