/* OikSys frame v1 · tokens (docs/contracts/oiksys-frame-v1.md).
   A theme is one set of values for the tokens below; structure and components never change with it.
   Theme and mode are attributes of <html>, set before paint by /_frame/v1/pre.js:
     data-ok-theme="oiksys" | "doyouwin"     (no attribute: oiksys)
     data-ok-mode="light" | "dark"           (no attribute: light)
   test/frame-tokens.test.mjs checks that every palette defines every colour token and that the
   text, control and status pairs reach WCAG 2.2 AA.
   Dark is a screen mode: its blocks sit in `@media screen`, so paper always gets the light palette of the theme. */

@font-face {
  font-family: "OK Archivo";
  src: url("fonts/archivo-latin-standard-5.3.0.woff2?v=e3a28eade2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "OK Mono";
  src: url("fonts/jetbrains-mono-latin-wght-5.3.0.woff2?v=18be452724") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: "OK Rubik";
  src: url("/brand/rubik-latin-variable.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

/* Same in every theme. Sizes are in rem so they follow the person's text size. */
:root {
  --ok-t-caption: 0.75rem;
  --ok-t-small: 0.8125rem;
  --ok-t-body: 0.875rem;
  --ok-t-lead: 1rem;
  --ok-t-title: 1.125rem;
  --ok-t-h2: 1.375rem;
  --ok-t-h1: 1.75rem;
  --ok-t-figure: 2rem;
  --ok-t-figure-sm: 1.5rem;
  --ok-lh-tight: 1.1;
  --ok-lh-body: 1.45;

  --ok-sp-1: 0.25rem;
  --ok-sp-2: 0.5rem;
  --ok-sp-3: 0.75rem;
  --ok-sp-4: 1rem;
  --ok-sp-5: 1.5rem;
  --ok-sp-6: 2rem;
  --ok-sp-7: 3rem;

  --ok-h: 2.25rem;
  --ok-h-sm: 2rem;
  --ok-h-lg: 2.75rem;
  --ok-row: 2.5rem;
  --ok-rail-w: 15.25rem;
  --ok-focus-w: 3px;
  --ok-dur: 160ms;
  /* The veil behind a dialog and the drawer: the same in every theme and mode. */
  --ok-scrim: rgb(11 11 15 / 0.45);

  /* The three pieces of the OikSys mark. Blue in light, cyan in dark, never mixed; no theme changes them. */
  --ok-piece-people: #80a3ff;
  --ok-piece-agents: #4277ff;
  --ok-piece-apps: #0047ff;
  --ok-wordmark: #0b0b0f;
  /* What a native control is drawn for (the box of a checkbox): the value of `color-scheme` in this mode. */
  --ok-scheme: light;
}
@media screen {
:root[data-ok-mode="dark"] {
  --ok-scheme: dark;
  --ok-piece-people: #0e8f99;
  --ok-piece-agents: #14b9c4;
  --ok-piece-apps: #19e3f0;
  --ok-wordmark: #eef3f6;
}
}

/* Theme oiksys · light. The product's own look: blue, Archivo, square corners. */
:root,
:root[data-ok-theme="oiksys"] {
  --ok-bg: #eceef2;
  --ok-surface: #ffffff;
  --ok-surface-2: #f3f4f7;
  --ok-raised: #ffffff;
  --ok-line: #d9dce3;
  --ok-line-strong: #7f8592;
  --ok-fg: #0b0b0f;
  --ok-fg-2: #454a57;
  --ok-fg-3: #5f6472;
  --ok-accent: #0047ff;
  --ok-on-accent: #ffffff;
  --ok-accent-soft: #e3ebff;
  --ok-marker: #c7d6ff;
  --ok-hero: #0047ff;
  --ok-on-hero: #ffffff;
  --ok-hero-marker: #0047ff;
  --ok-on-hero-marker: #ffffff;
  --ok-hero-piece-people: #80a3ff;
  --ok-hero-piece-agents: #b9cbff;
  --ok-hero-piece-apps: #ffffff;
  --ok-on-accent-soft: #0033b8;
  --ok-action: #0047ff;
  --ok-on-action: #ffffff;
  --ok-action-hover: #0039cc;
  --ok-action-mark: #ffffff;
  --ok-link: #0047ff;
  --ok-link-line: #9db8ff;
  --ok-focus: #0047ff;
  --ok-good: #1f7a0a;
  --ok-good-soft: #e6f4e1;
  --ok-bad: #c2333a;
  --ok-bad-soft: #fdecec;
  --ok-warn: #a04000;
  --ok-warn-soft: #fff0e5;
  --ok-info: #0a55cc;
  --ok-info-soft: #e6effe;
  --ok-shadow: 0 12px 32px rgb(11 11 15 / 0.14);
  --ok-shadow-1: 0 0 0 0 transparent;
  --ok-shadow-2: 0 0 0 0 transparent;

  --ok-font: "OK Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ok-font-head: "OK Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ok-font-num: "OK Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ok-head-weight: 820;
  --ok-head-stretch: 112%;
  --ok-head-tracking: -0.03em;
  --ok-num-tracking: -0.02em;
  --ok-label-font: "OK Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ok-label-case: uppercase;
  --ok-label-tracking: 0.06em;
  --ok-label-size: 0.6875rem;

  --ok-hero-disc: 0.95;
  --ok-r-ctl: 2px;
  --ok-r-card: 2px;
  --ok-r-sheet: 4px;
  --ok-r-pill: 2px;
  --ok-ease: cubic-bezier(0.35, 0, 0, 1);
}

/* Theme oiksys · dark. Neutral night, cyan for lines and marks, never as a large fill. */
@media screen {
:root:not([data-ok-theme])[data-ok-mode="dark"],
:root[data-ok-theme="oiksys"][data-ok-mode="dark"] {
  --ok-bg: #0b0b0f;
  --ok-surface: #141519;
  --ok-surface-2: #1b1d23;
  --ok-raised: #1f2128;
  --ok-line: #2a2d35;
  --ok-line-strong: #6f7582;
  --ok-fg: #e9ebef;
  --ok-fg-2: #b3b8c2;
  --ok-fg-3: #9095a1;
  --ok-accent: #19e3f0;
  --ok-on-accent: #0b0b0f;
  --ok-accent-soft: #0d3438;
  --ok-marker: #0d3438;
  --ok-hero: #0b0b0f;
  --ok-on-hero: #e9ebef;
  --ok-hero-marker: #0b0b0f;
  --ok-on-hero-marker: #e9ebef;
  --ok-hero-piece-people: #0e8f99;
  --ok-hero-piece-agents: #14b9c4;
  --ok-hero-piece-apps: #19e3f0;
  --ok-on-accent-soft: #7df0f7;
  --ok-action: #e9ebef;
  --ok-on-action: #0b0b0f;
  --ok-action-hover: #ffffff;
  --ok-action-mark: #0b0b0f;
  --ok-link: #19e3f0;
  --ok-link-line: #0f7f87;
  --ok-focus: #19e3f0;
  --ok-good: #7cd98b;
  --ok-good-soft: #12301a;
  --ok-bad: #ff8a8e;
  --ok-bad-soft: #3a1719;
  --ok-warn: #ffb070;
  --ok-warn-soft: #3a2410;
  --ok-info: #8ab8ff;
  --ok-info-soft: #13294a;
  --ok-shadow: 0 12px 32px rgb(0 0 0 / 0.5);
  --ok-shadow-1: 0 0 0 0 transparent;
  --ok-shadow-2: 0 0 0 0 transparent;
}
}

/* Theme doyouwin · light. Doyouwin's own style: Rubik, ink actions, yellow as a marker, round corners. */
:root[data-ok-theme="doyouwin"] {
  --ok-bg: #f5f7fa;
  --ok-surface: #ffffff;
  --ok-surface-2: #f0f2f6;
  --ok-raised: #ffffff;
  --ok-line: #e3e6ec;
  --ok-line-strong: #7f8592;
  --ok-fg: #111111;
  --ok-fg-2: #454545;
  --ok-fg-3: #666666;
  --ok-accent: #fbbe0a;
  --ok-on-accent: #1a1505;
  --ok-accent-soft: #fde7a6;
  --ok-marker: #fbbe0a;
  --ok-hero: #0b0b0f;
  --ok-on-hero: #ffffff;
  --ok-hero-marker: #fbbe0a;
  --ok-on-hero-marker: #1a1505;
  --ok-hero-piece-people: #ffffff;
  --ok-hero-piece-agents: #ffffff;
  --ok-hero-piece-apps: #ffffff;
  --ok-on-accent-soft: #4a3600;
  --ok-action: #000000;
  --ok-on-action: #ffffff;
  --ok-action-hover: #333333;
  --ok-action-mark: #fbbe0a;
  --ok-link: #111111;
  --ok-link-line: #b3b6bd;
  --ok-focus: #096afc;
  --ok-good: #1f7a0a;
  --ok-good-soft: #e6f4e1;
  --ok-bad: #c2333a;
  --ok-bad-soft: #fdecec;
  --ok-warn: #a04000;
  --ok-warn-soft: #fff0e5;
  --ok-info: #0a55cc;
  --ok-info-soft: #e6effe;
  --ok-shadow: 0 12px 32px rgb(17 17 17 / 0.12);
  --ok-shadow-1: 0 1px 2px rgb(17 17 17 / 0.06), 0 1px 1px rgb(17 17 17 / 0.03);
  --ok-shadow-2: 0 6px 16px rgb(17 17 17 / 0.09), 0 1px 2px rgb(17 17 17 / 0.05);

  --ok-font: "OK Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ok-font-head: "OK Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ok-font-num: "OK Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ok-head-weight: 700;
  --ok-head-stretch: 100%;
  --ok-head-tracking: -0.02em;
  --ok-num-tracking: 0;
  --ok-label-font: "OK Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ok-label-case: none;
  --ok-label-tracking: 0;
  --ok-label-size: 0.75rem;

  --ok-hero-disc: 0.14;
  --ok-r-ctl: 10px;
  --ok-r-card: 16px;
  --ok-r-sheet: 20px;
  --ok-r-pill: 999px;
  --ok-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Theme doyouwin · dark. */
@media screen {
:root[data-ok-theme="doyouwin"][data-ok-mode="dark"] {
  --ok-bg: #0c0c0d;
  --ok-surface: #151517;
  --ok-surface-2: #1c1c1f;
  --ok-raised: #26262a;
  --ok-line: #2c2c31;
  --ok-line-strong: #74747c;
  --ok-fg: #f3f2ee;
  --ok-fg-2: #b9b7b0;
  --ok-fg-3: #98968f;
  --ok-accent: #fbbe0a;
  --ok-on-accent: #1a1505;
  --ok-accent-soft: #3b2f08;
  --ok-marker: #5a4705;
  --ok-hero: #000000;
  --ok-on-hero: #ffffff;
  --ok-hero-marker: #fbbe0a;
  --ok-on-hero-marker: #1a1505;
  --ok-hero-piece-people: #ffffff;
  --ok-hero-piece-agents: #ffffff;
  --ok-hero-piece-apps: #ffffff;
  --ok-on-accent-soft: #fde7a6;
  --ok-action: #f3f2ee;
  --ok-on-action: #111111;
  --ok-action-hover: #ffffff;
  --ok-action-mark: #a06f00;
  --ok-link: #f3f2ee;
  --ok-link-line: #6d6c68;
  --ok-focus: #6aa5ff;
  --ok-good: #7cd98b;
  --ok-good-soft: #12301a;
  --ok-bad: #ff8a8e;
  --ok-bad-soft: #3a1719;
  --ok-warn: #ffb070;
  --ok-warn-soft: #3a2410;
  --ok-info: #8ab8ff;
  --ok-info-soft: #13294a;
  --ok-shadow: 0 12px 32px rgb(0 0 0 / 0.5);
  --ok-shadow-1: 0 0 0 0 transparent;
  --ok-shadow-2: 0 0 0 0 transparent;
}
}

/* Touch: controls grow to a 44 px target. */
@media (pointer: coarse) {
  :root { --ok-h: 2.75rem; --ok-h-sm: 2.75rem; --ok-row: 3rem; }
}

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