/* ============================================================
   SuiteScore — Civic Editorial Design System
   site.css · V1 "Ledger" site chrome (Виктор lock 2026-07-16)
   Shared grammar of surfaces 1–2 (landing + document pages).
   Consumes tokens from colors_and_type.css; motion.css provides
   .reveal. Page files keep ONLY page-specific styles.
   Canonical spec: DESIGN.md § "Three surfaces, one brand".
   ============================================================ */

/* ---- Page surface: plain paper (no drafting grid on site pages) ---- */
body {
  background: var(--paper);
  opacity: 0;
  transition: opacity var(--dur-fade) var(--ease-out);
}
body.ready { opacity: 1; }

/* Anchor targets breathe below the viewport edge when deep-linked. */
[id] { scroll-margin-top: 40px; }

/* ============================================================
   MASTHEAD — verbatim brand lockup over the hairline navline
   ============================================================ */
.masthead { padding: 34px 40px 0; max-width: 1200px; margin: 0 auto; }
.masthead .lockup-row { display: flex; justify-content: center; }

/* Brand lockup — verbatim composition (Виктор lock 2026-07-13). */
.brand-lockup {
  width: 324px;
  height: 197px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.brand-lockup .ghost {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-serif);
  font-weight: 600;
  font-style: italic;
  font-size: 150px;
  line-height: 1;
  color: var(--paper-deep);
  user-select: none;
}
.brand-lockup .inner { position: relative; text-align: center; }
.brand-lockup .word {
  display: block;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 36px;
  line-height: 1;
  color: var(--ink);
}
.brand-lockup .word em { font-style: italic; color: var(--civic-green); }
.brand-lockup .tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #6E6858; /* part of the verbatim lockup lock */
  margin-top: 6px;
}

.navline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 24px;
  border-top: 1px solid var(--hairline);
  padding-top: 12px;
}
.navline .side {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
}
.navline .side.r { text-align: right; }
.navline nav { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }
.navline nav a {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color var(--dur-micro) ease-out;
}
.navline nav a:hover { color: var(--civic-green); }
.navline nav a.go { color: var(--civic-green); }

/* ============================================================
   SLIM BAR — slides in once the masthead scrolls away
   ============================================================ */
.slimbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 40px;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline-soft);
  transform: translateY(-100%);
  transition: transform var(--dur-slide) var(--ease-standard);
}
.slimbar.on { transform: translateY(0); }
.slimbar .wordmark {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-wordmark);
  color: var(--ink);
  text-decoration: none;
}
.slimbar .wordmark em { font-style: italic; color: var(--civic-green); }
.slimbar .crumb {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.slimbar .cta {
  font-family: var(--font-sans);
  font-size: var(--fs-ui);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--civic-green);
  border-radius: var(--radius-pill);
  padding: 9px 20px;
  text-decoration: none;
  transition: background 180ms ease-out;
}
.slimbar .cta:hover { background: var(--civic-green-deep); color: #fff; }

/* ============================================================
   DOCUMENT SHELL — left "On this page" index + reading column
   ============================================================ */
.shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  gap: 72px;
}
.index { position: sticky; top: var(--sticky-offset); align-self: start; padding: 48px 0 0; }
.index .index-label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.index ol { list-style: none; margin: 0; padding: 0; }
.index a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  font-family: var(--font-sans);
  font-size: var(--fs-ui-lg);
  color: var(--ink-soft);
  text-decoration: none;
  transition: color var(--dur-micro) ease-out;
}
.index a .tick { font-family: var(--font-mono); font-size: 10px; color: var(--hairline); transition: color var(--dur-micro) ease-out; }
.index a:hover { color: var(--ink); }
.index a:hover .tick { color: var(--civic-green); }
.index a.active { color: var(--civic-green); font-weight: 600; }
.index a.active .tick { color: var(--civic-green); }
.index .index-foot {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--ls-3);
  text-transform: uppercase;
  color: var(--ink-mute);
  line-height: 1.8;
}

.content { max-width: 720px; padding: 48px 0 96px; }
.kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: var(--ls-4);
  text-transform: uppercase;
  color: var(--civic-green);
}
.content h1 { font-size: var(--fs-h1); line-height: 1.12; letter-spacing: -0.015em; margin: 10px 0 12px; }
.content .deck {
  font-family: var(--font-serif);
  font-size: var(--fs-lead);
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
  max-width: 640px;
}
.byline {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-3);
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ============================================================
   SECTION ANATOMY — ink-ruled head with a mono meta-summary
   ============================================================ */
section { padding-top: 56px; scroll-margin-top: calc(var(--sticky-offset) + 12px); }
section .sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 10px;
  margin-bottom: 20px;
}
section h2 { font-size: var(--fs-h2); letter-spacing: var(--ls-tight); }
section .sec-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
}
section p { font-size: var(--fs-body); line-height: 1.7; color: var(--ink-soft); margin: 0 0 14px; max-width: 640px; }
section p:last-child { margin-bottom: 0; }
section p em { font-style: italic; }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* Callout — quiet bordered note; green = assurance, amber = boundary */
.callout {
  margin: 20px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--hairline);
  border-left: var(--rule-state) solid var(--civic-green);
  border-radius: var(--radius-soft);
  background: var(--paper-warm);
}
.callout p { font-size: var(--fs-note); margin: 0; max-width: none; }
.callout.amber { border-left-color: var(--warning-amber); }

/* Facts — mono key / serif value rows under an ink rule */
.facts { margin: 20px 0 0; border-top: 1px solid var(--ink); }
.facts .frow {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.facts .fkey {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: 3px;
}
.facts .fval { font-family: var(--font-serif); font-size: var(--fs-body-s); line-height: 1.55; color: var(--ink); margin: 0; }
.facts .fval .num { font-feature-settings: 'tnum' 1, 'lnum' 1; }

/* Verdict dictionary — chip on the contract band + em-dash definition */
.spec { border-top: 1px solid var(--ink); margin: 0; }
/* A data block that opens with its own ink rule drops it when it directly
   follows a sec-head (whose bottom border IS the rule) — one line, not two
   (Виктор 2026-07-16: «лишняя полоска»). */
.sec-head + .spec, .sec-head + .facts, .sec-head + .bounds,
.sec-head + .not-inc, .sec-head + .more { border-top: none; }
.spec .row {
  display: grid;
  grid-template-columns: 176px 1fr;
  gap: 28px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.spec dt .chip {
  display: inline-block;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 17.5px;
  padding: 8px 18px;
  border-radius: var(--radius-tight);
  white-space: nowrap;
}
.spec dd { margin: 0; font-family: var(--font-serif); font-size: var(--fs-body-s); line-height: 1.6; color: var(--ink-soft); max-width: 640px; }
.spec dd::before { content: "\2014\00A0"; color: var(--ink-mute); }
/* Verdict colour contract — do not invent alternates */
.c-likely   { background: var(--civic-green-pale); color: var(--civic-green); }
.c-possible { background: var(--sand);             color: var(--possible-ink); }
.c-risky    { background: var(--clay-pale);        color: var(--clay); }
.c-unlikely { background: var(--unlikely-band);    color: var(--danger-red); }
.c-review   { background: var(--slate-pale);       color: var(--ink-soft); }

/* Measured checklist — green checks, hairline rows, two columns */
.measure { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.measure li {
  position: relative;
  padding: 10px 0 10px 30px;
  border-bottom: 1px solid var(--hairline-soft);
  font-family: var(--font-serif);
  font-size: var(--fs-body-s);
  line-height: 1.55;
  color: var(--ink);
}
.measure li::before { content: "\2713"; position: absolute; left: 0; top: 11px; color: var(--civic-green); font-size: 13px; }
.measure li.wide { grid-column: 1 / -1; }

/* Boundary lists — em-dash rows (.bounds/.plain) and amber × (.not-inc) */
.bounds, .plain { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); max-width: 640px; }
.plain { border-top: none; }
.bounds li, .plain li {
  position: relative;
  padding: 13px 0 13px 24px;
  border-bottom: 1px solid var(--hairline-soft);
  font-family: var(--font-serif);
  font-size: var(--fs-body-s);
  line-height: 1.65;
  color: var(--ink-soft);
}
.bounds li::before, .plain li::before { content: "\2014"; position: absolute; left: 0; color: var(--ink-mute); }
.not-inc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); max-width: 640px; }
.not-inc li {
  position: relative;
  padding: 13px 0 13px 26px;
  border-bottom: 1px solid var(--hairline-soft);
  font-family: var(--font-serif);
  font-size: var(--fs-body-s);
  line-height: 1.65;
  color: var(--ink-soft);
}
.not-inc li::before { content: "\00D7"; position: absolute; left: 2px; top: 12px; color: var(--warning-amber); font-family: var(--font-mono); font-size: 14px; }

/* Go-panel — pale-green bordered CTA panel */
.go-panel {
  margin-top: 24px;
  border: 1px solid var(--civic-green);
  border-radius: var(--radius-soft);
  background: var(--civic-green-pale);
  padding: 26px 30px;
}
.go-panel .t { font-family: var(--font-serif); font-weight: 600; font-size: 18px; color: var(--ink); margin: 0; }
.go-panel p { font-family: var(--font-serif); font-size: var(--fs-body-s); line-height: 1.6; color: var(--ink-soft); }
.go-panel .cta {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-ui);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--civic-green);
  border-radius: var(--radius-pill);
  padding: 12px 26px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 180ms ease-out;
}
.go-panel .cta:hover { background: var(--civic-green-deep); }

/* Read-more link rows */
.more { list-style: none; margin: 20px 0 0; padding: 0; border-top: 1px solid var(--ink); }
.more li { border-bottom: 1px solid var(--hairline-soft); }
.more a {
  display: block;
  padding: 12px 0;
  font-family: var(--font-serif);
  font-size: 15.5px;
  color: var(--ink);
  text-decoration: none;
  transition: color var(--dur-micro) ease-out;
}
.more a:hover { color: var(--civic-green); }

/* Generic action pill — graduation of the page-local button that repeated
   across cabinet surfaces (org home, kus 8-11 billing/brand). Values = the
   .go-panel .cta pill (radius-pill, civic-green, hover deep) plus <button>
   resets; works on both <a> and <button>. No new aesthetic. */
.btn-pill {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-ui);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--civic-green);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 12px 26px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 180ms ease-out;
}
.btn-pill:hover { background: var(--civic-green-deep); }
.btn-pill.outline {
  color: var(--civic-green);
  background: transparent;
  border: 1px solid var(--civic-green);
}
.btn-pill.outline:hover { color: #fff; background: var(--civic-green); }

/* Quiet pill — graduation of the page-local .togglebtn (org report-composition
   show/hide control) that duplicated a pill outside site.css (§ 8: page-local
   pill copies are forbidden; shared patterns graduate into site.css). Values =
   the .togglebtn verbatim (radius-pill in place of the literal 999px) plus the
   <button> resets from .btn-pill. Uses canonical --hairline/--paper-deep
   (obligation 041 — the undefined --rule/--paper-shade tokens were remapped to
   their canonical twins). Same look, new home. No new aesthetic. */
.pill-quiet {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink);
  background: none;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  cursor: pointer;
}
.pill-quiet:hover, .pill-quiet:focus-visible { background: var(--paper-deep); }

/* ============================================================
   INK COLOPHON FOOTER
   ============================================================ */
.colophon { background: var(--ink); color: var(--paper); margin-top: 56px; }
.colophon .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 52px 40px 44px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 1fr 1fr 1fr;
  gap: 40px 64px;
}
.colophon .brand .wm {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-h1-s);
  color: var(--paper);
  text-decoration: none;
}
.colophon .brand .wm em { font-style: italic; color: var(--civic-green-pale); }
.colophon .brand .indep {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-body-s);
  line-height: 1.6;
  color: var(--hairline);
  margin: 14px 0 0;
  max-width: 340px;
}
.colophon .col .h {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--ls-5);
  text-transform: uppercase;
  color: var(--grid-ink);
  margin-bottom: 14px;
}
.colophon .col a {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--fs-ui-lg);
  color: var(--hairline);
  text-decoration: none;
  padding: 5px 0;
  transition: color var(--dur-micro) ease-out;
}
.colophon .col a:hover { color: var(--paper); }
.colophon .legal {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(214, 211, 204, 0.25);
  padding-top: 16px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--grid-ink);
  line-height: 1.8;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Inline "On this page" — mobile-only collapsible TOC rendered under the
   page header (Виктор lock 2026-07-16: сворачиваемое оглавление, no burger).
   Same list markup as the rail, wrapped in a native <details>; desktop keeps
   the sticky rail and never shows this block. */
details.index.inline { display: none; }

@media (max-width: 900px) {
  .masthead { padding: 20px 24px 0; }
  .navline { grid-template-columns: 1fr; }
  .navline .side { display: none; }
  .slimbar { padding: 10px 24px; }
  .slimbar .crumb { display: none; }
  .shell { grid-template-columns: 1fr; gap: 0; padding: 0 24px; }
  .index { display: none; }
  .measure { grid-template-columns: 1fr; }
  .colophon .inner { grid-template-columns: 1fr; gap: 28px; padding: 40px 24px 36px; }

  details.index.inline {
    display: block;
    position: static;
    padding: 0;
    margin: 20px 0 0;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--hairline-soft);
  }
  details.index.inline summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
  }
  details.index.inline summary::-webkit-details-marker { display: none; }
  details.index.inline summary .index-label { margin-bottom: 0; }
  details.index.inline summary::after {
    content: "+";
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--civic-green);
  }
  details.index.inline[open] summary::after { content: "\2212"; }
  details.index.inline ol { padding-bottom: 10px; }
}

/* Narrow screens: a long locked CTA label must wrap, not tear the viewport
   (nowrap pill on 390px — found on community hubs, applies to any go-panel). */
@media (max-width: 640px) {
  .go-panel .cta { white-space: normal; }
}
