/* Poulpe design system: tokens.
   Every value the brand has, once. Colours carry both themes in one
   declaration, light-dark(light, dark), and follow the nearest colour scheme:
   the system's by default, or the one forced with data-theme on any element.
   Needs light-dark(): Chrome 123, Safari 17.5, Firefox 120.

   This file holds tokens and the one face they name (Fredoka). No selectors
   beyond :root and [data-theme]; the classes are in components.css. */

/* Fredoka, self-hosted (SIL Open Font License 1.1, fonts/OFL.txt). */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Fredoka-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/Fredoka-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/Fredoka-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/Fredoka-700.woff2') format('woff2');
}

:root {
  color-scheme: light dark;

  /* ---- Colour: surfaces ------------------------------------------------ */
  --pp-bg: light-dark(#fbfbfc, #111118);
  --pp-surface: light-dark(#ffffff, #1a1a24);
  --pp-surface-2: light-dark(#f3f3f6, #16161f);
  --pp-surface-hover: light-dark(#ececf2, #252532);
  --pp-border: light-dark(#e2e2e9, #2b2b3a);
  --pp-border-strong: light-dark(#cdcdd8, #3d3d50);

  /* ---- Colour: ink ----------------------------------------------------- */
  --pp-text: light-dark(#1b1b25, #e9e9f1);
  --pp-text-muted: light-dark(#5f5f75, #a3a3bb);
  /* Fails 4.5:1 in both themes: placeholders and decoration only. */
  --pp-text-faint: light-dark(#8b8ba0, #6f6f88);

  /* ---- Colour: accent (the head) --------------------------------------- */
  --pp-accent: light-dark(#4f46e5, #818cf8);
  --pp-accent-hover: light-dark(#4338ca, #a5b4fc);
  --pp-accent-text: light-dark(#4338ca, #a5b4fc);
  --pp-accent-soft: light-dark(rgba(79, 70, 229, 0.1), rgba(129, 140, 248, 0.16));
  --pp-on-accent: light-dark(#ffffff, #111118);

  /* ---- Colour: status -------------------------------------------------- */
  --pp-danger: light-dark(#d92d20, #f87171);
  --pp-warn: light-dark(#b54708, #fbbf24);
  --pp-ok: light-dark(#12805c, #34d399);
  /* Tints behind a status, and the ink that stays readable on them. */
  --pp-danger-soft: light-dark(rgba(217, 45, 32, 0.08), rgba(248, 113, 113, 0.12));
  --pp-warn-soft: light-dark(#fff7e8, rgba(251, 191, 36, 0.08));
  --pp-ok-soft: light-dark(rgba(18, 128, 92, 0.1), rgba(52, 211, 153, 0.12));
  --pp-danger-text: light-dark(#b42318, #f87171);
  --pp-warn-text: var(--pp-warn);
  --pp-ok-text: light-dark(#0b6b4a, #34d399);

  /* ---- Colour: issue states --------------------------------------------
     Dots and fills beside an ink label; progress and main fail as text
     in the light theme. */
  --pp-state-backlog: var(--pp-text-faint);
  --pp-state-todo: var(--pp-text-muted);
  --pp-state-progress: light-dark(#e0a800, #e2b93b);
  --pp-state-main: light-dark(#16a34a, #3dd68c);
  --pp-state-deployed: var(--pp-accent);
  --pp-state-cancelled: var(--pp-text-faint);
  --pp-state-duplicate: var(--pp-text-faint);

  /* ---- Colour: the eight arms ------------------------------------------
     In the logo's order. Fills, dots and bars only. */
  --pp-arm-1: light-dark(#c15f3c, #f0906a);
  --pp-arm-2: light-dark(#0f8f6f, #2dd4bf);
  --pp-arm-3: light-dark(#7e3af2, #c084fc);
  --pp-arm-4: light-dark(#2f7de1, #60a5fa);
  --pp-arm-5: light-dark(#596273, #9ca3af);
  --pp-arm-6: light-dark(#e0900b, #fbbf24);
  --pp-arm-7: light-dark(#0a9fc0, #22d3ee);
  --pp-arm-8: light-dark(#d6457f, #f472b6);

  /* Engines use Poulpe's colour scheme through their own tokens.
     No arm stands for an engine; the logo and loader keep their colours. */
  --pp-engine-claude: var(--pp-arm-1);
  --pp-engine-codex: var(--pp-arm-4);
  --pp-engine-local: var(--pp-arm-3);

  /* An arm's colour as text: darker in the light theme, so that it reaches
     4.5:1; the arm colour itself in the dark theme. */
  --pp-arm-1-text: light-dark(#ac5435, #f0906a);
  --pp-arm-2-text: light-dark(#0d7a5f, #2dd4bf);
  --pp-arm-3-text: light-dark(#7e3af2, #c084fc);
  --pp-arm-4-text: light-dark(#1e6cd1, #60a5fa);
  --pp-arm-5-text: light-dark(#596273, #9ca3af);
  --pp-arm-6-text: light-dark(#976107, #fbbf24);
  --pp-arm-7-text: light-dark(#077790, #22d3ee);
  --pp-arm-8-text: light-dark(#c92c6b, #f472b6);

  /* ---- Type ------------------------------------------------------------ */
  /* Display: the wordmark, marketing headings, big numbers. Never body
     text or dense UI. */
  --pp-font-display: 'Fredoka', ui-rounded, system-ui, sans-serif;
  --pp-font-text: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --pp-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --pp-size-1: 11.5px;
  --pp-size-1-5: 12px;
  --pp-size-2: 13px;
  --pp-size-3: 15px;
  --pp-size-4: 17px;
  --pp-size-5: 20px;
  --pp-size-6: 28px;
  --pp-size-7: 40px;
  --pp-size-8: 56px;

  --pp-leading-tight: 1.1;
  --pp-leading-snug: 1.3;
  --pp-leading: 1.5;

  --pp-weight-regular: 400;
  --pp-weight-medium: 500;
  --pp-weight-semibold: 600;
  --pp-weight-bold: 700;

  /* ---- Space, on a 4 px base, with 6 and 10 between its steps ----------- */
  --pp-space-1: 2px;
  --pp-space-2: 4px;
  --pp-space-2-5: 6px;
  --pp-space-3: 8px;
  --pp-space-3-5: 10px;
  --pp-space-4: 12px;
  --pp-space-5: 16px;
  --pp-space-6: 24px;
  --pp-space-7: 32px;
  --pp-space-8: 48px;
  --pp-space-9: 64px;
  --pp-space-10: 96px;

  /* ---- Radius ----------------------------------------------------------
     The arms end round: pills for calls to action and chips, md for
     dense controls. */
  --pp-radius-xs: 4px;
  --pp-radius-sm: 6px;
  --pp-radius-base: 8px;
  --pp-radius-md: 10px;
  --pp-radius-lg: 14px;
  --pp-radius-xl: 22px;
  --pp-radius-pill: 999px;
  /* An app-icon tile: this share of its side. */
  --pp-radius-tile: 22.5%;

  /* ---- Shadow, in the board's cool tint -------------------------------- */
  --pp-shadow-tint-1: light-dark(rgba(16, 16, 32, 0.05), rgba(0, 0, 0, 0.3));
  --pp-shadow-tint-2: light-dark(rgba(16, 16, 32, 0.08), rgba(0, 0, 0, 0.4));
  --pp-shadow-tint-3: light-dark(rgba(16, 16, 32, 0.16), rgba(0, 0, 0, 0.5));
  --pp-shadow-sm: 0 1px 2px var(--pp-shadow-tint-1);
  --pp-shadow-md: 0 4px 12px var(--pp-shadow-tint-2), 0 1px 2px var(--pp-shadow-tint-1);
  --pp-shadow-lg: 0 12px 32px var(--pp-shadow-tint-3), 0 2px 6px var(--pp-shadow-tint-2);

  /* ---- Motion ---------------------------------------------------------- */
  --pp-dur-fast: 120ms;
  --pp-dur-base: 200ms;
  --pp-dur-slow: 320ms;
  --pp-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* ---- Focus ----------------------------------------------------------- */
  --pp-focus: var(--pp-accent);
}

/* Force a scheme on any element: a page, or one demo pane. */
[data-theme='light'] {
  color-scheme: light;
}
[data-theme='dark'] {
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --pp-dur-fast: 0.01ms;
    --pp-dur-base: 0.01ms;
    --pp-dur-slow: 0.01ms;
  }
}
