/* ==========================================================================
   Paint Studio — design tokens, reset and primitives
   ========================================================================== */

:root {
  color-scheme: dark;

  /* surfaces */
  --bg-0: #0a0b0f; /* app / stage backdrop */
  --bg-1: #13151c; /* chrome: bars, panels */
  --bg-2: #1a1d26; /* inputs, wells */
  --bg-3: #232733; /* hover */
  --bg-4: #2c313f; /* pressed / selected */
  --glass: rgba(19, 21, 28, 0.82);

  /* lines */
  --stroke: rgba(255, 255, 255, 0.07);
  --stroke-2: rgba(255, 255, 255, 0.12);
  --stroke-3: rgba(255, 255, 255, 0.2);

  /* text */
  --text: #e7e9f0;
  --text-2: #9ba1b0;
  --text-3: #6a7080;

  /* brand */
  --accent: #6f7dff;
  --accent-2: #a855f7;
  --accent-soft: rgba(111, 125, 255, 0.16);
  --accent-glow: rgba(111, 125, 255, 0.45);
  --accent-text: #fff;
  --danger: #f4515f;
  --danger-soft: rgba(244, 81, 95, 0.15);
  --ok: #34d399;
  --warn: #fbbf24;

  /* geometry */
  --r-xs: 5px;
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  --h-top: 50px;
  --h-options: 44px;
  --h-status: 26px;
  --w-rail: 84px;
  --w-side: 290px;

  /* elevation */
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2: 0 4px 14px rgba(0, 0, 0, 0.35);
  --sh-3: 0 18px 50px rgba(0, 0, 0, 0.55);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* motion */
  --t-fast: 110ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-med: 190ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 320ms cubic-bezier(0.16, 1, 0.3, 1);

  /* type */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* canvas checkerboard */
  --check-a: #2a2e39;
  --check-b: #21242d;
  --check-bg: conic-gradient(
    var(--check-a) 0 25%,
    var(--check-b) 0 50%,
    var(--check-a) 0 75%,
    var(--check-b) 0
  );
  --stage: radial-gradient(120% 120% at 50% 0%, #14161d 0%, #0a0b0f 70%);
}

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

  --bg-0: #e9ebf2;
  --bg-1: #ffffff;
  --bg-2: #f3f4f9;
  --bg-3: #e9ebf3;
  --bg-4: #dcdfeb;
  --glass: rgba(255, 255, 255, 0.85);

  --stroke: rgba(16, 20, 38, 0.08);
  --stroke-2: rgba(16, 20, 38, 0.13);
  --stroke-3: rgba(16, 20, 38, 0.24);

  --text: #171a24;
  --text-2: #5c6373;
  --text-3: #8b91a1;

  --accent: #5b63f0;
  --accent-2: #9333ea;
  --accent-soft: rgba(91, 99, 240, 0.12);
  --accent-glow: rgba(91, 99, 240, 0.3);
  --danger: #e0384a;
  --danger-soft: rgba(224, 56, 74, 0.12);

  --sh-1: 0 1px 2px rgba(19, 23, 43, 0.08);
  --sh-2: 0 4px 14px rgba(19, 23, 43, 0.1);
  --sh-3: 0 18px 50px rgba(19, 23, 43, 0.18);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, 0.7);

  --check-a: #ffffff;
  --check-b: #e6e8f0;
  --stage: radial-gradient(120% 120% at 50% 0%, #f2f3f8 0%, #dfe2ec 75%);
}

/* --------------------------------- reset --------------------------------- */

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

* {
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

h1,
h2,
h3 {
  font-size: inherit;
  font-weight: 600;
}

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

button {
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

svg.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  pointer-events: none;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection {
  background: var(--accent-soft);
}

.spacer {
  flex: 1 1 auto;
}

.sep {
  width: 1px;
  align-self: stretch;
  margin: 5px 3px;
  background: var(--stroke-2);
  flex: none;
}

[hidden] {
  display: none !important;
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 40px;
  text-align: center;
  font-size: 15px;
  background: var(--bg-0);
}

/* scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-4) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-4);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--stroke-3);
  background-clip: content-box;
}

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