/* Homepage photos: automatic rotation, native swipe and simple dot navigation. */
main > .hero .hero-gallery {
  --gallery-stage-height: 600px;
  align-self: center;
  min-width: 0;
  perspective: 1200px;
  position: relative;
}

.hero-gallery-track {
  display: flex;
  height: var(--gallery-stage-height);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.hero-gallery-track::-webkit-scrollbar { display: none; }
.hero-gallery-track:focus-visible {
  border-radius: 20px;
  outline: 3px solid #0891b2;
  outline-offset: 3px;
}

.hero-gallery-slide {
  box-sizing: border-box;
  flex: 0 0 100%;
  height: 100%;
  margin: 0;
  min-width: 0;
  opacity: .72;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  transform: translateY(10px) scale(.965);
  transform-origin: 50% 50%;
  transition: opacity 760ms ease, transform 920ms cubic-bezier(.22, .72, .2, 1), filter 920ms ease;
  will-change: opacity, transform;
}

.hero-gallery-slide[data-gallery-active="true"] {
  filter: drop-shadow(0 20px 30px rgba(8, 47, 73, .13));
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hero-gallery-slide::after {
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .36) 48%, transparent 70%);
  border-radius: inherit;
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-120%);
  z-index: 4;
}

.hero-gallery-slide[data-gallery-active="true"]::after {
  animation: hero-gallery-sheen 1350ms cubic-bezier(.2, .7, .2, 1) 180ms both;
}

main > .hero .hero-gallery-slide--intro .hero-visual {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, .96), rgba(240, 250, 253, .82) 52%, rgba(220, 242, 248, .92) 100%);
  border: 2px solid #add9e5;
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 18px 38px rgba(13, 82, 112, .12);
  box-sizing: border-box;
  height: calc(var(--gallery-stage-height) - 12px);
  isolation: isolate;
  margin: 0;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

main > .hero .hero-gallery-slide--intro .hero-person {
  bottom: 12px;
}

.hero-gallery-slide--photo {
  align-items: center;
  background: linear-gradient(145deg, #f5fcff, #e3f4fa);
  border: 1px solid #b9dce6;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  padding: 12px;
}

.hero-gallery-slide--photo img {
  border-radius: 13px 13px 0 0;
  box-sizing: border-box;
  display: block;
  flex: 0 1 auto;
  height: auto;
  max-height: calc(100% - 92px);
  max-width: 100%;
  min-height: 0;
  object-fit: contain;
  transform-origin: 50% 50%;
  width: auto;
  will-change: transform, filter;
}

.hero-gallery-slide--photo figcaption {
  background: #fff;
  border: 1px solid #c9e4eb;
  border-radius: 0 0 13px 13px;
  box-sizing: border-box;
  color: #0d1f4e;
  flex: 0 0 auto;
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.55;
  padding: 10px 12px 12px;
  text-align: center;
  transform: translateY(10px);
  transition: opacity 620ms ease 120ms, transform 760ms cubic-bezier(.22, .72, .2, 1) 120ms;
  opacity: .64;
  width: 100%;
}

.hero-gallery-slide[data-gallery-active="true"] img,
.hero-gallery-slide[data-gallery-active="true"] .hero-portrait {
  animation: hero-gallery-breathe 2000ms cubic-bezier(.2, .7, .25, 1) both;
}

.hero-gallery-slide--photo[data-gallery-active="true"] img {
  animation: hero-gallery-photo-breathe 2000ms cubic-bezier(.2, .7, .25, 1) both;
}

.hero-gallery-slide[data-gallery-active="true"] figcaption {
  opacity: 1;
  transform: translateY(0);
}

@keyframes hero-gallery-breathe {
  from { filter: saturate(.96) contrast(.99); transform: scale(.985); }
  to { filter: saturate(1.04) contrast(1.015); transform: scale(1.025); }
}

@keyframes hero-gallery-photo-breathe {
  from { filter: saturate(.96) contrast(.99); }
  to { filter: saturate(1.04) contrast(1.015); }
}

@keyframes hero-gallery-sheen {
  0% { opacity: 0; transform: translateX(-120%); }
  24% { opacity: .18; }
  100% { opacity: 0; transform: translateX(120%); }
}

.hero-caption-main,
.hero-caption-sub { display: block; }
.hero-caption-sub { color: #25465f; }
.hero-caption-phrase { display: inline-block; white-space: nowrap; }
.hero-caption-badge {
  background: #eaf7fb;
  border: 1px solid #b9dce6;
  border-radius: 6px;
  color: #0e7490;
  display: inline-block;
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.5;
  margin-top: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}

.hero-gallery-status {
  border: 0;
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.hero-gallery-dots {
  display: flex;
  gap: 2px;
  justify-content: center;
  margin-top: 6px;
}

.hero-gallery-dot {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 36px;
  height: 36px;
  justify-content: center;
  padding: 0;
}

.hero-gallery-dot::before {
  background: #9eb9c8;
  border-radius: 50%;
  content: "";
  height: 8px;
  width: 8px;
}

.hero-gallery-dot[aria-current="true"]::before { background: #0d1f4e; }
.hero-gallery-dot:hover::before { background: #245f84; }
.hero-gallery-dot:focus-visible { outline: 2px solid #245f84; outline-offset: -3px; }

.hero-gallery-playback {
  align-items: center;
  background: rgba(255, 255, 255, .88);
  border: 1px solid #b9dce6;
  border-radius: 999px;
  color: #0d1f4e;
  cursor: pointer;
  display: none;
  font-size: .75rem;
  font-weight: 700;
  gap: 5px;
  margin: 2px auto 0;
  min-height: 34px;
  padding: 5px 12px;
}
.hero-gallery-playback:hover,
.hero-gallery-playback:focus-visible { border-color: #0e7490; background: #eaf7fb; outline: none; }
.hero-gallery-playback-icon { display: inline-block; min-width: 1em; text-align: center; }

@media (min-width: 821px) and (max-width: 960px) {
  main > .hero .hero-gallery { --gallery-stage-height: 490px; }
}

@media (max-width: 820px) {
  main > .hero .hero-gallery {
    --gallery-stage-height: 420px;
    margin: 28px auto 0;
    width: min(100%, 430px);
  }
  main > .hero .hero-gallery-slide--intro .hero-visual {
    border-radius: 18px;
  }
  main > .hero .hero-gallery-slide--intro .hero-person { bottom: 10px; }
  .hero-gallery-slide--photo { border-radius: 18px; padding: 10px; }
  .hero-gallery-playback { display: none; }
}

@media (max-width: 480px) {
  main > .hero .hero-gallery { --gallery-stage-height: 390px; }
  .hero-gallery-slide--photo figcaption { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-gallery-track { scroll-behavior: auto; }
  .hero-gallery-slide,
  .hero-gallery-slide--photo figcaption {
    filter: none;
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-gallery-slide::after,
  .hero-gallery-slide img,
  .hero-gallery-slide .hero-portrait { animation: none !important; }
}
