@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url(../fonts/inter-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url(../fonts/inter-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(../fonts/inter-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url(../fonts/inter-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url(../fonts/inter-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url(../fonts/inter-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Archivo'; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(../fonts/archivo-latin-wdth-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 100 800; font-display: swap; src: url(../fonts/jetbrains-mono-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 100 800; font-display: swap; src: url(../fonts/jetbrains-mono-cyrillic-wght-normal.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491; }

:root {
  --bg: #07080d;
  --surface: rgba(20, 22, 33, 0.72);
  --raised: rgba(28, 31, 45, 0.96);
  --tint: rgba(255, 255, 255, 0.055);
  --hover: rgba(255, 255, 255, 0.085);
  --sunken: rgba(0, 0, 0, 0.28);
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #eef1f8;
  --text2: #a2a9bd;
  --muted: #838ba4;
  --acc: #6366f1;
  --acc2: #8b5cf6;
  --acc-text: #a5b4fc;
  --acc-soft: rgba(99, 102, 241, 0.16);
  --grad: linear-gradient(135deg, #6366f1, #8b5cf6);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --font: 'Inter', 'Segoe UI', sans-serif;
  --font-display: 'Archivo', 'Inter', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; color: var(--text); background: var(--bg); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.glow { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(900px 520px at 78% -8%, rgba(99, 102, 241, 0.22), transparent 70%), radial-gradient(700px 480px at -10% 30%, rgba(139, 92, 246, 0.12), transparent 70%); }

.logo { display: block; flex: none; }
.logo svg { display: block; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; font: 600 13.5px/1 var(--font); white-space: nowrap; cursor: pointer; border: 1px solid transparent; border-radius: 10px; transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, opacity 150ms ease; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { color: #fff; background: var(--grad); box-shadow: 0 8px 24px -12px rgba(99, 102, 241, 0.8); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary { background: var(--tint); border-color: var(--line); }
.btn-secondary:hover { background: var(--hover); border-color: var(--line-strong); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--tint); }
.btn-danger { color: var(--bad); background: rgba(251, 113, 133, 0.08); border-color: rgba(251, 113, 133, 0.28); }
.btn-danger:hover { background: rgba(251, 113, 133, 0.14); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 14.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }

.input { width: 100%; height: 40px; padding: 0 12px; font: 14px var(--font); color: var(--text); background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; outline: none; transition: border-color 150ms ease, box-shadow 150ms ease; }
.input::placeholder { color: var(--muted); }
.input:focus { border-color: rgba(139, 140, 255, 0.6); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18); }
.input.mono { font-family: var(--mono); font-size: 13px; }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-label { font-size: 13px; font-weight: 500; color: var(--text2); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--text2); background: var(--tint); border: 1px solid var(--line-soft); border-radius: 999px; }
.pill::before { width: 6px; height: 6px; content: ''; background: currentColor; border-radius: 50%; }
.pill.ok { color: var(--ok); background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.22); }
.pill.bad { color: var(--bad); background: rgba(251, 113, 133, 0.08); border-color: rgba(251, 113, 133, 0.24); }
.pill.acc { color: var(--acc-text); background: var(--acc-soft); border-color: rgba(139, 140, 255, 0.28); }
.pill.plain::before { display: none; }

.switch { position: relative; flex: none; width: 38px; height: 22px; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.12); border-radius: 999px; transition: background 150ms ease; pointer-events: none; }
.switch i::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; content: ''; background: #fff; border-radius: 50%; transition: transform 150ms ease; }
.switch input:checked + i { background: var(--acc); }
.switch input:checked + i::after { transform: translateX(16px); }

.toasts { position: fixed; top: 18px; left: 50%; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; transform: translateX(-50%); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(460px, calc(100vw - 32px)); padding: 11px 14px; font-size: 13.5px; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9); animation: toast-in 200ms ease; }
.toast svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.toast.ok svg { color: var(--ok); }
.toast.bad svg { color: var(--bad); }
.toast.out { opacity: 0; transition: opacity 250ms ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

.demo-bar { position: fixed; bottom: 16px; left: 16px; z-index: 90; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: calc(100vw - 32px); padding: 6px 8px; font-size: 12px; background: rgba(10, 11, 18, 0.92); border: 1px dashed var(--line-strong); border-radius: 12px; }
.demo-bar b { padding: 0 4px; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 11px; }
.demo-bar button { height: 26px; padding: 0 9px; font-size: 12px; color: var(--text2); cursor: pointer; background: transparent; border: 1px solid var(--line); border-radius: 8px; }
.demo-bar button.on { color: var(--text); background: var(--acc-soft); border-color: rgba(139, 140, 255, 0.4); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Folded to one small button so it covers nothing; it opens on a click. */
.demo-bar:not(.open) > :not(b) { display: none; }
.demo-bar b { cursor: pointer; user-select: none; }
.demo-bar b::after { margin-left: 6px; content: '▸'; }
.demo-bar.open b::after { content: '◂'; }
