/*
 * 3D-ВИЖ design tokens — the only place colours are defined for the storefront.
 *
 * Theme selection (see theme.js):
 *   html[data-theme]  = the visitor's preference: light | dark | auto
 *   html[data-scheme] = the resolved scheme actually shown: light | dark
 * Components use the semantic tokens below and never raw colours, so they follow
 * the active theme automatically. Without JavaScript the OS preference still applies
 * through the media query fallback.
 */
:root {
  /* Surfaces */
  --color-bg: #f6f7fa;
  --color-surface: #ffffff;
  --color-surface-2: #f2f4f8;
  --color-surface-3: #e8ebf2;
  --color-border: #e2e6ee;
  --color-border-strong: #cdd4e2;
  --color-control-border: #7b8496; /* >= 3:1 against surfaces: inputs must be recognisable */
  /* Text */
  --color-text: #111216;
  --color-text-2: #3d4553;
  --color-muted: #5f6878;
  /* Actions */
  --color-primary: #0648ff;
  --color-primary-hover: #0037d1;
  --color-on-primary: #ffffff;
  --color-link: #0648ff;
  --color-accent-soft: #edf2ff;
  --color-accent-border: #b5c8f5;
  --color-contrast-bg: #111216;
  --color-contrast-fg: #ffffff;
  --color-focus: #0648ff;
  /* States */
  --color-danger: #b42318;
  --color-danger-soft: #fef0ec;
  --color-danger-border: #f0b4a6;
  --color-warning: #8f4710;
  --color-success: #0b7a3e;
  --color-favorite: #e0244a; /* filled hearts: 4.6:1 on white */
  --color-success-soft: #e9f7ef;
  --color-disabled-bg: #e9edf4;
  --color-disabled-fg: #6b7585;
  /* Always-dark areas (hero photos, top bar) keep their look in both themes */
  --color-always-dark: #111216;
  /* Depth */
  --shadow-sm: 0 4px 18px rgb(17 18 22 / .04);
  --shadow-md: 0 10px 30px rgb(17 18 22 / .08);
  --shadow-lg: 0 14px 55px rgb(30 32 37 / .16);
  --overlay: rgb(8 11 20 / .85);
  /* The logo PNG has a white background: multiply hides it on light surfaces */
  --logo-blend: multiply;
  --logo-filter: none;

  /* Type */
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 15px;
  --text-lg: 18px;
  /* Spacing scale (4px base) */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --page-gutter: clamp(16px, 4.5vw, 64px);
  /* Shape */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --radius-xl: 22px; --radius-pill: 999px;
  --control-height: 44px;
  /* Motion */
  --duration-fast: 120ms;
  --duration: 180ms;
  --ease: cubic-bezier(.2, .6, .2, 1);
  /* Layers */
  --z-header: 20; --z-popover: 40; --z-toast: 60; --z-dialog: 80;
  color-scheme: light;
}

/* Dark: deliberate tinted neutrals with clear surface steps, never pure white text on black */
:root[data-scheme="dark"] {
  --color-bg: #0e1117;
  --color-surface: #161a22;
  --color-surface-2: #1c212b;
  --color-surface-3: #262c38;
  --color-border: #2a3140;
  --color-border-strong: #3d4658;
  --color-control-border: #6b7487;
  --color-text: #e8ecf3;
  --color-text-2: #c5ccd8;
  --color-muted: #9aa3b3;
  --color-primary: #2f66ff;
  --color-primary-hover: #4a7bff;
  --color-on-primary: #ffffff;
  --color-link: #86a8ff;
  --color-accent-soft: #1a2647;
  --color-accent-border: #36518f;
  --color-contrast-bg: #e8ecf3;
  --color-contrast-fg: #0e1117;
  --color-focus: #8eb3ff;
  --color-danger: #ff8f80;
  --color-danger-soft: #35191a;
  --color-danger-border: #6c2e28;
  --color-warning: #f2b45f;
  --color-success: #63d394;
  --color-favorite: #ff5f7e;
  --color-success-soft: #13291d;
  --color-disabled-bg: #232935;
  --color-disabled-fg: #8a93a3;
  --color-always-dark: #0a0c11;
  --shadow-sm: 0 4px 18px rgb(0 0 0 / .25);
  --shadow-md: 0 10px 30px rgb(0 0 0 / .35);
  --shadow-lg: 0 14px 55px rgb(0 0 0 / .55);
  --overlay: rgb(3 5 10 / .88);
  /* Invert black lettering to light and keep the brand blue */
  --logo-blend: screen;
  --logo-filter: invert(1) hue-rotate(180deg) saturate(1.4);
  color-scheme: dark;
}

/* No JavaScript: follow the OS unless the page has been resolved explicitly */
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme]) {
    --color-bg: #0e1117;
    --color-surface: #161a22;
    --color-surface-2: #1c212b;
    --color-surface-3: #262c38;
    --color-border: #2a3140;
    --color-border-strong: #3d4658;
  --color-control-border: #6b7487;
    --color-text: #e8ecf3;
    --color-text-2: #c5ccd8;
    --color-muted: #9aa3b3;
    --color-primary: #2f66ff;
    --color-primary-hover: #4a7bff;
    --color-link: #86a8ff;
    --color-accent-soft: #1a2647;
    --color-accent-border: #36518f;
    --color-contrast-bg: #e8ecf3;
    --color-contrast-fg: #0e1117;
    --color-focus: #8eb3ff;
    --color-danger: #ff8f80;
    --color-danger-soft: #35191a;
    --color-danger-border: #6c2e28;
    --color-warning: #f2b45f;
    --color-success: #63d394;
  --color-favorite: #ff5f7e;
    --color-success-soft: #13291d;
    --color-disabled-bg: #232935;
    --color-disabled-fg: #8a93a3;
    --color-always-dark: #0a0c11;
    --shadow-sm: 0 4px 18px rgb(0 0 0 / .25);
    --shadow-md: 0 10px 30px rgb(0 0 0 / .35);
    --shadow-lg: 0 14px 55px rgb(0 0 0 / .55);
    --overlay: rgb(3 5 10 / .88);
    --logo-blend: screen;
    --logo-filter: invert(1) hue-rotate(180deg) saturate(1.4);
    color-scheme: dark;
  }
}

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