/* hero.css: geometry of the hero, its stages and the copy (SPEC 3). */

/* First paint and no-JS value of the demo bar (SPEC 5.2). On the root, so that the exact height main.js writes there wins. */
:root:has(body.has-demo) {
  --demo-h: 38px;
}

@media (max-width: 767px) {
  :root:has(body.has-demo) {
    --demo-h: 72px;
  }
}

.hero {
  /* One scene unit in px: the planes use preserveAspectRatio slice, so the larger ratio wins. */
  --hero-h: max(100svh, 560px);
  --u: max(calc(100vw / 2100), calc(var(--hero-h) / 900));
  /* Left pennant pole in viewport px: scene x 693, the centre of the viewBox is scene x 800. */
  --pole-x: calc(50vw - 107 * var(--u));
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: var(--hall-2);
}

.hero-stage,
.hero-plane-wrap {
  position: absolute;
  inset: 0;
}

/* hero.js sets this only while the hero is on screen and the dive has not started (SPEC 3.1). */
.hero-live .hero-plane-wrap {
  will-change: transform;
}

.hero-stage--tall {
  display: none;
}

.hero-plane {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero-block-num {
  font-family: var(--font-display);
  font-weight: 800;
}

/* The hero slides up behind the demo bar (SPEC 5.2), so the bar has to paint above it. */
.demo-bar {
  position: relative;
  z-index: calc(var(--z-header) + 1);
}

/* --demo-h is a rounded px value and the bar is not: rounded up, the hero would start above 0, the pin start would be
   negative and the dive would count as started at rest. One px lower is hidden under the bar, which paints on top. */
.has-demo .hero {
  margin-top: calc(1px - var(--demo-h));
}

/* ---------- Copy ---------- */
.hero-copy {
  position: relative;
  z-index: 3;
  box-sizing: content-box;
  width: min(37rem, calc(var(--pole-x) - var(--gutter) - 24px));
  padding-top: calc(var(--demo-h) + clamp(84px, 12.5svh, 124px));
  padding-left: var(--gutter);
  color: var(--ink);
}

.hero-copy .eyebrow {
  margin-bottom: var(--s-3);
}

.hero h1 {
  width: max-content;
  max-width: 52vw;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.02em;
}

.hero h1 em {
  color: var(--teal);
  font-style: normal;
}

.hero-lede {
  margin: var(--s-4) 0 0;
  font-size: var(--fs-lede);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-5);
  margin-top: var(--s-5);
}

.hero-actions .ico {
  width: 1em;
  height: 1em;
}

/* In the strip of near deck under the blocks. */
.hero-note {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(10px, 2svh, 18px);
  z-index: 3;
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-small);
  line-height: 1.35;
}

.hero-note strong {
  font-weight: 600;
}

@media (max-aspect-ratio: 1/1) {
  .hero {
    --u: max(calc(100vw / 1500), calc(var(--hero-h) / 1950));
  }

  .hero-stage--wide {
    display: none;
  }

  .hero-stage--tall {
    display: block;
  }

  .hero-copy {
    width: auto;
    max-width: 40rem;
    padding-top: calc(var(--demo-h) + clamp(76px, 10svh, 112px));
    padding-right: var(--gutter);
  }

  .hero h1 {
    max-width: none;
  }

  .hero-lede {
    margin-top: var(--s-3);
    line-height: 1.42;
  }

  .hero-actions {
    margin-top: var(--s-4);
  }
}

/* Phone: copy has to end above the pennants (scene y 1140), so both actions share a row and lose their decorative arrows. */
@media (max-aspect-ratio: 1/1) and (max-width: 520px) {
  .hero-copy {
    padding-top: calc(var(--demo-h) + clamp(72px, 9svh, 96px));
  }

  .hero-copy .eyebrow {
    margin-bottom: var(--s-2);
  }

  .hero-lede {
    margin-top: var(--s-2);
    font-size: 1rem;
  }

  .hero-actions {
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: var(--s-3);
  }

  .hero-actions .btn,
  .hero-actions .text-link {
    font-size: .9rem;
    white-space: nowrap;
  }

  .hero-actions .btn {
    padding-inline: 14px;
  }

  .hero-actions .ico {
    display: none;
  }

  /* Clear of the pause button at the bottom right. */
  .hero-note {
    max-width: calc(100% - var(--gutter) - 68px);
    font-size: .8125rem;
  }
}

@media (max-aspect-ratio: 1/1) and (max-width: 380px) {
  .hero-note {
    font-size: .75rem; /* two lines at most: the strip under the blocks is 64 px high here */
  }
}

/* Phone landscape: no pin, no note (SPEC 3.3). */
@media (max-height: 560px) {
  .hero {
    --fs-hero: 2.5rem;
  }

  .hero-copy {
    padding-top: calc(var(--demo-h) + 72px);
  }

  .hero-note {
    display: none;
  }

  /* Clear of block 1, which stands next to the actions here. */
  .hero-actions .btn {
    padding-inline: 18px;
  }
}
