/* CAD AI Project — every page is a drawing sheet */
:root {
  --paper: #ECEFEA;
  --paper-2: #E2E7E1;
  --ink: #1E2327;
  --ink-2: #4A5459;
  --line: #8A949A;
  --accent: #1F6FB2;
  --accent-ink: #164F80;
  --focus: #1F6FB2;
  --measure: 68ch;
  --frame: 28px;
  font-size: 17px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variation-settings: "wdth" 100;
  line-height: 1.55;
}

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

/* ---- sheet frame ---- */
.sheet {
  position: relative;
  max-width: 1180px;
  margin: 24px auto;
  padding: calc(var(--frame) + 28px) calc(var(--frame) + 36px) 0;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
.sheet::before {               /* inner frame line, like a drawing border */
  content: "";
  position: absolute;
  inset: var(--frame);
  border: 0.75px solid var(--ink);
  pointer-events: none;
}
.zones { position: absolute; color: var(--line); font-size: 11px; font-variation-settings: "wdth" 75; pointer-events: none; }
.zones.top { top: 6px; left: var(--frame); right: var(--frame); display: flex; justify-content: space-around; }
.zones.left { left: 9px; top: var(--frame); bottom: var(--frame); display: flex; flex-direction: column; justify-content: space-around; }

/* ---- header ---- */
.masthead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 0.75px solid var(--line);
}
.brand {
  font-size: 22px; font-weight: 700; letter-spacing: 0.01em; color: var(--ink); text-decoration: none;
  font-variation-settings: "wdth" 72;
}
.brand span { font-weight: 400; color: var(--ink-2); }
.nav { display: flex; gap: 22px; flex-wrap: wrap; font-size: 15px; }
.nav a { color: var(--ink); text-decoration: none; padding: 2px 0; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: var(--ink); color: var(--ink); }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent-ink); }

main { flex: 1; padding: 40px 0 56px; }

/* ---- type ---- */
h1, h2, h3 { font-variation-settings: "wdth" 70; line-height: 1.08; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(40px, 6vw, 68px); letter-spacing: -0.01em; max-width: 16ch; }
h2 { font-size: clamp(26px, 3vw, 34px); margin-top: 1.6em; }
h3 { font-size: 21px; margin-top: 1.4em; }
p, li { max-width: var(--measure); }
.lede { font-size: 20px; color: var(--ink-2); max-width: 54ch; }
.small { font-size: 14px; color: var(--ink-2); }

/* ---- hero drawing ---- */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: center; }
.drawing { width: 100%; height: auto; display: block; }
.drawing .outline { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.drawing .hidden  { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 7 4; }
.drawing .center  { fill: none; stroke: var(--accent); stroke-width: 0.9; stroke-dasharray: 18 4 3 4; }
.drawing .dim     { fill: none; stroke: var(--ink-2); stroke-width: 0.8; }
.drawing .hatch   { stroke: var(--ink-2); stroke-width: 0.7; }
.drawing text { font-family: "Archivo", sans-serif; font-variation-settings: "wdth" 75; font-size: 13px; fill: var(--ink); }
.drawing .label { font-size: 12px; fill: var(--ink-2); }
.draw-in .outline, .draw-in .dim { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.4s ease-out forwards; }
.draw-in .dim { animation-delay: 1.2s; animation-duration: 1.4s; }
.draw-in text, .draw-in .hatch, .draw-in .center, .draw-in .hidden { opacity: 0; animation: appear 0.6s ease-out 2.2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .draw-in .outline, .draw-in .dim { animation: none; stroke-dashoffset: 0; stroke-dasharray: none; }
  .draw-in text, .draw-in .hatch, .draw-in .center, .draw-in .hidden { animation: none; opacity: 1; }
}

/* ---- sections ---- */
.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 12px; border-top: 0.75px solid var(--line); }
.columns > div { padding: 20px 24px 8px 0; }
.columns > div + div { padding-left: 24px; border-left: 0.75px solid var(--line); }
.columns h3 { margin-top: 0; }

.steps { list-style: none; padding: 0; margin: 16px 0 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 14px 0; border-top: 0.75px solid var(--line); max-width: none; }
.steps li::before {
  content: "W" counter(step); font-variation-settings: "wdth" 65; font-weight: 700; font-size: 20px; color: var(--accent-ink);
}
.steps strong { display: block; font-size: 18px; }

.index-list { list-style: none; padding: 0; margin: 12px 0 0; }
.index-list li { padding: 16px 0; border-top: 0.75px solid var(--line); max-width: none; display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; }
.index-list a { font-size: 19px; font-weight: 600; text-decoration: none; color: var(--ink); }
.index-list a:hover { color: var(--accent-ink); text-decoration: underline; }
.index-list p { grid-column: 1 / -1; margin: 0; color: var(--ink-2); }
.index-list .meta { font-size: 14px; color: var(--ink-2); white-space: nowrap; }

table.parts { border-collapse: collapse; width: 100%; margin-top: 12px; font-size: 15px; }
table.parts th, table.parts td { text-align: left; padding: 10px 12px 10px 0; border-top: 0.75px solid var(--line); vertical-align: top; }
table.parts th { font-weight: 600; color: var(--ink-2); font-variation-settings: "wdth" 80; }
table.parts td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- forms & buttons ---- */
.button {
  display: inline-block; font: inherit; font-weight: 600; font-size: 16px; padding: 11px 20px;
  background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink); border-radius: 2px; cursor: pointer; text-decoration: none;
}
.button:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--paper); }
.button.quiet { background: transparent; color: var(--ink); }
.button.quiet:hover { background: var(--paper-2); color: var(--ink); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

form.panel { max-width: 460px; display: grid; gap: 14px; margin-top: 16px; }
label { display: grid; gap: 6px; font-size: 15px; font-weight: 600; }
input, select, textarea {
  font: inherit; font-size: 16px; font-weight: 400; padding: 10px 12px; color: var(--ink);
  background: #F6F8F4; border: 1px solid var(--line); border-radius: 2px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(31,111,178,.25); }
.notice { padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--paper-2); max-width: 460px; }
.notice.error { border-left-color: #A23B2A; }
[hidden] { display: none !important; }

/* ---- article ---- */
article { max-width: var(--measure); }
article p, article li { font-size: 17.5px; line-height: 1.65; }
article figure { margin: 28px 0; }
article figcaption { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
article pre { background: var(--paper-2); padding: 14px 16px; overflow-x: auto; font-size: 14px; border-left: 2px solid var(--line); }
article blockquote { margin: 24px 0; padding-left: 18px; border-left: 2px solid var(--accent); color: var(--ink-2); }

/* ---- title block (footer) ---- */
.titleblock {
  display: grid; grid-template-columns: 2.2fr 1.6fr 1fr 1fr 1fr; margin: 0 calc(-1 * 36px) 0 auto;
  width: min(100%, 720px); border-top: 0.75px solid var(--ink); border-left: 0.75px solid var(--ink);
  font-size: 13px; position: relative; top: 0;
}
.titleblock > div { padding: 6px 10px 8px; border-right: 0.75px solid var(--ink); border-bottom: 0.75px solid var(--ink); }
.titleblock > div:last-child { border-right: 0; }
.titleblock dt { color: var(--ink-2); font-size: 11px; }
.titleblock dd { margin: 0; font-weight: 600; font-variation-settings: "wdth" 75; }
.titleblock .wide { grid-column: span 2; }
.site-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: var(--frame); }
.site-foot .links { font-size: 14px; display: flex; gap: 18px; flex-wrap: wrap; padding: 0 0 12px; }

/* ---- responsive ---- */
@media (max-width: 880px) {
  :root { --frame: 12px; }
  .sheet { margin: 0; border: 0; padding: 28px 16px 0; min-height: 100vh; }
  .sheet::before, .zones.top, .zones.left { display: none; }
  .hero { grid-template-columns: 1fr; }
  .nav { gap: 6px 16px; font-size: 15px; }
  .columns { grid-template-columns: 1fr; }
  .columns > div, .columns > div + div { padding: 18px 0 4px; border-left: 0; border-top: 0.75px solid var(--line); }
  .columns > div:first-child { border-top: 0; }
  .titleblock { margin: 0; width: 100%; grid-template-columns: 1fr 1fr; }
  .titleblock .wide { grid-column: span 2; }
  .site-foot { margin-bottom: 0; }
  table.parts .hide-sm { display: none; }
}

.hero-fig { margin: 0; }
.article-title { max-width: 22ch; }

/* ---- 3D hero ---- */
.part3d canvas { display: none; width: 100%; height: auto; }
.part3d.is-live canvas { display: block; }
.feature-tree { list-style: none; counter-reset: feat; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 24px; font-size: 14px; font-variation-settings: "wdth" 80; color: var(--line); }
.feature-tree li { counter-increment: feat; display: grid; grid-template-columns: 22px 1fr; max-width: none; transition: color .3s; }
.feature-tree li::before { content: counter(feat); color: inherit; }
.feature-tree li.is-done { color: var(--ink-2); }
.feature-tree li.is-active { color: var(--accent-ink); font-weight: 600; }
.part3d:not(.is-live) .feature-tree li { color: var(--ink-2); }
@media (max-width: 880px) { .feature-tree { grid-template-columns: 1fr; } }

/* ---- cookie consent ---- */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; z-index: 20;
  background: var(--paper); border: 1.5px solid var(--ink); padding: 14px 16px; display: grid; gap: 10px; font-size: 15px; }
.consent p { margin: 0; max-width: none; }
.consent .actions { margin-top: 0; }

/* ---- мобильные правки 29.10: штамп без дыр, крупнее зона нажатия меню ---- */
@media (max-width: 880px) {
  .titleblock { grid-auto-flow: row dense; border-right: 0.75px solid var(--ink); }
  .titleblock > div, .titleblock > div:last-child { border-right: 0; }
  /* левые клетки пар (No., Rev.) — вертикальный разделитель */
  .titleblock > div:nth-child(2), .titleblock > div:nth-child(4) { border-right: 0.75px solid var(--ink); }
  .nav { gap: 0 4px; margin: 0 -8px; }
  .nav a { padding: 10px 8px; }
}
