/* degrad sync — монохромная инженерная тема */
:root {
  --paper: #000000;
  --line: #1c1c1c;
  --line-strong: #2e2e2e;
  --ink: #e6e6e6;
  --steel: #8c8c8c;
  --grid: 24px;
  --measure: 68ch;
  --gutter: clamp(16px, 4vw, 48px);
  font-family: "B612", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: var(--grid) var(--grid);
  background-position: -1px -1px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration-color: var(--steel); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

code, pre, kbd { font-family: "B612 Mono", ui-monospace, monospace; }

.sheet {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  border-left: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, .86);
  min-height: 100vh;
}

/* шапка */
.top {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  border-bottom: 1px solid var(--line-strong);
}
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.mark svg { width: 22px; height: 22px; }
.top nav { margin-left: auto; display: flex; gap: 22px; font-size: 14px; }
.top nav a { text-decoration: none; color: var(--steel); }
.top nav a:hover { color: var(--ink); }

/* первый экран: текст + чертёж */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  border-bottom: 1px solid var(--line-strong);
}
.hero-text { padding: 72px 40px 56px 0; border-right: 1px solid var(--line-strong); }
.hero h1 {
  margin: 0 0 24px;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -.02em;
  font-weight: 700;
  max-width: 14ch;
}
.hero p { margin: 0 0 16px; color: var(--steel); max-width: 42ch; }
.hero .access { margin-top: 28px; color: var(--ink); font-size: 14px; padding-left: 14px; border-left: 2px solid var(--ink); }

.drawing { display: flex; flex-direction: column; margin: 0; padding: 32px 0 0 24px; }
.canvas { flex: 1; display: flex; align-items: center; min-width: 0; }
.drawing svg { display: block; width: 100%; height: auto; }
.drawing svg.defs { position: absolute; width: 0; height: 0; }
.drawing svg.tall { display: none; }
.drawing .box { fill: var(--paper); stroke: var(--ink); stroke-width: 1.25; }
.drawing .thin { fill: none; stroke: var(--steel); stroke-width: .75; }
.drawing .solid { fill: var(--ink); }
.drawing .hatch { fill: url(#hatch); stroke: var(--steel); stroke-width: .75; }
.drawing .dot { fill: var(--ink); }
.drawing .ring { fill: var(--paper); stroke: var(--steel); stroke-width: .75; }
.drawing text { fill: var(--ink); font-family: "B612", sans-serif; font-size: 13px; }
.drawing text.sub { fill: var(--steel); font-size: 12px; }
.drawing text.big { font-size: 16px; font-weight: 700; }
.drawing text.n { font-size: 11px; text-anchor: middle; dominant-baseline: central; }

/* одна анимация: линии передачи прорисовываются при загрузке */
.drawing .wire { fill: none; stroke: var(--ink); stroke-width: 1.25; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw .7s ease-out .3s forwards; }
.drawing .wire.late { stroke: var(--steel); animation-delay: 1s; }
.drawing .head { fill: var(--ink); opacity: 0; animation: appear .2s linear 1s forwards; }
.drawing .head.late { fill: var(--steel); animation-delay: 1.7s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

/* примечания и штамп чертежа */
.drawing-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; margin-top: 16px; }
.notes { list-style: none; margin: 0 0 16px; padding: 0; counter-reset: note; font-size: 13px; line-height: 20px; color: var(--steel); }
.notes li { counter-increment: note; display: grid; grid-template-columns: 20px 1fr; gap: 10px; margin-top: 8px; }
.notes li::before {
  content: counter(note);
  display: grid; place-items: center;
  width: 20px; height: 20px;
  border: 1px solid var(--steel); border-radius: 50%;
  font-size: 11px; line-height: 1; color: var(--ink);
}
.stamp {
  display: grid; grid-template-columns: auto auto;
  margin: 0;
  border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong);
  font-size: 12px; background: var(--paper);
}
.stamp dt, .stamp dd { margin: 0; padding: 6px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stamp dt { color: var(--steel); border-right: 1px solid var(--line); }
.stamp dt:last-of-type, .stamp dd:last-of-type { border-bottom: 0; }

/* разделы */
section { padding: 64px 0; border-bottom: 1px solid var(--line-strong); }
section > h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.01em; }
section > .lead { margin: 0 0 32px; color: var(--steel); max-width: var(--measure); }

.props { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.props > div { padding: 24px 24px 8px 0; }
.props > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.props h3 { margin: 0 0 8px; font-size: 16px; }
.props p { margin: 0; color: var(--steel); font-size: 15px; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; max-width: 760px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 0 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.steps li::before { content: counter(step); grid-column: 1; grid-row: 1; font-weight: 700; color: var(--steel); }
.steps li > * { grid-column: 2; min-width: 0; }
.steps p { margin: 0 0 10px; }
.steps p:last-child { margin-bottom: 0; }
.steps pre { margin: 0; padding: 12px 14px; border: 1px solid var(--line-strong); background: var(--paper); overflow-x: auto; font-size: 14px; color: var(--ink); }

table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 400; color: var(--steel); font-size: 13px; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line-strong); }
td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.num, th.num { text-align: right; }
.state { display: inline-flex; align-items: center; gap: 8px; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }

.log { margin: 0; padding: 0; list-style: none; max-width: 760px; }
.log li { display: grid; grid-template-columns: 90px 170px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.log .ver { font-weight: 700; }
.log time { color: var(--steel); }
.log p { margin: 0; }

footer { display: flex; flex-wrap: wrap; gap: 24px; padding: 28px 0 40px; color: var(--steel); font-size: 13px; }
footer a { color: var(--steel); }
footer .right { margin-left: auto; }

/* страница 404 */
.notfound { padding: 120px 0 140px; border-bottom: 1px solid var(--line-strong); }
.notfound h1 { margin: 0 0 16px; font-size: clamp(30px, 4.2vw, 52px); line-height: 1.08; letter-spacing: -.02em; }
.notfound p { margin: 0 0 24px; color: var(--steel); }

/* узкие экраны */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-text { border-right: 0; padding: 48px 0 32px; }
  .drawing { padding: 24px 0 0; border-top: 1px solid var(--line-strong); }
  .drawing-foot { grid-template-columns: minmax(0, 1fr); }
  .stamp { justify-self: end; }
  .props { grid-template-columns: 1fr; }
  .props > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .log li { grid-template-columns: 70px 1fr; }
  .log li p { grid-column: 1 / -1; }
  .top nav a:not(.keep) { display: none; }
  .table-wrap { overflow-x: auto; }
}

@media (max-width: 600px) {
  .drawing svg.wide { display: none; }
  .drawing svg.tall { display: block; max-width: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  .drawing .wire { animation: none; stroke-dashoffset: 0; }
  .drawing .head { animation: none; opacity: 1; }
}
