/* Hero video preview + audio modal — HOME only.
   Vision and other pages reuse .ex-hero-visual with native controls. */

body[data-page="home"] .ex-hero-visual {
  cursor: pointer;
}

body[data-page="home"] .ex-hero-visual .ex-hero-visual__video {
  pointer-events: none; /* clicks go to open handler on figure */
}

/* Open CTA overlay */
.hero-video__open {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100% - 2rem);
  padding: 0.65rem 1rem 0.65rem 0.65rem;
  border: 1px solid oklch(100% 0 0 / 0.28);
  border-radius: 999px;
  background: oklch(8% 0.02 255 / 0.62);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px oklch(0% 0 0 / 0.35);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.hero-video__open:hover,
.hero-video__open:focus-visible {
  background: oklch(10% 0.03 255 / 0.78);
  border-color: oklch(100% 0 0 / 0.5);
  transform: translate(-50%, -50%) scale(1.03);
}

.hero-video__open:focus-visible {
  outline: 2px solid oklch(75% 0.12 230);
  outline-offset: 3px;
}

.hero-video__open-ico {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: oklch(100% 0 0 / 0.12);
  color: #fff;
}

.hero-video__open-ico svg {
  display: block;
  margin-left: 2px; /* optical center of play triangle */
}

.hero-video__open-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding-right: 0.35rem;
}

.hero-video__open-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.hero-video__open-hint {
  font-size: 0.72rem;
  opacity: 0.78;
  line-height: 1.25;
}

/* Muted chip */
.hero-video__muted-badge {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid oklch(100% 0 0 / 0.18);
  background: oklch(0% 0 0 / 0.5);
  color: oklch(96% 0 0 / 0.92);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hero-video__muted-badge svg {
  display: block;
  opacity: 0.9;
}

/* Soft gradient so CTA stays readable over bright frames */
.ex-hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse at center, oklch(0% 0 0 / 0.22) 0%, transparent 58%),
    linear-gradient(180deg, oklch(0% 0 0 / 0.12) 0%, transparent 35%, transparent 65%, oklch(0% 0 0 / 0.25) 100%);
  pointer-events: none;
}

/* Dialog */
body.hero-video-dialog-open {
  overflow: hidden;
}

.hero-video-dialog {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
}

.hero-video-dialog[hidden] {
  display: none !important;
}

.hero-video-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: oklch(4% 0.02 255 / 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.hero-video-dialog__panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid oklch(70% 0.03 255 / 0.2);
  background: oklch(12% 0.02 255);
  box-shadow: 0 24px 80px oklch(0% 0 0 / 0.55);
  overflow: hidden;
}

.hero-video-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem 0.85rem 1.15rem;
  border-bottom: 1px solid oklch(70% 0.03 255 / 0.12);
}

.hero-video-dialog__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.hero-video-dialog__close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid oklch(70% 0.03 255 / 0.18);
  background: transparent;
  color: inherit;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0.85;
  transition: opacity 0.15s, background 0.15s;
}

.hero-video-dialog__close:hover,
.hero-video-dialog__close:focus-visible {
  opacity: 1;
  background: oklch(100% 0 0 / 0.06);
}

.hero-video-dialog__close:focus-visible {
  outline: 2px solid oklch(75% 0.12 230);
  outline-offset: 2px;
}

.hero-video-dialog__body {
  padding: 0;
  background: #000;
  min-height: 0;
}

.hero-video-dialog__video {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(78vh, 780px);
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
  vertical-align: middle;
}

@media (max-width: 560px) {
  .hero-video__open {
    gap: 0.55rem;
    padding: 0.5rem 0.75rem 0.5rem 0.5rem;
  }

  .hero-video__open-ico {
    width: 42px;
    height: 42px;
  }

  .hero-video__open-title {
    font-size: 0.88rem;
  }

  .hero-video__open-hint {
    font-size: 0.68rem;
  }

  .hero-video-dialog__head h2 {
    font-size: 0.92rem;
  }
}

:root[data-theme="light"] .hero-video-dialog__panel {
  background: #f8fafc;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] .hero-video-dialog__head {
  border-bottom-color: rgba(15, 23, 42, 0.1);
}

:root[data-theme="light"] .hero-video-dialog__close {
  border-color: rgba(15, 23, 42, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .hero-video__open {
    transition: none;
  }
}
