/* Procedure hero — grayscale still, color YouTube on play */

.d2-hero--has-video .d2-hero__img {
  filter: grayscale(1) contrast(1.08) brightness(0.9);
  transition: filter 0.9s var(--ease-silk, cubic-bezier(0.22, 1, 0.36, 1)), opacity 0.7s ease;
}

.d2-hero--has-video.is-playing .d2-hero__img {
  opacity: 0;
  filter: grayscale(0);
}

.d2-hero__stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  background: #050505;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.d2-hero.is-playing .d2-hero__stage {
  opacity: 1;
  visibility: visible;
}

.d2-hero__stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.d2-hero.is-playing .d2-hero__vignette {
  background:
    linear-gradient(to top, hsl(var(--background)) 0%, hsl(var(--background) / 0.18) 18%, transparent 42%);
  z-index: 2;
  pointer-events: none;
}

.d2-hero.is-playing .d2-hero__shine,
.d2-hero.is-playing .d2-hero__play,
.d2-hero.is-playing .d2-hero__frame {
  opacity: 0;
  pointer-events: none;
}

.d2-hero.is-playing .d2-hero__frame {
  transition: opacity 0.4s ease;
}

.d2-hero__play {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: end;
  z-index: 4;
  position: relative;
  width: auto;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  margin: 0 0 0.15rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: hsl(var(--foreground));
  cursor: pointer;
}

.d2-hero__play-orb {
  position: relative;
  width: 6.5rem;
  height: 6.5rem;
  flex: 0 0 6.5rem;
}

.d2-hero__play-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1.5px solid hsl(var(--foreground) / 0.88);
  background: hsl(var(--background) / 0.38);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 48px hsl(0 0% 0% / 0.38);
  transition: transform 0.45s var(--ease-silk, cubic-bezier(0.22, 1, 0.36, 1)), background 0.45s ease, border-color 0.45s ease;
}

.d2-hero__play-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 52%;
  width: 0;
  height: 0;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 0.72rem 0 0.72rem 1.2rem;
  border-color: transparent transparent transparent hsl(var(--foreground));
}

.d2-hero__play-text {
  position: static;
  display: block;
  margin: 0;
  letter-spacing: 0.3em;
  font-size: 0.68rem;
  line-height: 1;
  color: hsl(var(--foreground));
  text-shadow: 0 2px 12px hsl(0 0% 0% / 0.45);
}

.d2-hero__play:hover .d2-hero__play-ring,
.d2-hero__play:focus-visible .d2-hero__play-ring {
  transform: scale(1.07);
  background: hsl(var(--foreground) / 0.16);
  border-color: hsl(var(--foreground));
}

.d2-hero__play:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: no-preference) {
  .d2-hero__play-ring {
    animation: d2-play-pulse 2.8s ease-in-out infinite;
  }
}

@keyframes d2-play-pulse {
  0%, 100% { box-shadow: 0 16px 48px hsl(0 0% 0% / 0.38), 0 0 0 0 hsl(var(--foreground) / 0.28); }
  70% { box-shadow: 0 16px 48px hsl(0 0% 0% / 0.38), 0 0 0 18px hsl(var(--foreground) / 0); }
}

.d2-hero__av {
  position: absolute;
  z-index: 6;
  top: auto;
  right: auto;
  left: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1.1rem, 3vw, 1.75rem);
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem;
  border: 1px solid hsl(var(--foreground) / 0.22);
  border-radius: 999px;
  background: hsl(var(--background) / 0.55);
  backdrop-filter: blur(14px);
}

.d2-hero__av[hidden] {
  display: none;
}

.d2-hero.is-playing .d2-hero__av {
  display: inline-flex;
}

.d2-hero__sound {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: hsl(var(--foreground) / 0.72);
  font-family: inherit;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

.d2-hero__sound.is-active,
.d2-hero__sound:hover,
.d2-hero__sound:focus-visible {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  outline: none;
}

.d2-hero__sound-icon {
  display: block;
  width: 0.95rem;
  height: 0.75rem;
  background: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

.d2-hero__sound-icon--off {
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z'/></svg>");
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z'/></svg>");
}

.d2-hero__sound-icon--on {
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z'/></svg>");
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z'/></svg>");
}

.d2-hero__close {
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: hsl(var(--foreground));
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.d2-hero__close:hover,
.d2-hero__close:focus-visible {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  outline: none;
}

.d2-btn--video {
  color: hsl(var(--foreground));
  background: transparent;
  border-color: hsl(var(--foreground) / 0.45);
  gap: 0.7rem;
}

.d2-btn--video:hover,
.d2-btn--video:focus-visible {
  color: hsl(var(--background));
  background: hsl(var(--foreground));
  border-color: hsl(var(--foreground));
}

.d2-btn__play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.32rem 0 0.32rem 0.52rem;
  border-color: transparent transparent transparent currentColor;
}

.d2-video-chip {
  position: fixed;
  z-index: 55;
  left: 1.25rem;
  bottom: 1.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.2rem;
  border: 1px solid hsl(var(--foreground) / 0.28);
  background: hsl(var(--background) / 0.78);
  color: hsl(var(--foreground));
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px hsl(0 0% 0% / 0.22);
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s var(--ease-silk, cubic-bezier(0.22, 1, 0.36, 1)), opacity 0.45s ease;
}

.d2-video-chip.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.d2-video-chip[hidden] {
  display: none;
}

.d2-video-chip:hover,
.d2-video-chip:focus-visible {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  outline: none;
}

@media (min-width: 1100px) {
  .d2-hero__play {
    width: 100%;
    max-width: 22rem;
    justify-self: end;
  }
}

@media (max-width: 767px) {
  .d2-hero__play {
    display: flex;
    justify-self: end;
    align-self: end;
    margin-bottom: 0.25rem;
  }

  .d2-hero__play-orb {
    width: 5.25rem;
    height: 5.25rem;
    flex-basis: 5.25rem;
  }

  .d2-hero__av {
    left: 0.85rem;
    bottom: 0.85rem;
    max-width: calc(100% - 1.7rem);
  }

  .d2-hero__sound {
    padding: 0.5rem 0.65rem;
    letter-spacing: 0.12em;
  }

  .d2-video-chip {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .d2-hero__play-ring,
  .d2-hero--has-video .d2-hero__img {
    animation: none;
    transition: none;
  }
}
