/* --- Архитектура и данные · AutoParser ---
   Тот же editorial-стиль (Fraunces + IBM Plex), что и pricing-methodology.css,
   но собственный набор переменных — страница не должна зависеть от других CSS. */

:root {
  --ink-900: #0f0f15;
  --ink-800: #13131a;
  --ink-700: #1a1a23;
  --ink-650: #202028;
  --ink-600: #25252f;
  --ink-500: #3a3a48;
  --paper-50: #f5f1ea;
  --paper-100: #ece6dc;
  --paper-200: #d8d1c4;
  --ink-text: #e8e5e0;
  --ink-muted: #8e8a82;
  --ink-faint: #5d5a55;
  --accent: #d4a574;
  --accent-soft: rgba(212, 165, 116, 0.14);
  --accent-line: rgba(212, 165, 116, 0.3);
  --success: #6fbb82;
  --success-soft: rgba(111, 187, 130, 0.12);
  --info: #7cb0d4;
  --info-soft: rgba(124, 176, 212, 0.12);
  --info-line: rgba(124, 176, 212, 0.32);
  --warn: #d4a574;
  --danger: #c75a55;
  --danger-soft: rgba(199, 90, 85, 0.12);
  --rule: rgba(232, 229, 224, 0.1);
  --rule-strong: rgba(232, 229, 224, 0.22);
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --content-max: 1180px;
  --measure: 720px;
  --col-gutter: 32px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink-800);
  color: var(--ink-text);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 800px 600px at 82% -8%, rgba(212, 165, 116, 0.07), transparent),
    radial-gradient(ellipse 640px 420px at -4% 22%, rgba(60, 60, 75, 0.38), transparent);
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-line); }
a:hover { border-bottom-color: var(--accent); }
::selection { background: var(--accent); color: var(--ink-900); }
code { font-family: var(--font-mono); font-size: 0.92em; color: var(--accent); background: transparent; }

/* --- Masthead --- */

.masthead {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 22px var(--col-gutter) 8px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.masthead-brand {
  display: inline-flex; border: 0; border-radius: 9px; background: #fff;
  padding: 7px 13px;
  box-shadow: 0 14px 30px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--paper-200);
}
.masthead-logo { height: 34px; width: auto; display: block; }
.masthead-divider { width: 1px; height: 22px; background: var(--rule-strong); }
.masthead-name {
  font-family: var(--font-display); font-size: 17px; letter-spacing: 0.01em;
  color: var(--ink-muted);
}

/* --- Layout shell --- */

.page { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--col-gutter) 96px; }

/* --- Hero --- */

.hero { padding: 40px 0 8px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--accent-line); }
.hero h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(32px, 5vw, 50px); line-height: 1.12; letter-spacing: -0.01em;
  margin: 18px 0 20px; max-width: 20ch; color: #fff;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p.lede {
  font-size: 17px; line-height: 1.65; color: var(--ink-muted); max-width: var(--measure);
  margin: 0 0 8px;
}

/* --- Table of contents --- */

.toc { margin: 40px 0 0; padding: 22px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.toc-cap { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 12px; }
.toc-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 28px; margin: 0; padding: 0; list-style: none; }
.toc-list a {
  display: flex; gap: 10px; padding: 7px 0; font-size: 14px; color: var(--ink-muted); border-bottom: 0;
}
.toc-list a:hover { color: var(--ink-text); }
.toc-list .n { font-family: var(--font-mono); color: var(--ink-faint); }
@media (max-width: 800px) { .toc-list { grid-template-columns: 1fr; } }

/* --- Stage sections --- */

.stage { padding: 64px 0 8px; border-top: 1px solid var(--rule); }
.stage:first-of-type { border-top: 0; }
.stage-head { display: flex; gap: 20px; align-items: baseline; margin-bottom: 18px; }
.stage-num {
  font-family: var(--font-display); font-size: 15px; color: var(--ink-faint);
  font-feature-settings: "tnum"; padding-top: 4px; flex: 0 0 auto;
}
.stage h2 {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 3vw, 28px);
  color: #fff; margin: 0; letter-spacing: -0.005em;
}
.stage .dek { font-size: 15.5px; color: var(--ink-muted); margin: 0 0 22px; max-width: var(--measure); line-height: 1.6; }
.stage p { font-size: 15.5px; line-height: 1.72; color: var(--ink-text); max-width: var(--measure); margin: 0 0 16px; }
.section-sub {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.03em; color: var(--ink-faint);
  margin: 32px 0 14px;
}

/* --- Fact cards --- */

.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; margin: 4px 0 26px; }
.fact-card { background: var(--ink-700); padding: 16px 18px; }
.fact-card .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 8px; }
.fact-card .v { font-size: 14px; color: var(--ink-text); line-height: 1.5; }

/* --- Callouts --- */

.callout { border-radius: 12px; padding: 18px 20px; margin: 8px 0 26px; max-width: var(--measure); }
.callout-cap { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; margin: 0 0 8px; }
.callout p { margin: 0; font-size: 14.5px; line-height: 1.62; }
.callout--rule { background: var(--accent-soft); border: 1px solid var(--accent-line); }
.callout--rule .callout-cap { color: var(--accent); }
.callout--rule p { color: var(--ink-text); }

/* --- Domain groups (схема БД по доменам) --- */

.domain-group { margin: 0 0 30px; }
.domain-title {
  font-family: var(--font-display); font-weight: 500; font-size: 17px; color: #fff;
  margin: 0 0 10px; letter-spacing: -0.003em;
}

/* --- Generic table (schema / services / landscape) --- */

.pm-table-wrap { max-width: 100%; overflow-x: auto; margin: 4px 0 8px; }
.pm-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13.5px; }
.pm-table th, .pm-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.pm-table thead th { color: var(--ink-faint); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
.pm-table td { color: var(--ink-text); line-height: 1.5; }
.pm-table-note { font-size: 12.5px; color: var(--ink-faint); max-width: var(--measure); margin: 10px 0 26px; line-height: 1.55; }

.schema-table { min-width: 620px; }
.services-table { min-width: 900px; }
.landscape-table { min-width: 980px; }
.landscape-table td:first-child { font-family: var(--font-mono); color: var(--ink-faint); }

.tag {
  display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 11px;
  padding: 3px 9px; border-radius: 20px; white-space: nowrap;
}
.tag--det { background: var(--success-soft); color: var(--success); border: 1px solid rgba(111,187,130,.3); }
.tag--mix { background: var(--info-soft); color: var(--info); border: 1px solid var(--info-line); }

/* --- Legend (мимикрия под нотацию ArchiMate-слайда) --- */

.legend {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center;
  margin: 4px 0 28px; padding: 14px 18px; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--ink-700);
}
.legend-item { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-muted); }
.legend-swatch { width: 18px; height: 12px; border-radius: 2px; flex: 0 0 auto; }
.legend-swatch--proc { border: 1.5px solid var(--ink-muted); background: transparent; }
.legend-swatch--internal { border: 1.5px solid var(--accent-line); background: var(--accent-soft); }
.legend-swatch--external { border: 1.5px dashed var(--info-line); background: transparent; }
.legend-arrow { color: var(--accent); font-family: var(--font-mono); }

/* --- Business Process Landscape diagram --- */

.landscape { display: flex; flex-direction: column; gap: 34px; margin: 0 0 12px; }
.lchain-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 12px;
}
.lrow { display: flex; align-items: stretch; gap: 4px; flex-wrap: wrap; }
.lrow--single { max-width: 420px; }

.proc-card {
  flex: 1 1 240px; min-width: 220px; border: 1px solid var(--rule-strong); border-radius: 12px;
  background: linear-gradient(180deg, var(--ink-700), var(--ink-650));
  padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px;
}
.proc-card--facade { border-color: var(--accent-line); background: linear-gradient(180deg, var(--ink-650), var(--ink-600)); }
.proc-card--context { border-style: dashed; background: transparent; max-width: 340px; }
.proc-card--context .proc-head { color: var(--ink-muted); font-size: 14px; }
.proc-head {
  font-family: var(--font-display); font-size: 15px; font-weight: 500; color: #fff;
  line-height: 1.28; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.proc-arrow { color: var(--accent); font-family: var(--font-mono); font-weight: 400; flex: 0 0 auto; }
.proc-box {
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; padding: 8px 10px; border-radius: 7px;
}
.proc-box--internal { border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--ink-text); }
.proc-box--external { border: 1px dashed var(--info-line); background: transparent; color: var(--ink-muted); }
.proc-feed { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.proc-feed a { color: var(--ink-muted); border-bottom-color: var(--rule-strong); font-size: 11.5px; }
.proc-feed a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.proc-feed--in { color: var(--accent); }

.lconn {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 96px; padding: 0 4px; gap: 4px;
}
.lconn-label {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); text-align: center; line-height: 1.35;
}
.lconn-arrow { color: var(--accent); font-size: 18px; }

@media (max-width: 900px) {
  .lrow { flex-direction: column; }
  .lconn { flex-direction: row; min-height: 32px; }
  .lconn-arrow { transform: rotate(90deg); }
}

/* --- Closing --- */

.closing {
  margin-top: 72px; padding: 40px 0 4px; border-top: 1px solid var(--rule-strong);
  display: flex; flex-wrap: wrap; gap: 24px; align-items: baseline; justify-content: space-between;
}
.closing h3 { font-family: var(--font-display); font-weight: 500; font-size: 22px; color: #fff; margin: 0; max-width: 26ch; }
.closing .cta {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 13px;
  padding: 11px 18px; border-radius: 8px; background: var(--accent); color: var(--ink-900);
  border-bottom: 0; white-space: nowrap;
}
.closing .cta:hover { background: #e0b688; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
