/* Arthur Reference Web Kit: palette, typography, geometry and interaction. */
@font-face {
  font-family: Jost;
  src: url("./Jost-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Jost;
  src: url("./Jost-ui.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0400-052F, U+2000-206F, U+20A0-20CF, U+2116, U+2190-21FF;
}

:root {
  --paper: #f4f4f4;
  --ink: #222626;
  --muted: #59625e;
  --line: #d9ddda;
  --white: #fff;
  --on-dark: #f8f9f4;
  --glass-ink: #1d1e22;
  --deep-moss: #232c2b;
  --forest: #315732;
  --leaf: #4a814a;
  --sage: #9ead72;
  --peach: #d4a58d;
  --signal: #e4ff00;
  --success: #315732;
  --success-bg: #e6ebd9;
  --warning: #73551b;
  --warning-bg: #f4ebd2;
  --error: #923d31;
  --error-bg: #f7e8e3;

  --font: Jost, system-ui, sans-serif;
  --display: clamp(2.5rem, 1.72rem + 3.4vw, 5rem);
  --heading: clamp(1.875rem, 1.44rem + 1.85vw, 3.25rem);
  --subheading: clamp(1.25rem, 1.12rem + .6vw, 1.75rem);
  --lead: clamp(1.0625rem, .97rem + .4vw, 1.375rem);
  --caption: .875rem;
  --micro: .75rem;
  --content: 1280px;
  --gutter: 48px;
  --section: clamp(32px, 4.2vw, 60px);
  --panel-padding: clamp(20px, 2.5vw, 32px);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --r-hero: 28px;
  --r-panel: 24px;
  --r-card: 16px;
  --r-control: 12px;
  --r-badge: 11px;
  --r-status: 4px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --press: 140ms;
  --reveal: 240ms;

  color-scheme: light;
  --bg: var(--paper);
  --surface: var(--white);
  --wash: var(--paper);
  --text: var(--ink);
  --subtle: var(--muted);
  --divider: var(--line);
  --focus: var(--forest);
  --selected: var(--success-bg);
  --positive: var(--success);
  --positive-fill: var(--success-bg);
  --caution: var(--warning);
  --caution-fill: var(--warning-bg);
  --negative: var(--error);
  --negative-fill: var(--error-bg);
  --hard-fill: var(--success-bg);
  --hard-mark: var(--forest);
  --clay-fill: color-mix(in srgb, var(--peach) 25%, var(--white));
  --clay-mark: var(--error);
  --own-fill: color-mix(in srgb, var(--sage) 24%, var(--paper));
  --own-mark: var(--ink);
  --scrim: color-mix(in srgb, var(--glass-ink) 60%, transparent);
  --shadow: 0 18px 54px color-mix(in srgb, var(--glass-ink) 18%, transparent);
  --forest-light: radial-gradient(ellipse at 76% 108%, var(--sage) 0%, transparent 65%),
    linear-gradient(156deg, var(--forest) 18%, var(--leaf) 88%);
}

/* color-scheme follows Telegram's explicit choice when embedded. */
@supports (color: light-dark(white, black)) {
  :root {
    color-scheme: light dark;
    --bg: light-dark(var(--paper), var(--glass-ink));
    --surface: light-dark(var(--white), var(--deep-moss));
    --wash: light-dark(var(--paper), color-mix(in srgb, var(--deep-moss) 82%, var(--glass-ink)));
    --text: light-dark(var(--ink), var(--on-dark));
    --subtle: light-dark(var(--muted), color-mix(in srgb, var(--line) 81%, var(--muted)));
    --divider: light-dark(var(--line), color-mix(in srgb, var(--line) 23%, var(--deep-moss)));
    --focus: light-dark(var(--forest), var(--sage));
    --selected: light-dark(var(--success-bg), color-mix(in srgb, var(--sage) 26%, var(--deep-moss)));
    --positive: light-dark(var(--success), var(--success-bg));
    --positive-fill: light-dark(var(--success-bg), color-mix(in srgb, var(--forest) 54%, var(--deep-moss)));
    --caution: light-dark(var(--warning), var(--warning-bg));
    --caution-fill: light-dark(var(--warning-bg), color-mix(in srgb, var(--warning) 55%, var(--deep-moss)));
    --negative: light-dark(var(--error), var(--error-bg));
    --negative-fill: light-dark(var(--error-bg), color-mix(in srgb, var(--error) 43%, var(--deep-moss)));
    --hard-fill: var(--positive-fill);
    --hard-mark: light-dark(var(--forest), var(--sage));
    --clay-fill: light-dark(color-mix(in srgb, var(--peach) 25%, var(--white)),
      color-mix(in srgb, var(--peach) 26%, var(--deep-moss)));
    --clay-mark: light-dark(var(--error), var(--peach));
    --own-fill: light-dark(color-mix(in srgb, var(--sage) 24%, var(--paper)), var(--selected));
    --own-mark: var(--text);
  }
  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"] { color-scheme: dark; }
}

@media (max-width: 1023px) { :root { --gutter: 24px; } }
@media (max-width: 767px) { :root { --gutter: 16px; } }
