﻿/* ============================================================
   skyser.tech — дизайн-прототип
   Направление A «Инженерный журнал» + экспрессия.
   Это макет, а не продакшн-код: токены ниже переносятся в реальную сборку.
   ============================================================ */

:root {
  --bg: #0b0d10;
  --bg-1: #101419;
  --bg-2: #161b22;

  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);

  --fg: #e8ecf1;
  --dim: #8a94a2;
  --faint: #5a6472;

  --accent: #4ade80;
  --accent-soft: rgba(74, 222, 128, 0.14);
  --blue: #38bdf8;
  --warn: #f5a524;

  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  --pad: clamp(20px, 4vw, 48px);
  --maxw: 1240px;
  --ease: cubic-bezier(0.16, 0.84, 0.44, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

img, svg, video { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- типографика ---------- */

.mono {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; }

.display {
  font-size: clamp(2.4rem, 6.4vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.1; }

.lead {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--dim);
  max-width: 62ch;
  text-wrap: pretty;
}

/* ---------- шапка ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 240ms var(--ease), border-color 240ms var(--ease);
}

.header.is-stuck {
  background: rgba(11, 13, 16, 0.82);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand__mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
  animation: pulse 2.8s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--dim);
}

.nav a { transition: color 180ms var(--ease); }
.nav a:hover { color: var(--fg); }

.lang {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--faint);
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  transition: color 180ms var(--ease), background 180ms var(--ease);
}

.lang button[aria-pressed="true"] { background: var(--bg-2); color: var(--fg); }
.lang button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid var(--line-2);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease),
    background 180ms var(--ease), color 180ms var(--ease);
}

.btn:hover { transform: translateY(-1px); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06120a;
  font-weight: 600;
}

.btn--primary:hover { background: #6ee79b; border-color: #6ee79b; }

.btn--ghost { color: var(--fg); }
.btn--ghost:hover { border-color: var(--fg); background: rgba(255, 255, 255, 0.04); }

/* ---------- hero ---------- */

.hero { position: relative; overflow: hidden; padding: clamp(56px, 9vw, 120px) 0 clamp(48px, 6vw, 88px); }

.hero::before {
  content: "";
  position: absolute;
  inset: -20% 40% 30% -10%;
  background: radial-gradient(circle at 30% 30%, rgba(74, 222, 128, 0.1), transparent 62%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.hero .display { margin-bottom: 24px; }
.hero .lead { margin: 0 0 34px; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 4vw, 56px);
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.metric__value {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
}

.metric__value span { color: var(--accent); }

.metric__label { margin-top: 8px; font-size: 0.82rem; color: var(--faint); max-width: 24ch; }

/* техническая панель в hero */

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.035), transparent 55%), var(--bg-1);
  padding: 20px;
  overflow: hidden;
}

.panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel__body { padding-top: 16px; }
.panel__body svg { width: 100%; height: auto; }

.panel__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.flow-line {
  stroke-dasharray: 6 8;
  animation: flow 2.4s linear infinite;
}

@keyframes flow { to { stroke-dashoffset: -28; } }

/* ---------- секции ---------- */

.section { padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--line); }

.section__head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section__head h2 { margin-right: auto; }

/* ---------- кейсы ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(22px, 2.6vw, 32px);
  background: var(--bg);
  transition: background 240ms var(--ease);
}

.card:hover { background: var(--bg-1); }

.card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.card__index {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--faint);
  transition: color 240ms var(--ease);
}

.card:hover .card__index { color: var(--accent); }

.card__title { font-size: 1.18rem; letter-spacing: -0.02em; }

.card__text { color: var(--dim); font-size: 0.94rem; margin: 0; }

.card__metric {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
}

/* карточка-заполнитель для сетки из пяти проектов */
.card--more { background: var(--bg-1); }
.card--more .card__title { color: var(--dim); font-weight: 500; }
.card--more .card__metric { color: var(--faint); }
.card--more:hover .card__title { color: var(--fg); }
.card--more:hover .card__metric { color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

/* ---------- стек ---------- */

.stack { border-top: 1px solid var(--line); }

.stack__row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.stack__row dt { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.stack__row dd { margin: 0; color: var(--fg); }
.stack__row dd span { color: var(--faint); }

/* ---------- услуги ---------- */

.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

.service {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-1);
  transition: border-color 240ms var(--ease), transform 240ms var(--ease);
}

.service:hover { border-color: var(--line-2); transform: translateY(-3px); }
.service h3 { font-size: 1.05rem; margin-bottom: 10px; }
.service p { margin: 0; color: var(--dim); font-size: 0.93rem; }
.service__num { font-family: var(--mono); font-size: 0.72rem; color: var(--accent); letter-spacing: 0.14em; display: block; margin-bottom: 16px; }

/* ---------- медиа-слот ---------- */

.media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.015) 0 10px, transparent 10px 20px), var(--bg-1);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
}

/* ---------- об авторе ---------- */

.about { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.about__media { aspect-ratio: 3 / 4; }
.about p { color: var(--dim); }
.about p + p { margin-top: 14px; }

/* ---------- контакты ---------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: end;
}

.contact__links { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }

.contact__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 0.86rem;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}

.contact__link:hover { background: var(--bg-1); color: var(--accent); }
.contact__link span:first-child { color: var(--faint); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- подвал ---------- */

.footer { border-top: 1px solid var(--line); padding: 32px 0 48px; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; color: var(--faint); font-size: 0.82rem; }

/* ---------- анимация появления ---------- */

.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 640ms var(--ease), transform 640ms var(--ease); }

/* ---------- страница кейса ---------- */

/* метрики кейса */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  margin: 20px 0 26px;
}

.stat { padding: 22px; background: var(--bg); }
.stat__value { font-family: var(--mono); font-size: clamp(1.5rem, 2.8vw, 2.1rem); line-height: 1; letter-spacing: -0.02em; }
.stat__value span { color: var(--accent); }
.stat__label { margin-top: 10px; color: var(--faint); font-size: 0.82rem; }

/* фотографии */
.figure { margin: 0; }
.figure img { width: 100%; border-radius: 16px; border: 1px solid var(--line); }
.figure--wide img { aspect-ratio: 21 / 9; object-fit: cover; }
.figure video { width: 100%; display: block; border-radius: 16px; border: 1px solid var(--line); background: #000; }
.figure figcaption { margin-top: 10px; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.gallery img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.gallery--wide img { aspect-ratio: 16 / 10; }

/* сравнение двух результатов */
.compare { display: grid; gap: 18px; margin: 22px 0 0; }
.compare__head { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 0.8rem; color: var(--fg); }
.compare__head span:last-child { color: var(--accent); }
.compare__bar { height: 10px; margin-top: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.compare__fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.compare__fill--dim { background: var(--line-2); }

/* нумерованные шаги */.steps { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 20px 0 0; }
.step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; padding: 16px 20px; background: var(--bg); }
.step__num { font-family: var(--mono); font-size: 0.72rem; color: var(--accent); letter-spacing: 0.1em; }
.step h4 { margin: 0 0 4px; font-size: 0.97rem; font-weight: 500; }
.step p { margin: 0; color: var(--dim); font-size: 0.92rem; }

.breadcrumb { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; color: var(--faint); font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.breadcrumb a:hover { color: var(--fg); }

.case-hero { padding: clamp(40px, 6vw, 72px) 0 0; }
.case-hero .display { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: 20px; }

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  margin: clamp(32px, 4vw, 48px) 0 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.meta__cell { padding: 18px 20px; background: var(--bg); }
.meta__cell dt { margin-bottom: 8px; }
.meta__cell dd { margin: 0; font-size: 0.94rem; }

.prose { max-width: 72ch; }
.prose h3 { font-size: 1.05rem; margin: 0 0 12px; }
.prose p { color: var(--dim); margin: 0 0 14px; }
.prose ul { color: var(--dim); margin: 0 0 14px; padding-left: 18px; }
.prose li { margin-bottom: 8px; }

.block { padding: clamp(32px, 4vw, 48px) 0; border-top: 1px solid var(--line); }
.block__num { display: block; margin-bottom: 12px; }

.result {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 16px;
  padding: clamp(22px, 3vw, 32px);
}

.result h3 { color: var(--accent); font-size: 0.78rem; font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 12px; }
.result p { color: var(--fg); margin: 0; }

.next a.mono { transition: color 180ms var(--ease); }
.next a.mono:hover { color: var(--fg); }

.next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(24px, 3vw, 36px) 0;
  border-top: 1px solid var(--line);
}

/* ---------- адаптив ---------- */

@media (max-width: 900px) {
  .hero__grid, .about, .contact { grid-template-columns: minmax(0, 1fr); }
  .nav { display: none; }
  .stack__row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .about__media { aspect-ratio: 16 / 9; }
}

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

/* ---------- форма заявки ---------- */
.modal {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--bg-1);
  color: var(--fg);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
}
.modal::backdrop { background: rgba(4, 6, 9, 0.74); }
.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}
.modal__title { margin: 0; font-size: 1.3rem; letter-spacing: -0.01em; }
.modal__close {
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: none;
  color: var(--dim);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.modal__close:hover { color: var(--fg); border-color: var(--line-2); }
.modal__body { display: grid; gap: 14px; padding: 16px 24px 24px; }
.modal__note { margin: 0; color: var(--dim); font-size: 0.88rem; }
.field { display: grid; gap: 6px; }
.field > span {
  color: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.field input,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--faint); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { min-height: 124px; resize: vertical; }
.modal__foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.modal__foot .btn[disabled] { opacity: 0.6; cursor: progress; }
.modal__status { margin: 0; min-height: 1.2em; font-size: 0.88rem; color: var(--dim); }
.modal__status[data-state="ok"] { color: var(--accent); }
.modal__status[data-state="error"] { color: var(--warn); }
/* ловушка для ботов: человек это поле не видит и не заполнит */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- окно конструктора ТЗ ---------- */
.nav__btn {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.nav__btn:hover { color: var(--fg); }
.nav__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.modal--spec {
  width: min(1040px, calc(100vw - 28px));
  height: min(720px, calc(100vh - 40px));
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.035), transparent 42%), var(--bg-1);
  color: var(--fg);
  overflow: hidden;
  box-shadow: 0 50px 140px rgba(0, 0, 0, 0.6);
}
.modal--spec::backdrop { background: rgba(4, 6, 9, 0.82); }

.spec__shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
}
.spec__top { padding: 18px 22px 0; border-bottom: 1px solid var(--line); }
.spec__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.spec__dots { display: flex; gap: 6px; }
.spec__dot {
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--line-2);
  transition: background 0.3s var(--ease), width 0.3s var(--ease);
}
.spec__dot.is-done { background: rgba(74, 222, 128, 0.45); }
.spec__dot.is-now { width: 42px; background: var(--accent); }

.spec__headline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 14px 0 16px;
}
.spec__stepnum {
  font-size: 2.4rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(74, 222, 128, 0.55);
}
.spec__title { margin: 0; font-size: 1.45rem; letter-spacing: -0.01em; }
.spec__lead { margin: 6px 0 0; color: var(--dim); font-size: 0.9rem; line-height: 1.45; }
.spec__bar { height: 2px; background: var(--line); }
.spec__bar span { display: block; height: 100%; width: 33%; background: var(--accent); transition: width 0.45s var(--ease); }

.spec__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 42%);
  gap: 18px;
  padding: 18px 22px;
  overflow: auto;
}
.spec__choices { display: grid; gap: 14px; align-content: start; }
.spec__choices.is-swap { animation: spec-swap 0.38s var(--ease) both; }
@keyframes spec-swap {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.spec__group { display: grid; gap: 8px; }
.spec__grouplabel { color: var(--faint); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; }
.spec__options { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 8px; }

.opt {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 14px;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--dim);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease),
    transform 0.18s var(--ease), color 0.18s var(--ease);
  animation: opt-in 0.34s var(--ease) both;
  animation-delay: calc(var(--i) * 28ms);
}
@keyframes opt-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.opt:hover { color: var(--fg); border-color: var(--line-2); transform: translateY(-1px); }
.opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt__icon { width: 22px; height: 22px; color: var(--faint); transition: color 0.18s var(--ease); }
.opt__body { display: grid; gap: 2px; }
.opt__body b { font-size: 0.92rem; font-weight: 600; color: var(--fg); }
.opt__body span { font-size: 0.78rem; color: var(--faint); }
.opt__check {
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.opt.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }
.opt.is-on .opt__icon { color: var(--accent); }
.opt.is-on .opt__check {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--bg-1);
}

.spec__live {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
}
.spec__livehead {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.spec__canvas { display: grid; place-items: start center; min-height: 150px; overflow: auto; }
.spec__canvas svg { width: 100%; height: auto; }
.spec__empty {
  margin: 0;
  padding: 24px 8px;
  color: var(--faint);
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
}
.spec__hint { margin: 0; color: var(--faint); font-size: 0.78rem; line-height: 1.45; }

.specnode rect { fill: rgba(255, 255, 255, 0.035); stroke: rgba(255, 255, 255, 0.18); }
.specnode text { font-family: var(--mono); font-size: 10.5px; fill: var(--fg); }
.specnode__prop { fill: rgba(138, 148, 162, 0.95); font-size: 9px; }
.specnode--safety rect { stroke: rgba(245, 165, 36, 0.55); }
.specnode--infra rect { stroke: rgba(56, 189, 248, 0.45); }
.specnode.is-new { animation: node-in 0.42s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes node-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}

.specline {
  fill: none;
  stroke: rgba(255, 255, 255, 0.26);
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: edge-in 0.6s var(--ease) forwards;
  animation-delay: calc(var(--d) * 1ms + 120ms);
}
@keyframes edge-in { to { stroke-dashoffset: 0; } }

.spec__foot { display: grid; gap: 10px; padding: 12px 22px 16px; border-top: 1px solid var(--line); }
.spec__notes {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 0.88rem;
  resize: none;
}
.spec__notes:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.spec__footnav { display: flex; justify-content: space-between; gap: 10px; }

.spec__result {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--bg-1);
}
.spec__shell.is-result .spec__result { display: grid; }
.spec__result.is-in { animation: result-in 0.4s var(--ease) both; }
@keyframes result-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.spec__resbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.spec__preview {
  margin: 0;
  padding: 18px 22px;
  overflow: auto;
  color: var(--fg);
  font: 12.5px/1.6 var(--mono);
  white-space: pre-wrap;
}
.spec__resfoot { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .modal--spec { height: min(100vh - 16px, 860px); }
  .spec__main { grid-template-columns: minmax(0, 1fr); }
  .spec__live { order: -1; }
  .spec__stepnum { font-size: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .opt, .specline, .specnode.is-new, .spec__choices.is-swap, .spec__result.is-in { animation: none !important; }
  .specline { stroke-dashoffset: 0; }
}
