/* PETROS brand — marble and gold. From the design system's assets/petros-brand.css.
   Dark is the default and light is a variant, both driven by the same
   [data-petros-theme] attribute the app already sets on #root — so the theme
   toggle keeps working and there is one visual language rather than two.
   Load AFTER ig-tokens.css, which it overrides. */
:root {
  --ig-surface-base: #14120E;
  --ig-surface-1: #1C1915;
  --ig-surface-1-muted: rgba(28,25,21,0.65);
  --ig-surface-2: #272219;
  --ig-surface-3: #3A3327;
  --ig-border-default: #2A251D;
  --ig-border-hover: #4A4232;
  --ig-accent: #D9B554;
  --ig-accent-hover: #E7C972;
  --ig-accent-ring: #C9A23F;
  --ig-accent-muted-bg: rgba(201,162,63,0.12);
  --ig-accent-border: rgba(201,162,63,0.32);
  --ig-header-bg: rgba(20,18,14,0.92);
  /* Ink on a solid accent fill. Gold is light enough that white on it
     is barely legible, which is what the chat bubbles were doing. */
  --ig-solid-ink: #14120E;
  --ig-inset-bg: rgba(10,9,7,0.5);
  --ig-text-primary: #F5F1E6;
  --ig-text-secondary: #D9D2C0;
  --ig-text-tertiary: #A69D87;
  --ig-text-muted: #7C745F;
  --ig-text-subtle: #57503E;
  --ig-warning: #E0703C;
  --ig-warning-text: #F3A97E;
  --ig-warning-bg: rgba(224,112,60,0.16);
  --ig-warning-border: rgba(224,112,60,0.4);

  /* Not in the design's dark block, which defines warning only — the same gap
     the electric-blue version had. Without these, a danger border and every
     neutral chip fall through to ig-tokens.css, which is the old cool scale:
     slate-gray pills and a cherry red on a warm marble surface, in the dark
     theme only.

     Success and info keep ig-tokens' hues, which read correctly against warm
     surfaces. Danger is pulled off its blue-red toward the warm red the light
     block chose, and the neutral scale is rebuilt on the marble text ramp above
     rather than on slate. */
  --ig-danger: #E05252;
  --ig-danger-text: #F08A80;
  --ig-danger-bg: rgba(224,82,82,0.14);
  --ig-danger-border: rgba(224,82,82,0.34);
  --ig-neutral-bg: rgba(166,157,135,0.10);
  --ig-neutral-text: #A69D87;
  --ig-neutral-border: rgba(166,157,135,0.28);
}
[data-petros-theme="light"] {
  --ig-surface-base: #F3F1EA;
  --ig-surface-1: #FDFCF8;
  --ig-surface-1-muted: rgba(253,252,248,0.75);
  --ig-surface-2: #ECE8DD;
  --ig-surface-3: #DBD5C5;
  --ig-border-default: #E2DDCF;
  --ig-border-hover: #C6BFA9;
  --ig-accent: #8A6D1F;
  --ig-accent-hover: #6F5717;
  --ig-accent-ring: #8A6D1F;
  --ig-accent-muted-bg: rgba(138,109,31,0.10);
  --ig-accent-border: rgba(138,109,31,0.30);
  --ig-header-bg: rgba(243,241,234,0.92);
  --ig-solid-ink: #FFFFFF;
  --ig-inset-bg: rgba(253,252,248,0.7);
  --ig-text-primary: #1B1810;
  --ig-text-secondary: #3C382D;
  --ig-text-tertiary: #5F5A4A;
  --ig-text-muted: #8B8471;
  --ig-text-subtle: #A9A390;
  --ig-success: #16A34A;
  --ig-success-text: #15803D;
  --ig-success-bg: rgba(21,128,61,0.10);
  --ig-success-border: rgba(21,128,61,0.32);
  --ig-warning: #B54A18;
  --ig-warning-text: #8F3D10;
  --ig-warning-bg: rgba(181,74,24,0.11);
  --ig-warning-border: rgba(181,74,24,0.34);
  --ig-danger: #DC2626;
  --ig-danger-text: #B3362C;
  --ig-danger-bg: rgba(179,54,44,0.08);
  --ig-danger-border: rgba(179,54,44,0.32);
  --ig-info: #2563EB;
  --ig-info-text: #1D4ED8;
  --ig-info-bg: rgba(37,99,235,0.09);
  --ig-info-border: rgba(37,99,235,0.28);
  --ig-neutral-bg: rgba(95,90,74,0.10);
  --ig-neutral-text: #5F5A4A;
  --ig-neutral-border: rgba(95,90,74,0.3);
}

/* ---- compatibility with the pre-brand scale ---------------------------------
   Health, Estate, Settings and the Work log are rendered by code written against
   the app's original tokens (--card, --text-2, --muted, …). Replacing the shell
   left ~600 of those references resolving to nothing, which does not fail — it
   renders as the inherited color, so the symptom is invisible text rather than
   an error. tools/check_css.py caught it before it shipped.

   Mapping them onto the brand scale rather than rewriting every call site: it
   makes the whole app adopt the new palette at once, in both themes, instead of
   leaving two visual languages side by side. The legacy names stay until their
   renderers are migrated, and each one points at its nearest brand equivalent. */
:root, [data-petros-theme="light"] {
  --bg: var(--ig-surface-base);
  --header-bg: var(--ig-header-bg);
  --card: var(--ig-surface-1);
  --card-2: var(--ig-surface-2);
  --border: var(--ig-border-default);
  --border-2: var(--ig-border-hover);
  --hairline: var(--ig-border-default);

  --text: var(--ig-text-primary);
  --text-2: var(--ig-text-secondary);
  --text-3: var(--ig-text-tertiary);
  --muted: var(--ig-text-muted);

  --accent-ink: var(--ig-accent);
  --accent-bg: var(--ig-accent-muted-bg);
  --accent-soft: var(--ig-accent-muted-bg);

  --good: var(--ig-success);
  --good-bg: var(--ig-success-bg);
  --warn: var(--ig-warning);
  --warn-2: var(--ig-warning-text);
  --warn-bg: var(--ig-warning-bg);
  --warn-bg-soft: var(--ig-warning-bg);
  --warn-border: var(--ig-warning-border);
  --bad: var(--ig-danger-text);
  --bad-bg: var(--ig-danger-bg);
  --gray-bg: var(--ig-neutral-bg);

  /* A solid high-contrast chip. In the old light theme this was near-black on
     cream; here it is the raised surface, which reads the same way in both. */
  --inverse: var(--ig-surface-3);
  --inverse-text: var(--ig-text-primary);

  --petros-bg: var(--ig-surface-1);
  --petros-border: var(--ig-accent-border);
}

/* The endorsed lockup, as Clu and Relay carry it: the name over "by
   Intelligant AI", smaller and muted. The endorsement drops on phones so the
   header stays one line. */
.lockup { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.lockup-by {
  font-family: var(--ig-font-mono); font-weight: 400; font-size: 10.5px;
  letter-spacing: 0.01em; line-height: 1.3; color: var(--ig-text-muted);
  white-space: nowrap;
}
@media (max-width: 560px) { .lockup-by { display: none; } }
