/* ====== Юрист Ai · Hybrid design system v2 ====== */

:root {
  /* === Base palette === */
  --bg: #050507;
  --bg-1: #0a0a0c;
  --bg-2: #111114;
  --bg-3: #161619;
  --text: #f2f2f0;
  --text-dim: #9b9ba0;
  --text-muted: #6b6b71;
  --accent: #FFD700;
  --accent-2: #ffe566;
  --accent-dim: #c9a700;
  --accent-glow: rgba(255, 215, 0, 0.18);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-hover: rgba(255, 255, 255, 0.22);

  /* Statuses */
  --danger: #ff5757;
  --warn: #ffb547;
  --ok: #5fd97a;
  --info: #6ec5ff;

  /* Glass (используется точечно) */
  --glass-bg: rgba(255, 255, 255, 0.035);
  --glass-bg-strong: rgba(255, 255, 255, 0.06);
  --glass-bg-hover: rgba(255, 255, 255, 0.075);
  --glass-blur: blur(28px) saturate(180%);

  /* Mono font for tech-accents */
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Radius */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --transition: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*::selection { background: var(--accent); color: #000; }

html, body {
  background: var(--bg);
  color: var(--text);
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
}
html { scroll-behavior: smooth; }
body { position: relative; min-height: 100vh; width: 100%; }

a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.85; }
button { font-family: inherit; cursor: pointer; }
[hidden], .is-hidden { display: none !important; }
.rotate-180 { transform: rotate(180deg); }
.status-tone-muted { color: var(--text-muted) !important; }
.status-tone-warn { color: var(--warn) !important; }
.status-tone-ok { color: var(--ok) !important; }
.status-tone-danger { color: var(--danger) !important; }
.nav-inner.has-mobile-nav { position: relative; }

/* ===== Декоративная сетка-фон ===== */
.grid-bg {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 1200px 800px at 50% 0%, black 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 1200px 800px at 50% 0%, black 30%, transparent 90%);
}

.app-shell { position: relative; z-index: 1; }


/* =============== NAVBAR =============== */

/* Pill-навбар: парит над контентом, дышит от краёв окна.
   Активный: прячется при скролле вниз, появляется при скролле вверх (см. mobile-nav.js). */
.nav {
  position: sticky; top: 16px; z-index: 50;
  background: transparent;
  padding: 0 16px;
  margin-top: 16px;
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 220ms ease;
  will-change: transform;
}
.nav.nav-hidden {
  transform: translateY(calc(-100% - 16px));
  opacity: 0;
  pointer-events: none;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 8px 12px 8px 24px;
  display: flex; align-items: center; gap: 16px;
  min-height: 56px;
  background: rgba(15, 15, 18, 0.85);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: min-height 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
              padding 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
              background 250ms ease,
              border-color 250ms ease,
              box-shadow 250ms ease,
              max-width 350ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* Состояние «scrolled» — pill сжимается, фон чуть плотнее, лого мельче.
   Применяется при scrollY > 60 (см. mobile-nav.js). */
.nav.scrolled { margin-top: 6px; }
.nav.scrolled .nav-inner {
  min-height: 46px;
  padding: 4px 8px 4px 16px;
  max-width: 880px;
  background: rgba(12, 12, 16, 0.96);
  border-color: rgba(255, 215, 0, 0.18);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 215, 0, 0.06);
  gap: 12px;
}
.nav.scrolled .nav-links { gap: 4px; }
.nav.scrolled .nav-links > a:not(.btn) { font-size: 13px; padding: 6px 10px; }
.nav .logo-mark { transition: width 250ms, height 250ms, font-size 250ms, border-radius 250ms; }
.nav.scrolled .logo-mark { width: 26px; height: 26px; font-size: 12px; border-radius: 6px; }
.nav .logo .brand-name { transition: font-size 250ms; }
.nav.scrolled .logo .brand-name { font-size: 15px; }
/* На мобиле pill сжимается до прямоугольника с большими радиусами,
   чтобы бургер-меню не выпрыгивало за края окна. */
@media (max-width: 800px) {
  .nav { top: 12px; padding: 0 12px; }
  .nav-inner {
    padding: 6px 8px 6px 16px;
    border-radius: 18px;
    min-height: 52px;
  }
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
/* Лого: текст «Юрист» рядом + жёлтая плашка с «Ai» внутри. */
.logo .brand-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}
.logo-mark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent), #ffb800);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #000;
  box-shadow: 0 4px 14px rgba(255, 215, 0, 0.22);
  flex-shrink: 0;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: -0.02em;
  line-height: 1;
  user-select: none;
}
/* Иконка внутри плашки (для совместимости со старыми страницами) */
.logo-mark .icon { width: 18px; height: 18px; stroke-width: 2.2; }

/* Класс остался для обратной совместимости со старыми страницами;
   на обновлённых страницах не используется. */
.brand-ai {
  display: inline-flex; align-items: center;
  padding: 2px 9px;
  background: linear-gradient(135deg, var(--accent), #ffb800);
  color: #000;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  margin-left: 4px;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.22);
}

.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a:not(.btn) {
  padding: 8px 14px;
  font-size: 13.5px; color: var(--text-dim);
  border-radius: 7px;
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}
.nav-links a:not(.btn):hover { color: var(--text); background: rgba(255,255,255,0.04); }


/* =============== BUTTONS =============== */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 7px;
  font-weight: 600; font-size: 13.5px;
  border: 0; cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
  background: var(--accent);
  color: #000;
  text-decoration: none;
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: wait; }

.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: var(--radius); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }

.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-2); border-color: var(--border-hover); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #ff7373; }

.btn .icon { width: 15px; height: 15px; }


/* =============== INPUTS / FORMS =============== */

.field { margin-bottom: 16px; }
.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

input, select, textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  transition: all var(--transition);
  outline: 0;
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus,
input[type="number"]:focus {
  border-color: var(--accent) !important;
  background: var(--bg-3) !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.06) !important;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset !important;
  caret-color: var(--text);
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  filter: invert(0.7);
}
textarea {
  font-family: inherit;
  font-size: 14.5px;
  resize: vertical; min-height: 80px;
  line-height: 1.5;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }


/* =============== ICONS =============== */

.icon { width: 1em; height: 1em; vertical-align: -0.15em; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }


/* =============== BADGES =============== */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge.b-accent { background: var(--accent); color: #000; }
.badge.b-danger { background: rgba(255, 87, 87, 0.12); color: var(--danger); border: 1px solid rgba(255, 87, 87, 0.3); }
.badge.b-warn { background: rgba(255, 181, 71, 0.12); color: var(--warn); border: 1px solid rgba(255, 181, 71, 0.3); }
.badge.b-info { background: rgba(110, 197, 255, 0.12); color: var(--info); border: 1px solid rgba(110, 197, 255, 0.3); }
.badge.b-ok { background: rgba(95, 217, 122, 0.12); color: var(--ok); border: 1px solid rgba(95, 217, 122, 0.3); }
.badge.b-glass { background: var(--bg-2); color: var(--text-dim); border: 1px solid var(--border); }


/* =============== MODAL =============== */

.modal-bg {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-bg.visible { display: flex; }
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.modal h3 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.01em; }
.modal-sub { color: var(--text-dim); margin-bottom: 24px; font-size: 14px; }


/* =============== SECTIONS =============== */

.section {
  padding: 96px 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.section-h {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 20px;
}
.section-h::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--accent);
}
.section-title {
  font-size: 36px; line-height: 1.1; letter-spacing: -0.02em;
  font-weight: 600; margin-bottom: 14px;
  max-width: 720px;
}
.section-title .accent {
  color: var(--accent);
}
.section-sub {
  font-size: 16px; color: var(--text-dim);
  max-width: 580px; margin-bottom: 40px;
  line-height: 1.55;
}


/* =============== TERMINAL =============== */

/* Wrapper для свечения — псевдо-элемент должен быть снаружи overflow:hidden */
.terminal-wrap {
  position: relative;
  isolation: isolate;
  /* Парящая анимация: бóльшая амплитуда (±8px) + лёгкий наклон + плавное вращение
     для впечатления «свободно висит в пространстве» */
  animation: terminal-float 8s ease-in-out infinite;
  transform-origin: 50% 60%;
  will-change: transform;
}
@keyframes terminal-float {
  0%, 100% { transform: translateY(0)    rotate(0deg)     scale(1); }
  25%      { transform: translateY(-6px) rotate(0.3deg)   scale(1.005); }
  50%      { transform: translateY(-9px) rotate(0deg)     scale(1.01); }
  75%      { transform: translateY(-6px) rotate(-0.3deg)  scale(1.005); }
}
.terminal-wrap::after {
  content: '';
  position: absolute;
  left: 6%; right: 6%;
  bottom: -42px;
  height: 48px;
  background: radial-gradient(ellipse at center top, rgba(255, 215, 0, 0.22), transparent 70%);
  filter: blur(20px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 400ms;
  /* Свечение пульсирует синхронно с парением: расширяется когда terminal выше */
  animation: terminal-glow 8s ease-in-out infinite;
}
@keyframes terminal-glow {
  0%, 100% { opacity: 0.55; transform: scaleX(0.85); }
  50%      { opacity: 1;    transform: scaleX(1.10); }
}
.terminal-wrap:hover::after { opacity: 1; }

.terminal {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  /* Эффект «парящего» элемента:
     - крупная мягкая тень снизу (объёмность)
     - тонкое золотое свечение для премиальности
     - inset-блик сверху (как на стекле)
  */
  box-shadow:
    0 32px 56px -16px rgba(0, 0, 0, 0.65),
    0 12px 28px -8px rgba(255, 215, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.terminal-wrap:hover .terminal {
  transform: translateY(-4px);
  box-shadow:
    0 40px 72px -16px rgba(0, 0, 0, 0.75),
    0 16px 36px -8px rgba(255, 215, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* Уважаем prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .terminal-wrap,
  .terminal-wrap::after { animation: none; }
}
.terminal-header {
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted);
  font-size: 11px;
}
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots .d { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.terminal-body { padding: 20px 24px; }
.tline { color: var(--text-dim); margin-bottom: 8px; }
.tline.cmd { color: var(--text); }
.tline.cmd::before { content: '$ '; color: var(--accent); }
.tline.out { color: var(--text); padding-left: 14px; border-left: 2px solid var(--accent); margin: 12px 0; }
.tline .key { color: var(--accent); }
.tline .num { color: var(--info); }
.tline .ok { color: var(--ok); }
.tline .warn { color: var(--warn); }
.tline .err { color: var(--danger); }
.tline.dim { color: var(--text-muted); font-size: 12px; }
.cursor { display: inline-block; width: 8px; height: 14px; background: var(--accent); animation: blink 1s infinite; vertical-align: middle; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }


/* =============== FOOTER =============== */

footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px 32px;
  background: var(--bg-1);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 40px; flex-wrap: wrap;
}
.footer-left .copy {
  color: var(--text-muted);
  font-size: 12px; margin-top: 12px;
  font-family: var(--mono);
}
.footer-left .disclaimer {
  color: var(--text-muted);
  font-size: 11px; margin-top: 8px; max-width: 480px;
  line-height: 1.5;
}
.footer-links { display: flex; gap: 32px; }
.footer-links h5 {
  font-family: var(--mono); font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.footer-links ul { list-style: none; }
.footer-links li { margin: 6px 0; }
.footer-links a { color: var(--text-dim); font-size: 13.5px; }
.footer-links a:hover { color: var(--text); }


/* =============== MOBILE NAV (бургер) =============== */

.nav-toggle {
  display: none;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 8px;
  align-items: center; justify-content: center;
  cursor: pointer;
  margin-left: auto;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle .icon { width: 18px; height: 18px; }
.nav-mobile {
  display: none;
  position: absolute;
  top: 100%; right: 16px; left: 16px;
  margin-top: 8px;
  padding: 8px;
  background: rgba(15, 15, 18, 0.95);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  z-index: 60;
}
.nav-mobile.visible { display: block; }
.nav-mobile a, .nav-mobile button {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 7px;
  color: var(--text); text-decoration: none;
  font-size: 14.5px;
  background: transparent; border: 0; width: 100%; text-align: left;
  font-family: inherit;
}
.nav-mobile a:hover, .nav-mobile button:hover { background: var(--bg-2); }
.nav-mobile .icon { width: 16px; height: 16px; color: var(--text-dim); }


/* =============== HELPERS =============== */

.muted { color: var(--text-dim); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.flex { display: flex; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }


/* =============== MEDIA =============== */

@media (max-width: 800px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .version-tag { display: none; }
  .section { padding: 72px 20px; }
  .section-title { font-size: 28px; }
  .section-sub { font-size: 15px; margin-bottom: 36px; }
  .footer-inner { flex-direction: column; gap: 24px; }
}
