/* Техническое описание HuVam (/tech): поверх site.css — те же цвета, шрифт и карточки. Без встроенных стилей (CSP). */

.t-hero { padding: 48px 0 8px; }
.t-hero .back { display: table; margin-bottom: 26px; color: var(--acc2); text-decoration: none; font-size: 15px; }
.t-hero .back::before { content: '‹ '; }
.t-hero h1 { font-size: clamp(34px, 5.4vw, 60px); max-width: 15em; }
.t-hero .lead { max-width: 44em; margin: 20px 0 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip { padding: 6px 13px; border-radius: 999px; font-size: 14px; color: var(--muted); background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1); }
.chip-acc { color: var(--acc2); background: rgba(255, 122, 26, .1); border-color: rgba(255, 122, 26, .3); }
.chip-warn { color: var(--fg); border-color: rgba(255, 200, 120, .35); }
.chip-warn::before { content: '! '; color: var(--acc2); font-weight: 700; }
.t-upd { margin-top: 16px; font-size: 14px; color: var(--dim); }

/* оглавление слева, текст справа */
.t-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; align-items: start; }
.toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; padding: 4px 4px 12px 0; margin-top: 64px;
  scrollbar-width: thin; }
.toc-h { font: 600 12px/1 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 14px; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; border-left: 1px solid rgba(255, 255, 255, .08); }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted);
  text-decoration: none; font-size: 14.5px; line-height: 1.35; }
.toc a::before { content: counter(toc, decimal-leading-zero); font: 500 12px/1.6 ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--dim); }
.toc a:hover { color: var(--fg); }
.toc a.on { color: var(--fg); border-left-color: var(--acc); }
.toc a.on::before { color: var(--acc2); }
.toc a:focus-visible { outline: 2px solid var(--acc2); outline-offset: 2px; }

/* разделы */
.t-main { min-width: 0; }
.tsec { padding-top: 64px; scroll-margin-top: 72px; }
.tsec h2 { display: flex; align-items: baseline; gap: 14px; font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 18px; }
.t-n { font: 600 14px/1 ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--acc2); letter-spacing: .06em; flex: none; }
.t-lead { color: var(--muted); font-size: 18px; max-width: 44em; margin-bottom: 22px; }
.t-p { color: var(--muted); max-width: 46em; margin-top: 14px; }
.t-dim { color: var(--dim); font-size: 15px; }
.t-h3 { margin: 30px 0 12px; }
.t-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 6px 0 8px; }
.t-cards3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.t-cards .card { padding: 22px; }
.t-cards .card h3 { font-size: 17px; }
.t-cards .card p { font-size: 15.5px; }
#principles .card:first-child { grid-column: 1 / -1; background: linear-gradient(135deg, var(--card2), var(--card)); border-color: var(--line); }
.t-box { margin: 18px 0; }
.t-note { margin-top: 20px; border-left: 3px solid rgba(255, 122, 26, .55); }
.t-note p { color: var(--muted); font-size: 16px; }
.t-list, .t-steps { margin: 14px 0 0; padding: 0; list-style: none; max-width: 46em; }
.t-list li { position: relative; padding: 7px 0 7px 22px; color: var(--muted); }
.t-list li::before { content: ''; position: absolute; left: 3px; top: 17px; width: 7px; height: 7px; border-radius: 2px; background: var(--acc); }
.t-steps { counter-reset: st; }
.t-steps li { counter-increment: st; position: relative; padding: 9px 0 9px 42px; color: var(--muted); }
.t-steps li::before { content: counter(st); position: absolute; left: 0; top: 7px; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--acc2); background: rgba(255, 122, 26, .1); border: 1px solid var(--line); }

code { font: 500 .88em/1.4 ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--acc2); }
.formula { margin: 20px 0 6px; padding: 18px 20px; border-radius: 14px; background: #110d0a; border: 1px solid var(--line);
  overflow-x: auto; font: 500 13.5px/1.7 ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--fg); tab-size: 2; }
.formula code { font: inherit; color: inherit; }
.formula .c { color: var(--dim); }
.formula:focus-visible, .tbl-wrap:focus-visible { outline: 2px solid var(--acc2); outline-offset: 2px; }

/* ключи личности */
.keys { margin: 16px 0 6px; padding: 0; list-style: none; display: grid; gap: 8px; max-width: 46em; }
.keys li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 12px 16px; border-radius: 12px;
  background: var(--card); border: 1px solid rgba(255, 255, 255, .07); color: var(--muted); }

/* таблицы */
.tbl-wrap { margin: 8px 0 10px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 16px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 620px; }
.tbl th, .tbl td { padding: 13px 16px; text-align: left; vertical-align: top; border-top: 1px solid rgba(255, 255, 255, .06); }
.tbl thead th { border-top: 0; background: rgba(255, 255, 255, .035); color: var(--fg); font-weight: 650; font-size: 14px; white-space: nowrap; }
.tbl td { color: var(--muted); }
.tbl td:first-child, .tbl tbody th { color: var(--fg); font-weight: 550; }
.tbl td code { white-space: nowrap; }
.tbl-srv .y, .tbl-srv .m, .tbl-srv .n { font-weight: 600; }
.tbl-srv .y, .tbl-srv .n { white-space: nowrap; }
.tbl-srv td:nth-child(2) { width: 24%; }
.tbl-srv .y { color: var(--fg); }
.tbl-srv .m { color: var(--acc2); }
.tbl-srv .n { color: #8fd18f; }
.tbl-srv .n::before { content: '✕ '; }
.tbl-plat { min-width: 480px; }
.tbl-plat tbody th { width: 130px; }
.tbl-threat { min-width: 700px; }
.tbl-threat tbody th { width: 26%; }
.tbl-threat td.no { color: var(--fg); background: rgba(255, 122, 26, .05); }

/* схема знакомства: две дорожки и стрелки */
.seq { margin: 22px 0 6px; padding: 18px 20px 8px; border-radius: 16px; background: var(--card); border: 1px solid rgba(255, 255, 255, .07); }
.seq-lanes { display: flex; justify-content: space-between; margin-bottom: 8px; }
.seq-lane { font: 600 11.5px/1.3 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--acc2);
  padding: 6px 10px; border-radius: 8px; background: rgba(255, 122, 26, .1); border: 1px solid var(--line); }
.seq-msg { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6% 18px; text-align: center; }
.seq-msg b { font-size: 15px; font-weight: 600; }
.seq-msg code { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.seq-msg i { position: absolute; left: 4%; right: 4%; bottom: 6px; height: 2px; background: linear-gradient(90deg, rgba(255, 122, 26, .25), var(--acc)); }
.seq-msg i::after { content: ''; position: absolute; top: -4px; right: -2px; border: 5px solid transparent; border-left: 8px solid var(--acc); border-right: 0; }
.seq-msg.to-a i { background: linear-gradient(270deg, rgba(255, 122, 26, .25), var(--acc)); }
.seq-msg.to-a i::after { right: auto; left: -2px; border-left: 0; border-right: 8px solid var(--acc); }
.seq-msg.both i { background: repeating-linear-gradient(90deg, var(--acc2) 0 6px, transparent 6px 11px); }
.seq-msg.both i::after { display: none; }
.seq-msg.both b { color: var(--acc2); }

/* слои одного сообщения */
.layers { margin: 26px 0 6px; }
.layers figcaption, .flow figcaption { font: 600 12px/1 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 12px; }
.ly { border-radius: 16px; padding: 16px 18px 18px; }
.ly .ly { margin-top: 14px; }
.ly1 { background: rgba(255, 255, 255, .03); border: 1px dashed rgba(255, 160, 90, .35); }
.ly2 { background: rgba(255, 122, 26, .06); border: 1px solid var(--line); }
.ly3 { background: rgba(255, 122, 26, .14); border: 1px solid rgba(255, 140, 60, .45); box-shadow: 0 0 30px rgba(255, 110, 30, .12); }
.ly-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.ly-h b { font-weight: 650; }
.ly-h code { font-size: 12.5px; }
.ly-s { margin-top: 2px; font-size: 14.5px; color: var(--muted); }

/* путь сообщения и звонка: три узла */
.flow { margin: 26px 0 6px; }
.flow ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px; margin: 0; padding: 0; list-style: none; }
.node { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 18px; border-radius: 16px; background: var(--card);
  border: 1px solid rgba(255, 255, 255, .08); text-align: center; }
.node b { font-weight: 650; }
.node span, .node code { font-size: 14px; color: var(--muted); }
.node code { color: var(--acc2); font-size: 12.5px; }
.node-srv { border-style: dashed; border-color: rgba(255, 160, 90, .35); background: rgba(255, 255, 255, .02); }
.node + .node::before { content: ''; position: absolute; left: -30px; top: 50%; width: 26px; height: 2px; background: var(--acc); }
.node + .node::after { content: ''; position: absolute; left: -9px; top: calc(50% - 4px); border: 5px solid transparent; border-left: 7px solid var(--acc); border-right: 0; }
.flow-call .node + .node::after { display: none; }
.flow-call .node + .node::before { left: -32px; width: 30px; background: repeating-linear-gradient(90deg, var(--acc) 0 5px, transparent 5px 9px); }

/* пределы, дорожная карта, уязвимость */
.limits { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.limits li { position: relative; padding: 16px 18px 16px 46px; border-radius: 14px; background: var(--card); border: 1px solid rgba(255, 255, 255, .07);
  color: var(--muted); font-size: 15.5px; }
.limits li::before { content: '!'; position: absolute; left: 14px; top: 15px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px;
  font-weight: 700; font-size: 13px; color: #1b0d03; background: var(--acc2); }
.limits li:first-child { grid-column: 1 / -1; color: var(--fg); border-color: var(--line); background: linear-gradient(135deg, rgba(255, 122, 26, .12), var(--card)); }
.road { margin: 0; padding: 0; list-style: none; counter-reset: rd; border-left: 2px solid var(--line); }
.road li { counter-increment: rd; position: relative; padding: 8px 0 14px 26px; color: var(--muted); max-width: 44em; }
.road li::before { content: ''; position: absolute; left: -7px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg);
  border: 2px solid var(--acc); }
#audit .state { margin: 0 0 6px; }
.t-report { display: grid; gap: 12px; border-color: var(--line); background: linear-gradient(135deg, rgba(255, 122, 26, .1), var(--card)); }
.t-report p { color: var(--muted); }
.t-mail { font-size: 18px; color: var(--fg) !important; }
.t-mail a { font-weight: 650; }

/* узкие экраны */
@media (max-width: 980px) {
  .t-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; max-height: none; overflow: visible; margin-top: 36px; padding: 18px 18px 8px; border-radius: 16px;
    background: var(--card); border: 1px solid rgba(255, 255, 255, .07); }
  .toc ol { border-left: 0; columns: 2; column-gap: 20px; }
  .toc a { padding: 5px 0; border-left: 0; margin: 0; break-inside: avoid; }
  .t-cards3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .t-hero { padding-top: 28px; }
  .toc ol { columns: 1; }
  .t-cards, .limits { grid-template-columns: minmax(0, 1fr); }
  .formula { font-size: 12.5px; padding: 14px 16px; }
  .keys li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .flow ol { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .node + .node::before { left: calc(50% - 1px); top: -24px; width: 2px; height: 22px; }
  .node + .node::after { left: calc(50% - 5px); top: -9px; border: 5px solid transparent; border-top: 7px solid var(--acc); border-bottom: 0; }
  .flow-call .node + .node::before { width: 2px; height: 22px; left: calc(50% - 1px); top: -24px;
    background: repeating-linear-gradient(180deg, var(--acc) 0 5px, transparent 5px 9px); }
  .seq { padding: 14px 12px 6px; }
  .seq-msg { padding: 10px 2% 16px; }
  .tsec { padding-top: 52px; }
}
@media (prefers-reduced-motion: reduce) { .toc a { transition: none; } }
