@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/Inter-VF.ttf') format('truetype-variations'),
       url('/static/fonts/Inter-VF.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ─── Токены: оранжевый, белый, чёрный ─── */
:root {
  --orange: #D9561A;
  --orange-press: #BF4A14;
  --ink: #0C0C0D;
  --ink-2: #1C1C1F;
  --paper: #FFFFFF;
  --surface: #F4F4F5;
  --line: #E7E7E9;
  --text: #0C0C0D;
  --text-2: #4A4A50;
  --text-3: #8A8A91;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
a { color: inherit; }
b { font-weight: 650; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 6px; }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 0;
}

.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.eyebrow--accent { color: var(--orange); }

/* ─── Кнопки ─── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s var(--ease), background-color 0.2s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:active { background: var(--orange-press); }
.btn-ghost { background: var(--surface); color: var(--text); }
.btn-ghost:disabled { opacity: 0.6; }

/* ─── Экран подписки ─── */
.sub-barrier {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  background: rgba(12, 12, 13, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.sub-barrier.active { display: flex; }

.barrier-card {
  width: 100%;
  max-width: 448px;
  background: var(--paper);
  border-radius: var(--r-lg);
  padding: 28px 20px 20px;
  animation: rise 0.35s var(--ease);
}
.barrier-icon, .alert-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--orange);
  color: #fff;
  margin-bottom: 18px;
}
.barrier-icon svg, .alert-icon svg { width: 24px; height: 24px; }
.alert-icon { margin: 0 auto 14px; border-radius: 50%; }
.barrier-card h2 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.barrier-card p { color: var(--text-2); margin-bottom: 20px; }
.sub-actions { display: grid; gap: 8px; }
.sub-error-hint {
  display: none;
  font-size: 13px;
  color: var(--orange-press);
  text-align: center;
  padding-top: 4px;
}

@keyframes rise {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ─── Главный экран ─── */
.home-header { padding: 12px 0 20px; }
.home-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.card-list { display: grid; gap: 10px; }

.item-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  overflow: hidden;
  transition: transform 0.15s var(--ease);
}
.item-card:active { transform: scale(0.985); }

.card-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; position: relative; }
.card-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.card-subtitle { font-size: 13px; color: var(--text-3); line-height: 1.4; }
.card-chevron { width: 18px; height: 18px; flex-shrink: 0; position: relative; }
.card-lock { width: 20px; height: 20px; flex-shrink: 0; color: var(--text-3); }

.item-card--featured {
  border: 1.5px solid var(--orange);
  padding: 20px 16px 20px 18px;
}
.item-card--featured .card-title { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.item-card--featured .card-subtitle { color: var(--text-2); }
.item-card--featured .card-chevron { color: var(--orange); }
.card-tag {
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 4px;
}

.locked-card .card-title { color: var(--text-2); }
.badge-soon {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 650;
  color: var(--text-3);
  background: var(--surface);
  padding: 4px 9px;
  border-radius: 999px;
}

/* ─── Материал ─── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-3);
}
.back-link:active { color: var(--text); }

/* Hero: чёрная карточка с белыми пятнами */
.hero {
  position: relative;
  overflow: hidden;
  border: 1.5px solid var(--orange);
  border-radius: var(--r-lg);
  padding: 22px 20px 20px;
  isolation: isolate;
}

.nw { white-space: nowrap; }
.hero-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 14px;
}
.hero-number {
  font-size: clamp(52px, 15vw, 64px);
  font-weight: 850;
  letter-spacing: -0.05em;
  line-height: 0.92;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}
.hero-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  margin-top: 10px;
  max-width: 270px;
}

.article-intro { padding: 24px 2px 4px; }
.article-title {
  font-size: 22px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-2);
}
.article-sub { font-size: 14.5px; color: var(--text-3); margin-top: 8px; }

/* Ролик на YouTube */
.video-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: transform 0.15s var(--ease);
}
.video-card:active { transform: scale(0.985); }
.video-play {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--orange);
  color: var(--orange);
}
.video-play svg { width: 18px; height: 18px; margin-left: 2px; }
.video-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.video-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.video-sub { font-size: 13px; color: var(--text-3); line-height: 1.4; }
.video-card .card-chevron { color: var(--text-3); }

.toc {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 16px 0 4px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}
.toc::-webkit-scrollbar { display: none; }
.toc a {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
}

.section {
  padding: 32px 0 4px;
  scroll-margin-top: 12px;
}
.section h2 {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.section > p { color: var(--text-2); margin-bottom: 12px; }
.section > p b { color: var(--text); }




/* 5 признаков */
.signs { list-style: none; display: grid; gap: 14px; margin-top: 6px; }
.signs li { display: flex; gap: 12px; color: var(--text-2); }
.signs li b { color: var(--text); }
.sign-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  margin-top: 8px;
}

/* Практикум */
.howto {
  display: grid;
  gap: 4px;
  font-size: 14px;
  color: var(--text-2);
  border-left: 3px solid var(--orange);
  padding: 2px 0 2px 14px;
  margin: 18px 0 8px;
}
.howto-cap { font-weight: 700; color: var(--text); }

.steps { list-style: none; margin-top: 20px; }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding-bottom: 28px;
}
.step::after {
  content: '';
  position: absolute;
  left: 17.5px;
  top: 40px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}
.step:last-child { padding-bottom: 0; }
.step:last-child::after { display: none; }
.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.step-body { min-width: 0; padding-top: 5px; }
.step-body h3 {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-bottom: 4px;
}
.step-body > p { font-size: 14px; color: var(--text-2); margin-bottom: 12px; }
.step-body > p.step-result { font-size: 13.5px; color: var(--text-2); margin: 12px 0 0; }
.step-result b { color: var(--text); }

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-sm);
  background: var(--surface);
  margin-bottom: 10px;
}
.seg-btn {
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 6px;
  border-radius: 9px;
  color: var(--text-3);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.seg-btn.is-active {
  background: var(--paper);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(12, 12, 13, 0.1);
}

.prompt-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  background: var(--paper);
}
.prompt-card + .prompt-card { margin-top: 10px; }
.prompt-card--spare { background: var(--surface); border-color: transparent; }
.prompt-kicker {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 4px;
}
.prompt-title { font-size: 16px; font-weight: 750; line-height: 1.3; letter-spacing: -0.01em; }
.prompt-desc { font-size: 13.5px; color: var(--text-2); margin-top: 3px; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  min-height: 46px;
  border-radius: var(--r-sm);
  background: var(--orange);
  color: #fff;
  font-size: 14.5px;
  font-weight: 650;
  transition: transform 0.15s var(--ease), background-color 0.2s var(--ease);
}
.copy-btn svg { width: 17px; height: 17px; }
.copy-btn:active { transform: scale(0.98); }
.copy-btn--quiet { background: var(--paper); color: var(--text); border: 1px solid var(--line); }
.copy-btn.copied { background: var(--orange-press); color: #fff; border-color: var(--orange-press); }

.prompt-box {
  position: relative;
  margin-top: 12px;
  background: var(--surface);
  border-radius: var(--r-sm);
}
.prompt-code {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
  padding: 14px 14px 4px;
}
.prompt-box.is-collapsed { cursor: pointer; }
.prompt-box.is-collapsed .prompt-code { max-height: 150px; overflow: hidden; }
.prompt-box.is-collapsed::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 84px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: linear-gradient(to bottom, rgba(244, 244, 245, 0), var(--surface) 70%);
  pointer-events: none;
}
.prompt-more {
  display: block;
  margin: 4px auto 0;
  padding: 8px 14px 12px;
  font-size: 13px;
  font-weight: 650;
  color: var(--orange);
}
.prompt-box.is-collapsed .prompt-more {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  z-index: 1;
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 1px 4px rgba(12, 12, 13, 0.12);
  white-space: nowrap;
}
.prompt-card--spare .prompt-box { background: var(--paper); }
.prompt-card--spare .prompt-box.is-collapsed::after {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--paper) 70%);
}

/* Где собрать */
.formats { display: grid; gap: 10px; margin-top: 4px; }
.format {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
}
.format:first-child { border-color: var(--orange); border-width: 1.5px; }
.format-tag {
  display: block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.format:first-child .format-tag { color: var(--orange); }
.format h3 { font-size: 16px; font-weight: 750; line-height: 1.3; margin-bottom: 4px; }
.format p { font-size: 14px; color: var(--text-2); }

/* Проверка */
.checks { display: grid; gap: 8px; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--text-2);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.check b { color: var(--text); }
.check-box {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid #C9C9CE;
  display: grid;
  place-items: center;
  color: #fff;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.check-box svg { width: 14px; height: 14px; opacity: 0; transition: opacity 0.15s; }
.check[aria-pressed="true"] { border-color: var(--orange); }
.check[aria-pressed="true"] .check-box { background: var(--orange); border-color: var(--orange); }
.check[aria-pressed="true"] .check-box svg { opacity: 1; }
.checks-done {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 650;
  color: var(--orange);
}

/* Автор */
.author {
  position: relative;
  overflow: hidden;
  margin-top: 36px;
  border: 1.5px solid var(--orange);
  border-radius: var(--r-lg);
  padding: 24px 20px 20px;
  isolation: isolate;
}
.author h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.author p {
  font-size: 14.5px;
  color: var(--text-2);
  margin-bottom: 10px;
  max-width: 340px;
}
.author-actions { display: grid; gap: 8px; margin-top: 18px; }

/* Поп-ап «Доступ открыт» */
.alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 12, 13, 0.55);
}
.alert-overlay.active { display: flex; }
.alert-card {
  width: 100%;
  max-width: 320px;
  background: var(--paper);
  border-radius: var(--r-lg);
  padding: 26px 20px 20px;
  text-align: center;
  animation: rise 0.3s var(--ease);
}
.alert-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.alert-text { font-size: 14.5px; color: var(--text-2); margin-bottom: 18px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
