/*
  GG Ticketing's design tokens: every colour, size, space and duration, for both themes. docs/DESIGN.md explains them.
  The palette is Velvet House (040): oxblood stage surfaces, warm paper, a rose accent.

  Themes. Light is defined on :root. Dark redefines tokens in TWO blocks that must stay identical:
    - the device setting:  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) }
    - the person's choice: :root[data-theme="dark"]
  Change a dark value in both; DesignTokensTests holds them equal and computes every pairing's contrast.

  A company's brand kit (018) redefines only the --brand-* tokens, on its public pages and mail. Everything else is GG's.
*/

:root {
  /* ---- colour: paper, where people read (040) ---- */
  --bg: #fbf7f3;              /* the page */
  --surface: #ffffff;         /* cards, lists, dialogs */
  --surface-2: #f3ebe4;       /* quiet fills: a total, a stat, a ticket's ground */
  --line: #e6d8d2;            /* dividers and card edges: decoration, not a control's edge */
  --edge-control: #8c7179;    /* the edge of an input, checkbox or select: at least 3:1 against --surface */
  --fg: #22161b;
  --fg-muted: #5e4b53;

  /* ---- colour: the stage, dark in both themes (040) ---- */
  --stage: #2a0e17;           /* headers, heroes, the staff sidebar, a ticket's head */
  --stage-2: #3e1622;         /* a raised or current item on the stage */
  --on-stage: #fbefe9;
  --on-stage-muted: #d9b7bf;
  --stage-bright: #ff8fab;    /* the rose: what can be pressed or what matters, on the stage */
  --on-stage-bright: #2a0e17;

  /* ---- colour: the accent on paper (040) ---- */
  --accent: #a3214a;          /* primary buttons, links, focus rings, the mark on paper */
  --on-accent: #ffffff;
  --link: #a3214a;

  /* ---- colour: meaning, never decoration ---- */
  --danger: #b42318;          /* something went wrong, or will be destroyed */
  --danger-soft: #fdecea;
  --ok: #1f7a4d;              /* on sale, connected, paid */

  /* ---- a company's brand kit (018): GG's own values until a company sets its own ---- */
  --brand-surface: var(--stage);
  --brand-on-surface: var(--on-stage);
  --brand-accent: var(--accent);
  --brand-on-accent: var(--on-accent);
  --brand-font-display: var(--font-display);
  --brand-display-weight: var(--weight-regular); /* the variable fonts are set heavier (055, HeadingFonts) */

  /* ---- QR codes: dark on light in BOTH themes, so every camera reads them; never redefined for dark ---- */
  --qr-dark: #000000;
  --qr-light: #ffffff;

  /* ---- type (041): Young Serif for headings, Inter for text, Plex Mono for codes; self-hosted ---- */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Young Serif", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --text-xs: 0.75rem;     /* 12px: labels, captions */
  --text-sm: 0.875rem;    /* 14px: secondary rows, staff tables */
  --text-base: 1rem;      /* 16px: running text; also every input, so iOS does not zoom on focus */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.625rem;    /* 26px: a page title */
  --text-2xl: 2.25rem;    /* 36px: a hero */
  --weight-regular: 400;
  --weight-bold: 600;
  --leading-body: 1.55;
  --leading-tight: 1.15;
  --measure: 66ch;

  /* ---- space: a 4px scale ---- */
  --space-1: 0.25rem;  --space-2: 0.5rem;  --space-3: 0.75rem;  --space-4: 1rem;
  --space-5: 1.5rem;   --space-6: 2rem;    --space-7: 3rem;     --space-8: 4rem;

  /* ---- shape and depth: only what can be pressed is raised ---- */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --shadow-raised: 0 1px 2px rgb(42 14 23 / 0.18);
  --shadow-overlay: 0 8px 28px rgb(42 14 23 / 0.18), 0 2px 6px rgb(42 14 23 / 0.10);
  /* Focus is an outline, never a box-shadow: a component's own shadow would replace a shadow ring (gibbs-toolkit). */
  --focus-ring: 2px solid var(--accent);
  --focus-offset: 2px;

  /* ---- layout ---- */
  --target-min: 44px;     /* the smallest tap target */
  --button-height: 48px;  /* a primary action */
  --page-max: 72rem;
  --sidebar-width: 16rem; /* the staff sidebar, from 48rem (050) */
  --logo-band: 5rem;      /* a company's logo, at most this tall, in its public header band (057) */
  --logo-small: 2.5rem;   /* and in the staff sidebar, the brand page and its preview */

  /* ---- motion: stops under prefers-reduced-motion ---- */
  --duration-fast: 120ms;
  --duration: 200ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* ---- stacking ---- */
  --z-sticky: 10;
  --z-overlay: 100;
  --z-toast: 200;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1114;
    --surface: #24181c;
    --surface-2: #2e2025;
    --line: #3d2c32;
    --edge-control: #8a727a;
    --fg: #f4e9e6;
    --fg-muted: #c3adb3;
    --stage: #120609;
    --stage-2: #2a0e17;
    --accent: #ff8fab;
    --on-accent: #2a0e17;
    --link: #ff9fb7;
    --danger: #f4a09a;
    --danger-soft: #3a1f1f;
    --ok: #6fd39d;
    --shadow-raised: 0 1px 2px rgb(0 0 0 / 0.45);
    --shadow-overlay: 0 8px 28px rgb(0 0 0 / 0.5), 0 2px 6px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #1a1114;
  --surface: #24181c;
  --surface-2: #2e2025;
  --line: #3d2c32;
  --edge-control: #8a727a;
  --fg: #f4e9e6;
  --fg-muted: #c3adb3;
  --stage: #120609;
  --stage-2: #2a0e17;
  --accent: #ff8fab;
  --on-accent: #2a0e17;
  --link: #ff9fb7;
  --danger: #f4a09a;
  --danger-soft: #3a1f1f;
  --ok: #6fd39d;
  --shadow-raised: 0 1px 2px rgb(0 0 0 / 0.45);
  --shadow-overlay: 0 8px 28px rgb(0 0 0 / 0.5), 0 2px 6px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration-fast: 0ms; --duration: 0ms; }
}
