/* ============ Кнопки ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  background: none;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease),
              color var(--t) var(--ease), transform var(--t) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #1D4FD7; }
.btn--primary .icon { stroke: #fff; }
.btn--ghost { border-color: var(--accent); color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); }
.btn.reveal { margin-top: 28px; }

.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--muted); cursor: pointer; font-size: var(--small);
  transition: color var(--t) var(--ease);
}
.link-btn:hover { color: var(--accent); }

/* ============ Навигация / бургер ============ */
.nav__link {
  color: var(--muted);
  font-size: var(--small);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.nav__link:hover, .nav__link.is-active { color: var(--text); border-color: var(--accent); }

.burger {
  display: none;
  width: 40px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-elev);
  cursor: pointer;
  padding: 8px 9px;
}
.burger span { display: block; height: 1.5px; background: var(--text); margin: 3.5px 0; transition: transform var(--t) var(--ease), opacity var(--t); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
@media (max-width: 767px) { .burger { display: block; } }

/* ============ Индикатор статуса ============ */
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}
.status__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 2.4s var(--ease) infinite;
}
.status__dot[data-tone="ok"]   { background: var(--ok);   color: var(--ok); }
.status__dot[data-tone="warn"] { background: var(--warn); color: var(--warn); }
.status__dot[data-tone="bad"]  { background: var(--bad);  color: var(--bad); animation: none; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 160, 67, .45); }
  70%  { box-shadow: 0 0 0 7px rgba(46, 160, 67, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 160, 67, 0); }
}

/* ============ Карточки ============ */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--t) var(--ease);
}
.card:hover { border-color: #30363D; }
.card__title { font-size: 18px; font-weight: 700; }
.card__text { color: var(--muted); font-size: var(--small); }

/* ============ Hero pipeline ============ */
.pipeline {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 28px 20px;
}
.pipeline__item {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.pipeline__link {
  position: relative;
  flex: 0 0 44px;
  height: 1px;
  background: var(--line);
}
.pipeline__link::after {
  content: '';
  position: absolute;
  right: -1px; top: -3px;
  border-left: 6px solid var(--line);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
}
.packet {
  position: absolute;
  top: -2px; left: 0;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: packet 2.4s linear infinite;
}
.packet--d1 { animation-delay: .35s; }
.packet--d2 { animation-delay: .7s; }
@keyframes packet {
  0%   { transform: translateX(0);    opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateX(40px); opacity: 0; }
}

/* ============ Архитектурная схема кейса ============ */
.arch {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: start;
  gap: 10px;
  margin-top: 32px;
}
.arch__arrow { display: grid; place-items: center; padding-top: 24px; }
.arch__node {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--t) var(--ease);
}
.arch__node.is-open, .arch__node:hover { border-color: var(--accent); }
.arch__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.arch__title { font-weight: 500; flex: 1; }
.arch__chev { color: var(--accent); font-weight: 700; transition: transform var(--t) var(--ease); }
.arch__node.is-open .arch__chev { transform: rotate(45deg); }
.arch__body {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: height var(--t-slow) var(--ease), opacity var(--t-slow) var(--ease);
}
.arch__body[hidden] { display: block; }      /* управляем анимацией из JS */
.arch__node.is-open .arch__body { opacity: 1; }
.ticks { padding: 0 18px 18px; display: grid; gap: 8px; font-size: var(--small); color: var(--muted); }
.ticks li { padding-left: 16px; position: relative; }
.ticks li::before { content: '›'; position: absolute; left: 0; color: var(--accent); }

.result {
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background: var(--bg-elev);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--small);
}

/* ============ Скриншоты / плейсхолдеры ============ */
.shot { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); }
.shot img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; height: auto; }
.shot figcaption { padding: 12px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.shot--empty { display: grid; }
.shot__ph {
  aspect-ratio: 16 / 10;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--muted);
  background:
    repeating-linear-gradient(45deg, #12171F 0 10px, #0F141B 10px 20px);
}
.shot__ph b { color: var(--accent); }

/* ============ Калькулятор ============ */
.estimator {
  margin-top: 32px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 24px;
}
.estimator__bar { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.estimator__bar span { display: block; height: 100%; width: 20%; background: var(--accent); transition: width var(--t-slow) var(--ease); }
.estimator__counter { font-size: 13px; color: var(--muted); margin: 12px 0 18px; }

.step { display: none; }
.step.is-active { display: block; animation: fade-in var(--t-slow) var(--ease); }
.step__title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.step__options { display: grid; gap: 10px; margin-bottom: 14px; }
.opt {
  text-align: left;
  padding: 13px 16px;
  background: #0F141B;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--small);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease);
}
.opt:hover { border-color: var(--accent); color: var(--accent); }
.opt.is-picked { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.estimator__result { animation: fade-in var(--t-slow) var(--ease); }
.quote { border-left: 2px solid var(--accent); padding-left: 16px; display: grid; gap: 8px; }
.quote__line { font-size: var(--small); }
.quote__line--big { font-size: 20px; font-weight: 700; }
.quote__muted { color: var(--muted); font-size: 13px; }
.estimator__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 22px; }
.estimator__error { color: var(--warn); font-size: var(--small); }

/* ============ Дорожная карта ============ */
.roadmap {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  padding-bottom: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.roadmap::-webkit-scrollbar { height: 6px; }
.roadmap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.roadmap__step {
  flex: 0 0 250px;
  scroll-snap-align: start;
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.roadmap__num { font-size: 12px; color: var(--accent); font-weight: 700; }
.roadmap__title { font-size: 15px; font-weight: 700; }
.roadmap__text { font-size: 13px; color: var(--muted); }

/* ============ Стек ============ */
.stack-col__title { font-size: 15px; font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.stack-col__list { margin-top: 14px; display: grid; gap: 8px; font-size: var(--small); color: var(--muted); }
.stack-col__list li::before { content: '· '; color: var(--accent); }

/* ============ Публикации ============ */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chip {
  padding: 7px 14px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.pubs { display: grid; gap: 16px; margin-top: 22px; }
.pub {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  gap: 8px;
  transition: border-color var(--t) var(--ease), opacity var(--t) var(--ease);
}
.pub:hover { border-color: #30363D; }
.pub.is-hidden { display: none; }
.pub__title { font-size: 17px; font-weight: 700; line-height: 1.45; }
.pub__authors, .pub__venue { font-size: 13px; color: var(--muted); }
.pub__self { color: var(--text); font-weight: 700; }
.pub__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.tag { font-size: 12px; color: var(--accent); border: 1px solid var(--line); background: var(--accent-soft); border-radius: 4px; padding: 2px 8px; }
.pub__abstract { font-size: var(--small); color: var(--muted); }
.pub__link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent); margin-top: 4px; }
.pub__link:hover { text-decoration: underline; }
.pubs__empty { color: var(--muted); font-size: var(--small); margin-top: 18px; }

/* ============ Ограничения ============ */
.limits { display: grid; gap: 12px; margin-top: 28px; }
.limits__item {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: var(--small);
  color: var(--muted);
}
.limits__item b { color: var(--text); font-weight: 500; }

/* ============ Форма ============ */
.form { margin-top: 30px; display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field__label { font-size: 13px; color: var(--muted); }
.field__opt { color: #6E7681; }
.field__control {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: var(--small);
  resize: vertical;
  transition: border-color var(--t) var(--ease);
}
.field__control:hover { border-color: #30363D; }
.field__control:focus { border-color: var(--accent); outline: none; }

.contacts { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.contacts a { display: inline-flex; align-items: center; gap: 8px; font-size: var(--small); color: var(--muted); transition: color var(--t) var(--ease); }
.contacts a:hover { color: var(--accent); }
.contacts a:hover .icon { stroke: var(--accent); }

/* ============ Адаптив схемы ============ */
@media (max-width: 1023px) {                    /* планшет: 2×2 */
  .arch { grid-template-columns: 1fr auto 1fr; }
  .arch__arrow:nth-of-type(2) { display: none; }
  .pipeline { flex-wrap: wrap; row-gap: 22px; }
  .pipeline__item { flex: 0 0 40%; }
  .pipeline__link { flex: 0 0 30px; }
}

@media (max-width: 767px) {                     /* мобильный: вертикально */
  .arch { grid-template-columns: 1fr; }
  .arch__arrow { padding: 0; transform: rotate(90deg); }
  .roadmap { flex-direction: column; overflow: visible; }
  .roadmap__step { flex: none; }
  .note--hint { display: none; }
  .pipeline__item { flex: 1 0 100%; }
  .pipeline__link { flex: 1 0 100%; height: 24px; background: none; }
  .pipeline__link::after, .packet { display: none; }
  .pipeline__link::before {
    content: '↓'; color: var(--accent);
    display: block; text-align: center; line-height: 24px;
  }
}