/* ФОРТЕМ — design tokens & base
   Art direction: strict corporate consulting. Navy / graphite / steel,
   single blue accent from the brand mark, hairline rules instead of cards. */

:root,
[data-theme='light'] {
  /* Surfaces */
  --color-bg: #ffffff;
  --color-surface: #f5f7f9;
  --color-surface-2: #eceff3;
  --color-surface-offset: #e4e9ee;
  --color-deep: #0a2a52;
  --color-deep-2: #0e3463;
  --color-divider: #e2e7ec;
  --color-border: #d3dae2;
  --color-logo-tile: #ffffff;

  /* Text */
  --color-text: #101b28;
  --color-text-muted: #556375;
  --color-text-faint: #8c97a6;
  --color-text-inverse: #f4f7fa;
  --color-text-on-deep: #d9e2ec;
  --color-text-on-deep-muted: #9aabbe;

  /* Accent */
  --color-primary: #145c92;
  --color-primary-hover: #0e4674;
  --color-primary-active: #0a3459;
  --color-primary-soft: #e8f0f7;
  --color-brand-red: #b22030;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-full: 9999px;

  /* Transition */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows — used sparingly */
  --shadow-sm: 0 1px 2px rgb(16 27 40 / 0.06);
  --shadow-md: 0 6px 24px rgb(16 27 40 / 0.08);

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Widths */
  --content-narrow: 680px;
  --content-default: 1000px;
  --content-wide: 1280px;

  /* Fonts */
  --font-display: 'Source Serif 4', 'PT Serif', Georgia, serif;
  --font-body: 'Manrope', 'Segoe UI', 'Helvetica Neue', sans-serif;
}

[data-theme='dark'] {
  --color-bg: #0b1119;
  --color-surface: #101a24;
  --color-surface-2: #16212d;
  --color-surface-offset: #1c2836;
  --color-deep: #061a33;
  --color-deep-2: #0a2444;
  --color-divider: #1c2836;
  --color-border: #27364a;
  --color-logo-tile: #f2f5f8;

  --color-text: #d9e0e9;
  --color-text-muted: #8c9aac;
  --color-text-faint: #64717f;
  --color-text-inverse: #101b28;
  --color-text-on-deep: #d5deea;
  --color-text-on-deep-muted: #93a3b6;

  --color-primary: #74afdd;
  --color-primary-hover: #9cc8e9;
  --color-primary-active: #b9d9f1;
  --color-primary-soft: #14212e;
  --color-brand-red: #d2434f;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 6px 24px rgb(0 0 0 / 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0b1119;
    --color-surface: #101a24;
    --color-surface-2: #16212d;
    --color-surface-offset: #1c2836;
    --color-deep: #061a33;
    --color-deep-2: #0a2444;
    --color-divider: #1c2836;
    --color-border: #27364a;
    --color-logo-tile: #f2f5f8;
    --color-text: #d9e0e9;
    --color-text-muted: #8c9aac;
    --color-text-faint: #64717f;
    --color-text-inverse: #101b28;
    --color-text-on-deep: #d5deea;
    --color-text-on-deep-muted: #93a3b6;
    --color-primary: #74afdd;
    --color-primary-hover: #9cc8e9;
    --color-primary-active: #b9d9f1;
    --color-primary-soft: #14212e;
    --color-brand-red: #d2434f;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 6px 24px rgb(0 0 0 / 0.45);
  }
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--transition-interactive), color var(--transition-interactive);
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--color-text);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

::selection {
  background: var(--color-primary);
  color: #fff;
}
