/*
  Offbeat design tokens. The only file that holds raw values.

  Everything else uses these names, which describe a role ("the panel
  background", "a pressed control"), never an appearance ("tangerine").
  Change the look of Offbeat here and nowhere else.

  Source: the Offbeat App design canvas (Color, Type, Logo, Favicon, and
  Hand-drawn boards). Board names are kept in the comments.

  Each color holds its light and dark value together: light-dark(light, dark).
  The theme comes from `color-scheme`: the device setting by default, or the
  person's choice from the theme button (data-theme on <html>).
*/

@layer tokens {
  :root {
    color-scheme: light dark;

    /* ---------- Brand ---------- */

    /* Tangerine is the one bright color. Logo, favicon, focus, selection. */
    --color-brand: #ff7a2f;
    /* Focus ring, selected bite, pressed control, drop line. One step deeper on light to stay visible on white. */
    --color-focus: light-dark(#e8601a, #ff7a2f);
    --color-logo-bars: light-dark(#8a929b, #9aa1a9);
    /* Hand-drawn words: the eyebrow and empty states. Tangerine, one step deeper on light. */
    --color-hand: light-dark(#e8601a, #ff7a2f);

    /* ---------- Surfaces ---------- */

    --color-background: light-dark(#f3f5f7, #15171a);
    --color-panel: light-dark(#fff, #1c1f23);
    /* The tray and script panel beside the beats. */
    --color-sidebar: light-dark(#f8f9fa, #181a1e);
    --color-card: light-dark(#f1f3f5, #23272c);

    /* ---------- Lines ---------- */

    --color-line: light-dark(#e4e8ec, #2a2e33);
    --color-line-strong: light-dark(#dde2e7, #31363c);
    /* Board name "Skeleton": input borders, dashed outlines, placeholder bars. */
    --color-line-dashed: light-dark(#d3d9df, #3a4047);
    --color-line-hover: light-dark(#b0b7bf, #4b525a);

    /* ---------- Text ---------- */

    --color-ink: light-dark(#1f2328, #e9ebee);
    --color-ink-secondary: light-dark(#444b53, #c7ccd2);
    --color-ink-tertiary: light-dark(#4f565e, #b9bfc6);
    --color-muted: light-dark(#626a73, #9aa1a9);
    --color-faint: light-dark(#6f7781, #7d858e);
    --color-link: light-dark(#2f6bb0, #9fc6ea);

    /* ---------- Controls ---------- */

    --color-primary: light-dark(#33373d, #e8eaed);
    --color-primary-ink: light-dark(#fff, #17191c);
    /* A pressed toggle or filter chip. */
    --color-pressed: light-dark(#fff0e6, #3a2619);
    --color-pressed-ink: light-dark(#b8470c, #ffb184);

    /* ---------- Status ---------- */
    /* Not on the Color board yet. Kept quiet so tangerine stays the highlight. */

    --color-success: light-dark(#2e6b3a, #9bd3a6);
    --color-danger: light-dark(#b3261e, #f2b8b5);

    /* ---------- Editor's note (Parchment) ---------- */

    --color-note-fill: light-dark(#efebe4, #2c2a26);
    --color-note-ink: light-dark(#574c3e, #d2c7b6);
    --color-note-icon: light-dark(#8c7c66, #ab9c86);

    /* ---------- Speakers ---------- */
    /* One set for both themes. Muted on purpose so tangerine stays the only bright color. */

    --color-speaker-1: #5aa6e0;
    --color-speaker-2: #e0b154;
    --color-speaker-3: #e0768f;
    --color-speaker-4: #63c0b0;
    --color-speaker-5: #9dc46b;
    --color-speaker-6: #b394d8;

    /* ---------- Type ---------- */
    /* Literata for words people said, Inter for the tool around them. */

    --font-serif: "Literata", georgia, serif;
    --font-sans: "Inter", ui-sans-serif, -apple-system, "Segoe UI", roboto, sans-serif;
    --font-mono: ui-monospace, menlo, monospace;
    /* Reenie Beanie: the hand-drawn accent. Eyebrows and empty states only. */
    --font-hand: "Reenie Beanie", cursive;

    /* The type scale from the Type board: size, weight, line height. */
    --type-display-size: clamp(36px, 4.6vw, 58px);
    --type-display-weight: 500;
    --type-display-line: 1.06;
    --type-display-tracking: -0.02em;
    --type-page-title-size: 34px;
    --type-page-title-tracking: -0.015em;
    --type-section-title-size: 28px;
    --type-section-title-tracking: -0.01em;
    --type-panel-title-size: 20px;
    --type-beat-title-size: 17px;
    --type-script-name-size: 16px;
    --type-lead-size: 17px;
    --type-lead-line: 1.6;
    --type-body-size: 15px;
    --type-body-line: 1.5;
    --type-button-size: 14px;
    --type-button-weight: 600;
    --type-small-size: 13px;
    --type-caption-size: 12px;
    --type-meta-size: 13px;
    --type-label-size: 11px;
    --type-label-weight: 600;
    --type-label-tracking: 0.1em;
    --type-runtime-size: 20px;
    --type-timecode-size: 13px;
    --type-eyebrow-size: 34px;
    --type-eyebrow-tilt: -2deg;
    --type-empty-size: 26px;

    /* Bites read at 14px on the board so beats stay narrow. A- and A+ change it. */
    --type-bite-size: 14px;
    --type-bite-line: 1.5;

    /* ---------- Space ---------- */

    --space-1: 4px;
    --space-2: 6px;
    --space-3: 8px;
    --space-4: 10px;
    --space-5: 12px;
    --space-6: 14px;
    --space-7: 16px;
    --space-8: 18px;
    --space-9: 24px;
    --space-10: 32px;
    --space-11: 40px;
    --space-12: 48px;
    --gutter: clamp(16px, 3vw, 32px);

    /* ---------- Shape ---------- */

    --radius-xs: 5px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 16px;
    --radius-pill: 999px;
    --control-height: 36px;
    --control-height-large: 40px;
    --input-height: 46px;
    --touch-target: 44px;

    /* ---------- Depth and motion ---------- */

    --shadow-lift: 0 20px 48px rgb(0 0 0 / 35%);
    --duration-fast: 0.15s;
    --ease-spring: cubic-bezier(0.34, 1.3, 0.5, 1);
    --z-sticky: 2;
    --z-drag: 9999;
  }

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

  :root[data-theme="dark"] {
    color-scheme: dark;
  }
}
