/* Eileen Presence v1: in-page presentations of Eileen.
   AILANE-CC-BRIEF-EILEEN-PRESENCE-P1-WEBSITE-001 (standard: AILANE-SPEC-EILEEN-PRESENCE-001).
   Pairs with /assets/js/eileen-presence.js. No gold: #F59E0B is reserved (AMD-279). */

/* ── Summon control (secondary button, as .btn-secondary on the landing page) ── */
.ep-summon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 14px 24px;
  border-radius: 8px;
  font-family: var(--font-body, 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  background: transparent;
  color: var(--text, var(--ac-e2e8f0, #E2E8F0));
  border: 1px solid var(--border-medium, var(--ac-94a3b8-a20, rgba(148, 163, 184, 0.2)));
  cursor: pointer;
  transition: all 0.25s ease;
}
.ep-summon:hover { border-color: var(--cyan, var(--ac-0ea5e9, #0EA5E9)); color: var(--cyan, var(--ac-0ea5e9, #0EA5E9)); }
.ep-summon:focus-visible { outline: 2px solid var(--cyan-soft, var(--ac-22d3ee, #22d3ee)); outline-offset: 3px; }
.ep-summon[hidden] { display: none; }
.ep-summon svg { width: 16px; height: 16px; flex: none; color: var(--cyan-soft, var(--ac-22d3ee, #22d3ee)); }
.ep-summon-time {
  font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 0.82rem;
  color: var(--text-dim, var(--ac-94a3b8, #94A3B8));
}
.ep-summon-time:empty { display: none; }

/* ── Stage ── */
.ep-stage {
  position: relative;
  z-index: 1;
  aspect-ratio: 4 / 5;
  overflow: visible;
  background: none;
  border: 0;
  box-shadow: none;
}
.ep-stage[hidden] { display: none; }

/* The feathered edge (Approach A) is applied to the picture layer, so the label,
   notice, captions and controls stay crisp and are not masked away at the edges. */
.ep-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  background: transparent;
  -webkit-mask-image: radial-gradient(ellipse closest-side at 50% 46%, var(--ac-000000, #000) 52%, var(--ac-000000-a60, rgba(0, 0, 0, 0.6)) 72%, transparent 100%);
  mask-image: radial-gradient(ellipse closest-side at 50% 46%, var(--ac-000000, #000) 52%, var(--ac-000000-a60, rgba(0, 0, 0, 0.6)) 72%, transparent 100%);
  opacity: 0;
  filter: blur(6px);
  transition: opacity var(--ep-dur, 900ms) ease, filter var(--ep-dur, 900ms) ease;
}
.ep-stage.is-in .ep-video { opacity: 1; filter: blur(0); }
.ep-stage.is-in.is-paused .ep-video { opacity: 0.18; filter: blur(2px); }

.ep-fx {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}
.ep-fx[hidden] { display: none; }

.ep-label {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--ac-000000-a55, rgba(0, 0, 0, 0.55));
  color: var(--ac-ffffff, #ffffff);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.ep-notice {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 148px;
  z-index: 4;
  margin: 0;
  text-align: center;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ac-ffffff-a85, rgba(255, 255, 255, 0.85));
  text-shadow: 0 1px 3px var(--ac-000000-a85, rgba(0, 0, 0, 0.85));
  opacity: 0;
  transition: opacity 300ms ease;
}
.ep-notice.is-on { opacity: 1; }

.ep-captions {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 72px;
  z-index: 4;
  text-align: center;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.35;
  color: var(--ac-ffffff, #ffffff);
  text-shadow: 0 1px 3px var(--ac-000000-a85, rgba(0, 0, 0, 0.85));
  pointer-events: none;
}
.ep-captions span { display: block; }
.ep-stage.ep-captions-off .ep-captions { display: none; }

/* ── Controls (glass pills) ── */
.ep-controls {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 5;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}
.ep-stage.ep-show-controls .ep-controls { opacity: 1; pointer-events: auto; }
.ep-stage:focus-within .ep-controls { opacity: 1; pointer-events: auto; }

.ep-btn,
.ep-resume,
.ep-next,
.ep-transcript-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ac-0a0e1a-a55, rgba(10, 14, 26, 0.55));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--ac-22d3ee-a35, rgba(34, 211, 238, 0.35));
  color: var(--ac-ffffff, #ffffff);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.ep-btn:hover,
.ep-resume:hover,
.ep-next:hover,
.ep-transcript-close:hover { background: var(--ac-0ea5e9-a28, rgba(14, 165, 233, 0.28)); border-color: var(--cyan-soft, var(--ac-22d3ee, #22d3ee)); color: var(--ac-ffffff, #ffffff); }
.ep-btn:focus-visible,
.ep-resume:focus-visible,
.ep-next:focus-visible,
.ep-transcript-close:focus-visible,
.ep-line:focus-visible { outline: 2px solid var(--cyan-soft, var(--ac-22d3ee, #22d3ee)); outline-offset: 2px; }
.ep-btn svg,
.ep-resume svg,
.ep-transcript-close svg { width: 20px; height: 20px; flex: none; }
.ep-btn[aria-pressed="true"] { border-color: var(--cyan-soft, var(--ac-22d3ee, #22d3ee)); }
.ep-btn[aria-pressed="false"] { color: var(--ac-ffffff-a70, rgba(255, 255, 255, 0.7)); }

.ep-resume {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 6;
  padding: 0 22px;
  transform: translate(-50%, -50%);
}
.ep-resume[hidden] { display: none; }

.ep-next {
  position: absolute;
  left: 50%;
  bottom: 72px;
  z-index: 6;
  padding: 0 20px;
  transform: translateX(-50%);
}
.ep-next[hidden] { display: none; }

/* ── Chat panel stands aside while Eileen presents (R-3: CSS only) ── */
#eileen-panel { transition: opacity 300ms ease, visibility 0s linear 0s; }
body.eileen-presenting #eileen-panel {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 0s linear 300ms;
}

/* ── Hero placement ── */
@media (min-width: 769px) {
  #hero.ep-host-active { gap: 32px; }
  #hero.ep-host-active .hero-content {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    margin: 0 0 0 max(0px, calc((100% - 1200px) / 2));
  }
  .ep-stage[data-placement="hero"] {
    flex: 0 0 auto;
    align-self: center;
    width: min(46%, 640px, calc((100vh - 220px) * 0.8));
    margin-right: max(24px, calc((100% - 1200px) / 2));
  }
}
@media (max-width: 768px) {
  .hero-ctas .ep-summon { width: 100%; }
  #hero.ep-host-active { flex-direction: column; align-items: stretch; }
  #hero.ep-host-active .hero-content { display: contents; }
  #hero.ep-host-active .hero-content > * { position: relative; z-index: 1; margin-left: 24px; margin-right: 24px; }
  #hero.ep-host-active .hero-content > .hero-badge { align-self: flex-start; }
  #hero.ep-host-active .hero-content > .hero-strip { order: 2; margin-top: 32px; }
  .ep-stage[data-placement="hero"] {
    order: 1;
    width: 100%;
    max-height: 70vh;
    margin: 0 auto;
  }
  .ep-captions { font-size: 15px; bottom: 66px; }
  .ep-notice { bottom: 132px; }
}

/* ── Transcript panel ── */
.ep-transcript {
  position: fixed;
  top: var(--ep-top, 0px);
  right: 0;
  bottom: 0;
  z-index: 790;
  width: 380px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--ac-0a0e1a, #0a0e1a);
  border-left: 1px solid var(--ac-22d3ee-a25, rgba(34, 211, 238, 0.25));
  color: var(--ac-ffffff, #ffffff);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  line-height: 1.6;
  transform: translateX(100%);
  transition: transform 250ms ease;
}
.ep-transcript[hidden] { display: none; }
.ep-transcript.is-open { transform: translateX(0); }
.ep-transcript-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--ac-22d3ee-a15, rgba(34, 211, 238, 0.15));
}
.ep-transcript-title {
  margin: 0;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ac-ffffff, #ffffff);
  line-height: 1.4;
}
.ep-transcript-title:focus { outline: none; }
.ep-transcript-title:focus-visible { outline: 2px solid var(--cyan-soft, var(--ac-22d3ee, #22d3ee)); outline-offset: 2px; }
.ep-transcript-meta {
  margin: 4px 0 0;
  font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 0.78rem;
  color: var(--ac-ffffff-a70, rgba(255, 255, 255, 0.7));
}
.ep-transcript-notice {
  margin: 0;
  padding: 12px 18px;
  font-size: 0.85rem;
  color: var(--ac-ffffff-a85, rgba(255, 255, 255, 0.85));
  border-bottom: 1px solid var(--ac-22d3ee-a15, rgba(34, 211, 238, 0.15));
}
.ep-transcript-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 0 24px;
}
.ep-line {
  display: flex;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 8px 18px 8px 15px;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  color: var(--ac-ffffff-a70, rgba(255, 255, 255, 0.7));
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: left;
  cursor: pointer;
}
.ep-line:hover { color: var(--ac-ffffff, #ffffff); background: var(--ac-22d3ee-a6, rgba(34, 211, 238, 0.06)); }
.ep-line.is-current { color: var(--ac-ffffff, #ffffff); border-left-color: var(--cyan-soft, var(--ac-22d3ee, #22d3ee)); background: var(--ac-22d3ee-a8, rgba(34, 211, 238, 0.08)); }
.ep-line-time {
  flex: none;
  min-width: 3.2em;
  font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 0.8rem;
  line-height: 1.95;
  color: var(--cyan-soft, var(--ac-22d3ee, #22d3ee));
}
@media (max-width: 768px) {
  .ep-transcript {
    top: auto;
    left: 0;
    width: 100%;
    height: 60vh;
    border-left: 0;
    border-top: 1px solid var(--ac-22d3ee-a25, rgba(34, 211, 238, 0.25));
    border-radius: 14px 14px 0 0;
    transform: translateY(100%);
  }
  .ep-transcript.is-open { transform: translateY(0); }
}

/* ── Reduced motion: 150 ms opacity changes only (no points, blur or scale) ── */
@media (prefers-reduced-motion: reduce) {
  .ep-stage .ep-video,
  .ep-stage.is-in .ep-video,
  .ep-stage.is-in.is-paused .ep-video {
    filter: none !important;
    transition: opacity 150ms ease !important;
  }
  .ep-fx { display: none !important; }
}

/* Transcript open on desktop: move the hero stage left so the panel never covers Eileen (Director review, 7 Nov 2026). */
.ep-stage[data-placement="hero"] { transition: transform 250ms ease; }
@media (min-width: 1100px) {
  body:has(.ep-transcript.is-open) .ep-stage[data-placement="hero"] { transform: translateX(-200px); }
}
@media (prefers-reduced-motion: reduce) {
  .ep-stage[data-placement="hero"] { transition: none; }
}

/* ── Inline placement: product cards (AILANE-CC-BRIEF-EILEEN-PRESENCE-P3-CARDS-WEBSITE-001) ── */

/* Compact ghost pill: 36 px tall, with a 44 px touch target from the ::after overlay. No gold. */
.ep-summon.ep-summon--inline {
  position: relative;
  align-self: flex-start;
  gap: 6px;
  min-height: 36px;
  height: 36px;
  margin: 0 0 16px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--ac-0a0e1a-a55, rgba(10, 14, 26, 0.55));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--ac-22d3ee-a35, rgba(34, 211, 238, 0.35));
  color: var(--ac-ffffff-a85, rgba(255, 255, 255, 0.85));
}
.ep-summon.ep-summon--inline::after { content: ''; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
.ep-summon.ep-summon--inline:hover { background: var(--ac-0ea5e9-a18, rgba(14, 165, 233, 0.18)); border-color: var(--cyan-soft, var(--ac-22d3ee, #22d3ee)); color: var(--ac-ffffff, #ffffff); }
.ep-summon.ep-summon--inline svg { width: 14px; height: 14px; }
.ep-summon.ep-summon--inline .ep-summon-time { font-size: 0.78rem; color: var(--ac-ffffff-a70, rgba(255, 255, 255, 0.7)); }
.ep-summon.ep-summon--inline[hidden] { display: none; }

/* Neighbouring cards keep their own height when one card expands. */
#products .card-trio > .product-card { align-self: start; }

/* The card grows to make room: one grid row animating from 0fr to 1fr over 450 ms. */
.ep-inline-wrap {
  display: grid;
  grid-template-rows: 0fr;
  margin: 0;
  transition: grid-template-rows 450ms ease, margin-bottom 450ms ease;
}
.ep-inline-wrap.is-expanded { grid-template-rows: 1fr; margin-bottom: 20px; }
.ep-inline-inner { min-height: 0; overflow: hidden; }
.ep-inline-wrap.is-open .ep-inline-inner { overflow: visible; }

.ep-stage[data-placement="inline"] {
  width: 100%;
  max-height: 460px;
  aspect-ratio: 4 / 5;
}
.ep-stage[data-placement="inline"] .ep-video { object-position: 50% 28%; }

/* Nexus field behind the stage: the feathered edge dissolves into a faint glow, not the card colour. */
.ep-stage[data-placement="inline"]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, var(--ac-22d3ee-a10, rgba(34, 211, 238, 0.10)), transparent 70%);
  opacity: 0;
  transition: opacity var(--ep-dur, 900ms) ease;
}
.ep-stage[data-placement="inline"].is-in::before { opacity: 1; }

@media (max-width: 768px) {
  .ep-stage[data-placement="inline"] .ep-notice { left: 4%; right: 4%; }
}

@media (prefers-reduced-motion: reduce) {
  .ep-inline-wrap { transition: none; }
  .ep-stage[data-placement="inline"]::before { transition: opacity 150ms ease; }
}
