/* ---- The client brain's own look ------------------------------------------------------------------------
   Brad is the brain's face: one mark, one accent, used wherever Brad speaks or is offered, so the brain
   reads as a product of its own inside RADAR. Everything else on its pages is the UI kit. */

@layer components {
  .brad-mark {
    background-image: linear-gradient(135deg, #2563eb 0%, #6366f1 55%, #22d3ee 130%);
  }
  /* While Brad is working, a soft ring breathes around the mark. */
  .brad-mark-working::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    border: 2px solid color-mix(in oklab, #6366f1 60%, transparent);
    animation: brad-breathe 1.6s ease-in-out infinite;
  }
  @keyframes brad-breathe {
    0%, 100% { opacity: 0.15; transform: scale(0.96); }
    50% { opacity: 0.9; transform: scale(1.06); }
  }

  /* The welcome's backdrop: a faint glow behind Brad, the same in both themes. */
  .brad-stage {
    background-image: radial-gradient(60rem 22rem at 50% -6rem, color-mix(in oklab, #6366f1 14%, transparent), transparent 70%);
  }

  /* Brad's headline card on Home: a night-sky panel in Brad's colours, the same in both themes, so it reads as
     Brad's own space above the rest of the dashboard. The panel holds the ask; the chats beside it stay on the
     page's surface. brad-hero-card frames the whole card, brad-hero-stage is the panel, brad-hero-glow its
     decoration (drawn behind, never clipping the client list that opens from the ask box). */
  .brad-hero-card {
    border-color: color-mix(in oklab, #6366f1 38%, var(--color-gray-200));
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 24px 48px -28px color-mix(in oklab, #4f46e5 70%, transparent);
  }
  .brad-hero-stage {
    position: relative;
    isolation: isolate;
    color: #fff;
    background-color: #0b1030;
    background-image:
      radial-gradient(36rem 20rem at 0% 0%, color-mix(in oklab, #2563eb 55%, transparent), transparent 70%),
      radial-gradient(30rem 18rem at 100% 110%, color-mix(in oklab, #06b6d4 38%, transparent), transparent 70%),
      linear-gradient(135deg, #0b1030 0%, #1e1b4b 60%, #172554 100%);
  }
  .brad-hero-glow {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
  }
  /* A faint dot grid that fades out to the right, and rings around where Brad's mark sits. */
  .brad-hero-glow::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgb(255 255 255 / 0.13) 1px, transparent 1.2px);
    background-size: 18px 18px;
    mask-image: linear-gradient(110deg, #000 0%, transparent 65%);
  }
  .brad-hero-glow::after {
    content: "";
    position: absolute;
    left: -5.5rem;
    top: -5.5rem;
    width: 15rem;
    height: 15rem;
    border-radius: 9999px;
    border: 1px solid rgb(165 180 252 / 0.22);
    box-shadow: 0 0 0 2.25rem rgb(165 180 252 / 0.05), 0 0 0 4.5rem rgb(165 180 252 / 0.03);
  }
  .brad-hero-stage .brad-mark {
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.18), 0 0 28px 2px color-mix(in oklab, #22d3ee 45%, transparent);
  }
  .brad-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #67e8f9;
  }
  .brad-hero-eyebrow::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 9999px;
    background: #22d3ee;
    box-shadow: 0 0 8px #22d3ee;
  }
  .brad-hero-muted { color: rgb(199 210 254 / 0.78); }
  .brad-hero-label { color: rgb(199 210 254 / 0.6); }
  .brad-hero-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 2.25rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(255 255 255 / 0.16);
    background: rgb(255 255 255 / 0.06);
    font-size: 0.8125rem;
    font-weight: 500;
    color: #fff;
    transition: background-color 150ms, border-color 150ms;
  }
  .brad-hero-link:hover { background: rgb(255 255 255 / 0.12); border-color: rgb(255 255 255 / 0.28); }
  .brad-hero-chip {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.25rem;
    padding: 0 0.75rem 0 0.375rem;
    border-radius: 9999px;
    border: 1px solid rgb(255 255 255 / 0.14);
    background: rgb(255 255 255 / 0.06);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    color: #e0e7ff;
    transition: background-color 150ms, border-color 150ms;
  }
  .brad-hero-chip:hover { background: rgb(255 255 255 / 0.12); border-color: rgb(255 255 255 / 0.28); color: #fff; }
  .brad-hero-chip-more { padding-left: 0.75rem; color: #67e8f9; }
  .brad-hero-stage :focus-visible { outline: 2px solid #67e8f9; outline-offset: 2px; }
  /* The ask box keeps the page's surface so typing reads the same everywhere, lifted off the night sky. */
  .brad-hero-stage .brad-composer {
    border-color: rgb(255 255 255 / 0.2);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.04), 0 18px 40px -18px rgb(0 0 0 / 0.6), 0 0 36px -8px color-mix(in oklab, #6366f1 55%, transparent);
  }
  .brad-hero-stage .brad-composer:focus-within {
    border-color: #67e8f9;
    box-shadow: 0 0 0 3px color-mix(in oklab, #22d3ee 35%, transparent), 0 18px 40px -18px rgb(0 0 0 / 0.6);
  }

  /* The ask box: the question in one roomy field, with the client it's about and the send button on a bar
     beneath, all inside one border that lights up while either has focus. */
  .brad-composer {
    border: 1px solid var(--color-gray-300);
    border-radius: 0.875rem;
    background-color: var(--color-surface);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 8px 24px -12px color-mix(in oklab, #6366f1 35%, transparent);
    transition: border-color 150ms, box-shadow 150ms;
  }
  .brad-composer:focus-within {
    border-color: var(--color-blue-600);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-blue-600) 22%, transparent), 0 8px 24px -12px color-mix(in oklab, #6366f1 35%, transparent);
  }
  .brad-composer-input {
    display: block;
    width: 100%;
    min-height: 3.25rem;
    padding: 0.875rem 1rem 0.625rem;
    border: 0;
    border-radius: 0.875rem 0.875rem 0 0;
    background: transparent;
    font-size: 1rem;
    line-height: 1.5rem;
    color: var(--color-gray-900);
    outline: none;
  }
  .brad-composer-input::placeholder { color: var(--color-gray-400); }
  .brad-composer-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-top: 1px solid var(--color-gray-100);
  }

  /* The brain's name, in Brad's colours. */
  .brad-wordmark {
    background-image: linear-gradient(90deg, #2563eb, #6366f1 60%, #0891b2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  html.dark .brad-wordmark {
    background-image: linear-gradient(90deg, #60a5fa, #a5b4fc 60%, #67e8f9);
  }

  /* A search hit's matched words. */
  .brain-excerpt mark {
    border-radius: 0.25rem;
    padding: 0 0.125rem;
    background-color: color-mix(in oklab, #facc15 35%, transparent);
    color: inherit;
  }
}

/* The client switcher's rows (brad-switcher). The row picked with the arrow keys is the highlighted one. */
@layer components {
  .brad-switcher-option {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.625rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--color-gray-800);
  }
  .brad-switcher-option:hover {
    background-color: var(--color-gray-50);
  }
  .brad-switcher-option[aria-selected="true"] {
    background-color: color-mix(in oklab, #6366f1 12%, transparent);
    color: var(--color-gray-900);
  }
}
