/*
 * Reusable style layer, ported from the v1 dashboard's `styles/main.css`.
 *
 * The tokens these rules consume (--color-*, --ui-*, --font-*) are emitted onto
 * :root from `design/tokens.ts` via the MUI CssBaseline override, so this file
 * never hard-codes a colour. Tailwind `@apply` from the original has been
 * expanded to plain CSS — there is no Tailwind in this app.
 *
 * Nuxt-UI-specific pieces from the original were intentionally dropped: the
 * `.nav-frost` rules (they patched UNavigationMenu's ::before pill) and the
 * `.bg-gradient-to-*` shims (they patched Tailwind v4 gradient positions).
 */

/* Frosted-glass grain — pair with a translucent background on a card or pill. */
.frost {
  background-image: var(--frost-noise);
  background-size: 100px 100px;
}

/* ============================================================
   Scoped typography — .doc-typo
   ONE place for heading size/weight/colour/margin, driven by role tokens
   (gold title, slate-50 highlighted, muted). Scoped on purpose: put the class
   on a container and its headings inherit the document scale.
   ============================================================ */
.doc-typo h1 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  color: var(--ui-text-title); /* gold — the system-wide h1 treatment, never white */
}

.doc-typo h2 {
  font-family: var(--font-title);
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--ui-text-title); /* gold */
}

.doc-typo h3 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-slate-50); /* L3a large card title */
}

.doc-typo h4 {
  font-family: var(--font-title);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-slate-50); /* L3b compact list-item title */
}

.doc-typo h5 {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--color-slate-50); /* L5 console card title */
}

.doc-typo h6 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ui-text-muted); /* L6 console label — flex rows own the spacing */
}

/* A heading immediately followed by its own subtitle/meta gets a tight gap. */
.doc-typo :is(h1, h2, h3, h4):has(+ .description, + .meta-line) {
  margin-bottom: 0.5rem;
}

.doc-typo :is(h1, h2, h3, h4) + :is(.description, .meta-line) {
  margin-top: 0;
}

/* A heading inside a flex header row (e.g. "… / View all") — the wrapper owns spacing. */
.doc-typo .section-head :is(h1, h2, h3, h4) {
  margin-bottom: 0;
}

.eyebrow {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ui-text-muted);
  margin-bottom: 0.75rem;
}

.kicker {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ui-text-title); /* gold */
}

.meta-line {
  font-size: 0.875rem;
  color: var(--ui-text-muted);
  margin-top: 0.5rem;
}

.description {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ui-text-highlighted);
  line-height: 1.625;
  margin-top: 1rem;
}

.h-inherit {
  height: inherit;
}

.min-h-inherit {
  min-height: inherit;
}

.max-h-inherit {
  max-height: inherit;
}

/* ============================================================
   Surfaces — ported from the v1 brief components' UCard usage.
   `.panel` is the default card edge (silver hairline on an elevated
   surface); `.panel-featured` is the North Star treatment: a gold ring
   plus a soft gold bloom, used for the one thing on a page that matters
   most. Both expect the elevated background from the MUI Paper they sit on.
   ============================================================ */
/* THE CARD, for the Papers that reach it through a class rather than the `panelSx`
   recipe. Same surface, spelled in CSS: glass, grain, hairline, 12px. Keep the two in
   step — a card must not depend on which door it came through. */
/*
 * ⚠ THE DOUBLED SELECTOR IS THE WHOLE POINT — do not "tidy" it back to a single `.panel`.
 *
 * MUI paints a Paper's surface through its own generated class, which has EXACTLY the same
 * specificity as a single `.panel` (one class each). Ties are broken by document order, and
 * Emotion injects its styles after this stylesheet — so on every `<Paper className="panel">`
 * MUI won, and the card rendered opaque navy-900 with no grain while still paying for the
 * `backdrop-filter` that had nothing to show through.
 *
 * That is why consumers had `bgcolor: navy[900], backgroundImage: 'none'` written inline:
 * they were describing what they already got, not choosing it. Repeating the class takes
 * the specificity to two, so the card surface wins on a Paper as it always did on a Box.
 *
 * Measured 2026-09-01: `.panel` applied, `backdrop-filter: blur(12px) saturate(1.5)`
 * present, and `background-color: rgb(2, 6, 23)` — opaque — with `background-image: none`.
 */
.panel.panel {
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--ui-card-border);
  background-color: color-mix(in oklch, var(--ui-bg-elevated) 50%, transparent);
  backdrop-filter: blur(12px) saturate(150%);
  background-image: var(--frost-noise);
  background-size: 100px 100px;
}

/*
 * The North Star card — a gold ring and a soft bloom. OPAQUE on purpose: `.panel` is
 * glass, and glass plus a bloom is two effects competing for the same edge.
 *
 * It carries its own fill now. It had none, so every consumer wrote `bgcolor: navy[900]`
 * inline — and because the same `sx` served the plain `.panel` branch beside it, that
 * inline fill was switching the frost off on all the ordinary cards too. The value is
 * `--ui-bg-elevated`, which IS navy-900; nothing changes here, and the plain cards get
 * their glass back. Mirrors `featuredPanelSx` in recipes.ts.
 */
.panel-featured.panel-featured {
  border-radius: 12px;
  background-color: var(--ui-bg-elevated);
  box-shadow:
    0 0 0 1px var(--ui-primary),
    0 0 30px color-mix(in oklch, var(--color-gold-500) 18%, transparent);
}

/* Body copy never runs the full width of a wide container — 66ch keeps the line
   length in the comfortable-reading band no matter how wide the page gets. */
.prose-width {
  max-width: 66ch;
}

/* Two columns on wide screens, one on narrow. Used for card sets and key/value
   blocks so a wider page gains density instead of longer lines. */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

@media (min-width: 900px) {
  .two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

/* A lone item spans the row rather than sitting in the left column with a hole
   beside it — which also gives a single-member group (the subject) its emphasis. */
.two-col > :only-child {
  grid-column: 1 / -1;
}

/* ============================================================
   ⭐ THE ROW BECOMES THE HEADER — a shared-element transition,
   forward only.

   The chat row you click and the thread's header island carry the
   same `view-transition-name`, so the browser animates one into the
   other. Nothing is hand-animated: the names are the instruction.

   ⚠ ONE DIRECTION, DELIBERATELY. Wiring the way back meant the thread
   page leaving a note about which row it came from, and that made the
   animation depend on how you arrived. Back gets the list's ordinary
   entrance instead.

   ⚠ AND NOTHING ELSE ANIMATES ON THIS PAGE. A page-entrance animation
   was added over this later and the morph turned to mush — two motions
   on the same pixels, the second one blurring the first. If the thread
   page ever wants an entrance, it belongs on the CONTENT, never on the
   bar and never on the container that holds it.
   ============================================================ */
.vt-chat-card {
  view-transition-name: chat-card;
}

.vt-chat-title {
  view-transition-name: chat-title;
}

::view-transition-group(chat-card),
::view-transition-group(chat-title) {
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* The rest of the page is a plain crossfade, and a quick one: the morph is
   the event, the background changing under it is not. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
}

/* Someone who asked their system to stop animating things asked this too.
   The global reduced-motion rule cannot reach these pseudo-elements. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
