/* SPDX-License-Identifier: AGPL-3.0-only */
@font-face { font-family: "AOO Display"; src: url("aoo/Fraunces.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }
/* Design tokens (the brand packet 1.1.0 identity, the lipsync packet 0.1.0-review, revision 2, mouth). Originally PLACEHOLDER tokens. The branding team's packet for "ai of our own" replaces this file; page.css and index.html only
   read these names. The family accents (docs/family.md of the brand docs) are kept as named tokens, not used as text colours. */
:root {
  /* family accents, by name */
  --brand-cream: #F4ECDF;
  --brand-ink: #16142E;
  --brand-plc-gold: #F9B52B;
  --brand-sonalon-coral: #FF6B4A;

  /* type: system stack for text; the display face (Fraunces, from the brand packet, a local file) only for the word "lipsync" */
  --font-display: "AOO Display", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --text-base: 1.0625rem;
  --text-small: 0.875rem;
  --text-large: 1.25rem;
  --text-h1: clamp(2rem, 6vw, 3rem);
  --text-h2: clamp(1.4rem, 4vw, 1.85rem);
  --line: 1.55;

  /* space and shape */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2.5rem;
  --radius-1: 6px;
  --radius-2: 14px;
  --measure: 70rem;

  /* the segmented controls (the 2D | 3D face switch, stubble, finish): the selected side is deep violet with cream text (Brand packet 1.1.0) */
  --seg-bg: var(--surface);
  --seg-text: var(--text);
  --seg-border: var(--text);
  --seg-selected-bg: #33257C;
  --seg-selected-text: #F4ECDF;

  /* focus ring */
  --focus-width: 3px;
  --focus-offset: 2px;

  /* light scheme (default) */
  --bg: var(--brand-cream);
  --surface: #FFFBF3;
  --surface-2: #EDE3D2;
  --text: var(--brand-ink);
  --muted: #484564;
  --border: #8A8478;
  --link: #2A2397;
  --focus: var(--brand-ink);
  --btn-bg: var(--brand-ink);
  --btn-text: var(--brand-cream);
  --btn-quiet-bg: #FFFBF3;
  --btn-quiet-text: var(--brand-ink);
  --disabled-text: #5C586E;
  --disabled-bg: #E4DACA;
  --error: #8E1B0B;
  --error-bg: #FFE9E3;
  --wave: #2A2397;
  --cursor: #B3361A;
  --plc-edge: var(--brand-plc-gold);
  --sonalon-edge: var(--brand-sonalon-coral);

  /* the waveform scrubber: size of the handle, the waveform colours, the handle and its rings (works on cream and on ink) */
  --scrub-size: 44px;
  --scrub-bg: var(--surface);
  --scrub-wave-played: #2A2397;
  --scrub-wave-rest: #8F8BBE;
  --scrub-wave-shadow: rgba(42, 35, 151, 0.28);
  --scrub-boundary: rgba(22, 20, 46, 0.2);
  --scrub-line: #B3361A;
  --scrub-knob-bg: #B3361A;
  --scrub-knob-ink: #FFFFFF;
  --scrub-ring-inner: #F4ECDF;
  --scrub-ring-outer: #16142E;
  --scrub-shadow: rgba(22, 20, 46, 0.45);
  --scrub-focus: var(--focus);
  --scrub-tip-bg: #16142E;
  --scrub-tip-text: #F4ECDF;

  /* the mouth, from the brand packet (demo/brand/packet/0.1.0-review/mouth-tokens.css, revision 2, Brand commit b9b1ccb): these values
     are the packet's, copied; a test keeps them equal. Light is the default, dark follows below. The rig reads these names directly. */
  --mouth-skin: #F2D3B8;
  --mouth-skin-highlight: #F8E3CF;
  --mouth-skin-shade: #E0B898;
  --mouth-lip: #C9504A;
  --mouth-lip-shadow: #8F2E32;
  --mouth-lip-highlight: #E0766E;
  --mouth-teeth: #FFFDF7;
  --mouth-teeth-shade: #E4D9C6;
  --mouth-gum: #D9788A;
  --mouth-tongue: #E9808A;
  --mouth-tongue-tip: #EE9AA2;
  --mouth-tongue-dark: #C45F6C;
  --mouth-cavity: #3A0F1A;
  --mouth-cavity-deep: #1F0710;
  --mouth-outline: #16142E;
  --mouth-line: 3;                 /* stroke width in the 400-wide viewBox; scales with the SVG */
  /* aliases (the packet's older names) */
  --mouth-face: var(--mouth-skin);
  --mouth-interior: var(--mouth-cavity);
  --mouth-lip-edge: var(--mouth-lip-shadow);

  /* rig extra, not from the packet: the one thing the rig draws that the packet does not name. Derived from the packet's colours, so
     the packet's light and dark values carry through; Brand can adopt, change or drop it. */
  --mouth-cavity-edge: color-mix(in srgb, var(--mouth-cavity) 72%, var(--mouth-lip-shadow)); /* the cavity near the lips */

  /* viseme group colours: block background, then text */
  --v-text: var(--brand-ink);
  --v-sil: hsl(40 15% 88%);  --v-pp: hsl(350 70% 86%); --v-ff: hsl(25 80% 84%);  --v-th: hsl(55 70% 80%);
  --v-dd: hsl(95 50% 80%);   --v-kk: hsl(150 45% 80%); --v-ch: hsl(175 50% 78%); --v-ss: hsl(195 65% 82%);
  --v-nn: hsl(215 70% 86%);  --v-rr: hsl(240 65% 88%); --v-aa: hsl(270 60% 87%); --v-e: hsl(300 50% 86%);
  --v-i: hsl(325 60% 86%);   --v-o: hsl(10 70% 85%);   --v-u: hsl(35 80% 82%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--brand-ink);
    --surface: #211F42;
    --surface-2: #2C2A52;
    --text: var(--brand-cream);
    --muted: #CFC8D8;
    --border: #8F8CAE;
    --link: #FFC857;
    --focus: var(--brand-plc-gold);
    --btn-bg: var(--brand-cream);
    --btn-text: var(--brand-ink);
    --btn-quiet-bg: #2C2A52;
    --btn-quiet-text: var(--brand-cream);
    --disabled-text: #B5B0C6;
    --disabled-bg: #2A2848;
    --error: #FFB4A4;
    --error-bg: #4A1A18;
    --wave: #FFC857;
    --cursor: #FF8A6E;
    --scrub-wave-played: #FFC857;
    --scrub-wave-rest: #7C77AE;
    --scrub-wave-shadow: rgba(255, 200, 87, 0.3);
    --scrub-boundary: rgba(244, 236, 223, 0.22);
    --scrub-line: #FF8A6E;
    --scrub-knob-bg: #FF8A6E;
    --scrub-knob-ink: #16142E;
    --scrub-ring-inner: #16142E;
    --scrub-ring-outer: #F4ECDF;
    --scrub-shadow: rgba(0, 0, 0, 0.7);
    --scrub-tip-bg: #F4ECDF;
    --scrub-tip-text: #16142E;

    /* the mouth on ink: the packet's dark values, copied (natural warm skin, never violet; no local override) */
    --mouth-skin: #C79275;         /* dimmed warm tan */
    --mouth-skin-highlight: #D8A88A;
    --mouth-skin-shade: #A97759;
    --mouth-lip: #7E2A36;          /* deep warm red: reads as lips on the tan skin */
    --mouth-lip-shadow: #5A1B26;
    --mouth-lip-highlight: #A0485A;
    --mouth-teeth: #F4ECDF;
    --mouth-teeth-shade: #CFC4B0;
    --mouth-gum: #B6606E;
    --mouth-tongue: #E58A8A;
    --mouth-tongue-tip: #EE9A9A;
    --mouth-tongue-dark: #B45E70;
    --mouth-cavity: #2A1018;       /* warm near-black, not violet */
    --mouth-cavity-deep: #170810;
    --mouth-outline: #16142E;      /* ink on the tan skin; cream would be too faint */

    --v-text: var(--brand-cream);
    --v-sil: hsl(250 12% 28%);  --v-pp: hsl(350 45% 32%); --v-ff: hsl(25 55% 29%);  --v-th: hsl(55 50% 26%);
    --v-dd: hsl(95 38% 26%);    --v-kk: hsl(150 40% 25%); --v-ch: hsl(175 45% 25%); --v-ss: hsl(195 50% 28%);
    --v-nn: hsl(215 50% 33%);   --v-rr: hsl(240 40% 38%); --v-aa: hsl(270 40% 36%); --v-e: hsl(300 35% 33%);
    --v-i: hsl(325 40% 33%);    --v-o: hsl(10 50% 31%);   --v-u: hsl(35 55% 27%);
  }
}

/* a phone, or any coarse pointer: a bigger handle */
@media (pointer: coarse), (max-width: 40rem) {
  :root { --scrub-size: 56px; }
}
