/*
 * Prompt Grabber v2 design tokens.
 *
 * Source of truth: docs/design/v2-design-spec.md ("Color tokens") and the
 * approved mockups in docs/design/mockup/. Light is the default; dark follows
 * prefers-color-scheme. Pages can force a theme with data-theme="light|dark"
 * on <html> or on any wrapper element (the dev gallery shows both side by side).
 *
 * Keep the two dark declarations identical: the media query and the forced
 * [data-theme="dark"] block (tests/unit/design.test.mjs checks that they match).
 *
 * Fonts: Geist and Geist Mono come first in each stack; bundled font files and
 * @font-face are added later, after the download is agreed.
 */

:root,
[data-theme="light"] {
  color-scheme: light;

  /* surfaces */
  --pg-ground: #f7f6fb;
  --pg-surface: #fdfcff;
  --pg-raised: #fdfcff;
  --pg-sunken: #ecebf3;
  --pg-nav: #f1f0f7;

  /* text and icons */
  --pg-ink: #1c1a2b;
  --pg-ink-2: #3d3a52;
  --pg-muted: #615e75;
  --pg-icon: #4a4760;

  /* borders */
  --pg-line: #e6e3f0;
  --pg-line-strong: #dcd9e8;
  --pg-divider: #efedf5;

  /* brand */
  --pg-primary: #5b54d6;
  --pg-primary-hover: #4c45c4;
  --pg-primary-soft: #f0eefd;
  --pg-primary-ink: #3f3a9e;
  --pg-primary-line: #5b54d6;
  --pg-on-primary: #fdfcff;
  --pg-chip: #e6e3fb;
  --pg-chip-ink: #3f3a9e;
  --pg-link: #5b54d6;
  --pg-link-hover: #4741b8;

  /* focus and selection */
  --pg-focus: #c9c4f7;
  --pg-ring: #e3e0fa;

  /* small controls */
  --pg-switch-off: #cfcbe0;
  --pg-kbd-bg: #fdfcff;
  --pg-kbd-line: #dcd9e8;
  --pg-chevron: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a4760' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");

  /* status */
  --pg-success: #17663a;
  --pg-success-bg: #e6f4ea;
  --pg-warning: #8a4b06;
  --pg-warning-bg: #fdf0dc;
  --pg-warning-fill: #c46a12;
  --pg-danger: #a8321f;
  --pg-danger-bg: #fbe6e3;
  --pg-danger-line: #f0c7c2;

  /* identity: only the logo tile, popup header band and welcome/plan hero use it */
  --pg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  --pg-font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pg-mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --pg-ground: #15141c;
    --pg-surface: #1d1c27;
    --pg-raised: #262433;
    --pg-sunken: #0e0d13;
    --pg-nav: #121118;

    --pg-ink: #eeecf6;
    --pg-ink-2: #d4d1e4;
    --pg-muted: #aba8c0;
    --pg-icon: #cfcce0;

    --pg-line: #34314a;
    --pg-line-strong: #4b4868;
    --pg-divider: #2a2838;

    --pg-primary: #6a63e3;
    --pg-primary-hover: #5b54d6;
    --pg-primary-soft: #2a2650;
    --pg-primary-ink: #d0ccfb;
    --pg-primary-line: #8f89f2;
    --pg-on-primary: #fdfcff;
    --pg-chip: #2f2b52;
    --pg-chip-ink: #c9c5fb;
    --pg-link: #b3aef7;
    --pg-link-hover: #d0ccfb;

    --pg-focus: #5a54b8;
    --pg-ring: #2a2650;

    --pg-switch-off: #4b4868;
    --pg-kbd-bg: rgba(253, 252, 255, 0.2);
    --pg-kbd-line: transparent;
    --pg-chevron: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cfcce0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");

    --pg-success: #8fdcae;
    --pg-success-bg: #16291f;
    --pg-warning: #f0b45a;
    --pg-warning-bg: #2e2210;
    --pg-warning-fill: #e08a2c;
    --pg-danger: #f4a79b;
    --pg-danger-bg: #35171a;
    --pg-danger-line: #6a3034;
  }
}

[data-theme="dark"] {
  color-scheme: dark;

  --pg-ground: #15141c;
  --pg-surface: #1d1c27;
  --pg-raised: #262433;
  --pg-sunken: #0e0d13;
  --pg-nav: #121118;

  --pg-ink: #eeecf6;
  --pg-ink-2: #d4d1e4;
  --pg-muted: #aba8c0;
  --pg-icon: #cfcce0;

  --pg-line: #34314a;
  --pg-line-strong: #4b4868;
  --pg-divider: #2a2838;

  --pg-primary: #6a63e3;
  --pg-primary-hover: #5b54d6;
  --pg-primary-soft: #2a2650;
  --pg-primary-ink: #d0ccfb;
  --pg-primary-line: #8f89f2;
  --pg-on-primary: #fdfcff;
  --pg-chip: #2f2b52;
  --pg-chip-ink: #c9c5fb;
  --pg-link: #b3aef7;
  --pg-link-hover: #d0ccfb;

  --pg-focus: #5a54b8;
  --pg-ring: #2a2650;

  --pg-switch-off: #4b4868;
  --pg-kbd-bg: rgba(253, 252, 255, 0.2);
  --pg-kbd-line: transparent;
  --pg-chevron: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cfcce0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");

  --pg-success: #8fdcae;
  --pg-success-bg: #16291f;
  --pg-warning: #f0b45a;
  --pg-warning-bg: #2e2210;
  --pg-warning-fill: #e08a2c;
  --pg-danger: #f4a79b;
  --pg-danger-bg: #35171a;
  --pg-danger-line: #6a3034;
}
