/*
  Waf Visual design tokens (built on the LatihSpeaking design system, 2026-11-14).
  Every raw value lives here; components.css and pages.css read these variables only. The one exception is data:
  a style's own colours, passed in as style="--sw: #hex" (prompt swatches and the colour pickers).

  Taken from LatihSpeaking: the white ground with a cool fill for grouping, the ink and muted ink, the good and bad
  roles, the control edge, Plus Jakarta Sans and its small scale, the 4px space scale, the radii, the 44px tap target
  and the motion curves. Left behind: Melati, the jasmine accent and the brand blue #004beb.
  Waf Visual's own: the logo blue #386FCA as the accent, a dark theme designed from the same roles, the film stage,
  the star (best tool, favourite) and the five tool colours for the Lab.

  Contrast ratios are WCAG 2.x, measured by tools/check_contrast.py (it reads this file; run it after any change).
  Text needs 4.5:1; icons, control edges and large type need 3:1. Colour is never the only signal.

  Theme: light by default, whatever the system setting (the user's choice, 2026-11-14). Dark only when the header
  switch sets data-theme="dark" on <html>; any element can also carry data-theme="light" or "dark" to show one
  theme inside the other (design.html does).
*/

:root,
[data-theme="light"] {
  color-scheme: light;

  /* Ground and surfaces. The page is white; grouped content sits on a cool fill, never on a border or a shadow. */
  --c-ground: #ffffff;
  --c-fill: #f4f6fa;          /* cards, rows, the prompt box */
  --c-fill-strong: #e9edf4;   /* hover and pressed rows, segmented track, meter track */
  --c-fill-disabled: #eef1f6;
  --c-raised: #ffffff;        /* floating parts: segmented thumb, menus, sheets (they carry the shadow) */

  /* Ink. Running text is full ink; muted ink is for second notes only. */
  --c-ink: #253051;           /* 12.96:1 on ground, 11.98:1 on fill, 11.04:1 on fill-strong */
  --c-ink-muted: #546078;     /* 6.32:1 on ground, 5.84:1 on fill, 5.38:1 on fill-strong */
  --c-ink-faint: #5e6779;     /* disabled labels: 5.02:1 on fill-disabled */

  /* Accent: the Waf Visual logo blue. A fill for things you press and for selection; blue text uses accent-ink. */
  --c-accent: #386fca;        /* white on it 4.89:1; as an icon or edge 4.89:1 on ground, 4.52:1 on fill */
  --c-accent-press: #2d5fb3;  /* white on it 6.18:1 */
  --c-accent-ink: #2c5db0;    /* links and blue labels: 6.36:1 on ground, 5.88:1 on fill, 5.67:1 on accent-tint */
  --c-accent-tint: #edf2fb;   /* selected rows, tint buttons, the voiceover-on row */
  --c-accent-soft: #dbe5f7;   /* tint hover, focus halo; accent-ink on it 5.02:1 */
  --c-on-accent: #ffffff;
  --c-focus: #386fca;

  /* Roles. Always paired with an icon or a word, never colour alone. */
  --c-good: #2f6b0a;          /* on good-tint 5.85:1 */
  --c-good-tint: #edf6e1;
  --c-bad: #b21c1c;           /* on bad-tint 5.95:1 */
  --c-bad-tint: #fbecec;
  --c-star: #a87200;          /* the star icon (best tool, favourite): 4.14:1 on ground, 3.83:1 on fill */
  --c-star-ink: #7a4d00;      /* text on star-tint 6.42:1 */
  --c-star-tint: #fdf0cf;

  /* Controls and overlays */
  --c-edge: #848da0;          /* input and switch edges: 3.33:1 on ground, 3.08:1 on fill */
  --c-scrim: rgb(28 37 65 / 0.48);

  /* Films sit on a dark stage in both themes. The overlay carries small labels on top of a film or its poster. */
  --c-stage: #0b0d12;
  --c-on-stage: #ffffff;      /* 19.43:1 on stage */
  --c-on-stage-muted: rgb(255 255 255 / 0.78); /* second lines on the overlay */
  --c-overlay: rgb(11 13 18 / 0.66);

  /* The five tools (Lab only, and the dot on tool chips). Marks, not text: each is at least 3:1 on fill. */
  --c-tool-motion: #7b52e0;      /* 4.70:1 on fill */
  --c-tool-remotion: #2577d0;    /* 4.19:1 */
  --c-tool-three: #0f9a6e;       /* 3.31:1 */
  --c-tool-hyperframes: #b97800; /* 3.38:1 */
  --c-tool-blender: #d9502c;     /* 3.78:1 */

  /* Elevation, only for things that float above the page. */
  --shadow-float: 0 1px 2px rgb(37 48 81 / 0.08), 0 8px 24px rgb(37 48 81 / 0.12);
  --shadow-thumb: 0 1px 3px rgb(37 48 81 / 0.16);

  /* Glass: the sticky header, the one translucent surface. */
  --c-glass: rgb(255 255 255 / 0.86);
}

/* Dark: designed from the same roles (LatihSpeaking has no dark set). Only the header switch turns it on. */
[data-theme="dark"] {
  color-scheme: dark;
  --c-ground: #0e1118;
  --c-fill: #171b24;
  --c-fill-strong: #232835;
  --c-fill-disabled: #1b1f29;
  --c-raised: #2a3040;
  --c-ink: #edf0f6;           /* 16.54:1 on ground, 15.09:1 on fill, 12.90:1 on fill-strong */
  --c-ink-muted: #a3abbd;     /* 8.20:1 on ground, 7.48:1 on fill, 6.39:1 on fill-strong */
  --c-ink-faint: #8f98ab;     /* 5.69:1 on fill-disabled */
  --c-accent: #386fca;        /* white on it 4.89:1; as an icon 3.86:1 on ground, 3.52:1 on fill */
  --c-accent-press: #3165bb;  /* white on it 5.66:1 */
  --c-accent-ink: #8fb3ef;    /* 8.87:1 on ground, 8.09:1 on fill, 7.42:1 on accent-tint */
  --c-accent-tint: #18223a;
  --c-accent-soft: #22335a;   /* accent-ink on it 5.84:1 */
  --c-on-accent: #ffffff;
  --c-focus: #8fb3ef;
  --c-good: #8edb9d;          /* on good-tint 9.37:1 */
  --c-good-tint: #14291b;
  --c-bad: #ff9d9d;           /* on bad-tint 8.15:1 */
  --c-bad-tint: #33191b;
  --c-star: #f5b83d;          /* 10.62:1 on ground */
  --c-star-ink: #ffd27a;      /* on star-tint 10.17:1 */
  --c-star-tint: #33280f;
  --c-edge: #6f788c;          /* 4.26:1 on ground, 3.89:1 on fill */
  --c-scrim: rgb(4 6 10 / 0.64);
  --c-stage: #07080c;
  --c-on-stage: #ffffff;
  --c-on-stage-muted: rgb(255 255 255 / 0.78);
  --c-overlay: rgb(7 8 12 / 0.7);
  --c-tool-motion: #b591ff;
  --c-tool-remotion: #5aa9ff;
  --c-tool-three: #3fd0a0;
  --c-tool-hyperframes: #ffb340;
  --c-tool-blender: #ff7a59;
  --shadow-float: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.5);
  --shadow-thumb: 0 1px 3px rgb(0 0 0 / 0.5);
  --c-glass: rgb(14 17 24 / 0.86);
}

/* Everything that isn't colour is the same in both themes. */
:root {
  /* Type. Plus Jakarta Sans for everything (LatihSpeaking's face); JetBrains Mono only inside the prompt box,
     because a prompt is code-like text people copy. One display line per page. */
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --t-display: 800 clamp(32px, 1.6rem + 2vw, 52px)/1.08 var(--font);   /* one per page */
  --t-heading: 800 clamp(22px, 1.1rem + 0.8vw, 28px)/1.2 var(--font);  /* section heads (the site's addition) */
  --t-title: 700 20px/1.3 var(--font);
  --t-lead: 400 18px/1.55 var(--font);                                  /* the one paragraph under a display line */
  --t-body: 400 16px/1.55 var(--font);
  --t-body-strong: 700 16px/1.55 var(--font);
  --t-small: 400 14px/1.45 var(--font);
  --t-small-strong: 700 14px/1.45 var(--font);
  --t-caption: 600 12px/1.35 var(--font);
  --t-stat: 800 44px/1 var(--font);
  --t-mono: 400 13px/1.65 var(--font-mono);
  --track-display: -0.03em;
  --track-heading: -0.02em;
  --track-title: -0.012em;

  /* Space, 4px base. The page gutter is 16px on a phone and grows to 48px. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-24: 96px;
  --gutter: clamp(16px, 4vw, 48px);
  --wrap: 1240px;       /* content width */
  --measure: 68ch;      /* running text */
  --side: 360px;        /* the style page's side column */

  /* Radius: small for inner parts, medium for controls, large for cards and films, xl for big panels. */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 9999px;

  /* Sizes */
  --tap: 44px;          /* the smallest thing you can press */
  --btn-h: 48px;        /* LatihSpeaking's 52 is sized for a thumb on a phone dock; the site uses 48 */
  --btn-h-sm: 40px;
  --head-h: 64px;       /* the site header */
  --logo: 32px;

  /* Motion. Critically damped by default; a sheet gets the iOS curve. */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-press: 100ms;
  --dur-fast: 180ms;
  --dur-slow: 360ms;
  --dur-sheet: 420ms;
}
