/* ============ Azy AI — design system ============
   Референс: neuemontreal.com — крупная дисплейная типографика,
   спейсинг в навигации, высокий контраст, номер темы как графика. */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0b0a09;
  --bg-elevated: #151412;
  --bg-card: #181613;
  --line: rgba(243, 241, 234, 0.1);
  --line-strong: rgba(243, 241, 234, 0.22);
  --text: #f3f1ea;
  --text-muted: #a19c8f;
  --text-dim: #6b675e;
  --accent: #d7ff3e;
  --accent-dim: #9db02c;
  --amber: #ffb454;
  --rose: #ff6b57;
  --code-bg: #100f0d;

  --f-display: 'Unbounded', sans-serif;
  --f-body: 'Inter', sans-serif;
  --f-mono: 'JetBrains Mono', monospace;

  --container: 1180px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  /* subtle film-grain texture so the flat dark bg doesn't feel dead */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #0b0a09; }

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 32px; }

/* ---------------- Topbar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: rgba(11, 10, 9, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand em { font-style: normal; color: var(--accent); }

.topnav { display: flex; align-items: center; gap: 34px; }
.topnav a {
  font-family: var(--f-display);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.topnav a:hover, .topnav a.active { color: var(--text); border-color: var(--accent); }

.search-trigger {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 13px; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 16px; cursor: pointer; background: transparent;
  transition: border-color 0.15s, color 0.15s;
}
.search-trigger:hover { border-color: var(--line-strong); color: var(--text-muted); }
.search-trigger kbd {
  font-family: var(--f-mono); font-size: 11px; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
}

.mobile-toggle { display: none; }

@media (max-width: 880px) {
  .topnav-links { display: none; }
  .mobile-toggle {
    display: block; background: none; border: none; color: var(--text);
    font-size: 22px; cursor: pointer;
  }
}

/* ---------------- Search overlay ---------------- */

.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(11, 10, 9, 0.92);
  backdrop-filter: blur(6px);
  display: none;
  flex-direction: column;
  align-items: center;
  padding-top: 12vh;
}
.search-overlay.open { display: flex; }
.search-box { width: min(720px, 90vw); }
.search-box input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--line-strong);
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(22px, 4vw, 36px);
  color: var(--text);
  padding: 12px 0;
  outline: none;
}
.search-box input::placeholder { color: var(--text-dim); }
.search-hint { margin-top: 10px; font-family: var(--f-mono); font-size: 12px; color: var(--text-dim); }
.search-results { margin-top: 28px; max-height: 55vh; overflow-y: auto; }
.search-result {
  display: block; padding: 16px 4px; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.search-result:hover .sr-title { color: var(--accent); }
.sr-cat { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--text-dim); text-transform: uppercase; }
.sr-title { font-family: var(--f-display); font-size: 18px; margin: 4px 0 6px; transition: color 0.15s; }
.sr-snippet { font-size: 14px; color: var(--text-muted); }
.sr-snippet mark { background: var(--accent); color: #0b0a09; padding: 0 2px; }
.search-close {
  position: absolute; top: 26px; right: 32px;
  background: none; border: none; color: var(--text-muted);
  font-size: 26px; cursor: pointer; line-height: 1;
}

/* ---------------- Hero ---------------- */

.hero {
  padding: 120px 0 90px;
  position: relative;
}
.hero-eyebrow {
  font-family: var(--f-mono); font-size: 13px; color: var(--accent);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 22px;
  display: flex; align-items: center; gap: 10px;
}
.hero-eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.hero h1 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(42px, 8vw, 108px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 30px;
  max-width: 16ch;
}
.hero h1 .accent { color: var(--accent); }
.hero-sub {
  font-size: clamp(17px, 2vw, 21px);
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 0 44px;
  line-height: 1.6;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

.btn {
  font-family: var(--f-display); font-weight: 600; font-size: 13px;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 17px 30px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; display: inline-flex; align-items: center; gap: 10px;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #0b0a09; }
.btn-primary:hover { background: #e4ff70; }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line); margin-top: 90px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.hero-stat { background: var(--bg); padding: 26px 4px 10px; }
.hero-stat b {
  display: block; font-family: var(--f-display); font-weight: 700;
  font-size: clamp(30px, 4vw, 52px); color: var(--text); line-height: 1;
}
.hero-stat span { font-size: 13px; color: var(--text-muted); }
@media (max-width: 720px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------- Section shell ---------------- */

.section { padding: 100px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: 56px; }
.section-eyebrow {
  font-family: var(--f-mono); font-size: 12px; color: var(--accent);
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 16px;
}
.section-head h2 {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(30px, 4.4vw, 54px); line-height: 1.05; margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.section-head p { color: var(--text-muted); font-size: 17px; line-height: 1.65; margin: 0; }

/* ---------------- About: manifesto blocks ---------------- */

.manifesto-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.manifesto-col { background: var(--bg); padding: 40px; }
.manifesto-col h3 {
  font-family: var(--f-display); font-size: 13px; letter-spacing: 0.1em;
  text-transform: uppercase; margin: 0 0 24px;
}
.manifesto-col.no h3 { color: var(--text-dim); }
.manifesto-col.yes h3 { color: var(--accent); }
.manifesto-col ul { list-style: none; margin: 0; padding: 0; }
.manifesto-col li {
  padding: 14px 0; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.5;
}
.manifesto-col li:first-of-type { border-top: none; }
.manifesto-col.no li { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(255,107,87,0.5); text-decoration-thickness: 1.5px; }
.manifesto-col.yes li { color: var(--text); }
.manifesto-col.yes li::before { content: "→ "; color: var(--accent); font-family: var(--f-mono); text-decoration: none; }
@media (max-width: 720px) { .manifesto-grid { grid-template-columns: 1fr; } }

.pull-line {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(22px, 3vw, 32px); line-height: 1.3;
  max-width: 24ch; margin: 56px 0 0; color: var(--text);
}
.pull-line .accent { color: var(--accent); }

/* ---------------- Categories ---------------- */

.cat-list { border-top: 1px solid var(--line); }
.cat-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 34px 0; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: padding-left 0.2s;
}
.cat-row:hover { padding-left: 14px; }
.cat-row-left { display: flex; align-items: baseline; gap: 22px; }
.cat-index { font-family: var(--f-mono); font-size: 13px; color: var(--text-dim); width: 26px; }
.cat-name { font-family: var(--f-display); font-weight: 600; font-size: clamp(20px, 3vw, 30px); }
.cat-row-right { display: flex; align-items: center; gap: 22px; }
.cat-count { font-family: var(--f-mono); font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.cat-arrow { font-size: 22px; color: var(--text-dim); transition: transform 0.2s, color 0.2s; }
.cat-row:hover .cat-arrow { transform: translateX(4px); color: var(--accent); }

/* ---------------- Topic rows (inside category view) ---------------- */

.topic-list { border-top: 1px solid var(--line); }
.topic-row {
  display: grid; grid-template-columns: 70px 1fr auto;
  gap: 24px; align-items: start; padding: 30px 0; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.topic-row-num { font-family: var(--f-mono); font-size: 14px; color: var(--accent); padding-top: 4px; }
.topic-row-title { font-family: var(--f-display); font-weight: 600; font-size: 21px; margin: 0 0 8px; transition: color 0.15s; }
.topic-row:hover .topic-row-title { color: var(--accent); }
.topic-row-teaser { color: var(--text-muted); font-size: 15px; line-height: 1.55; max-width: 68ch; }
.topic-row-arrow { font-size: 20px; color: var(--text-dim); padding-top: 4px; }

/* ---------------- Topic detail view ---------------- */

.topic-header { position: relative; padding: 100px 0 60px; overflow: hidden; }
.topic-ghost-num {
  position: absolute; top: -0.18em; right: -0.02em;
  font-family: var(--f-display); font-weight: 800; font-size: clamp(160px, 26vw, 380px);
  color: var(--text); opacity: 0.045; line-height: 1; pointer-events: none;
  user-select: none;
}
.topic-crumb {
  font-family: var(--f-mono); font-size: 12px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 22px;
}
.topic-crumb a:hover { color: var(--accent); }
.topic-tag {
  display: inline-block; font-family: var(--f-mono); font-size: 12px;
  color: var(--accent); border: 1px solid rgba(215,255,62,0.35); border-radius: 999px;
  padding: 5px 14px; margin-bottom: 24px;
}
.topic-header h1 {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(34px, 6vw, 68px); line-height: 1.02; letter-spacing: -0.01em;
  max-width: 20ch; margin: 0; position: relative; z-index: 1;
}

.topic-intro {
  font-size: clamp(18px, 2.1vw, 22px); line-height: 1.65; color: var(--text);
  max-width: 66ch; padding: 0 0 60px;
  font-weight: 400;
}
.topic-intro p:first-child::first-letter {
  font-family: var(--f-display); font-weight: 700; font-size: 1.7em;
  color: var(--accent); padding-right: 3px;
}

.topic-body { max-width: 72ch; padding-bottom: 40px; }
.topic-body h2 {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(22px, 3vw, 30px); line-height: 1.2;
  margin: 64px 0 22px; letter-spacing: -0.005em;
  scroll-margin-top: 100px;
}
.topic-body h2:first-child { margin-top: 0; }
.topic-body p { margin: 0 0 20px; color: var(--text); }
.topic-body strong { color: var(--text); font-weight: 600; }
.topic-body strong:not(:has(+ *)) {}
.topic-body em { color: var(--text-muted); }
.topic-body a { color: var(--accent); border-bottom: 1px solid rgba(215,255,62,0.4); }
.topic-body a:hover { border-color: var(--accent); }

.topic-body ul, .topic-body ol { padding-left: 0; margin: 0 0 20px; list-style: none; }
.topic-body ul li, .topic-body ol li {
  position: relative; padding-left: 26px; margin-bottom: 14px; color: var(--text);
  line-height: 1.6;
}
.topic-body ul li::before {
  content: "—"; position: absolute; left: 0; color: var(--accent);
}
.topic-body ol { counter-reset: ol; }
.topic-body ol li { counter-increment: ol; }
.topic-body ol li::before {
  content: counter(ol) "."; position: absolute; left: 0; color: var(--accent);
  font-family: var(--f-mono); font-size: 14px;
}

.topic-body pre {
  position: relative;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 22px 24px; overflow-x: auto; margin: 8px 0 28px;
}
.topic-body pre code {
  display: block;
  font-family: var(--f-mono); font-size: 14.5px; line-height: 1.6;
  color: #d7ffb0; white-space: pre-wrap; word-break: break-word;
  padding-right: 84px;
}
.prompt-label {
  font-family: var(--f-display); font-weight: 600; font-size: 14px;
  color: var(--text-muted); margin: 30px 0 8px;
}
.topic-body-scroll > .prompt-label:first-child { margin-top: 0; }
.prompt-note {
  font-size: 14px; color: var(--text-dim); margin: -18px 0 26px; line-height: 1.5;
}

.copy-btn {
  position: absolute; top: 14px; right: 14px;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.02em;
  color: var(--text-dim); background: var(--bg-elevated);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 10px; cursor: pointer;
  opacity: 0; transform: translateY(-2px);
  transition: opacity 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.topic-body pre:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1; transform: translateY(0);
}
.copy-btn:hover { color: var(--text); border-color: var(--line-strong); }
.copy-btn.copied { opacity: 1; color: var(--accent); border-color: rgba(215,255,62,0.4); }
.copy-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
@media (max-width: 720px) {
  /* нет hover на тачскринах — кнопка всегда видна */
  .copy-btn { opacity: 1; transform: none; }
  .topic-body pre code { padding-right: 0; padding-bottom: 40px; }
}
.topic-body p code, .topic-body li code {
  font-family: var(--f-mono); font-size: 0.88em; background: var(--bg-elevated);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; color: var(--accent);
}

.topic-body table { width: 100%; min-width: 640px; border-collapse: collapse; margin: 8px 0 30px; font-size: 15px; }
.topic-body th, .topic-body td {
  border: 1px solid var(--line); padding: 12px 14px; text-align: left; vertical-align: top;
  min-width: 140px;
}
.topic-body th {
  font-family: var(--f-display); font-weight: 500; font-size: 12px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent);
  background: var(--bg-elevated);
}
.topic-body-scroll { overflow-x: auto; }

.mini-task {
  max-width: 72ch; margin: 20px 0 0; padding: 32px 36px;
  background: var(--bg-card); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.mini-task-label {
  font-family: var(--f-mono); font-size: 12px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px; display: block;
}
.mini-task p { margin: 0; color: var(--text); line-height: 1.6; }

.topic-nav {
  display: flex; justify-content: space-between; gap: 20px;
  border-top: 1px solid var(--line); margin-top: 80px; padding-top: 40px;
}
.topic-nav-btn { max-width: 42%; cursor: pointer; }
.topic-nav-btn.next { text-align: right; margin-left: auto; }
.topic-nav-dir { font-family: var(--f-mono); font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.topic-nav-title { font-family: var(--f-display); font-weight: 600; font-size: 18px; margin-top: 8px; transition: color 0.15s; }
.topic-nav-btn:hover .topic-nav-title { color: var(--accent); }

/* ---------------- Glossary / FAQ ---------------- */

.glossary-group { margin-bottom: 50px; }
.glossary-group h3 {
  font-family: var(--f-display); font-size: 13px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 20px;
}
.glossary-term { padding: 16px 0; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.6; }
.glossary-term:first-child { border-top: none; }
.glossary-term strong { color: var(--text); }
.glossary-term a, .faq-a a {
  color: var(--accent); border-bottom: 1px solid rgba(215,255,62,0.4);
}
.glossary-term a:hover, .faq-a a:hover { border-color: var(--accent); }

.faq-item { border-top: 1px solid var(--line); padding: 26px 0; cursor: pointer; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-q {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  font-family: var(--f-display); font-weight: 600; font-size: 19px;
}
.faq-q .plus { color: var(--accent); font-family: var(--f-mono); font-size: 20px; transition: transform 0.2s; flex-shrink: 0; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; color: var(--text-muted); font-size: 16px; line-height: 1.6; }
.faq-item.open .faq-a { max-height: 400px; padding-top: 16px; }

/* ---------------- Footer ---------------- */

.site-footer { border-top: 1px solid var(--line); padding: 70px 0 40px; }
.footer-top {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 30px; flex-wrap: wrap; margin-bottom: 50px;
}
.footer-line {
  font-family: var(--f-display); font-weight: 500; font-size: clamp(20px, 3vw, 30px);
  max-width: 30ch; line-height: 1.3;
}
.footer-bottom {
  display: flex; justify-content: space-between; color: var(--text-dim);
  font-size: 13px; font-family: var(--f-mono); flex-wrap: wrap; gap: 12px;
}

/* ---------------- Page transitions & utility ---------------- */

.view { animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.hidden { display: none !important; }

@media (max-width: 720px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 90px 0 60px; }
  .section { padding: 70px 0; }
  .topbar { padding: 16px 20px; }
  .topic-row { grid-template-columns: 40px 1fr; }
  .topic-row-arrow { display: none; }
}
