/* metalgen × Bakpol — «Perforacja»: швейцарский плакат на перфорированном листе.
   Цвета: catalogs/bakpol/factory.json → theme (#cd2c03, #9e2202, #fbeae5, #ffffff) и производные. */
:root {
  --acc: #cd2c03;
  --acc-d: #9e2202;
  --acc-s: #fbeae5;
  --on: #ffffff;
  --paper: #fdf8f6;      /* acc-s, осветлённый */
  --paper-2: #f7ebe6;    /* между acc-s и paper */
  --ink: #2b0e06;        /* acc-d, затемнённый */
  --ink-2: #6a3a2c;      /* приглушённые чернила */
  --line: rgba(43, 14, 6, .14);
  --f: "Helvetica Neue", "Inter", "Segoe UI Variable Display", "Segoe UI", Arial, system-ui, sans-serif;
  --gut: 16px;
  --r: 4px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.5 var(--f); font-feature-settings: "tnum" 1, "kern" 1;
  overflow-wrap: break-word;
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
b { font-weight: 800; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--on); padding: 10px 14px; z-index: 50; }
.skip:focus { top: 8px; }

/* перфорация: отверстия цвета acc-d на плите acc */
.perf {
  background-color: var(--acc);
  background-image: radial-gradient(circle at 50% 50%, var(--acc-d) 0 1.7px, transparent 2.2px);
  background-size: 13px 13px;
  color: var(--on);
}

/* шапка */
.hd {
  display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap;
  padding: 12px var(--gut); background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 800; letter-spacing: -.02em; font-size: 19px; }
.brand .x { color: var(--acc); font-weight: 400; }
.brand .fn { color: var(--acc); }
.concept {
  font-size: 13px; line-height: 1.3; color: var(--ink-2); border: 1px solid var(--line);
  padding: 5px 10px; border-radius: 999px; background: var(--on);
}
.langs { margin-left: auto; display: flex; gap: 4px; }
.langs a {
  display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 8px;
  text-decoration: none; font-weight: 700; font-size: 14px; letter-spacing: .06em; border-radius: var(--r);
}
html[lang="pl"] .lk-pl, html[lang="en"] .lk-en { background: var(--ink); color: var(--on); }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: var(--r); text-decoration: none;
  font-weight: 800; font-size: 17px; letter-spacing: -.01em; transition: transform .15s ease, background-color .15s;
}
.btn-main { background: var(--ink); color: var(--on); }
.btn-ghost { border: 2px solid currentColor; }
.btn .arr { font-weight: 400; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }

/* hero */
.hero { position: relative; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { font-weight: 800; letter-spacing: -.045em; line-height: .94; }
.hero h1 span { display: block; }
.hero .h1b { color: var(--acc-s); }
.hero .lead { max-width: 60ch; }
.stat {
  position: relative; background: var(--paper); color: var(--ink); border-radius: var(--r);
  padding: 22px 22px 18px; box-shadow: 0 1px 0 var(--acc-d), 0 18px 40px -22px rgba(43, 14, 6, .55);
}
.stat::before, .stat::after {      /* «заклёпки» таблички */
  content: ""; position: absolute; top: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--acc-s); box-shadow: inset 0 1px 1px rgba(43, 14, 6, .35);
}
.stat::before { left: 10px; } .stat::after { right: 10px; }
.stat-n { font-size: 84px; line-height: .9; font-weight: 800; letter-spacing: -.05em; color: var(--acc); }
.stat-l { font-weight: 700; margin-top: 6px; }
.stat-mix { color: var(--ink-2); font-size: 15px; }
.stat-sum { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.stat-sum span { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.stat-cap { font-size: 13px; color: var(--ink-2); }

/* секции */
.sec-h { display: grid; gap: 8px; margin-bottom: 22px; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--acc); }
h2 { font-weight: 800; letter-spacing: -.035em; line-height: 1.02; }
.sec-note { color: var(--ink-2); font-size: 15px; max-width: 70ch; margin-top: 10px; }
section { scroll-margin-top: 72px; }

/* выбор сценария */
.chip {
  font: inherit; color: inherit; cursor: pointer; text-align: left; background: var(--on);
  border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; min-height: 44px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: baseline;
}
.chip-n { font-weight: 800; color: var(--acc); grid-row: span 2; font-size: 22px; letter-spacing: -.04em; }
.chip-t { font-weight: 800; }
.chip-m { font-size: 14px; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on); border-color: var(--ink); }
.chip[aria-pressed="true"] .chip-n { color: var(--acc-s); }
.chip[aria-pressed="true"] .chip-m { color: var(--acc-s); }

/* карточка сценария */
.card { background: var(--on); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; min-width: 0; }
.card-h { padding: 16px 18px 6px; display: grid; gap: 2px; }
.card-n { font-weight: 800; color: var(--acc); font-size: 14px; letter-spacing: .1em; }
.card-h h3 { font-size: 24px; letter-spacing: -.03em; line-height: 1.1; }
.card-m { font-weight: 700; }
.card-d { color: var(--ink-2); font-size: 15px; }
.card-fig { padding: 0 6px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.facts > div { padding: 12px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.facts > div:nth-child(2n) { border-right: 0; }
.facts dt { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.facts dd { font-weight: 600; }
.facts .big { font-size: 34px; line-height: 1; letter-spacing: -.04em; color: var(--acc); }
.facts .tot { background: var(--ink); color: var(--on); }
.facts .tot dt { color: var(--acc-s); }
.facts .tot b { font-size: 22px; letter-spacing: -.02em; }

/* легенда */
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.sw { display: inline-block; width: 16px; height: 12px; border-radius: 2px; }
.sw-lk { background: linear-gradient(90deg, var(--acc) 60%, var(--acc-d) 60%); }
.sw-bn { background: var(--ink); }
.sw-ai { background: rgba(205, 44, 3, .14); outline: 1.5px dashed var(--acc); outline-offset: -1.5px; }
.sw-dr { background: repeating-linear-gradient(45deg, rgba(43, 14, 6, .45) 0 1.5px, transparent 1.5px 5px); outline: 1px dashed var(--ink); outline-offset: -1px; }
.sw-zn { background: var(--acc-s); outline: 1px solid var(--ink-2); outline-offset: -1px; }
.swipe-hint { display: none; }

/* аксонометрия */
.iso { display: block; width: 100%; height: auto; }
.iso .wall { stroke: rgba(43, 14, 6, .25); stroke-width: 1; }
.iso .pf { fill: var(--acc); opacity: .2; }
.iso .floor { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.4; }
.iso .grid { stroke: rgba(43, 14, 6, .09); stroke-width: 1; }
.iso .doorband { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 4; }
.iso .hatch { stroke: rgba(43, 14, 6, .38); stroke-width: 1.5; }
.iso .aisle { fill: rgba(205, 44, 3, .1); stroke: var(--acc); stroke-width: 1.4; stroke-dasharray: 7 5; transition: fill .2s ease; }
.iso .aisle.hl { fill: rgba(205, 44, 3, .34); }
.iso .lk polygon, .iso .bn polygon { stroke: rgba(43, 14, 6, .4); stroke-width: .6; stroke-linejoin: round; }
.iso .lk-top { fill: var(--acc-s); }
.iso .lk-s { fill: var(--acc); }
.iso .lk-e { fill: var(--acc-d); }
.iso .lk-door { stroke: rgba(255, 255, 255, .6); stroke-width: 1; fill: none; }
.iso .bn-top { fill: #6a3a2c; }
.iso .bn-s { fill: var(--ink); }
.iso .bn-e { fill: #1a0703; }
.iso .zone-win { fill: var(--acc-s); stroke: var(--ink-2); stroke-width: 1; }
.iso .zone-line { stroke-width: 6; stroke-linecap: butt; }
.iso line.zone-win { stroke: #e8b6a6; }
.iso .zone-rad { stroke: var(--ink-2); }
.iso .door { stroke: var(--ink); stroke-width: 8; stroke-linecap: butt; }
.iso .dim, .iso .door-t { fill: var(--ink); font: 700 24px var(--f); letter-spacing: -.01em; }
.iso .lab-bg { fill: var(--ink); transition: fill .2s ease; }
.iso .lab-t { fill: var(--on); font: 800 22px var(--f); font-variant-numeric: tabular-nums; }
.iso .lab.hl .lab-bg { fill: var(--acc); }
.iso .lab-m { display: none; }
.iso .lab-m .lab-t { font-size: 38px; }

/* ledger */
.lg-cap { font-weight: 800; margin-bottom: 10px; }
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 10px; border-bottom: 1px solid var(--line); }
thead th { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); border-bottom: 2px solid var(--ink); }
tbody th { font-weight: 700; }
.ltab .pl { font-weight: 800; white-space: nowrap; }
.ltab .rq { white-space: nowrap; color: var(--ink-2); }
.ltab .src { font-size: 13px; color: var(--ink-2); }
.ltab tr[data-ref] { cursor: pointer; }
.ltab tr[data-ref]:hover, .ltab tr[data-ref]:focus-visible, .ltab tr.hl { background: var(--acc-s); }
.badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; white-space: nowrap; border: 1.5px solid var(--ink); }
tr.fail .badge { background: var(--ink); color: var(--on); }
tr.fail .pl { color: var(--acc); }
.warns { margin-top: 14px; border-left: 4px solid var(--acc); background: var(--on); padding: 12px 16px; font-size: 15px; }
.warns-h { font-weight: 800; margin-bottom: 4px; }
.warns li + li { margin-top: 6px; }
.docs { margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.docs summary { cursor: pointer; font-weight: 700; color: var(--ink); min-height: 44px; display: flex; align-items: center; }
.docs dl { display: grid; gap: 8px; }
.docs dt { font-weight: 800; color: var(--ink); }

/* спецификация */
.spec-d > summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; color: var(--acc); }
.stab .n { text-align: right; white-space: nowrap; }
.stab tfoot th, .stab tfoot td { border-bottom: 0; border-top: 2px solid var(--ink); font-size: 17px; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 8px; background: var(--acc-s); color: var(--acc-d); border-radius: 999px; white-space: nowrap; }

/* шаги */
.steps { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.steps li { background: var(--paper); padding: 20px; display: grid; gap: 6px; align-content: start; }
.st-n { font-size: 64px; line-height: .85; font-weight: 800; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1.5px var(--acc); }
.steps h3 { font-size: 20px; letter-spacing: -.02em; }
.steps p { color: var(--ink-2); font-size: 15px; }

/* честные плитки */
.tiles { display: grid; gap: 12px; }
.tile { border-radius: var(--r); padding: 20px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.tile h3 { font-size: 30px; letter-spacing: -.04em; line-height: 1; }
.tile-s { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.tile-on .tile-s { color: var(--acc-s); }
.tile-wait {
  border: 2px dashed var(--ink-2); color: var(--ink);
  background: repeating-linear-gradient(-45deg, var(--paper) 0 10px, var(--paper-2) 10px 20px);
}
.tile-wait .tile-s { color: var(--acc); }
.tile-wait p:last-child { color: var(--ink-2); }

/* финал */
.final { display: grid; gap: 18px; }
.final h2 { color: var(--on); }
.final .btn-main { background: var(--paper); color: var(--ink); }
.who { background: var(--paper); color: var(--ink); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 2px; max-width: 520px; }
.who-h { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--acc); }
.who-n { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.who-r { color: var(--ink-2); font-size: 15px; }
.who a { font-weight: 700; display: inline-block; padding: 8px 0; }

.ft { padding: 24px var(--gut) 32px; font-size: 13px; color: var(--ink-2); display: grid; gap: 6px; border-top: 1px solid var(--line); }
.dock { display: none; }

/* видимость по выбранному сценарию */
html[data-sc="1"] [data-for]:not([data-for="1"]),
html[data-sc="2"] [data-for]:not([data-for="2"]),
html[data-sc="3"] [data-for]:not([data-for="3"]) { display: none; }

/* «жалюзи»: заголовки секций открываются горизонтальными ламелями по прокрутке */
@property --lv { syntax: "<length>"; inherits: false; initial-value: 14px; }
@keyframes louvre { from { --lv: 0px; } to { --lv: 14px; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .lv {
      -webkit-mask-image: repeating-linear-gradient(180deg, #000 0 var(--lv), transparent var(--lv) 14px);
      mask-image: repeating-linear-gradient(180deg, #000 0 var(--lv), transparent var(--lv) 14px);
      animation: louvre linear both; animation-timeline: view(); animation-range: entry 0% entry 100%;
    }
  }
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-2px); }
  .chip:hover:not([aria-pressed="true"]) { border-color: var(--ink); }
}
