/* Record design tokens. Light values live on :root. Dark values are repeated for an explicit
   dark theme and for the system appearance, unless the page has asked for light.
   1rem is the browser default (16px) times --text-scale, so every rem size follows Text size. */

:root {
  color-scheme: light;
  --text-scale: 1;
  --text-scale-larger: 1.35;
  --text-scale-largest: 1.6;

  --font-editorial: ui-serif, "New York", "Newsreader", Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --large-title-size: 2.125rem;
  --large-title-line: 1.205;
  --large-title-weight: 500;
  --large-title-tracking: -0.4px;

  --memo-title-size: 2rem;
  --memo-title-line: 1.15;
  --memo-title-weight: 500;
  --memo-title-tracking: -0.6px;

  --desktop-title-size: 2.5rem;
  --desktop-title-line: 1.15;
  --desktop-title-weight: 500;
  --desktop-title-tracking: -0.6px;

  --question-size: 1.5rem;
  --question-line: 1.2;
  --question-weight: 500;
  --question-tracking: -0.3px;

  --day-summary-size: 1.1875rem;
  --day-summary-line: 1.47;
  --day-summary-weight: 400;
  --day-summary-tracking: 0px;

  --summary-size: 1.1875rem;
  --summary-line: 1.58;
  --summary-weight: 400;
  --summary-tracking: -0.15px;

  --headline-size: 1.0625rem;
  --headline-line: 1.35;
  --headline-weight: 600;
  --headline-tracking: -0.2px;

  --body-size: 1.0625rem;
  --body-line: 1.47;
  --body-weight: 400;
  --body-tracking: 0px;

  --reading-size: 1.125rem;
  --reading-line: 1.5556;
  --reading-weight: 400;
  --reading-tracking: -0.15px;

  --recording-title-size: 1.5rem;
  --recording-title-line: 1.205;
  --recording-title-weight: 550;
  --recording-title-tracking: -0.4px;

  --label-size: 0.9375rem;
  --label-line: 1.4;
  --label-weight: 600;
  --label-tracking: 0px;

  --meta-size: 0.9375rem;
  --meta-line: 1.4;
  --meta-weight: 400;
  --meta-tracking: 0px;

  --timer-size: 4.25rem;
  --timer-line: 1.18;
  --timer-weight: 400;
  --timer-tracking: -2.8px;

  --timer-fraction-size: 1.75rem;
  --timer-fraction-line: 1.18;
  --timer-fraction-weight: 400;
  --timer-fraction-tracking: -1px;

  --wordmark-weight: 700;
  --wordmark-tracking: -0.5px;
  --device-code-tracking: 4px;

  --ink: #191d24;
  --secondary: #535963;
  --tertiary: #a3a8b0;
  --hairline: #dee1e6;
  --tint: #17655b;
  --tint-on: #ffffff;
  --tint-soft: #e4f0ed;
  --record: #c52b36;
  --record-on: #ffffff;
  --success: #226944;
  --warning: #885600;
  --danger: #ae2733;
  --unsure: #885600;
  --primary: #20242b;
  --primary-on: #ffffff;
  --bg-canvas: #ffffff;
  --surface: #ffffff;
  --elevated: #f3f3f3;
  --group-fill: transparent;
  --now: #d9eee7;
  --now-ink: #14594f;
  --sidebar-paper: #f3f3f3;
  --glass-fill: #ffffffa3;
  --glass-solid: #f7f7f8;
  --glass-edge: #5a5a5e2e;
  --glass-specular: #fffffff2;
  --glass-sheen: #ffffff0f;
  --glass-label: #191d24;
  --glass-label-secondary: #191d24;
  --sheet-scrim: #00000040;
  --tab-lens: #191d2414;

  --glass-blur: 36px;
  --glass-saturate: 1.9;
  --float-shadow: 0 4px 8px #141e2d1f;
  --elev-float: inset 0 0.5px 0 #fffffff2, inset 0 0 0 0.5px #5a5a5e2e, 0 8px 30px #141e2d1f;
  --elev-sheet: inset 0 0.5px 0 #fffffff2, 0 -12px 48px #141e2d1f;

  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-56: 56px;
  --space-64: 64px;
  --target-min: 44px;
  --dock-height: 72px;
  --player-height: 64px;
  --player-primary-control: 48px;
  --scroll-edge-top: 112px;
  --scroll-edge-bottom: 136px;
  --scroll-safe-padding: 160px;
  --sheet-inset: 8px;
  --sheet-top: 210px;
  --sheet-bottom: 34px;
  --settings-tile: 32px;
  --desktop-sidebar: 340px;
  --desktop-document-max: 680px;
  --desktop-dock-max: 560px;

  --radius-word: 5px;
  --radius-stop: 8px;
  --radius-settings-tile: 8px;
  --radius-control: 22px;
  --radius-card: 26px;
  --radius-sheet: 47px;
  --radius-capsule: 999px;
  --recess-scale: 0.93;

  /* Names screens already use. They follow the tokens above, including in the dark. */
  --canvas: var(--bg-canvas);
  --ink-2: var(--secondary);
  --line: var(--hairline);
  --line-2: var(--hairline);
  --blue: var(--tint);
  --blue-ink: var(--tint);
  --blue-soft: var(--tint-soft);
  --ok: var(--success);
  --warn: var(--warning);
  --bad: var(--danger);
  --ok-soft: color-mix(in srgb, var(--success) 14%, var(--surface));
  --warn-soft: color-mix(in srgb, var(--warning) 18%, var(--surface));
  --bad-soft: color-mix(in srgb, var(--danger) 12%, var(--surface));
  --mono: var(--font-mono);
  --radius: 12px;

  /* The spatial room is painted dark by the page script in both themes. These do not flip. */
  --dark: #000000;
  --dark-2: #1c1c1e;
  --dark-3: #2c2c2e;
  --dark-line: #38383a;
  --dark-ink: #f5f5f7;
  --dark-ink-2: #c4cbd5;
}

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

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f7;
  --secondary: #c4cbd5;
  --tertiary: #767678;
  --hairline: #38383a;
  --tint: #8db8ff;
  --tint-on: #102039;
  --tint-soft: #293e5e;
  --record: #ff7580;
  --record-on: #301017;
  --success: #91d7af;
  --warning: #f1c779;
  --danger: #ff9aa3;
  --unsure: #f1c779;
  --primary: #f5f5f7;
  --primary-on: #1c1c1e;
  --bg-canvas: #000000;
  --surface: #1c1c1e;
  --elevated: #2c2c2e;
  --group-fill: #1c1c1e;
  --now: #304f7c;
  --now-ink: #e1edff;
  --sidebar-paper: #1c1c1e;
  --glass-fill: #000000a6;
  --glass-solid: #2c2c2e;
  --glass-edge: #ffffff1a;
  --glass-specular: #ffffff80;
  --glass-sheen: #ffffff03;
  --glass-label: #ffffff;
  --glass-label-secondary: #ffffff;
  --tab-lens: #ffffff14;
  --float-shadow: 0 8px 30px #00000052;
  --elev-float: inset 0 0.5px 0 #ffffff80, inset 0 0 0 0.5px #ffffff1a, 0 8px 30px #00000052;
  --elev-sheet: inset 0 0.5px 0 #ffffff80, 0 -12px 48px #00000052;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #f5f5f7;
    --secondary: #c4cbd5;
    --tertiary: #767678;
    --hairline: #38383a;
    --tint: #8db8ff;
    --tint-on: #102039;
    --tint-soft: #293e5e;
    --record: #ff7580;
    --record-on: #301017;
    --success: #91d7af;
    --warning: #f1c779;
    --danger: #ff9aa3;
    --unsure: #f1c779;
    --primary: #f5f5f7;
    --primary-on: #1c1c1e;
    --bg-canvas: #000000;
    --surface: #1c1c1e;
    --elevated: #2c2c2e;
    --group-fill: #1c1c1e;
    --now: #304f7c;
    --now-ink: #e1edff;
    --sidebar-paper: #1c1c1e;
    --glass-fill: #000000a6;
    --glass-solid: #2c2c2e;
    --glass-edge: #ffffff1a;
    --glass-specular: #ffffff80;
    --glass-sheen: #ffffff03;
    --glass-label: #ffffff;
    --glass-label-secondary: #ffffff;
    --tab-lens: #ffffff14;
    --float-shadow: 0 8px 30px #00000052;
    --elev-float: inset 0 0.5px 0 #ffffff80, inset 0 0 0 0.5px #ffffff1a, 0 8px 30px #00000052;
    --elev-sheet: inset 0 0.5px 0 #ffffff80, 0 -12px 48px #00000052;
  }
}

:root[data-text-size="larger"] { --text-scale: 1.35; }
:root[data-text-size="largest"],
[data-text-size="largest"] { --text-scale: 1.6; }

html { font-size: calc(100% * var(--text-scale)); }
