/* SurdoAI — общая дизайн-система (тёмная тема). */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #06060d;
  --ink: #f4f4fb;
  --ink-soft: #d7d8ea;
  --muted: #9a9cb6;
  --muted-2: #8a8ca5;
  --hairline: rgba(255, 255, 255, 0.08);

  --brand: #7c5cff;
  --brand-2: #46c8ff;
  --accent: #a78bff;
  --brand-grad: linear-gradient(120deg, #7c5cff, #46c8ff);
  --brand-grad-2: linear-gradient(135deg, #a78bff, #46c8ff);
  --brand-grad-3: linear-gradient(135deg, #46c8ff, #7c5cff);

  --surface: rgba(20, 20, 34, 0.72);
  --surface-2: rgba(20, 20, 34, 0.55);
  --surface-3: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.06);

  --shadow-sm: 0 2px 14px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.55);
  --glow: 0 10px 30px rgba(124, 92, 255, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { color: var(--accent); }

.font-display { font-family: 'Space Grotesk', system-ui, sans-serif; letter-spacing: -0.4px; }

.bg-mesh {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(900px 600px at 12% 108%, rgba(70, 200, 255, 0.12), transparent 60%),
    radial-gradient(700px 500px at 50% 50%, rgba(167, 139, 255, 0.05), transparent 60%),
    var(--bg);
}
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 40%, transparent 100%);
}

.nav-bar {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(8, 8, 16, 0.55);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-brand { display: flex; align-items: center; gap: 11px; }
.nav-brand .bico {
  width: 38px; height: 38px; border-radius: 13px;
  background: radial-gradient(circle at 32% 28%, #c9b8ff, #7c5cff 62%, #4b32b0);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}
.nav-brand .bname {
  font-family: 'Space Grotesk', sans-serif; font-size: 19px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.4px;
}
.nav-brand .bname b, .nav-brand .bname .accent {
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-links {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.nav-link {
  font-family: 'Space Grotesk', sans-serif; font-size: 13.5px; font-weight: 500;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 10px;
  transition: background .15s, color .15s;
  white-space: nowrap;
  position: relative;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active {
  color: var(--ink);
}
.nav-link.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 1px; height: 2px;
  border-radius: 2px; background: var(--brand-grad);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Space Grotesk', sans-serif; font-size: 13.5px; font-weight: 600;
  padding: 11px 22px;
  border-radius: 999px;
  border: none; cursor: pointer;
  background: var(--brand-grad);
  color: #fff;
  box-shadow: var(--glow);
  transition: transform .12s, box-shadow .12s, opacity .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(124, 92, 255, 0.5); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); box-shadow: none; }

.btn-sm { padding: 7px 14px; font-size: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: .5px;
}
.pill-brand { background: rgba(124, 92, 255, 0.14); color: var(--accent); }
.pill-blue  { background: rgba(70, 200, 255, 0.14); color: var(--brand-2); }
.pill-purple{ background: rgba(167, 139, 255, 0.14); color: var(--accent); }
.pill-soft  { background: rgba(255, 255, 255, 0.05); color: var(--muted); border: 1px solid var(--border); }

input[type=text], input[type=search], textarea, select {
  font-family: 'Manrope', sans-serif; font-size: 13px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input[type=text]:focus, input[type=search]:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .22);
}

input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: 4px; background: rgba(255, 255, 255, 0.12); border-radius: 999px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--brand); cursor: pointer;
  box-shadow: 0 2px 8px rgba(124, 92, 255, .55);
}
input[type=range]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--brand); cursor: pointer; border: none;
  box-shadow: 0 2px 8px rgba(124, 92, 255, .55);
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(124, 92, 255, .3); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124, 92, 255, .5); }
::-webkit-scrollbar-track { background: transparent; }

/* SurdoAI brand mark — переиспользуется в шапке всех страниц. */
.brand-svg {
  width: 22px; height: 22px;
}

/* Language switcher (UZ / RU) — переиспользуется в шапке всех страниц. */
#lang-switch {
  display: inline-flex; gap: 2px;
  margin-left: 8px; padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
}
#lang-switch button {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  color: var(--muted);
  background: transparent; border: none;
  padding: 5px 11px; border-radius: 7px; cursor: pointer;
  transition: background .12s, color .12s;
}
#lang-switch button:hover { color: var(--ink); }
#lang-switch button.active { color: #fff; background: var(--brand-grad); }

/* ── Theme toggle button (nav) ─────────────────────────────────────────── */
.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
  transition: border-color .15s, background .15s, transform .15s;
}
.theme-toggle:hover { border-color: var(--brand); }
.theme-toggle .ic { width: 18px; height: 18px; color: var(--ink); display: block; }
.theme-toggle .ic-sun { display: none; }
html[data-theme="light"] .theme-toggle .ic-moon { display: none; }
html[data-theme="light"] .theme-toggle .ic-sun { display: block; }
html[data-theme="light"] .theme-toggle .ic-sun { color: #b8860b; }
.theme-toggle .ic-moon { color: #cdbcff; }

/* ── Light theme (toggled from the nav; dark is the default) ────────────── */
html[data-theme="light"] {
  --bg: #eceaf8;
  --ink: #191832;
  --ink-soft: #2c2b48;
  --muted: #56546f;
  --muted-2: #7d7c95;
  --hairline: rgba(26, 22, 66, 0.10);
  --surface: rgba(248, 247, 253, 0.72);
  --surface-2: rgba(255, 255, 255, 0.6);
  --surface-3: rgba(26, 22, 66, 0.04);
  --border: rgba(26, 22, 66, 0.10);
  --border-soft: rgba(26, 22, 66, 0.07);
  --shadow-sm: 0 2px 14px rgba(26, 22, 66, 0.08);
  --shadow-md: 0 10px 30px rgba(26, 22, 66, 0.12);
  --shadow-lg: 0 22px 60px rgba(26, 22, 66, 0.16);
  color-scheme: light;
}
html[data-theme="light"] .bg-mesh {
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(124, 92, 255, 0.16), transparent 60%),
    radial-gradient(900px 600px at 12% 108%, rgba(70, 200, 255, 0.10), transparent 60%),
    var(--bg);
}
html[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(rgba(26, 22, 66, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 22, 66, 0.045) 1px, transparent 1px);
}
html[data-theme="light"] .nav-bar { background: rgba(255, 255, 255, 0.62); }
html[data-theme="light"] .nav-brand .bname { color: var(--ink); }
html[data-theme="light"] .btn-ghost { background: rgba(26, 22, 66, 0.03); }
html[data-theme="light"] .btn-ghost:hover { background: rgba(26, 22, 66, 0.06); }
html[data-theme="light"] .theme-toggle { background: rgba(26, 22, 66, 0.03); }
html[data-theme="light"] #lang-switch { background: rgba(26, 22, 66, 0.05); }
html[data-theme="light"] input[type=text], html[data-theme="light"] input[type=search],
html[data-theme="light"] textarea, html[data-theme="light"] select { background: rgba(255, 255, 255, 0.7); }
html[data-theme="light"] input[type=range] { background: rgba(26, 22, 66, 0.12); }

/* ── Mobile nav: one compact scrollable row instead of a 3-row wrap ────────── */
@media (max-width: 700px) {
  .nav-bar { gap: 10px; padding: 8px 12px; }
  .nav-brand .bico { width: 30px; height: 30px; border-radius: 10px; }
  .nav-brand .bico svg { width: 17px; height: 17px; }
  .nav-brand .bname { font-size: 16px; white-space: nowrap; }
  .nav-links {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-link { padding: 6px 9px; font-size: 12.5px; }
  #lang-switch { flex-shrink: 0; }
  .theme-toggle { flex-shrink: 0; }
}
