/* ============================================================
   AI Tools Portal — DOGMA corporate theme
   Палитра снята со скриншота-референса (приближённая).
   Точные бренд-цвета правятся здесь, в :root.
   ============================================================ */

/* ------------------------------------------------------------
   ФИРМЕННЫЙ ШРИФТ TT DOGMA
   Сейчас портал использует Montserrat (подключён в <head> страниц).
   Когда появятся файлы TT Dogma с веб-лицензией:
   1) положи их в  public/assets/fonts/  (лучше формат .woff2)
   2) раскомментируй блок ниже и укажи реальные имена файлов/начертания
   3) больше ничего менять не нужно — каскад в --sans подхватит шрифт сам
   ------------------------------------------------------------ */
/*
@font-face {
  font-family: "TT Dogma";
  src: url("/assets/fonts/TTDogma-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "TT Dogma";
  src: url("/assets/fonts/TTDogma-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "TT Dogma";
  src: url("/assets/fonts/TTDogma-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
*/

:root {
  /* Base — бренд-серый #dddddd и производные */
  --bg:            #ffffff;
  --bg-muted:      #dddddd;      /* фирменный серый — фон плиток */
  --bg-muted-2:    #d2d2d2;      /* hover-состояние плиток */
  --surface:       #ffffff;
  --line:          #d0d0d0;
  --line-soft:     #e2e2e2;

  /* Ink */
  --ink:           #1c1c1e;      /* основной чёрный текст */
  --ink-dim:       #63636a;
  --ink-faint:     #8c8c93;

  /* Brand accent — фирменный песочный #ddb184 и производные */
  --accent:        #ddb184;      /* фон акцентных кнопок/шапки */
  --accent-strong: #cf9a63;      /* hover / текст-акцент */
  --accent-ink:    #ffffff;      /* текст на акценте */
  --accent-soft:   #f4e6d6;      /* лёгкая заливка под иконки/теги */
  --accent-border: #ecd8c1;

  --radius:        16px;
  --radius-lg:     22px;
  --radius-pill:   999px;
  --maxw:          1160px;
  --shadow-sm:     0 1px 2px rgba(24,24,26,0.04);
  --shadow:        0 8px 24px -14px rgba(24,24,26,0.18);
  --shadow-lg:     0 20px 48px -24px rgba(24,24,26,0.28);

  --logo-ink:      #000000;      /* цвет надписи DOGMA в шапке */

  --sans: "TT Dogma", "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

/* ------------------------------------------------------------
   ТЁМНАЯ ТЕМА (фиолетово-синяя)
   Переключается атрибутом data-theme="dark" на <html> — ставится
   скриптом assets/js/theme.js. Меняет только значения переменных,
   вся остальная вёрстка ниже их переиспользует без изменений.
   ------------------------------------------------------------ */
:root[data-theme="dark"] {
  --bg:            #0b0c18;
  --bg-muted:      #171933;
  --bg-muted-2:    #20223f;
  --surface:       #14152b;
  --line:          #2b2d4d;
  --line-soft:     #1f2140;

  --ink:           #eef0fb;
  --ink-dim:       #a2a7c9;
  --ink-faint:     #6b6f95;

  --accent:        #6c63ff;
  --accent-strong: #8f86ff;
  --accent-ink:    #ffffff;
  --accent-soft:   rgba(108,99,255,0.16);
  --accent-border: rgba(108,99,255,0.4);

  --logo-ink:      #ffffff;

  --shadow-sm:     0 1px 2px rgba(0,0,0,0.35);
  --shadow:        0 10px 26px -14px rgba(0,0,0,0.6);
  --shadow-lg:     0 22px 50px -24px rgba(0,0,0,0.7);
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(1100px 560px at 12% -8%, rgba(108,99,255,0.16), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, rgba(108,99,255,0.08), transparent 55%),
    var(--bg);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent-strong); text-transform: none;
  display: inline-flex; align-items: center; gap: 9px;
}
.eyebrow::before {
  content: ""; width: 20px; height: 2px; border-radius: 2px;
  background: var(--accent); display: inline-block;
}

/* ---------- Top bar ---------- */
.topbar {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  position: sticky; top: 0; z-index: 20;
}
.topbar__inner {
  display: flex; align-items: center; gap: 14px; height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__logo {
  font-family: "Montserrat", sans-serif;
  font-weight: 800; letter-spacing: 0.02em; font-size: 20px;
  color: var(--logo-ink);
  transition: color .2s ease;
}
.brand__divider { width: 1px; height: 22px; background: rgba(255,255,255,0.4); }
.brand__sub {
  font-size: 14px; font-weight: 500; color: var(--accent-ink);
  opacity: 0.92;
}
.topbar__spacer { flex: 1; }
.topbar__home {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--accent-ink); font-size: 14px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.16); transition: background .15s ease;
}
.topbar__home:hover { background: rgba(255,255,255,0.26); }
.topbar__home svg { width: 16px; height: 16px; }

/* ---------- Тумблер оформления ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px 7px 12px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.14);
  cursor: pointer; transition: background .18s ease, border-color .18s ease;
  font-family: "Montserrat", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { background: rgba(255,255,255,0.24); }
.theme-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.theme-toggle__dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: rgba(255,255,255,0.55);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.14);
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}
[data-theme="dark"] .theme-toggle__dot {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.28), 0 0 10px 1px rgba(255,255,255,0.5);
}
.theme-toggle__label {
  font-weight: 800; letter-spacing: 0.02em; font-size: 13px; color: #ffffff;
}

/* ---------- Breadcrumb ---------- */
.crumbs {
  font-size: 13.5px; color: var(--ink-faint);
  margin: 24px 0 0; display: flex; gap: 9px; align-items: center; flex-wrap: wrap;
}
.crumbs a { color: var(--ink-dim); }
.crumbs a:hover { color: var(--accent-strong); }
.crumbs__sep { color: var(--line); }

/* ---------- Page head ---------- */
.head { padding: 40px 0 28px; }
.head h1 {
  font-size: clamp(30px, 4vw, 46px); line-height: 1.06;
  letter-spacing: -0.02em; margin: 14px 0 12px; font-weight: 750; color: var(--ink);
}
.head p { color: var(--ink-dim); max-width: 62ch; margin: 0; font-size: 16.5px; }

/* ---------- Tile grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px; padding: 6px 0 64px;
}
.tile {
  position: relative; display: flex; flex-direction: column; gap: 22px;
  padding: 28px; min-height: 210px;
  background: var(--bg-muted); border: 1px solid transparent;
  border-radius: var(--radius-lg);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  overflow: hidden;
}
.tile[href]:hover {
  transform: translateY(-4px); background: var(--bg-muted-2);
  box-shadow: var(--shadow-lg);
}
.tile[href]:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.tile__icon {
  width: 60px; height: 60px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--surface); color: var(--accent-strong);
  box-shadow: var(--shadow-sm);
}
.tile__icon svg { width: 30px; height: 30px; }
.tile__title {
  display: block; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink);
  line-height: 1.3; min-height: calc(1.3em * 2);
}
.tile__desc { display: block; color: var(--ink-dim); font-size: 14px; margin-top: 6px; }
.tile__tag {
  position: absolute; top: 22px; right: 22px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent-strong); background: var(--accent-soft);
  border-radius: var(--radius-pill); padding: 4px 11px;
}
.tile--soon { opacity: 0.62; }
.tile--soon .tile__icon { color: var(--ink-faint); }
.tile--soon .tile__tag { color: var(--ink-faint); background: var(--bg-muted-2); }

/* ---------- Action buttons (inside tool) ---------- */
.actions {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px; padding: 8px 0 60px;
}
.action {
  display: flex; align-items: flex-start; gap: 18px; padding: 26px;
  background: var(--bg-muted); border: 1px solid transparent;
  border-radius: var(--radius-lg);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.action:hover { transform: translateY(-3px); background: var(--bg-muted-2); box-shadow: var(--shadow-lg); }
.action:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.action__icon {
  flex: none; width: 54px; height: 54px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface); color: var(--accent-strong); box-shadow: var(--shadow-sm);
}
.action__icon svg { width: 27px; height: 27px; }
.action--primary { background: var(--accent); }
.action--primary:hover { background: var(--accent-strong); }
.action--primary .action__t,
.action--primary .action__d { color: var(--accent-ink); }
.action--primary .action__d { opacity: 0.92; }
.action--primary .action__icon { background: rgba(255,255,255,0.9); color: var(--accent-strong); }
.action--primary .action__meta { color: var(--accent-ink); opacity: 0.9; }
.action__t { display: block; font-weight: 700; font-size: 18px; color: var(--ink); letter-spacing: -0.01em; }
.action__d { display: block; color: var(--ink-dim); font-size: 14px; margin-top: 5px; }
.action__meta {
  margin-top: 12px; font-size: 12.5px; font-weight: 500; color: var(--ink-faint);
  display: inline-flex; align-items: center; gap: 6px;
}
.action__meta svg { width: 14px; height: 14px; }

/* ---------- Video hero ---------- */
.hero-video {
  border-radius: var(--radius-lg); overflow: hidden; background: #000;
  margin: 4px 0 32px; box-shadow: var(--shadow);
}
.hero-video video, .hero-video iframe {
  width: 100%; aspect-ratio: 16 / 9; display: block; border: 0;
}
.hero-video__cap {
  padding: 13px 18px; font-size: 12.5px; font-weight: 500;
  color: var(--ink-faint); background: var(--bg-muted);
}

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 24px 0 36px; margin-top: 30px;
  font-size: 13px; color: var(--ink-faint);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ---------- Back link ---------- */
.back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--ink-dim);
  margin: 26px 0 0;
}
.back:hover { color: var(--accent-strong); }
.back svg { width: 16px; height: 16px; }

@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .head { padding: 28px 0 18px; }
  .brand__sub { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Плавающая кнопка баг-репорта ---------- */
.bugreport {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  background: none; border: none; padding: 0; margin: 0; overflow: visible;
}
.bugreport__trigger {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 9px;
  padding: 6px 6px 6px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transition: transform .15s ease, border-color .15s ease;
}
.bugreport__trigger::-webkit-details-marker { display: none; }
.bugreport__trigger::marker { content: ""; }
.bugreport__trigger::before { content: none !important; }
.bugreport__trigger:hover { transform: translateY(-2px); border-color: var(--accent-border); }
.bugreport__trigger:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
.bugreport__label {
  font-size: 12.5px; font-weight: 600; color: var(--ink-dim);
  white-space: nowrap;
}
.bugreport__icon {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #ffffff;
  transition: background .15s ease;
}
.bugreport__trigger:hover .bugreport__icon { background: var(--accent-strong); }
.bugreport__icon svg { width: 17px; height: 17px; }
@media (max-width: 560px) {
  .bugreport__label { display: none; }
  .bugreport__trigger { padding: 6px; }
}
.bugreport__panel {
  position: absolute; right: 0; bottom: 58px;
  width: 270px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 14px;
}
.bugreport__panel a {
  display: block; font-size: 13.5px; font-weight: 600; color: var(--ink);
  padding: 10px 11px; border-radius: 10px; transition: background .15s ease;
}
.bugreport__panel a:hover { background: var(--bg-muted); }
.bugreport__panel a.bugreport__view {
  font-size: 12.5px; font-weight: 500; color: var(--ink-dim);
  padding: 8px 11px 0;
}
.bugreport__panel .bugreport__hint {
  display: block; margin: 4px 0 2px; padding: 0 11px;
  font-size: 11px; color: var(--ink-faint);
}

/* ---------- Форма баг-репорта ---------- */
.bugreport__title {
  font-size: 13.5px; font-weight: 700; color: var(--ink);
  padding: 2px 2px 10px;
}
.bugreport__field {
  display: block; margin-bottom: 10px;
}
.bugreport__field span {
  display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-dim);
  margin-bottom: 4px;
}
.bugreport__field input,
.bugreport__field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg-muted); color: var(--ink);
  font-family: inherit; font-size: 13px; padding: 8px 10px;
  resize: vertical; transition: border-color .15s ease;
}
.bugreport__field input:focus,
.bugreport__field textarea:focus {
  outline: none; border-color: var(--accent-strong);
}
.bugreport__submit {
  width: 100%; border: none; cursor: pointer;
  background: var(--accent); color: #ffffff;
  font-family: inherit; font-weight: 700; font-size: 13px;
  padding: 10px; border-radius: 10px; transition: background .15s ease;
}
.bugreport__submit:hover { background: var(--accent-strong); }
.bugreport__submit:disabled { opacity: .6; cursor: default; }
.bugreport__status {
  min-height: 16px; margin-top: 8px; font-size: 12px; color: var(--ink-dim); text-align: center;
}
.bugreport__status.ok { color: #2e9c6a; }
.bugreport__status.err { color: #c0392b; }
@media (max-width: 560px) {
  .bugreport { right: 14px; bottom: 14px; }
}

/* ---------- Пошаговая инструкция (шаги с нумерацией и фото) ---------- */
.steps { display: flex; flex-direction: column; padding: 8px 0 40px; max-width: 720px; }
.step { position: relative; padding: 0 0 34px 54px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ""; position: absolute; left: 17px; top: 38px; bottom: 0;
  width: 1px; background: var(--line);
}
.step:last-child::before { display: none; }
.step__num {
  position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
  color: var(--accent-strong); font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.step h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 4px 0 6px; }
.step p { font-size: 13.5px; color: var(--ink-dim); margin: 0 0 10px; line-height: 1.55; }
.step .shot {
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, var(--bg-muted), var(--bg-muted) 10px, var(--surface) 10px, var(--surface) 20px);
  overflow: hidden; margin: 4px 0 10px; min-height: 160px;
  display: flex; align-items: center; justify-content: center;
}
.step .shot img { width: 100%; display: block; }
.step .shot__label { font-size: 12px; color: var(--ink-faint); padding: 10px; }
.step__link {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13px;
  padding: 9px 16px; border-radius: var(--radius-pill); margin: 2px 0 10px;
  transition: background .15s ease;
}
.step__link:hover { background: var(--accent-strong); }
.step__link svg { width: 14px; height: 14px; }

/* ---------- Диаграмма-связка (например VPN → Gemini) ---------- */
.flow {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 28px 20px; margin: 4px 0 6px;
  background: var(--bg-muted); border-radius: var(--radius-lg); flex-wrap: wrap;
}
.flow__card {
  flex: 1 1 200px; max-width: 230px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 16px; box-shadow: var(--shadow-sm);
}
.flow__icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-strong);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 10px;
}
.flow__icon svg { width: 22px; height: 22px; }
.flow__title { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.flow__desc { font-size: 12.5px; color: var(--ink-dim); margin-top: 4px; }
.flow__arrow { flex: none; color: var(--accent-strong); display: flex; align-items: center; }
.flow__arrow svg { width: 26px; height: 26px; }
.flow__note {
  text-align: center; font-size: 13.5px; color: var(--ink-dim);
  margin: 14px 0 30px; padding: 0 12px;
}
.flow__note b { color: var(--ink); }
@media (max-width: 560px) {
  .flow { flex-direction: column; }
  .flow__arrow svg { transform: rotate(90deg); }
}
