/* Find an EMS — homepage explainer embed. Scoped under .fae */
.fae {
  --fae-navy: #082452; --fae-blue: #075AD7; --fae-orange: #FF5A0A; --fae-green: #24A148;
  --fae-ink: #12213D; --fae-mute: #52617A; --fae-line: #DFE6F0; --fae-soft: #F4F8FF; --fae-white: #FFFFFF;
  position: relative; box-sizing: border-box; width: 100%; max-width: 1160px; margin: 0 auto;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  container-type: inline-size; container-name: fae;
}
.fae *, .fae *::before, .fae *::after { box-sizing: border-box; }

/* 16:9 box reserved from first paint — no layout shift */
.fae-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate;
  background: var(--fae-soft); border-radius: clamp(10px, 1.6cqw, 20px);
  box-shadow: 0 0 0 1px var(--fae-line), 0 20px 50px rgba(8, 36, 82, .10);
  container-type: inline-size;
}
@supports not (aspect-ratio: 16 / 9) { .fae-frame { height: 0; padding-top: 56.25%; } }

.fae-stage { position: absolute; inset: 0; visibility: hidden; }
.fae-canvas { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; will-change: transform; contain: layout paint; }
.fae.is-live .fae-stage { visibility: visible; }
.fae.is-live .fae-poster { visibility: hidden; }

/* ── static poster (shown before init, with no JS, and for reduced motion) ── */
.fae-poster { position: absolute; inset: 0; color: var(--fae-navy); text-align: center; }
.fae-poster__blob { position: absolute; border-radius: 50%; background: var(--fae-blue); }
.fae-poster__blob--a { width: 46.9cqw; height: 46.9cqw; left: -21.9cqw; top: -17.7cqw; opacity: .05; }
.fae-poster__blob--b { width: 52cqw; height: 52cqw; left: 71.9cqw; top: 29.2cqw; opacity: .04; }
.fae-poster__dots { position: absolute; inset: 0; background-image: radial-gradient(rgba(8,36,82,.10) .09cqw, transparent .11cqw); background-size: 2.08cqw 2.08cqw; }
.fae-poster__logo { position: absolute; left: 50%; top: 12cqw; transform: translate(-50%, -50%); height: 5.42cqw; width: auto; }
.fae-poster__h { position: absolute; left: 0; right: 0; margin: 0; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-size: 6.77cqw; transform: translateY(-50%); }
.fae-poster__h--1 { top: 21.35cqw; color: var(--fae-navy); }
.fae-poster__h--2 { top: 28.39cqw; color: var(--fae-blue); }
.fae-poster__bar { position: absolute; left: 50%; top: 33.1cqw; width: 27.1cqw; height: .625cqw; transform: translateX(-50%); border-radius: 1cqw; background: linear-gradient(90deg, var(--fae-navy) 50%, var(--fae-blue) 50%); }
.fae-poster__sub { position: absolute; left: 0; right: 0; top: 36.8cqw; margin: 0; transform: translateY(-50%); font-size: 1.77cqw; font-weight: 600; color: var(--fae-mute); }
.fae-poster__sides { position: absolute; left: 50%; top: 43cqw; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 1.25cqw; white-space: nowrap; }
.fae-poster__side { display: inline-flex; align-items: center; gap: .7cqw; padding: .8cqw 1.4cqw; border-radius: 99cqw; background: #fff; box-shadow: 0 .6cqw 1.6cqw rgba(8,36,82,.10); font-size: 1.35cqw; font-weight: 700; color: var(--fae-ink); }
.fae-poster__side b { font-weight: 800; }
.fae-poster__dot { width: .9cqw; height: .9cqw; border-radius: 50%; }
.fae-poster__link { width: 11cqw; height: .5cqw; background-image: radial-gradient(circle, var(--fae-blue) 45%, transparent 50%); background-size: 1.1cqw .5cqw; background-repeat: repeat-x; }
.fae-poster__mark { height: 3.3cqw; width: auto; }

/* ── controls ── */
.fae-controls { position: absolute; right: clamp(8px, 1.6cqw, 18px); bottom: clamp(8px, 1.6cqw, 18px); z-index: 3; display: flex; gap: 8px; }
.fae-btn {
  -webkit-appearance: none; appearance: none; margin: 0; height: 44px; min-width: 44px; padding: 0; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,.95); color: var(--fae-navy); border: 1px solid var(--fae-line);
  box-shadow: 0 6px 18px rgba(8,36,82,.16); font: 700 15px/1 Inter, system-ui, sans-serif; letter-spacing: .01em;
  transition: background-color .14s, color .14s, border-color .14s;
}
.fae-btn--wide { padding: 0 18px 0 14px; }
.fae-btn:hover { background: var(--fae-blue); border-color: var(--fae-blue); color: #fff; }
.fae-btn:focus { outline: none; }
.fae-btn:focus-visible { outline: 3px solid var(--fae-blue); outline-offset: 3px; }
.fae-btn svg { display: block; flex: none; }

/* Narrow embeds: controls move below the frame so they never cover the composition */
@media (max-width: 599px) { .fae-controls { position: static; justify-content: flex-end; min-height: 44px; margin-top: 10px; } }
@container fae (max-width: 599px) { .fae-controls { position: static; justify-content: flex-end; min-height: 44px; margin-top: 10px; } }
@container fae (min-width: 600px) { .fae-controls { position: absolute; margin-top: 0; } }

/* ── phone treatment (<600px): taller 4:5 stage with a reflowed composition ── */
.fae-canvas--m { width: 1080px; height: 1350px; }
@media (max-width: 599px) { .fae-frame { aspect-ratio: 4 / 5; } }
@container fae (max-width: 599px) { .fae-frame { aspect-ratio: 4 / 5; } }
@container fae (min-width: 600px) { .fae-frame { aspect-ratio: 16 / 9; } }
@supports not (aspect-ratio: 4 / 5) { @media (max-width: 599px) { .fae-frame { padding-top: 125%; } } }
@container (max-width: 599px) {
  .fae-poster__dots { background-size: 4.4cqw 4.4cqw; background-image: radial-gradient(rgba(8,36,82,.10) .16cqw, transparent .2cqw); }
  .fae-poster__blob--a { width: 80cqw; height: 80cqw; left: -40cqw; top: -30cqw; }
  .fae-poster__blob--b { width: 90cqw; height: 90cqw; left: 50cqw; top: 70cqw; }
  .fae-poster__logo { top: 18.5cqw; height: 13.9cqw; }
  .fae-poster__h { font-size: 11.85cqw; }
  .fae-poster__h--1 { top: 43.5cqw; }
  .fae-poster__h--2 { top: 56cqw; font-size: 10.2cqw; }
  .fae-poster__bar { top: 64cqw; width: 40.7cqw; height: 1.48cqw; }
  .fae-poster__sub { top: 74cqw; font-size: 4.1cqw; line-height: 1.3; padding: 0 9cqw; }
  .fae-poster__sides { top: 99cqw; flex-direction: column; gap: 2.6cqw; }
  .fae-poster__side { font-size: 3.9cqw; padding: 2.2cqw 4cqw; gap: 2cqw; box-shadow: 0 1.2cqw 3cqw rgba(8,36,82,.10); }
  .fae-poster__dot { width: 2.4cqw; height: 2.4cqw; }
  .fae-poster__link { display: none; }
  .fae-poster__mark { display: none; }
}

.fae-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

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