/* Svitlo design system — shared tokens. Every page links this file first. */
@import url("https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* Brand */
  --amber-50: #fff8eb;
  --amber-100: #ffecc7;
  --amber-300: #ffc94d;
  --amber-400: #ffb81f;   /* primary — "light" */
  --amber-500: #f59e0b;
  --amber-600: #c97a04;
  --ink-950: #0b0c0f;
  --ink-900: #121419;
  --ink-850: #181b22;
  --ink-800: #1f232c;
  --ink-700: #2b303b;
  --ink-500: #5b6272;
  --ink-400: #8a91a1;
  --ink-200: #d5d8df;
  --ink-100: #eceef2;
  --ink-50: #f6f7f9;

  /* Semantic status */
  --green-500: #22c55e;   /* power on */
  --red-500: #ef4444;     /* outage */
  --blue-500: #3b82f6;    /* info / possible outage */
  --violet-500: #8b5cf6;  /* battery */

  /* Theme (dark is default — the product lives in the dark) */
  --bg: var(--ink-950);
  --surface: var(--ink-900);
  --surface-2: var(--ink-850);
  --surface-3: var(--ink-800);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f5f7;
  --text-muted: var(--ink-400);
  --text-subtle: var(--ink-500);
  --accent: var(--amber-400);
  --accent-hover: var(--amber-300);
  --accent-ink: #1a1203;   /* text on accent */
  --accent-soft: rgba(255, 184, 31, 0.12);
  --on: var(--green-500);
  --off: var(--red-500);
  --maybe: var(--blue-500);
  --battery: var(--violet-500);
  --focus: 0 0 0 3px rgba(255, 184, 31, 0.45);

  /* Type */
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  --fs-3xl: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);
  --fs-display: clamp(2.75rem, 1.2rem + 6.4vw, 6.5rem);
  --lh-tight: 1.05;
  --lh-snug: 1.25;
  --lh-body: 1.6;

  /* Space (4px grid) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;
  --s-20: 80px; --s-24: 96px; --s-32: 128px;

  /* Shape & depth */
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-xl: 28px; --r-full: 999px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 80px rgba(255, 184, 31, 0.25);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 150ms; --t-med: 260ms; --t-slow: 600ms;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: var(--ink-50);
  --surface: #ffffff;
  --surface-2: var(--ink-50);
  --surface-3: var(--ink-100);
  --border: rgba(11, 12, 15, 0.08);
  --border-strong: rgba(11, 12, 15, 0.16);
  --text: var(--ink-950);
  --text-muted: var(--ink-500);
  --text-subtle: var(--ink-400);
  --accent: var(--amber-500);
  --accent-hover: var(--amber-600);
  --accent-soft: rgba(245, 158, 11, 0.12);
  --shadow-2: 0 8px 24px rgba(11, 12, 15, 0.08);
  color-scheme: light;
}

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

/* Minimal shared base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
