/*
 * Layer AI panel — scoped styles (phase 3 retry 2/3)
 *
 * All selectors are scoped to .layer-ai-panel. No global selectors.
 *
 * Layers (z-index):
 *   0   .la-bg-canvas       violet wave-line background
 *   1   .la-root            main panel content
 *   50  .la-intro-overlay   full-panel intro overlay (one-shot)
 */

.layer-ai-panel {
  /* ---- color tokens ---- */
  --la-bg:      #0B0F14;
  --la-surface: #141A23;
  --la-accent:  #7BE0C8;
  --la-droppy:  #A06CFF;
  --la-droppy-light: #D4B3FF;
  --la-warm:    #FF8A3D;
  --la-text:    #E8EEF3;
  --la-muted:   #7C8A99;
  --la-hover:   #A4F0DD;
  --la-rule:    #1F2731;

  /* ---- structural tokens ---- */
  --la-pad-y:   2.5rem;
  --la-pad-x:   1.5rem;

  position: relative;
  background: var(--la-bg);
  color: var(--la-text);
  font-family: 'Chivo Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: auto;
  overflow-x: hidden;
  container-type: inline-size;
}

.layer-ai-panel * { box-sizing: border-box; }

/* ---------------------------------------------------------------- */
/* Background wave canvas                                           */
/* ---------------------------------------------------------------- */

.layer-ai-panel .la-bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------------------------------------------------------------- */
/* Layout shell                                                     */
/* ---------------------------------------------------------------- */

.layer-ai-panel .la-root {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--la-pad-y) var(--la-pad-x);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ---------------------------------------------------------------- */
/* Brand row — wordmark SVG + role + meta                           */
/* ---------------------------------------------------------------- */

.layer-ai-panel .la-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin: 20px 0 8px 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--la-rule);
  flex-wrap: wrap;
}

.layer-ai-panel .la-brand-title {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.layer-ai-panel .la-wordmark-img {
  margin: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
}

.layer-ai-panel .la-wordmark-img img {
  display: block;
  height: 48px;
  width: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.layer-ai-panel .la-brand-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.layer-ai-panel .la-role {
  font-family: 'Chivo Mono', monospace;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--la-text);
  margin-top: 10px;
  display: inline-block;
}

.layer-ai-panel .la-meta {
  font-family: 'Chivo Mono', monospace;
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--la-muted);
}

/* ---------------------------------------------------------------- */
/* Body — single floating-video layout                              */
/*                                                                  */
/* ONE continuous <ul> of bullets. Video floats right; the list     */
/* flows beside it, then wraps under once the bullets pass the      */
/* video's bottom edge.                                             */
/* ---------------------------------------------------------------- */

.layer-ai-panel .la-body {
  position: relative;
  overflow: hidden;       /* contain the float */
  padding: 1.5rem;
}

.layer-ai-panel .la-video-frame {
  float: right;
  width: 38%;
  aspect-ratio: 16 / 9;
  margin: 0 0 1.25rem 1.5rem;  /* space below + left of the video */
  position: relative;
  background: var(--la-bg);
  border-radius: 10px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--la-rule);
}

.layer-ai-panel .la-hero-media-mount {
  position: absolute;
  inset: 0;
}

.layer-ai-panel .la-hero-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.layer-ai-panel .la-hero-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* ---------------------------------------------------------------- */
/* Accomplishments — one continuous <ul> flowing around the float   */
/* ---------------------------------------------------------------- */

.layer-ai-panel .la-acc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  /* No flex/grid/column-count — must remain block-flow so each <li>
     reflows around the floated video automatically. */
}

.layer-ai-panel .la-acc-list li.__scrambling__ { color: var(--la-droppy-light); }
.layer-ai-panel .la-acc-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  font-family: 'Chivo Mono', monospace;
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.01em;
  line-height: 1.55;
  color: var(--la-text);
  cursor: default;
  transition: color 180ms ease-out;
}

.layer-ai-panel .la-acc-list li:last-child {
  margin-bottom: 0;
}

.layer-ai-panel .la-acc-list li::before {
  content: '>';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--la-accent);
  font-weight: 500;
}

@media (hover: hover) {
  .layer-ai-panel .la-acc-list li:hover {
    color: var(--la-hover);
  }
}

/* ---------------------------------------------------------------- */
/* Intro overlay — full-panel, plays once                           */
/*                                                                  */
/* Layout: [ unclipped wordmark <img> ] [gap] [ Droppy well square ] */
/* ---------------------------------------------------------------- */

.layer-ai-panel .la-intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: transparent;
  display: block;
  pointer-events: none;
  overflow: hidden;
}

.layer-ai-panel .la-intro-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 24px;
  max-width: 92%;
}

.layer-ai-panel .la-intro-wordmark {
  display: block;
  height: 160px;
  width: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.layer-ai-panel .la-intro-well {
  position: relative;
  flex: 0 0 auto;
  height: 160px;
  width: 160px;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background: var(--la-surface);
  border: 1.5px solid color-mix(in srgb, var(--la-droppy) 65%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 20px color-mix(in srgb, var(--la-droppy) 22%, transparent),
    0 6px 22px rgba(0, 0, 0, 0.55);
}

.layer-ai-panel .la-intro-well img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

/* ---------------------------------------------------------------- */
/* Mobile breakpoint (<900px)                                       */
/* ---------------------------------------------------------------- */

@media (max-width: 900px) {
  .layer-ai-panel {
    --la-pad-y: 1.5rem;
    --la-pad-x: 1rem;
  }

  .layer-ai-panel .la-brand-row {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .layer-ai-panel .la-wordmark-img img { height: 36px; }
  .layer-ai-panel .la-role { font-size: 14px; }
  .layer-ai-panel .la-meta { font-size: 11px; }

  /* Drop the float: video goes full-width at the top, bullets follow. */
  .layer-ai-panel .la-body {
    padding: 1rem;
  }
  .layer-ai-panel .la-video-frame {
    float: none;
    width: 100%;
    margin: 0 0 1.5rem 0;
  }

  .layer-ai-panel .la-acc-list li { font-size: 17px; }

  /* Intro shrinks proportionally on mobile + is constrained to
     viewport height so `top: 50%` on the stage centers in what the
     user sees, not the (very tall) full-stacked-content panel.
     `position: fixed` can't be used here — an ancestor `.panels` has
     a transform, which scopes `fixed` like `absolute` anyway. */
  .layer-ai-panel .la-intro-overlay,
  .layer-ai-panel .la-bg-canvas {
    bottom: auto;
    height: 100vh;
    height: 100dvh;   /* prefer dynamic viewport on mobile browsers */
  }
  .layer-ai-panel .la-intro-wordmark { height: 100px; }
  .layer-ai-panel .la-intro-well     { height: 100px; width: 100px; }
  .layer-ai-panel .la-intro-stage    { gap: 16px; }
}

@media (max-width: 600px) {
  .layer-ai-panel .la-wordmark-img img { height: 30px; }
  .layer-ai-panel .la-brand-meta { align-items: flex-start; text-align: left; }

  .layer-ai-panel .la-intro-wordmark { height: 84px; }
  .layer-ai-panel .la-intro-well     { height: 84px; width: 84px; }
  .layer-ai-panel .la-intro-stage    { gap: 14px; }
}

/* ---------------------------------------------------------------- */
/* Reduced-motion fallback                                          */
/* ---------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .layer-ai-panel .la-acc-list li { transition: none; }
  .layer-ai-panel .la-intro-overlay { display: none; }
}
