/*
 * Look B, "brand gradient" (du AI redesign): the organization's own gradient carries the allowance on Home, task
 * cards are lightly tinted, the Create button and the person's own messages wear the gradient.
 *
 * A look obeys docs/superpowers/specs/2026-11-12-du-ai-platform-redesign/look-contract.md, checked by
 * tests/unit/public/aiPlatformLooks.test.js: every selector starts with body[data-layout="gradient"]; colours come
 * only from the organization's variables (--primary, --accent, --ink, --surface, --paper, --on-primary), color-mix(),
 * white, black or transparent; it sets all thirteen look tokens and styles only the listed hooks.
 */
/* ── tokens ─────────────────────────────────────────────────────────────────────────────────────── */
body[data-layout="gradient"] {
  --aip-gradient: linear-gradient(135deg, var(--primary, #1f3864), var(--accent, #2e75b6));
  --aip-bg: color-mix(in srgb, var(--primary, #1f3864) 4%, var(--paper, #f4f7fb));
  --aip-card: var(--surface, #fff);
  --aip-card-ink: var(--ink, #26313f);
  --aip-muted: color-mix(in srgb, var(--ink, #26313f) 68%, var(--surface, #fff));
  --aip-line: color-mix(in srgb, var(--primary, #1f3864) 14%, transparent);
  --aip-nav-bg: var(--surface, #fff);
  --aip-nav-ink: color-mix(in srgb, var(--ink, #26313f) 68%, var(--surface, #fff));
  --aip-nav-active: var(--primary, #1f3864);
  --aip-hero-bg: var(--aip-gradient);
  --aip-hero-ink: #fff;
  --aip-ring-track: color-mix(in srgb, #fff 30%, transparent);
  --aip-ring-fill: #fff;
  --aip-focus: var(--primary, #1f3864);
}

/* ── the hooks ──────────────────────────────────────────────────────────────────────────────────── */
body[data-layout="gradient"][data-shell="on"] header.top { border-block-end: 3px solid transparent; border-image: var(--aip-gradient) 1; }
body[data-layout="gradient"][data-shell="on"] .aip-hero { position: relative; overflow: hidden; box-shadow: 0 12px 32px color-mix(in srgb, var(--primary, #1f3864) 28%, transparent); }
body[data-layout="gradient"][data-shell="on"] .aip-hero::after {
  content: ''; position: absolute; inset-block-start: -40%; inset-inline-end: -12%; inline-size: 55%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, #fff 22%, transparent), transparent 70%); pointer-events: none;
}
body[data-layout="gradient"][data-shell="on"] .aip-hero > * { position: relative; z-index: 1; }
body[data-layout="gradient"][data-shell="on"] .aip-topup { border-color: color-mix(in srgb, #fff 60%, transparent); background: color-mix(in srgb, #fff 18%, transparent); }
body[data-layout="gradient"][data-shell="on"] .aip-topup:hover { background: color-mix(in srgb, #fff 30%, transparent); }
body[data-layout="gradient"][data-shell="on"] .aip-nav-item[data-dest="create"] .aip-nav-icon { background: var(--aip-gradient); color: #fff; }
body[data-layout="gradient"][data-shell="on"] .aip-task-card { border-color: transparent; background: linear-gradient(160deg, color-mix(in srgb, var(--primary, #1f3864) 8%, var(--surface, #fff)), var(--surface, #fff) 70%); }
body[data-layout="gradient"][data-shell="on"] .aip-task-card:nth-child(4n+2) { background: linear-gradient(160deg, color-mix(in srgb, var(--accent, #2e75b6) 12%, var(--surface, #fff)), var(--surface, #fff) 70%); }
body[data-layout="gradient"][data-shell="on"] .aip-task-card:nth-child(4n+3) { background: linear-gradient(160deg, color-mix(in srgb, var(--primary, #1f3864) 5%, color-mix(in srgb, var(--accent, #2e75b6) 9%, var(--surface, #fff))), var(--surface, #fff) 70%); }
body[data-layout="gradient"][data-shell="on"] .aip-task-card:nth-child(4n+4) { background: linear-gradient(160deg, color-mix(in srgb, var(--accent, #2e75b6) 7%, var(--surface, #fff)), var(--surface, #fff) 70%); }
body[data-layout="gradient"][data-shell="on"] .aip-task-icon { background: var(--aip-gradient); color: #fff; }
body[data-layout="gradient"][data-shell="on"] .aip-task-card:nth-child(4n+2) .aip-task-icon { background: linear-gradient(135deg, var(--accent, #2e75b6), var(--primary, #1f3864)); }
body[data-layout="gradient"][data-shell="on"] #messages .msg { border-radius: var(--aip-r-16); }
body[data-layout="gradient"][data-shell="on"] #messages .msg.user { background: var(--aip-gradient); color: #fff; border-end-end-radius: var(--aip-s-1); }
body[data-layout="gradient"][data-shell="on"] #messages .msg.assistant { border-color: var(--aip-line); border-end-start-radius: var(--aip-s-1); box-shadow: var(--aip-e-1); }
body[data-layout="gradient"][data-shell="on"] #sidebar { background: var(--aip-card); border-inline-end: 1px solid var(--aip-line); }
/* Learn rewards: the Spotlight on the brand gradient, its text in the on-gradient colour (the gold stays the shell's) */
body[data-layout="gradient"][data-shell="on"] .aip-spot { --aip-spot-bg: radial-gradient(420px 420px at 50% 30%, color-mix(in srgb, white 16%, transparent), transparent 70%), var(--aip-gradient); --aip-spot-ink: var(--aip-on-gradient); --aip-spot-muted: color-mix(in srgb, var(--aip-on-gradient) 80%, transparent); --aip-spot-gold-ink: color-mix(in srgb, var(--aip-on-gradient) 72%, var(--aip-learn-gold)); /* gold text readable on any brand gradient; the rim and the token stay gold */ }
/* Personal memory (issue #1710): the first-use notice on the brand gradient, its text in the on-gradient colour */
body[data-layout="gradient"][data-shell="on"] .aip-mem-notice { background: var(--aip-gradient); color: var(--aip-on-gradient); }
body[data-layout="gradient"][data-shell="on"] .aip-mem-switch[aria-checked="true"] .aip-mem-switch-track { background: var(--aip-gradient); }
