/*
 * Design tokens of the team workspace (workspace-spaces/apps/web/src/index.css), translated from the Tailwind theme
 * into plain custom properties. Look of the Mediateka «Облако»: cool paper canvas under white surfaces, hairline
 * borders, ink #090909 for the main action and the active menu item, Udav blue #1600ed for links and focus.
 *
 * Standalone: no build step, no imports. Server-side templates link it first, then site.css and content.css.
 */

@font-face {
  font-family: 'Artegra Sans Extended';
  src: url('../fonts/artegra-extended-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Artegra Sans Extended';
  src: url('../fonts/artegra-extended-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-100_900.woff2') format('woff2-variations'), url('../fonts/Inter-100_900.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Surfaces and text */
  --canvas: #f5f6fa;
  --surface: #ffffff;
  --text: #090909;
  --ink: #090909;
  --ink-hover: #2a2a2e;
  --on-ink: #ffffff;
  --on-ink-muted: rgb(255 255 255 / 0.65);
  --header-bg: rgb(245 246 250 / 0.88);
  --focus: #1600ed;

  /* Neutrals of the Mediateka */
  --gray-50: #f1f2f6;
  --gray-100: #efefec;
  --gray-200: #e0e2ea;
  --gray-300: #c9ccd6;
  --gray-400: #9a9dab;
  --gray-500: #5f6270;
  --gray-600: #4a4d59;
  --gray-700: #33353f;
  --gray-800: #1d1e24;
  --gray-900: #090909;

  /* Accent (Udav blue) */
  --brand-50: #eeedfe;
  --brand-100: #dddbfd;
  --brand-200: #bab6fb;
  --brand-500: #3a2ff2;
  --brand-600: #1600ed;
  --brand-700: #1000b4;

  /* Tones for content notes */
  --green-50: #effaf3;
  --green-200: #bfe6cc;
  --green-700: #177a3e;
  --amber-50: #fff8e8;
  --amber-200: #f5dca3;
  --amber-700: #a4560a;
  --red-50: #fdeeee;
  --red-200: #f3c4c4;
  --red-700: #b40000;

  /* Shapes: small parts 10-14, cards 20, panels and dialogs 26; controls are capsules */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 26px;
  --radius-full: 9999px;

  /* Spacing: one 4/8 scale for every gap */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Type */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-head: 'Artegra Sans Extended', 'Inter', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Shadows: sm under cards, md under menus, lg under dialogs */
  --shadow-card: 0 1px 2px rgb(15 20 28 / 0.06);
  --shadow-pop: 0 4px 16px rgb(15 20 28 / 0.1);
  --shadow-dialog: 0 12px 40px rgb(15 20 28 / 0.18);
  --shadow-primary-hover: 0 6px 18px -8px rgb(9 9 9 / 0.6);

  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 180ms;

  /* Layout */
  --nav-w: 256px;
  --nav-w-tablet: 96px;
  --header-h: 56px;
  --bottom-bar-h: 64px;
  --content-w: 760px;
  --toc-w: 240px;
  /* One right edge for tabs, the prep grid (column + gap + TOC), the files list and the home grid. */
  --page-w: calc(var(--content-w) + var(--space-12) + var(--toc-w));
  /* Height of small controls (segments, menu items, editor tools, chips): 40 with a mouse, 44 on touch screens. */
  --control-h: 40px;
}
@media (any-pointer: coarse) {
  :root {
    --control-h: 44px;
  }
}

/*
 * Dark theme of the Mediateka: #0d0d0f paper, #161618 surfaces, #1f1f22 soft fills, #2a2a2e borders; ink turns light.
 * The same block twice: once for the OS setting (unless the reader picked light), once for an explicit choice.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --canvas: #0d0d0f;
    --surface: #161618;
    --text: #f2f2f4;
    --ink: #f5f6fa;
    --ink-hover: #ffffff;
    --on-ink: #090909;
    --on-ink-muted: rgb(9 9 9 / 0.6);
    --header-bg: rgb(13 13 15 / 0.86);
    --focus: #9ea3ff;
    --gray-50: #1a1a1d;
    --gray-100: #1f1f22;
    --gray-200: #2a2a2e;
    --gray-300: #3a3a40;
    --gray-400: #6e7079;
    --gray-500: #a2a3ad;
    --gray-600: #babcc5;
    --gray-700: #d2d3da;
    --gray-800: #e6e6ea;
    --gray-900: #f2f2f4;
    --brand-50: #1d1c3f;
    --brand-100: #262457;
    --brand-200: #34317a;
    --brand-500: #7a73ff;
    --brand-600: #8f89ff;
    --brand-700: #9ea3ff;
    --green-50: #13291b;
    --green-200: #1f4a31;
    --green-700: #4ade80;
    --amber-50: #2e2311;
    --amber-200: #59451c;
    --amber-700: #f2b450;
    --red-50: #2a1516;
    --red-200: #5b2a30;
    --red-700: #f87171;
    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-pop: 0 4px 16px rgb(0 0 0 / 0.45);
    --shadow-dialog: 0 12px 40px rgb(0 0 0 / 0.55);
    --shadow-primary-hover: 0 6px 18px -8px rgb(0 0 0 / 0.8);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --canvas: #0d0d0f;
  --surface: #161618;
  --text: #f2f2f4;
  --ink: #f5f6fa;
  --ink-hover: #ffffff;
  --on-ink: #090909;
  --on-ink-muted: rgb(9 9 9 / 0.6);
  --header-bg: rgb(13 13 15 / 0.86);
  --focus: #9ea3ff;
  --gray-50: #1a1a1d;
  --gray-100: #1f1f22;
  --gray-200: #2a2a2e;
  --gray-300: #3a3a40;
  --gray-400: #6e7079;
  --gray-500: #a2a3ad;
  --gray-600: #babcc5;
  --gray-700: #d2d3da;
  --gray-800: #e6e6ea;
  --gray-900: #f2f2f4;
  --brand-50: #1d1c3f;
  --brand-100: #262457;
  --brand-200: #34317a;
  --brand-500: #7a73ff;
  --brand-600: #8f89ff;
  --brand-700: #9ea3ff;
  --green-50: #13291b;
  --green-200: #1f4a31;
  --green-700: #4ade80;
  --amber-50: #2e2311;
  --amber-200: #59451c;
  --amber-700: #f2b450;
  --red-50: #2a1516;
  --red-200: #5b2a30;
  --red-700: #f87171;
  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-pop: 0 4px 16px rgb(0 0 0 / 0.45);
  --shadow-dialog: 0 12px 40px rgb(0 0 0 / 0.55);
  --shadow-primary-hover: 0 6px 18px -8px rgb(0 0 0 / 0.8);
}
