/* ==========================================================================
   BORDERLINE · OBSIDIAN RED
   One token system for the industrial dark and matte warm-grey light theme.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("assets/fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("assets/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

  /* Surfaces — neutral graphite, no blue undertone */
  --bg: #11100f;
  --ambient: radial-gradient(1000px 620px at 10% -12%, rgba(210, 55, 61, .11), transparent 62%), radial-gradient(900px 520px at 100% 0%, rgba(233, 161, 90, .065), transparent 66%);
  --bg-deep: #0b0a09;
  --sidebar: #171512;
  --surface: #1e1b18;
  --surface-2: #26221e;
  --surface-3: #2e2924;
  --surface-inset: #191613;
  --elevated: #2a2520;
  --viewfinder: #0a0908;
  --overlay: rgba(0, 0, 0, .7);

  /* Text */
  --text: #f2ece4;
  --text-2: #d6cec4;
  --muted: #b2a89c;
  --muted-2: #978d81;

  /* Lines */
  --border: #332e29;
  --border-strong: #453e36;
  --border-soft: rgba(242, 236, 228, .06);
  --hairline: rgba(242, 236, 228, .085);

  /* Brand — red is punctuation, not a surface */
  --primary: #d2373d;
  --primary-strong: #d2373d;
  --primary-hover: #c93238;
  --primary-press: #b0272d;
  --primary-soft: rgba(210, 55, 61, .14);
  --primary-softer: rgba(210, 55, 61, .07);
  --accent: #f28772;
  --accent-2: #e9a15a;
  --accent-2-soft: rgba(233, 161, 90, .13);
  --accent-line: #e1454b;
  --on-primary: #fff8f2;
  --focus: #f2ece4;

  /* Semantics */
  --success: #86d6a2;
  --success-strong: #6cc28b;
  --success-soft: rgba(134, 214, 162, .12);
  --success-line: rgba(134, 214, 162, .34);
  --warning: #f0be63;
  --warning-soft: rgba(240, 190, 99, .12);
  --warning-line: rgba(240, 190, 99, .32);
  --danger: #e57b72;
  --danger-soft: rgba(229, 123, 114, .12);
  --danger-line: rgba(229, 123, 114, .34);
  --denied: #e57b72;
  --expired: #9a9186;
  --expired-soft: rgba(154, 145, 134, .1);
  --info: #d6c8b7;
  --neutral-soft: rgba(242, 236, 228, .065);

  /* Elevation — borders first, shadows only for overlays */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .42);
  --shadow-sm: 0 8px 24px -18px rgba(0, 0, 0, .9);
  --shadow-md: 0 20px 60px -32px rgba(0, 0, 0, .95);
  --shadow-lg: 0 40px 110px -48px rgba(0, 0, 0, 1);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, .055);

  /* Geometry */
  --r-xs: 3px;
  --r-sm: 5px;
  --r-md: 7px;
  --r-lg: 10px;
  --r-pill: 999px;
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 56px;
  --content-max: 1520px;
  --row-h: 48px;
  --control-h: 38px;
  --card-pad: 22px;

  /* Type */
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Manrope", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;

  /* Motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --ease-spring: cubic-bezier(.34, 1.35, .64, 1);
  --dur-1: 120ms;
  --dur-2: 170ms;
  --dur-3: 220ms;
  --dur-4: 300ms;

  /* Data viz — graphite field, red key */
  --chart-1: #d2373d;
  --chart-2: #c08b57;
  --chart-3: #86d6a2;
  --chart-4: #f0be63;
  --chart-5: #8c8379;
  --chart-warning: #f0be63;
  --chart-grid: rgba(242, 236, 228, .08);
  --chart-label: #a89d92;
}

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

  --bg: #e9e3d9;
  --ambient: radial-gradient(900px 560px at 8% -12%, rgba(194, 43, 49, .07), transparent 60%), radial-gradient(800px 480px at 100% 0%, rgba(233, 161, 90, .11), transparent 62%);
  --bg-deep: #ddd7cc;
  --sidebar: #dfd8cd;
  --surface: #f5f1ea;
  --surface-2: #fbf8f3;
  --surface-3: #ede7de;
  --surface-inset: #e4ddd2;
  --elevated: #fbf8f3;
  --viewfinder: #121212;
  --overlay: rgba(38, 33, 28, .32);

  --text: #26211c;
  --text-2: #403a33;
  --muted: #5f574d;
  --muted-2: #5f574d;

  --border: #cfc7ba;
  --border-strong: #b9b0a3;
  --border-soft: rgba(38, 33, 28, .09);
  --hairline: rgba(38, 33, 28, .12);

  --primary: #c22b31;
  --primary-strong: #c22b31;
  --primary-hover: #d13a40;
  --primary-press: #a11f25;
  --primary-soft: rgba(194, 43, 49, .12);
  --primary-softer: rgba(194, 43, 49, .05);
  --accent: #b23a33;
  --accent-2: #a5671f;
  --accent-2-soft: rgba(165, 103, 31, .11);
  --accent-line: #c22b31;
  --on-primary: #fff8f2;
  --focus: #8f1d22;

  --success: #256b45;
  --success-strong: #1e5a39;
  --success-soft: #dfede5;
  --success-line: #a9cbb8;
  --warning: #8a5a12;
  --warning-soft: #ede2cf;
  --warning-line: #cfb98e;
  --danger: #9e2a2a;
  --danger-soft: #f1dad6;
  --danger-line: #d2aaa6;
  --denied: #9e2a2a;
  --expired: #686055;
  --expired-soft: #e6dfd4;
  --info: #5f574d;
  --neutral-soft: rgba(38, 33, 28, .07);

  --shadow-xs: 0 1px 2px rgba(36, 36, 36, .07);
  --shadow-sm: 0 8px 24px -18px rgba(36, 36, 36, .32);
  --shadow-md: 0 20px 56px -34px rgba(36, 36, 36, .38);
  --shadow-lg: 0 40px 100px -54px rgba(36, 36, 36, .45);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, .32);

  --chart-1: #c22b31;
  --chart-2: #a5671f;
  --chart-3: #256b45;
  --chart-4: #8a5a12;
  --chart-5: #746b60;
  --chart-warning: #8a5a12;
  --chart-grid: rgba(36, 36, 36, .11);
  --chart-label: #6a6258;
}

[data-density="compact"] {
  --row-h: 42px;
  --control-h: 32px;
  --card-pad: 16px;
  --topbar-h: 50px;
}

html[data-theme="light"] .theme-toggle .moon { display: none; }
html[data-theme="light"] .theme-toggle .sun { display: block; }
html[data-theme="dark"] .theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: block; }
