/* ============================================================
   Владимир Семакин — тёмная тема. Референс структуры: evdokimov.ai
   Шрифт: Geist (variable, self-hosted) — как на recca.ru
   Меняешь этот файл — меняется весь сайт.
   ============================================================ */

@font-face {
  font-family: Geist;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/geist-cyrillic.woff2) format("woff2");
  unicode-range: U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116;
}
@font-face {
  font-family: Geist;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/geist-latin.woff2) format("woff2");
  unicode-range: U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  color-scheme: dark;

  /* Фон и поверхности — тёплая тёмная зелень (solarpunk night) */
  --bg:      #10140e;
  --surface: #0c100a;
  --deep:    #090c07;
  --card:    #161c12;

  /* Текст — тёплый кремовый */
  --ink:   #f4f1e6;
  --dim:   #d8d4c2;
  --muted: #969482;
  --faint: #6e6d60;

  /* Линии */
  --line:      #37402c;
  --line-soft: #2a3222;

  /* Акценты — тёплые неоновые: янтарь, лайм, закатный коралл */
  --accent:      #ffc957;
  --accent-2:    #b8f03c;
  --accent-3:    #ff8a5c;
  --live:        #7ee65f;
  --accent-soft: rgba(255,201,87,.35);
  --grad-warm:   linear-gradient(100deg, #ffc957 0%, #ff8a5c 50%, #ff5e78 100%);
  --grad-lime:   linear-gradient(100deg, #b8f03c 0%, #7ee65f 100%);
  --grad-sun:    linear-gradient(100deg, #ffd66e 0%, #b8f03c 55%, #5cd6a8 100%);
  --sel-ink:     #1a1405;

  /* Шрифт — Geist везде */
  --font-body: Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: var(--font-body);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1200px;
  --radius: 24px;
}

* { box-sizing: border-box; }
::selection { background: var(--accent); color: var(--sel-ink); }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}
@media (min-width: 768px) { .wrap { padding-inline: 40px; } }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20,20,20,.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 16px;
}
.brand {
  font-weight: 700; font-size: 15px; letter-spacing: -.2px;
  white-space: nowrap;
}
.brand b { color: var(--accent); }
.nav { display: none; gap: 22px; align-items: center; }
@media (min-width: 900px) { .nav { display: flex; } }
.nav a {
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink);
  transition: color .15s;
}
.nav a:hover { color: var(--muted); }
.nav a.cta {
  background: #fff; color: #000;
  padding: 8px 18px; border-radius: 999px;
}
.nav a.cta:hover { background: #e5e5e5; color: #000; }

/* Мобильное меню */
.menu-btn {
  display: flex; flex-direction: column; gap: 4px;
  background: none; border: none; padding: 8px; cursor: pointer;
}
@media (min-width: 900px) { .menu-btn { display: none; } }
.menu-btn span { display: block; width: 24px; height: 2px; background: var(--ink); }
.mobile-nav {
  display: none;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 12px 24px 20px;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block; padding: 11px 0;
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--line-soft);
}
.mobile-nav a:last-child { border-bottom: none; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 80px; }
@media (min-width: 768px) { .hero { padding: 96px 0 112px; } }
.hero h1 {
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -.03em;
  font-weight: 800;
  margin: 0 0 24px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead {
  max-width: 560px;
  font-size: 19px; line-height: 1.45; font-weight: 500;
  color: var(--dim);
  margin: 0 0 36px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 14px; font-weight: 700;
  transition: background .15s, color .15s, border-color .15s;
  cursor: pointer;
}
.btn-light { background: #fff; color: #000; }
.btn-light:hover { background: #e5e5e5; }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #555; }
.btn-accent { background: var(--grad-lime); color: var(--sel-ink); box-shadow: 0 0 18px rgba(184,240,60,.25); }
.btn-accent:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ---------- Секции ---------- */
.section { padding: 72px 0; border-top: 1px solid var(--line); }
@media (min-width: 768px) { .section { padding: 96px 0; } }
.section h2 {
  font-size: clamp(30px, 4.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -.025em;
  font-weight: 700;
  margin: 0 0 20px;
  max-width: 640px;
}
.section .sub {
  color: var(--muted); font-size: 17px; max-width: 560px;
  margin: 0 0 44px;
}

/* Сетка карточек */
.grid { display: grid; gap: 20px; }
@media (min-width: 640px)  { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px)  { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Карточки ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex; flex-direction: column;
  transition: border-color .2s;
}
.card:hover { border-color: #555; }
.card h3 { font-size: 21px; line-height: 1.25; margin: 0 0 12px; font-weight: 700; }
.card p  { color: var(--muted); font-size: 15px; margin: 0 0 8px; }
.card .more {
  margin-top: auto; padding-top: 16px;
  color: var(--accent); font-size: 14px; font-weight: 700;
}
.card .more:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  background: #fff; color: #000;
  font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
  align-self: flex-start;
  margin-bottom: 20px;
}
.badge-accent { background: var(--accent); color: var(--sel-ink); }

/* Кейс: ЗАДАЧА / РЕШЕНИЕ / РЕЗУЛЬТАТ */
.case-label {
  display: block;
  color: var(--ink); font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  margin: 14px 0 3px;
}
.card p.case-text { margin: 0; }

/* ---------- Листинг статей (стиль /lab/) ---------- */
.page-head { padding: 56px 0 8px; }
.page-head h1 {
  font-size: clamp(36px, 6vw, 72px);
  letter-spacing: -.03em; line-height: 1.02;
  margin: 0 0 16px; font-weight: 800;
}
.page-head .standfirst {
  color: var(--dim); max-width: 620px; font-size: 17px;
}
.stamp {
  color: var(--faint); font-size: 13px; letter-spacing: .02em;
}
.stamp b { color: var(--live); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 8px; }
.filter-bar input[type="search"] {
  flex: 1 1 240px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font: inherit; font-size: 15px;
  padding: 11px 16px;
  outline: none;
}
.filter-bar input[type="search"]:focus { border-color: var(--accent-soft); }
.chip {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: #555; color: var(--ink); }
.chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.entry-list { display: flex; flex-direction: column; margin-top: 28px; }
.entry {
  border-top: 1px solid var(--line-soft);
  padding: 28px 0;
}
.entry:last-child { border-bottom: 1px solid var(--line-soft); }
.entry .meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  color: var(--faint); font-size: 13px;
  margin-bottom: 8px;
}
.entry .meta .no { color: var(--accent); font-weight: 700; }
.entry .meta .tag { color: var(--dim); }
.entry h3 {
  font-size: clamp(20px, 2.6vw, 27px);
  line-height: 1.2; letter-spacing: -.015em;
  margin: 0 0 8px; font-weight: 700;
}
.entry:hover h3 { color: var(--accent); }
.entry .dek { color: var(--muted); font-size: 15px; margin: 0; max-width: 720px; }

/* ---------- Статья ---------- */
.article {
  max-width: 760px;
  margin-inline: auto;
  padding: 56px 24px 80px;
}
.article h1 {
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.08; letter-spacing: -.025em;
  margin: 0 0 16px;
}
.article .meta {
  color: var(--faint); font-size: 14px; margin-bottom: 40px;
}
.article h2 {
  font-size: 26px; margin: 44px 0 14px; letter-spacing: -.01em;
}
.article p  { color: var(--dim); font-size: 17px; margin: 0 0 18px; }
.article a  { color: var(--accent); }
.article a:hover { text-decoration: underline; }
.article code {
  font-family: var(--font-mono); font-size: .9em;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 6px; padding: 2px 7px;
}
.article pre {
  background: var(--deep);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto;
}
.article pre code { background: none; border: none; padding: 0; }
.article ul, .article ol { color: var(--dim); padding-left: 22px; }
.article li { margin-bottom: 8px; }
.article blockquote {
  border-left: 3px solid var(--accent);
  margin: 20px 0; padding: 4px 0 4px 20px;
  color: var(--muted);
}

/* Факты у статьи (как sidebar у /lab/) */
.facts {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 20px 22px;
  margin: 0 0 40px;
}
.facts .f { display: flex; gap: 14px; padding: 7px 0; font-size: 14px; }
.facts .f span { color: var(--faint); min-width: 110px; }
.facts .f b { color: var(--ink); font-weight: 600; }

/* ---------- Продукты/курсы: широкие карточки ---------- */
.wide-card {
  display: flex; flex-direction: column; gap: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}
@media (min-width: 800px) {
  .wide-card { flex-direction: row; align-items: center; justify-content: space-between; }
}
.wide-card .txt h3 { margin: 0 0 8px; font-size: 24px; }
.wide-card .txt p  { margin: 0; color: var(--muted); max-width: 560px; }

/* ---------- Таблица-полоска метрик ---------- */
.metrics { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 0; }
.metric {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 18px;
}
.metric b { display: block; font-size: 22px; letter-spacing: -.02em; }
.metric span { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--line-soft); }
.faq-item summary {
  list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  cursor: pointer;
  padding: 20px 0;
  font-weight: 600; font-size: 17px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .plus {
  flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 18px;
  transition: transform .2s;
}
.faq-item[open] summary .plus { transform: rotate(45deg); color: var(--accent); }
.faq-item .a { color: var(--muted); padding: 0 0 22px; max-width: 700px; }

/* ---------- CTA / подвал ---------- */
.cta-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
}
.cta-box h2 { margin-inline: auto; }
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 32px 0 48px;
  color: var(--faint); font-size: 14px;
}
.footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.footer a:hover { color: var(--ink); }

/* Хлебные крошки */
.crumbs { color: var(--faint); font-size: 13px; margin: 28px 0 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }

/* ============================================================
   SOLARPUNK-слой: тёплые градиенты, свечения, микро-анимации
   ============================================================ */

/* Градиентный текст для акцентов в заголовках */
.hero h1 em, .page-head h1 .grad {
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: grad-shift 7s ease-in-out infinite;
}
@keyframes grad-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* Живое свечение за hero */
.hero { position: relative; }
.hero::before {
  content: "";
  position: absolute;
  inset: -120px -40px auto;
  height: 480px;
  background:
    radial-gradient(560px 320px at 18% 20%, rgba(255,201,87,.13), transparent 65%),
    radial-gradient(520px 300px at 82% 12%, rgba(184,240,60,.10), transparent 65%),
    radial-gradient(420px 260px at 55% 55%, rgba(255,138,92,.08), transparent 70%);
  pointer-events: none;
  filter: blur(6px);
  animation: glow-breathe 9s ease-in-out infinite;
}
.hero > * { position: relative; }
@keyframes glow-breathe {
  0%, 100% { opacity: .85; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.04); }
}

/* Бейджи категорий — тёплый градиент вместо белого */
.badge {
  background: var(--grad-sun);
  color: var(--sel-ink);
}
.badge-accent {
  background: var(--grad-warm);
  color: #2a0a08;
}

/* CTA-кнопки: тёплое сияние, лёгкое парение */
.btn-light {
  background: var(--grad-warm);
  color: #2a0a08;
  box-shadow: 0 0 22px rgba(255,164,87,.28);
}
.btn-light:hover {
  background: var(--grad-warm);
  filter: brightness(1.08);
  box-shadow: 0 0 34px rgba(255,164,87,.45);
  transform: translateY(-1px);
}
.nav a.cta {
  background: var(--grad-sun);
  color: var(--sel-ink);
}
.nav a.cta:hover { filter: brightness(1.07); }

/* Карточки: тёплая рамка-свечение при наведении + подъём */
.card { transition: border-color .25s, box-shadow .25s, transform .25s; }
.card:hover {
  border-color: rgba(255,201,87,.45);
  box-shadow: 0 8px 36px rgba(255,164,87,.10), inset 0 0 0 1px rgba(255,201,87,.08);
  transform: translateY(-3px);
}

/* Появление блоков при загрузке (однократно, деликатно) */
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero .lead, .hero-actions, .section h2, .section .sub,
  .grid > .card, .entry, .wide-card, .cta-box {
    animation: rise-in .6s cubic-bezier(.22,1,.36,1) both;
  }
  .grid > .card:nth-child(2) { animation-delay: .07s; }
  .grid > .card:nth-child(3) { animation-delay: .14s; }
  .grid > .card:nth-child(4) { animation-delay: .21s; }
  .entry:nth-child(2) { animation-delay: .08s; }
  @keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* Солнечный разделитель секций */
.section { border-top: 1px solid transparent; border-image: var(--grad-sun) 1; border-image-slice: 1 0 0 0; opacity: 1; }
/* border-image режет радиус — оставим только верхней границе линию градиентом */
.section { border-image: none; border-top: 1px solid var(--line); position: relative; }
.section::before {
  content: "";
  position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  background: var(--grad-sun);
  opacity: .35;
}

/* Мигающий "живой" индикатор в stamp — уже есть b ●, красим и пульсируем */
.stamp b {
  background: var(--grad-lime);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: .45; }
}

/* Чипы фильтров: тёплый акцент при выборе */
.chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 14px rgba(255,201,87,.22);
}

/* Ссылки «подробнее» в карточках — градиентный текст */
.card .more {
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
}

/* Плавный скролл-прогресс сверху страницы */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--grad-warm);
  z-index: 100;
  transition: width .1s linear;
}

/* Микро-анимация: живой курсор в конце заголовка */
.cursor-blink {
  display: inline-block;
  width: .55ch;
  margin-left: .08em;
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: blink 1.15s steps(1) infinite;
  font-weight: 300;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   ASCII-декорации: арты-«обложки» и градиентные перебивки
   ============================================================ */

/* Арт-обложка страницы */
.ascii-art {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: 0;
  white-space: pre;
  overflow: hidden;
  margin: 0 0 28px;
  background: var(--grad-sun);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: grad-shift 8s ease-in-out infinite;
  user-select: none;
}
.ascii-art b {
  font-weight: 400;
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (min-width: 768px) { .ascii-art { font-size: 15px; } }

/* Перебивка между секциями */
.ascii-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  color: var(--faint);
  user-select: none;
}
@media (min-width: 768px) { .ascii-divider { padding: 0 40px; } }
.ascii-divider::before,
.ascii-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--grad-sun);
  opacity: .3;
}
.ascii-divider .orn {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .4em;
  background: var(--grad-lime);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  animation: pulse-dot 3s ease-in-out infinite;
}

/* ============================================================
   Каомодзи у заголовков — живые, тёплые
   ============================================================ */
.kao {
  display: inline-block;
  font-size: .38em;
  vertical-align: middle;
  margin-right: .5em;
  margin-top: -.35em;
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: kao-bob 2.8s ease-in-out infinite;
  transform-origin: 50% 80%;
}
.kao-slow { animation-duration: 4.2s; }
.kao-wave { animation: kao-wave 2.2s ease-in-out infinite; }
.kao-spin { animation: kao-spin 5s linear infinite; }
@keyframes kao-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-4px) rotate(3deg); }
}
@keyframes kao-wave {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-8deg); }
  45% { transform: rotate(10deg); }
  60% { transform: rotate(0); }
}
@keyframes kao-spin {
  0%   { transform: rotate(0) scale(1); }
  50%  { transform: rotate(180deg) scale(1.12); }
  100% { transform: rotate(360deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .kao, .kao-wave, .kao-spin { animation: none; }
}
