/* Homepage navigation and typography. */
.home {
  --home-edge-left: max(var(--pad), env(safe-area-inset-left));
  --home-edge-right: max(var(--pad), env(safe-area-inset-right));
  --home-edge-top: max(1rem, env(safe-area-inset-top));
}

.home .hero {
  grid-template-columns: minmax(0, 1fr);
  padding: 7rem max(var(--home-edge-left), var(--home-edge-right));
}

.home .hero__brand {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
  pointer-events: none;
}

.home .hero__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
}

.home .hero__brand .hero__fallback {
  /* Only show the static logo when animation is unavailable, never while loading. */
  visibility: hidden;
  top: 50%;
  left: 50%;
  width: min(72vw, 72rem);
  max-width: calc(100% - 2 * var(--pad));
  height: auto;
  transform: translate(-50%, -50%);
}

.hero__brand.is-playing .hero__video { opacity: 1; }
.home .hero__brand.is-fallback .hero__fallback { visibility: visible; }

/* Keep both actions inside the existing hero, clear of the artwork and cue. */
.home .hero__actions {
  position: absolute;
  z-index: 1;
  left: var(--home-edge-left);
  right: var(--home-edge-right);
  bottom: clamp(6.5rem, 22svh, 15rem);
  display: flex;
  justify-content: center;
  gap: .75rem;
}

.home .hero__action {
  display: inline-flex;
  flex: 0 1 12rem;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: .875rem clamp(.75rem, 2vw, 1.5rem);
  border: 1px solid var(--home-fg);
  background: transparent;
  color: var(--home-fg);
  font: 500 .75rem/1.2 var(--font-ui);
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 250ms ease, color 250ms ease;
}

.home .hero__action--primary {
  background: var(--home-fg);
  color: var(--home-bg);
}
.home .hero__action span { transition: transform 250ms ease; }
.home .hero__action:focus-visible {
  outline: 2px solid var(--home-fg);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .home .hero__action:hover {
    background: var(--home-fg);
    color: var(--home-bg);
  }
  .home .hero__action--primary:hover {
    background: transparent;
    color: var(--home-fg);
  }
  .home .hero__action:hover span { transform: translateX(2px); }
}

@media (max-width: 600px), (max-height: 500px) {
  .home .hero__action {
    flex-basis: 10rem;
    min-height: 44px;
    padding: .75rem;
    font-size: .6875rem;
  }
}

@media (max-height: 500px) {
  .home .hero__actions {
    bottom: max(5.75rem, calc(env(safe-area-inset-bottom) + 5.5rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  .home .hero__action, .home .hero__action span { transition: none; }
  .home .hero__action:hover span { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .home .hero__video { display: none; }
  .home .hero__brand .hero__fallback { visibility: visible; }
}

/* Social links belong to the document footer, after the Explore section. */
.home-footer {
  padding: 1.5rem var(--home-edge-right) max(2rem, env(safe-area-inset-bottom)) var(--home-edge-left);
  background: var(--home-bg);
  color: var(--home-fg);
}

.home-socials {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-socials a {
  display: inline-flex;
  width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  transition: opacity .2s ease;
}

.home-social-icon {
  display: block;
  width: 22px;
  height: 22px;
  flex: none;
  fill: currentColor;
}

.home-socials a:hover { opacity: .6; }
.home-socials a:focus-visible { outline-offset: 2px; }

@media (max-width: 1000px) {
  .home .hero__brand .hero__fallback { width: min(72vw, 38rem); }
}

/* The lower navigation is typography only at every width. */
.home .home-menu { grid-template-columns: minmax(0, 1fr); }
.home .home-menu__links a { font-size: clamp(3.5rem, 12vw, 13rem); }

/* Keep the longer Selected Work Braille label inside its navigation row. */
.home-menu__links a[href="/work/"] .home-menu__label::after {
  font-size: min(.82em, 10cqi);
}

@media (max-width: 760px) {
  .home .home-menu__links a { font-size: clamp(3rem, 16.8vw, 5.6rem); }
}

/* Hold Braille briefly before same-tab navigation on touch, mouse and keyboard. */
.home-menu__links a.is-activating .home-menu__english {
  opacity: 0;
}

.home-menu__links a.is-activating .home-menu__label::after {
  opacity: 1;
}

/* A cached page must return to readable labels, even with restored hover/focus. */
.home-menu__links a.is-resting:not(.is-activating) .home-menu__english {
  opacity: 1;
  transition: none;
}

.home-menu__links a.is-resting:not(.is-activating) .home-menu__label::after {
  opacity: 0;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .home-menu__english,
  .home-menu__label::after {
    transition: none;
  }
}
