/* ==========================================================================
   commercial-html.css  —  rev 41
   Homepage commercial: HTML/SVG animation frame + logo-outro video.
   Scoped to .sgt-commercial. No host :root dependency.
   ========================================================================== */

.sgt-commercial {
  /* Scoped tokens — travel with the fragment. */
  --sgt-commercial-bg: #FBFCFD;
  --sgt-commercial-frame-bg: #0B1220;
  --sgt-commercial-radius: 18px;
  --sgt-commercial-focus: #0B5FFF;
  --sgt-commercial-overlay-bg: rgba(11, 18, 32, 0.72);
  --sgt-commercial-overlay-ring: rgba(255, 255, 255, 0.9);
  --sgt-commercial-overlay-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --sgt-commercial-overlay-opacity: 0.5;
  --sgt-commercial-overlay-size: clamp(64px, 12vw, 88px);
  --sgt-commercial-overlay-glyph: 36px;
  --sgt-commercial-gutter: clamp(16px, 3vw, 32px);
  --sgt-commercial-pad-block: clamp(16px, 3vw, 32px);

  padding: var(--sgt-commercial-pad-block) 0;
  background: var(--sgt-commercial-bg);
}

.sgt-commercial__wrap {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--sgt-commercial-gutter);
}

/* The frame is the single 16:9 box. Scene, outro video and overlay all
   fill it absolutely so nothing can shift the aspect ratio. */
.sgt-commercial__frame {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: var(--sgt-commercial-radius);
  background: var(--sgt-commercial-frame-bg);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sgt-commercial__frame:focus-visible {
  outline: 3px solid var(--sgt-commercial-focus);
  outline-offset: -3px;
}

/* --- Scene layer: responsive SVG fills the frame ------------------------ */

.sgt-commercial__frame #sgt-commercial-scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.sgt-commercial__frame #sgt-commercial-scene svg {
  display: block;
  width: 100%;
  height: 100%;
  /* preserveAspectRatio on the SVG element governs letterboxing; the
     element itself always fills the frame. */
}

/* --- Pointer target: the frame, never its descendants ------------------- */

/* The scene's innerHTML is replaced at 24fps, so a descendant can be
   destroyed mid-press and the click never reaches the frame. The outro
   video must not swallow clicks either. Both layers stay fully visible
   and playable; only hit-testing moves to the stable frame. */
.sgt-commercial__frame #sgt-commercial-scene,
.sgt-commercial__frame #sgt-commercial-scene svg,
.sgt-commercial__frame #sgt-commercial-outro {
  pointer-events: none;
}

/* --- Outro layer: high-res logo video, same frame, cover ----------------- */

.sgt-commercial__frame #sgt-commercial-outro {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: inherit;
  background: var(--sgt-commercial-frame-bg);
  z-index: 2;
}

/* `hidden` must win over the absolute layout above. */
.sgt-commercial__frame #sgt-commercial-outro[hidden] {
  display: none;
}

/* --- Audio: never rendered ---------------------------------------------- */

.sgt-commercial__frame #sgt-commercial-audio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Paused play affordance: frame-driven, not video-driven -------------- */

.sgt-commercial__frame::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--sgt-commercial-overlay-size);
  height: var(--sgt-commercial-overlay-size);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background-color: var(--sgt-commercial-overlay-bg);
  /* Play triangle as inline SVG (optically centered in the circle via
     geometry, not a font glyph whose metrics carry right-side bearing). */
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2040%2040'%3E%3Cpath%20d='M14%208%20L14%2032%20L35%2020%20Z'%20fill='%23ffffff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 34px 34px;
  border: 2px solid var(--sgt-commercial-overlay-ring);
  box-shadow: var(--sgt-commercial-overlay-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 3;
}

.sgt-commercial__frame.is-paused::after {
  opacity: var(--sgt-commercial-overlay-opacity);
}

/* --- Footer suppression inside the commercial ---------------------------- */

.sgt-commercial .sgt-footer {
  display: none;
}

/* --- Reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .sgt-commercial__frame::after {
    transition: none;
  }
}

/* --- Small screens: keep the frame inside the viewport ------------------- */

@media (max-width: 480px) {
  .sgt-commercial__frame {
    border-radius: 12px;
  }

  .sgt-commercial__frame::after {
    --sgt-commercial-overlay-size: clamp(56px, 18vw, 72px);
    --sgt-commercial-overlay-glyph: 30px;
  }
}


/* --- Seek bar: native range below the frame ----------------------------- */

.sgt-commercial__transport {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 4px 2px;
  color: #0B1220;
  font: 500 14px/1.2 "Segoe UI", system-ui, sans-serif;
}

.sgt-commercial__transport .sgt-commercial__time {
  flex: 0 0 auto;
  min-width: 3.5ch;
  font-variant-numeric: tabular-nums;
  color: #334155;
}

.sgt-commercial__transport .sgt-commercial__seek {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0;
  background: transparent;
  accent-color: #0B5FFF;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.sgt-commercial__transport .sgt-commercial__seek:focus-visible {
  outline: 3px solid var(--sgt-commercial-focus, #0B5FFF);
  outline-offset: 2px;
  border-radius: 6px;
}

.sgt-commercial__transport .sgt-commercial__seek::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: #CBD5E1;
}

.sgt-commercial__transport .sgt-commercial__seek::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #CBD5E1;
}

.sgt-commercial__transport .sgt-commercial__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: #0B5FFF;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.sgt-commercial__transport .sgt-commercial__seek::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0B5FFF;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

@media (max-width: 480px) {
  .sgt-commercial__transport {
    gap: 8px;
    font-size: 13px;
  }

  .sgt-commercial__transport .sgt-commercial__seek {
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sgt-commercial__transport .sgt-commercial__seek {
    transition: none;
  }
}
