/* zametkiai.ru — современный справочник по работе с ИИ */
:root {
  --bg: #f8fafc;
  --bg-elev: #ffffff;
  --bg-soft: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --accent: #4f46e5;
  --accent-2: #0284c7;
  --accent-soft: rgba(79, 70, 229, 0.10);
  --good-bg: rgba(16, 185, 129, 0.10);
  --good-border: rgba(16, 185, 129, 0.35);
  --good-text: #047857;
  --bad-bg: rgba(239, 68, 68, 0.08);
  --bad-border: rgba(239, 68, 68, 0.30);
  --bad-text: #b91c1c;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1120px;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-elev: #111827;
  --bg-soft: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #1f2937;
  --accent: #818cf8;
  --accent-2: #38bdf8;
  --accent-soft: rgba(129, 140, 248, 0.16);
  --good-bg: rgba(16, 185, 129, 0.14);
  --good-border: rgba(16, 185, 129, 0.40);
  --good-text: #34d399;
  --bad-bg: rgba(239, 68, 68, 0.14);
  --bad-border: rgba(239, 68, 68, 0.38);
  --bad-text: #f87171;
  --code-bg: #060a14;
  --code-text: #e2e8f0;
  --shadow: 0 14px 36px -14px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(900px 420px at 12% -10%, rgba(79, 70, 229, 0.10), transparent 60%),
    radial-gradient(700px 380px at 88% -5%, rgba(14, 165, 233, 0.10), transparent 55%);
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 1.08rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand-badge {
  font-size: 0.72rem;
  font-weight: 650;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 550;
  transition: color 0.15s ease;
}
.nav a:hover, .nav a.active {
  color: var(--text);
  text-decoration: none;
}

.theme-btn {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.theme-btn:hover { border-color: var(--accent); }

/* Hero */
.hero {
  padding: 58px 0 36px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 650;
  margin-bottom: 18px;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
  max-width: 820px;
}
.hero h1 .grad {
  background: linear-gradient(110deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 0 28px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 650;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(79, 70, 229, 0.55);
}
.btn-secondary {
  background: var(--bg-elev);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--accent); }

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.stat-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}
.stat-val {
  font-size: 1.04rem;
  font-weight: 700;
  margin-top: 4px;
}

/* Sections */
.section {
  padding: 40px 0;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}
.section-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  letter-spacing: -0.025em;
}
.section-sub {
  margin: 6px 0 0;
  color: var(--text-muted);
  max-width: 680px;
}

/* Cards & Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  transform: translateY(-2px);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 650;
  background: var(--accent-soft);
  color: var(--accent);
}
.card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.32;
  letter-spacing: -0.015em;
}
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }
.card p {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 0.94rem;
  flex: 1;
}
.card-link {
  font-weight: 650;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Filter bar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.search-input {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.9rem;
  min-width: 240px;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Comparison Before/After */
.compare-box {
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid var(--border);
}
.compare-bad {
  background: var(--bad-bg);
  border-color: var(--bad-border);
}
.compare-good {
  background: var(--good-bg);
  border-color: var(--good-border);
}
.compare-label {
  font-size: 0.82rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.compare-bad .compare-label { color: var(--bad-text); }
.compare-good .compare-label { color: var(--good-text); }

/* Code / Prompt blocks */
.code-wrap {
  position: relative;
  margin: 14px 0;
  border-radius: 12px;
  background: var(--code-bg);
  border: 1px solid rgba(148, 163, 184, 0.20);
  overflow: hidden;
}
.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 0.78rem;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.copy-btn {
  background: rgba(255, 255, 255, 0.09);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.18); }
.code-wrap pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--code-text);
  white-space: pre-wrap;
  word-break: break-word;
}

code.inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Table */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  background: var(--bg-soft);
  font-weight: 700;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
tr:last-child td { border-bottom: none; }

/* Checklist */
.checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
}
.check-item input {
  margin-top: 4px;
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}
.check-item.checked {
  border-color: var(--good-border);
  background: var(--good-bg);
}
.check-item strong { display: block; font-size: 0.95rem; }
.check-item span { display: block; font-size: 0.85rem; color: var(--text-muted); }

/* Article Layout */
.article-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 36px 0 60px;
}
.breadcrumbs {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.article-wrap h1 {
  font-size: clamp(1.75rem, 3.6vw, 2.55rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin: 12px 0 16px;
}
.article-lead {
  font-size: 1.08rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.article-wrap h2 {
  margin: 34px 0 12px;
  font-size: 1.42rem;
  letter-spacing: -0.02em;
}
.article-wrap h3 {
  margin: 22px 0 8px;
  font-size: 1.12rem;
}
.article-wrap ul, .article-wrap ol {
  padding-left: 22px;
}
.article-wrap li { margin-bottom: 8px; }
.callout {
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  margin: 22px 0;
  font-size: 0.95rem;
}
.article-nav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 28px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }

.hidden { display: none !important; }

@media (max-width: 680px) {
  .header-inner { height: auto; padding: 12px 0; flex-wrap: wrap; }
  .nav { gap: 14px; }
  .hero { padding: 36px 0 24px; }
  .search-input { width: 100%; min-width: 0; }
}
