/* barslan.cc — the one shared stylesheet.
   Sections: 1 fonts · 2 tokens · 3 base and layout · 4 chrome (nav, footer) · 5 components · 6 resource pages · 7 workbench pages.
   Tokens: Steppe (vidi-steppe.json v5.0-steppe), consumed as-is per
   barslan-design-DECISION-2026-07-10.md. Site-specific tokens live only here.
   Tool pages may add page-level CSS, reading colors only from these variables.
   Seeded 2026-10-18 from site/src/styles (tokens.css + base.css) and the Astro
   scoped styles; Astro is archived, this file is now the source. */

/* ========== 1 fonts (self-hosted; cyrillic, cyrillic-ext, latin, latin-ext) ========== */

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/onest-cyrillic-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/onest-cyrillic-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/onest-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/onest-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Geologica';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/geologica-cyrillic-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

@font-face {
  font-family: 'Geologica';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/geologica-cyrillic-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'Geologica';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/geologica-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Geologica';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/geologica-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ========== 2 tokens ========== */


:root {
  /* brand */
  --accent: #4961AA;
  --accent-alt: #2E9286;

  /* ui.light */
  --bg-main: #FFFFFF;
  --bg-alt: #F5F7FA;
  --surface: #FFFFFF;
  --text-main: #1A1F2E;
  --heading: #1A1F2E;
  --text-secondary: #657084;
  --border: #D2D8E2;
  --divider: #E6EAF0;
  --accent-bar: #4961AA;
  --zebra-bg: #F5F7FA;
  --tooltip-bg: #1A1F2E;
  --tooltip-text: #FFFFFF;

  /* interactive.light */
  --link: #4961AA;
  --hover-bg: #EAF1F9;
  --focus-ring: #4961AA;

  /* semantic.light */
  --positive: #1A7A45;
  --caution: #B33000;
  --neutral: #657084;

  /* structural */
  --radius: 5px;
  --radius-pill: 8px; /* site-specific: Vidi v2 pill shape */
  --border-width: 1px;
  --accent-bar-w: 3px;
  --max-width: 1200px;
  --measure: 42rem; /* site-specific: long-form article measure only */

  /* spacing */
  --sp-2xs: 2px;
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-section: 32px;

  /* site type scale (web reading; the JSON's sizes are chart-scale, deliberately not reused) */
  --fs-h1: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
  --fs-h2: clamp(1.35rem, 1.15rem + 0.9vw, 1.7rem);
  --fs-h3: 1.125rem;
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-meta: 0.8125rem;
  --lh-body: 1.6;
  --lh-heading: 1.2;

  /* animation */
  --dur-fast: 100ms;
  --dur-normal: 200ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    /* brand_dark */
    --accent: #6F8FDC;
    --accent-alt: #43A89A;

    /* ui.dark */
    --bg-main: #0B0F1A;
    --bg-alt: #111628;
    --surface: #111628;
    --text-main: #E5E7EB;
    --heading: #FFFFFF;
    --text-secondary: #9CA3AF;
    --border: rgba(255, 255, 255, 0.15);
    --divider: rgba(255, 255, 255, 0.08);
    --accent-bar: #6F8FDC;
    --zebra-bg: #0F1424;
    --tooltip-bg: #111628;
    --tooltip-text: #E5E7EB;

    /* interactive.dark */
    --link: #6F8FDC;
    --hover-bg: #111628;
    --focus-ring: #6F8FDC;

    /* semantic.dark */
    --positive: #4CAF50;
    --caution: #E87750;
    --neutral: #9CA3AF;
  }
}

[data-theme='dark'] {
  --accent: #6F8FDC;
  --accent-alt: #43A89A;
  --bg-main: #0B0F1A;
  --bg-alt: #111628;
  --surface: #111628;
  --text-main: #E5E7EB;
  --heading: #FFFFFF;
  --text-secondary: #9CA3AF;
  --border: rgba(255, 255, 255, 0.15);
  --divider: rgba(255, 255, 255, 0.08);
  --accent-bar: #6F8FDC;
  --zebra-bg: #0F1424;
  --tooltip-bg: #111628;
  --tooltip-text: #E5E7EB;
  --link: #6F8FDC;
  --hover-bg: #111628;
  --focus-ring: #6F8FDC;
  --positive: #4CAF50;
  --caution: #E87750;
  --neutral: #9CA3AF;
}

/* Sankey extension tokens (design decision, committed for the site build).
   Consumed by the future inline-chart helper, parked here so they ship with the token layer.
   OPEN: dark-ground compositing check before locking dark link_opacity (decision record). */
:root {
  --sankey-link-opacity: 0.6;
  --sankey-accent-bump: 0.1;
  --sankey-link-edge-l: 0.74;
  --sankey-link-edge-w: 0.85px;
}

/* ========== 3 base and layout ========== */


*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-optical-sizing: auto;
}

/* ---------- headings: specimen C3 register ---------- */

h1,
h2 {
  font-family: 'Geologica', 'Onest', system-ui, sans-serif;
  color: var(--heading);
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  /* specimen: 650 3.1rem/1.14, ls -0.015em */
  font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.1rem);
  font-weight: 650;
  line-height: 1.14;
  letter-spacing: -0.015em;
}

h2 {
  /* specimen: 600 1.75rem/1.26, ls -0.008em */
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem);
  font-weight: 600;
  line-height: 1.26;
  letter-spacing: -0.008em;
}

h3,
h4 {
  font-family: 'Onest', system-ui, sans-serif;
  color: var(--heading);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.3;
  margin: 1.4em 0 0.5em;
}

/* specimen article body: 1.06rem/1.68, max 42em */
p, ul, ol { margin: 0 0 1.1em; }

/* avoid short orphan last lines (2026-07-17 pass; headings already balance) */
p, li { text-wrap: pretty; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent);
  transition: color var(--dur-fast) var(--ease-standard),
    text-decoration-color var(--dur-fast) var(--ease-standard);
}

a:hover { text-decoration-color: var(--accent-alt); text-decoration-thickness: 2px; }

a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; }

hr {
  border: 0;
  border-top: var(--border-width) solid var(--divider);
  margin: 2.5rem 0; /* specimen .divider */
}

blockquote,
.caption {
  margin: 1.2em 0;
  padding: 0.1em 0 0.1em 0.8rem;
  border-left: 3px solid var(--accent-alt); /* specimen: teal caption bar */
  color: var(--text-secondary);
  max-width: 40em;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-small);
  margin: 1.2em 0;
}

th, td {
  text-align: left;
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: var(--border-width) solid var(--divider);
}

thead th { background: var(--bg-alt); }
tbody tr:nth-child(even) { background: var(--zebra-bg); }

code {
  background: var(--bg-alt);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}

/* ---------- layout: specimen column ---------- */

.wrap {
  max-width: calc(var(--max-width) + 3rem); /* full width (2026-10-18); was 876px specimen column */
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.prose { max-width: 42em; }

.meta {
  color: var(--text-secondary);
  font-size: 0.85rem; /* specimen meta: 500 .85rem */
  font-weight: 500;
}

/* specimen meta row: date · teal dot · category */
.meta-row {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.meta-row .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-alt);
  align-self: center;
  flex: none;
}

.section { margin-block: clamp(2.6rem, 6vw, 4rem); }

/* full-bleed band: section background escapes the .wrap column */
.band {
  margin-inline: calc(50% - 50vw);
  padding-inline: calc(50vw - 50%);
  background: var(--bg-alt);
  padding-block: clamp(2.2rem, 5vw, 3.2rem);
}

/* small teal kicker above a section heading */
.section-kicker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  font-size: var(--fs-meta);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent-alt);
}

.section-kicker::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-alt);
  flex: none;
}

.section-lead {
  color: var(--text-secondary);
  max-width: 38em; /* specimen .sub measure */
  font-size: 1.06rem;
}

/* no divider lines between sections (2026-11-12 round 2): spacing and bands separate them */

/* ---------- buttons: specimen outline CTA ---------- */

.btn {
  display: inline-block;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-standard);
}

.btn:hover { background: var(--hover-bg); }

.btn.secondary {
  border-color: var(--accent);
  color: var(--accent);
}

.btn.secondary:hover { background: var(--hover-bg); }


/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 240px);
  gap: clamp(var(--sp-xl), 5vw, 56px);
  align-items: start;
  margin-block: 0;
  padding-block: clamp(2.8rem, 7vw, 4.5rem);
}

/* hero band: quiet full-bleed wash so the page opens with a defined space */
.hero-band {
  margin-inline: calc(50% - 50vw);
  padding-inline: calc(50vw - 50%);
  background: linear-gradient(
    170deg,
    color-mix(in srgb, var(--accent) 5%, var(--bg-main)),
    var(--bg-main) 62%
  );
}

.hero .kicker {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0.1em 0 1.2rem;
}

.hero .prose {
  /* specimen .sub: 400 1.15rem/1.6, secondary, 38em */
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 38em;
}

.hero-photo-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 0.6rem;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 12%, var(--bg-alt)),
      var(--bg-alt) 55%, color-mix(in srgb, var(--accent-alt) 9%, var(--bg-alt)));
}

.hero-photo-wrap::after {
  /* monogram placeholder until the real photo lands on the CDN */
  content: 'БА';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: 'Geologica', sans-serif;
  font-size: 2.6rem;
  font-weight: 650;
  color: color-mix(in srgb, var(--accent) 50%, transparent);
  z-index: 0;
}

.hero-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo-wrap { max-width: 180px; order: -1; }
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-md);
  margin-top: 1.6rem; /* specimen .cta margin */
  align-items: center;
}

/* ---------- services ---------- */

.service {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: var(--sp-lg);
  padding-block: var(--sp-xl);
}

.service + .service { border-top: var(--border-width) solid var(--divider); }

.service .num {
  font-family: 'Geologica', sans-serif;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--accent);
  padding-top: 0.15rem;
}

.service h3 { margin-top: 0; font-size: 1.15rem; }

.service .lead { max-width: 42em; }

.service .deliverables {
  color: var(--text-secondary);
  font-size: var(--fs-small);
  max-width: 46em;
}

.service .proof { font-size: var(--fs-small); margin-bottom: 0; }

@media (max-width: 560px) {
  .service { grid-template-columns: 1fr; gap: var(--sp-sm); }
}

/* ---------- article rows ---------- */

.card-row {
  display: block;
  padding: var(--sp-lg) 0;
  text-decoration: none;
  color: inherit;
}

.card-row + .card-row { border-top: var(--border-width) solid var(--divider); }

.card-row h3 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  transition: color var(--dur-fast) var(--ease-standard);
}

.card-row:hover h3 { color: var(--link); }

.card-row .meta-row { margin-bottom: 0; }

/* ---------- vidi dark panel (specimen dir-label vocabulary) ---------- */

.vidi-block {
  background: #0B0F1A;
  color: #9CA3AF;
  border-radius: var(--radius);
  padding: clamp(var(--sp-xl), 4vw, 40px);
}

.vidi-block h2 {
  color: #E5E7EB;
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem);
}

.vidi-block h2::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #43A89A;
  margin-right: 0.6rem;
  vertical-align: 0.18em;
}

.vidi-block .prose { color: inherit; }

.vidi-block a { color: #91ACF1; }

[data-theme='dark'] .vidi-block { background: #050810; color: #8896A8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .vidi-block { background: #050810; color: #8896A8; }
}

/* the vidi panel escapes the section-divider rule (it frames itself) */
.section.vidi-section { border-top: 0; padding-top: 0; }

/* banded sections frame themselves too */
.section.band { border-top: 0; }
.section.band + .section { border-top: 0; }

/* vidi panel: text + decorative chart marks */
.vidi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 210px);
  gap: clamp(var(--sp-xl), 4vw, 48px);
  align-items: center;
}

.vidi-art { width: 100%; height: auto; display: block; }

@media (max-width: 640px) {
  .vidi-grid { grid-template-columns: 1fr; }
  .vidi-art { max-width: 240px; }
}

/* ---------- featured chart band (homepage) ---------- */

.featured-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(var(--sp-xl), 4vw, 56px);
  align-items: start;
}

.featured-grid .chart { margin: 0.4em 0 0; }

@media (max-width: 720px) {
  .featured-grid { grid-template-columns: 1fr; }
}

/* ---------- embed placeholder (unknown hosts only) ---------- */

.embed-placeholder {
  border: var(--border-width) dashed var(--border);
  border-left: 3px solid var(--accent-alt);
  border-radius: var(--radius);
  background: var(--bg-alt);
  padding: var(--sp-lg);
  margin: 1.2em 0;
  font-size: var(--fs-small);
  color: var(--text-secondary);
}

/* ---------- inline embeds (lazy iframes) ---------- */

.embed-figure {
  margin: 1.6em 0;
}

.embed-figure iframe {
  display: block;
  width: 100%;
  aspect-ratio: var(--embed-ratio, 16 / 9);
  border: var(--border-width) solid var(--divider);
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.embed-figure.fixed iframe {
  aspect-ratio: auto;
  height: var(--embed-height, 480px);
}

.embed-figure figcaption {
  margin-top: 0.4rem;
  font-size: var(--fs-meta);
  color: var(--text-secondary);
}

/* ---------- inline charts (Steppe helper) ---------- */

.chart {
  margin: 1.8em 0;
}

.chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-md);
  margin-bottom: 1rem;
}

.chart-title {
  font-family: 'Onest', system-ui, sans-serif;
  font-weight: 600;
  color: var(--heading);
}

.chart-unit {
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--text-secondary);
}

p.chart-unit { margin: 0.6rem 0 0; }

.chart-rows {
  display: grid;
  gap: 0.55rem;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(9em, 17em) 1fr;
  gap: var(--sp-md);
  align-items: center;
  font-size: var(--fs-small);
}

.chart-label {
  color: var(--text-secondary);
  text-align: right;
  line-height: 1.25;
}

.chart-track {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.chart-bar {
  display: block;
  height: 0.95rem;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
  transition: opacity var(--dur-fast) var(--ease-standard);
}

.chart-bar.hl { background: var(--accent-alt); }

.chart-row:hover .chart-bar { opacity: 0.82; }

.chart-value {
  font-size: var(--fs-meta);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .chart-row { grid-template-columns: 1fr; gap: 0.15rem; }
  .chart-label { text-align: left; }
}

/* ---------- article lede drop cap (2026-07-17, FRONTIER/26 transfer) ----------
   remarkLede marks the first substantive article paragraph with .lede at build
   time (dates and short lines never get the cap). Geologica at the heading
   weight, teal accent: the display voice the site already speaks, not a
   literary-serif register. Float hack is the baseline; engines with
   initial-letter get proper cap-height alignment. */

.article-body .lede::first-letter {
  float: left;
  font-family: 'Geologica', 'Onest', system-ui, sans-serif;
  font-weight: 650;
  font-size: 3.1em;
  line-height: 0.82;
  padding: 0.06em 0.14em 0 0;
  color: var(--accent-alt);
}

@supports (initial-letter: 3) or (-webkit-initial-letter: 3) {
  .article-body .lede::first-letter {
    float: none;
    font-size: 1em;
    line-height: 1;
    padding: 0;
    margin-right: 0.14em;
    -webkit-initial-letter: 3;
    initial-letter: 3;
  }
}

/* ---------- profile card ---------- */

.profile-rows { display: grid; }

.profile-row {
  display: grid;
  grid-template-columns: minmax(11em, 15em) 1fr;
  gap: var(--sp-lg);
  padding: var(--sp-lg) 0;
  border-bottom: var(--border-width) solid var(--divider);
}

.profile-row:first-child { border-top: var(--border-width) solid var(--divider); }

@media (max-width: 560px) {
  .profile-row { grid-template-columns: 1fr; gap: var(--sp-2xs); }
}

/* ---------- closing strip ---------- */

.closing .prose {
  font-family: 'Geologica', sans-serif;
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.008em;
  color: var(--heading);
  line-height: 1.3;
}

/* ========== 4 chrome: nav and footer ========== */

.site-header {
  border-bottom: var(--border-width) solid var(--divider);
  background: var(--bg-main);
}

/* weighted wordmark, links in secondary, baseline-aligned */
.nav-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-lg);
  padding-block: var(--sp-md);
  flex-wrap: wrap;
}

.wordmark {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--heading);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: baseline;
  gap: 1.6rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a { color: var(--text-secondary); text-decoration: none; }
.nav-links a:hover,
.nav-links a[aria-current='page'] { color: var(--link); }

.lang-switch {
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.1em 0.6em;
}

@media (max-width: 520px) {
  .nav-links { gap: 0.9rem; font-size: 0.86rem; }
}
@media (max-width: 380px) {
  .nav-links { gap: 0.7rem; }
}

/* theme toggle (2026-11-17): moon in light, sun in dark; a click saves the choice as barslan.theme.
   Wide screens: after the links. Narrow screens: top right, beside the wordmark, links on their own row. */
:root[data-theme='dark'] { color-scheme: dark; }
:root[data-theme='light'] { color-scheme: light; }
.nav-links { margin-left: auto; }
.theme-toggle {
  align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 0.92rem; line-height: var(--lh-body);
  padding: 0.1em 0.6em;
  background: none; color: var(--text-secondary);
  border: var(--border-width) solid var(--border); border-radius: var(--radius-pill);
  cursor: pointer;
}
@media (max-width: 520px) { .theme-toggle { font-size: 0.86rem; } }
.theme-toggle:hover { color: var(--link); border-color: var(--link); }
.theme-toggle:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.theme-toggle svg { width: 1.15em; height: calc(1em * var(--lh-body)); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .ic-sun { display: none; }
[data-theme='dark'] .theme-toggle .ic-sun { display: block; }
[data-theme='dark'] .theme-toggle .ic-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .ic-sun { display: block; }
  :root:not([data-theme='light']) .theme-toggle .ic-moon { display: none; }
}
@media (max-width: 640px) {
  .theme-toggle { order: 1; margin-left: auto; }
  .nav-links { order: 2; flex-basis: 100%; margin-left: 0; }
}
@media print { .theme-toggle { display: none; } }

.site-footer {
  margin-top: clamp(3rem, 8vw, 5rem);
  border-top: var(--border-width) solid var(--divider);
  background: var(--bg-alt);
  padding-block: var(--sp-section);
}

.footer-row { display: grid; gap: var(--sp-md); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-lg);
  font-size: var(--fs-small);
}

.footer-links a { color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--link); }

/* external links: domain in muted text, no arrows (decision 2026-10-16 §6) */
.ext-domain {
  color: var(--text-secondary);
  font-size: 0.88em;
  margin-left: 0.3em;
}

/* ========== 5 components ========== */

/* ---------- pills: Vidi shape (rounded rectangle, 8px), 2026-10-18 ----------
   Same geometry as the VIDI v2 viewer pills (engine/viewers/*: 8px radius,
   1.5px border, 4px 12px padding). Separated chips for filters and selectors.
   Never on article rows. States: default, hover, .on / aria-pressed / aria-current. */

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
  display: inline-block;
  padding: 4px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard);
}

.pill:hover { border-color: var(--text-secondary); color: var(--text-main); }

.pill.on,
.pill[aria-pressed='true'],
.pill[aria-current='page'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-main);
}

.pill:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ---------- small page bits carried from Astro scoped styles ---------- */

.contact-row { display: flex; flex-wrap: wrap; gap: var(--sp-lg); align-items: center; }
.article-head { display: flex; align-items: center; gap: var(--sp-md); }
.more-title { font-size: var(--fs-h3); }
.closing .cta-row { align-items: center; }

/* ========== 6 resource pages (interactive resources), 2026-11-11 ==========
   Shared frame of resources/deal-time, sale-readiness and advisor-or-diy, so the
   three stay identical: 1040px column, intro left with the "how it works" box and
   the privacy line right, the tool inside one framed panel, print and delete
   actions, invitation block. Behaviour (storage, print, delete): assets/resource.js.
   Format reference: resources/deal-time.html. */

.res-root { max-width: 1040px; }

.res-hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.res-hero h1 { margin-bottom: 0.3em; }
.res-hero .section-lead { max-width: none; }
.res-sub { font-size: 1.2rem; line-height: 1.4; color: var(--heading); font-weight: 600; margin: 0 0 var(--sp-lg); }
.res-aside { display: grid; gap: var(--sp-md); }
.res-how { border: var(--border-width) solid var(--divider); border-left: 3px solid var(--accent-alt); border-radius: var(--radius); background: var(--surface); padding: var(--sp-lg) var(--sp-xl); }
.res-how h3 { margin: 0 0 0.6rem; }
.res-how ol { margin: 0; padding-left: 1.2em; font-size: var(--fs-small); }
.res-how li + li { margin-top: 0.4em; }

.res-privacy { padding: var(--sp-md) var(--sp-lg); background: var(--bg-alt); border-radius: var(--radius); font-size: var(--fs-small); }
.res-privacy p { margin: 0; }
.res-privacy > p { color: var(--text-secondary); }
.res-privacy details { margin-top: 6px; color: var(--text-secondary); }
.res-privacy summary { cursor: pointer; color: var(--link); font-weight: 600; width: fit-content; }
.res-privacy details p { margin-top: 6px; }

/* the tool: one framed object with air around it */
.res-panel { background: var(--surface); border: var(--border-width) solid var(--border); border-radius: calc(var(--radius) * 2); padding: clamp(16px, 2.6vw, 28px); box-shadow: 0 1px 2px rgba(20, 30, 60, 0.04), 0 8px 24px rgba(20, 30, 60, 0.05); }

.res-next { font-size: 1.06rem; margin: 0; }
.res-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-md); margin: var(--sp-xl) 0; }
.res-actions .btn, .res-cta .btn { cursor: pointer; font-family: inherit; }
.res-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-sm); font-size: var(--fs-small); font-weight: 600; color: var(--heading); }
.res-confirm[hidden] { display: none; }
.res-cta { border: var(--border-width) solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); padding: var(--sp-xl); }
.res-cta h2 { margin: 0 0 0.4em; font-size: 1.35rem; }
.res-cta p { margin: 0 0 var(--sp-lg); }
.res-cta-row { display: flex; flex-wrap: wrap; gap: var(--sp-md); }
.res-cta .btn:first-child { background: var(--accent); color: #fff; }
.res-cta .btn:first-child:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.print-only { display: none; }

@media (max-width: 900px) {
  .res-hero { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .res-cta { padding: var(--sp-lg); }
}
@media print {
  .res-root { max-width: none; }
  .res-panel { border: 0; box-shadow: none; padding: 0; }
  .site-header, .site-footer, .no-print, .res-how, .res-privacy { display: none !important; }
  .print-only { display: block; }
  body { font-size: 10.5pt; }
  .res-hero { display: block; }
  .section { padding-block: 12pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* Printed pages: the resource title and address at the foot of every sheet.
   Each resource page sets the text itself, in its own style block:
     @page { @bottom-left { content: "<title> · barslan.cc/resources/<slug>"; } }
   Margin boxes print in Chrome and Edge (131+); Firefox and Safari ignore them
   and keep the dated line at the top of the first sheet (#print-stamp). */
@page {
  margin: 14mm 12mm 18mm;
  @bottom-left { font-family: 'Onest', system-ui, sans-serif; font-size: 8pt; color: #555; vertical-align: top; padding-top: 3mm; }
}

/* ========== 7 workbench pages (calculation tools), 2026-11-11 ==========
   Shared frame of resources/cost-of-capital and resources/calculator. They are a
   different kind of resource from section 6: nothing is answered or saved, the
   visitor works with numbers, so they keep the full page width. What they share
   with the interactive resources is everything around the tool, taken from
   section 6 as-is: .res-hero with .res-how and .res-privacy, .res-panel, .res-cta.
   This section adds the calculation parts: card, fields, result, workings.
   Pages keep only what is their own in a page-level style block. */

.wb-root .res-hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.wb-root .res-how ul { margin: 0; padding-left: 1.2em; font-size: var(--fs-small); }
.wb-root .res-how li + li { margin-top: 0.4em; }
.wb-root .res-how p { margin: 0.8rem 0 0; padding-top: 0.7rem; border-top: var(--border-width) solid var(--divider); font-size: var(--fs-small); }
.wb-foot { margin: clamp(2rem, 5vw, 2.8rem) 0 var(--sp-xl); padding-top: var(--sp-lg); border-top: var(--border-width) solid var(--divider); display: grid; gap: 0.4rem; }
.wb-foot p { margin: 0; font-size: var(--fs-meta); color: var(--text-secondary); }

/* card */
.calc-panel { background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius); padding: var(--sp-lg); display: flex; flex-direction: column; gap: var(--sp-md); min-width: 0; }
.calc-name { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.3; color: var(--heading); }
.calc-desc { margin: 2px 0 0; font-size: var(--fs-small); line-height: 1.4; color: var(--text-secondary); }
.calc-formula { margin: 0; font-size: var(--fs-small); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.calc-formula sup, .calc-formula sub { font-size: 0.72em; line-height: 0; }

/* fields */
.calc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-md); align-items: end; }
.calc-fields.cols-1 { grid-template-columns: 1fr; }
.calc-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.calc-field.span-2 { grid-column: 1 / -1; }
.calc-field label { font-size: var(--fs-meta); line-height: 1.35; color: var(--text-secondary); }
.calc-input-wrap { position: relative; display: flex; align-items: center; }
.calc-field input, .calc-field select, .calc-row input {
  width: 100%; min-width: 0; min-height: 2.4rem;
  font: inherit; font-size: 0.95rem; font-weight: 500; font-variant-numeric: tabular-nums;
  background: var(--bg-main); color: var(--text-main);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 0.4rem 0.65rem;
  transition: border-color var(--dur-normal) var(--ease-standard);
  color-scheme: light dark;
}
.calc-field select { cursor: pointer; }
.calc-field input:focus-visible, .calc-field select:focus-visible, .calc-row input:focus-visible {
  outline: none; border-color: var(--focus-ring);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus-ring) 30%, transparent);
}
.calc-unit { position: absolute; right: 0.65rem; font-size: var(--fs-meta); color: var(--text-secondary); pointer-events: none; }
.calc-input-wrap:has(.calc-unit) input { padding-right: 1.9rem; }

/* result and workings */
.calc-result { background: var(--bg-alt); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: var(--sp-md) var(--sp-lg); margin-top: auto; }
.calc-result-label { font-size: var(--fs-meta); color: var(--text-secondary); margin-bottom: 2px; min-height: 1.2em; }
.calc-result-value { font-weight: 600; font-size: 1.5rem; line-height: 1.25; color: var(--heading); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.calc-breakdown { list-style: none; margin: var(--sp-sm) 0 0; padding: var(--sp-sm) 0 0; border-top: var(--border-width) solid var(--divider); display: flex; flex-direction: column; gap: 3px; }
.calc-breakdown:empty { display: none; }
.calc-breakdown li { display: flex; justify-content: space-between; gap: var(--sp-md); font-size: var(--fs-small); line-height: 1.45; color: var(--text-secondary); }
.calc-breakdown li span { min-width: 0; overflow-wrap: anywhere; }
.calc-breakdown li b { font-weight: 600; color: var(--text-main); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.calc-warn { font-size: var(--fs-meta); color: var(--caution); }
.calc-warn:empty { display: none; }

@media (max-width: 900px) {
  .wb-root .res-hero { grid-template-columns: 1fr; }
}
@media (max-width: 340px) {
  .calc-fields { grid-template-columns: 1fr; }
}
/* mobile fit (2026-11-17): 16px inputs stop iOS Safari zooming on focus; date fields get a full row;
   a worded result value may wrap instead of squeezing its label */
@media (max-width: 720px) {
  .calc-field input, .calc-field select, .calc-row input { font-size: 16px; }
}
@media (max-width: 560px) {
  .calc-field:has(input[type='date']) { grid-column: 1 / -1; }
  .calc-breakdown li b { white-space: normal; }
}

/* ========== 8 about page and footer icons (2026-11-12) ========== */

/* the landing page carries the name in its hero, so the top bar drops it there */
.home .site-header .wordmark { visibility: hidden; }

/* compact landing page: same content width as the resource pages; the menu keeps the full width */
.home main.wrap { max-width: 1040px; }

.footer-links { align-items: center; }
.footer-icon { display: inline-flex; align-items: center; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-md) var(--sp-xl); }
.footer-social { display: flex; align-items: center; gap: var(--sp-lg); }
.footer-social a { color: var(--text-secondary); }
.footer-social a:hover { color: var(--link); }
.footer-icon svg { width: 22px; height: 22px; }
.footer-icon svg { display: block; }

.hero .prose + .prose { margin-top: -0.3em; }

.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-lg);
  margin-top: var(--sp-lg);
}
.svc-card {
  display: flex;
  flex-direction: column;
  padding: var(--sp-xl);
  border: var(--border-width) solid var(--divider);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}
.svc-card .num {
  font-family: 'Geologica', sans-serif;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--accent);
}
.svc-card h3 { margin: 0.35em 0 0.5em; font-size: 1.2rem; }
.svc-card .lead { margin: 0 0 var(--sp-lg); }
.svc-out {
  margin: 0;
  padding-top: var(--sp-md);
  border-top: var(--border-width) solid var(--divider);
  font-size: var(--fs-small);
  color: var(--text-secondary);
}
.svc-out b { display: block; margin-bottom: 4px; font-weight: 600; color: var(--heading); }
.svc-out ul { margin: 0; padding-left: 1.1em; }
.svc-out li { margin: 0 0 2px; }
@media (max-width: 900px) { .svc-grid { grid-template-columns: 1fr; } }

/* ---------- reduced motion (2026-07-17 pass) ----------
   Motion today is only micro-transitions, but the guard is policy: any future
   animation (scroll reveals, view transitions) inherits it for free. */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ========== 9 round 2: buttons, Vidi block, language pills, contacts (2026-11-12) ========== */

/* filled main CTA; the blue outline .btn.secondary sits beside it */
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }

.vidi-list { margin: 0.2em 0 1.1em; padding-left: 1.1em; max-width: 42em; }
.vidi-list li { margin: 0 0 0.25em; }
.vidi-list li::marker { color: #43A89A; }

/* language pill: marks a resource available in one language only */
.lang-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.4;
  padding: 0.1em 0.55em;
  border-radius: var(--radius-pill);
  color: var(--accent-alt);
  background: color-mix(in srgb, var(--accent-alt) 12%, transparent);
  border: var(--border-width) solid color-mix(in srgb, var(--accent-alt) 35%, transparent);
}

/* contacts: compact column like the landing page */
.contact-page main.wrap { max-width: 1040px; }
.contact-intro h1 { margin-bottom: 0.3em; }
.cal-slot { margin-top: var(--sp-lg); }
.contact-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-lg) var(--sp-xl); }
.contact-card { display: flex; align-items: center; gap: var(--sp-lg); flex-wrap: wrap; }
.contact-qr { width: 112px; height: 112px; background: #fff; padding: 6px; border-radius: var(--radius); border: var(--border-width) solid var(--divider); }
.contact-card-text { display: grid; gap: 0.6rem; justify-items: start; }
.contact-card-text .meta { margin: 0; max-width: 24em; }
/* a QR code cannot be scanned by the phone showing it: phones get the button only (2026-11-17) */
@media (max-width: 720px) { .contact-qr, .contact-qr-note { display: none; } }

/* round 2 spacing fixes: the Vidi panel keeps its own top padding; the hero band needs less air below it now the divider is gone */
.section.vidi-section.vidi-block { padding-top: clamp(var(--sp-xl), 4vw, 40px); }
.hero-band + .section { margin-top: clamp(1.8rem, 4vw, 2.6rem); }

/* dark mode: white on the lighter dark-mode blue is too faint, so the filled button takes dark text */
[data-theme='dark'] .btn.primary { color: #0B0F1A; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .btn.primary { color: #0B0F1A; }
}

/* ========== 10 articles: article page, reading aids, articles index (2026-11-14) ==========
   Article page: centred reading column (44rem) with equal space on both sides; figures run
   wider (up to 1040px) on the same axis. Reading progress bar and back-to-top button come
   from assets/article.js. Format reference: articles/three-reasons-to-invest-in-kazakhstan.html;
   copy-me pages: articles/_template.html, en/articles/_template.html. */

.article { max-width: 1040px; margin-inline: auto; padding-block: clamp(48px, 7vw, 96px) 72px;
  display: grid; grid-template-columns: 1fr min(44rem, 100%) 1fr; }
.article > *, .article-body > * { grid-column: 2; }
.article-body { display: contents; }
.article .meta-row { margin-bottom: 1rem; }
.meta-row .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-alt); align-self: center; flex: none; }
.article h1 { margin-bottom: clamp(2rem, 3.5vw, 3rem); }
/* optional subtitle under the title (2026-11-15) */
.article h1:has(+ .dek) { margin-bottom: 0.8rem; }
.article .dek { font-size: 1.2rem; line-height: 1.45; color: var(--text-secondary); margin: 0 0 clamp(2rem, 3.5vw, 3rem); }
.article-body h2 { margin-top: 1.4em; }
.article-body li + li { margin-top: 0.4em; }
.article-body li p { margin: 0; }
.article-body .lede { display: flow-root; } /* keeps the drop cap from pushing into a list below a short opening */
.article-body .article-fig { grid-column: 1 / -1; margin: 0.9rem 0 2rem; }
/* raster pictures from the old site keep a white card in dark mode; new charts use site tokens instead */
.article-fig img { display: block; width: 100%; height: auto; background: #FFFFFF; border: var(--border-width) solid var(--divider); border-radius: var(--radius); padding: clamp(6px, 1.4vw, 16px); box-sizing: border-box; }
.article-fig figcaption { margin-top: 0.5rem; font-size: var(--fs-meta); color: var(--text-secondary); }
.article-body .pull { font-family: 'Geologica', 'Onest', system-ui, sans-serif; font-size: 1.25rem; line-height: 1.4; font-weight: 600; color: var(--heading); border-left: 3px solid var(--accent-alt); padding-left: 0.9rem; margin: 0.7em 0 1.8em; }
.article-sources { margin-top: 1.6em; font-size: var(--fs-small); color: var(--text-secondary); }
.article-sources h2 { font-family: 'Onest', system-ui, sans-serif; font-size: var(--fs-h3); margin: 0 0 0.6em; }
.article-back { margin: 2.6rem 0 0; font-weight: 500; }
.article-back a { text-decoration: none; }
.article-back a:hover { text-decoration: underline; }

/* reading progress: 2px teal line at the top edge, no track, article pages only */
.read-progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 60;
  background: var(--accent-alt); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }

/* back to top: soft round button with a thin teal ring that fills as the article is read;
   appears after the first screen (redrawn 2026-11-14: quieter than the blue outline) */
.to-top { position: fixed; right: clamp(16px, 3vw, 32px); bottom: clamp(16px, 3vw, 32px); z-index: 60;
  width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(20, 40, 70, 0.08), 0 6px 18px rgba(20, 40, 70, 0.12);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity var(--dur-normal) var(--ease-standard), transform var(--dur-normal) var(--ease-standard),
    visibility 0s linear var(--dur-normal), color var(--dur-fast) var(--ease-standard); }
.to-top.on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.to-top:hover { color: var(--link); }
.to-top:hover .chev { transform: translateY(-2px); }
.to-top .chev { transition: transform var(--dur-normal) var(--ease-standard); }
.to-top .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.to-top .ring circle { fill: none; stroke-width: 2; }
.to-top .ring .track { stroke: var(--divider); }
.to-top .ring .fill { stroke: var(--accent-alt); stroke-linecap: round; }
.to-top:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
[data-theme='dark'] .to-top { box-shadow: 0 0 0 1px var(--border), 0 6px 18px rgba(0, 0, 0, 0.45); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .to-top { box-shadow: 0 0 0 1px var(--border), 0 6px 18px rgba(0, 0, 0, 0.45); }
}
@media (prefers-reduced-motion: reduce) { .to-top, .to-top .chev { transition: none; } }
@media print { .read-progress, .to-top, .article-back { display: none !important; } }

/* articles index: same centred column as the articles */
.articles-index { max-width: 44rem; margin-inline: auto; padding-block: clamp(48px, 7vw, 96px) 72px; }
.articles-index h1 { margin-bottom: clamp(1.4rem, 3vw, 2.2rem); }
.articles-index .pill-row { margin-bottom: 0.8rem; }
.articles-index .pill-row[hidden] { display: none; }
.card-row .lang { color: var(--text-secondary); }
.card-row p.desc { margin: 0.3rem 0 0; color: var(--text-secondary); font-size: var(--fs-small); }
.card-row[hidden] { display: none; }
.card-row .meta-row { margin-top: 0.55rem; }

/* ---------- 10b article inserts (2026-11-14) ----------
   HTML replacements for the old site's text-in-picture inserts, drawn in site tokens so they
   follow dark mode and stay crisp. First used in articles/advisor-yes-or-no.html.
   .art-dialog   speech bubbles, question then answer; .is-turn marks the bubble the point turns on
   .art-quote    a framed set of quoted arguments, inside the reading column
   .art-resource block link from an article to a resource page */
/* invite line that opens a closing link block: set apart from the article text above (2026-11-15) */
.article-body .art-invite { margin-top: 2.4em; }
.art-dialog-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); align-items: start; padding-bottom: 14px; }
.art-bubble { position: relative; background: var(--surface); border: 1.5px solid var(--border); border-radius: 22px; padding: 1.1rem 1.3rem 1.2rem; }
.art-bubble::after { content: ''; position: absolute; left: 2.2rem; bottom: -9px; width: 16px; height: 16px; background: var(--surface);
  border-right: 1.5px solid var(--border); border-bottom: 1.5px solid var(--border); transform: rotate(45deg); }
.art-bubble p { margin: 0; }
.art-bubble .q { color: var(--accent); font-weight: 600; line-height: 1.35; }
.art-bubble .a { margin-top: 0.55rem; font-family: 'Geologica', 'Onest', system-ui, sans-serif; font-weight: 600; font-size: 1.12rem; color: var(--heading); line-height: 1.3; }
.art-bubble.is-turn { border-color: var(--accent-alt); box-shadow: 0 0 0 1px var(--accent-alt); }
.art-bubble.is-turn::after { border-color: var(--accent-alt); }
.art-bubble.is-turn .a { color: var(--caution); }
@media (max-width: 720px) {
  .art-dialog-row { grid-template-columns: 1fr; gap: 22px; }
}
.art-quote { position: relative; background: var(--bg-alt); border-radius: var(--radius); padding: 1.4rem 1.6rem 1.3rem 4.2rem; margin: 0.6rem 0 2rem; }
.art-quote::before { content: '\00AB'; position: absolute; left: 1.2rem; top: 0.7rem; font-family: 'Geologica', 'Onest', system-ui, sans-serif;
  font-size: 3.4rem; font-weight: 700; line-height: 1; color: var(--accent); }
.art-quote-h { margin: 0 0 0.7rem; font-family: 'Geologica', 'Onest', system-ui, sans-serif; font-weight: 600; font-size: 1.12rem; color: var(--heading); line-height: 1.3; }
.art-quote ul { margin: 0; padding-left: 1.1em; }
.art-quote li::marker { color: var(--accent-alt); }
@media (max-width: 520px) { .art-quote { padding: 3.6rem 1.2rem 1.2rem; } .art-quote::before { top: 0.6rem; } }
.article-body .art-resource { display: grid; gap: 0.35rem; margin: 1.2rem 0 1.6rem; padding: var(--sp-lg) var(--sp-xl); text-decoration: none; color: inherit;
  background: var(--surface); border: var(--border-width) solid var(--divider); border-left: 3px solid var(--accent-alt); border-radius: var(--radius);
  transition: background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard); }
.art-resource:hover { background: var(--hover-bg); border-color: var(--border); border-left-color: var(--accent-alt); }
.art-resource:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.art-resource-k { font-size: var(--fs-meta); color: var(--text-secondary); }
.art-resource-t { font-family: 'Geologica', 'Onest', system-ui, sans-serif; font-weight: 600; font-size: 1.15rem; color: var(--heading); line-height: 1.3; }
.art-resource-d { font-size: var(--fs-small); color: var(--text-secondary); }
.art-resource-go { margin-top: 0.3rem; font-weight: 600; font-size: var(--fs-small); color: var(--link); }
.art-resource:hover .art-resource-go { text-decoration: underline; }
@media print { .art-bubble, .art-quote, .art-resource { break-inside: avoid; } .art-resource-go { display: none; } }

/* ---------- 10c population bubble chart (2026-11-14) ----------
   articles/central-asia-population-growth (RU, EN); script assets/articles/central-asia-population-growth/population-bubbles.js.
   Chart colours validated with the dataviz palette script, light and dark: the site's own teal reads too grey
   for a chart mark, so Central Asia uses a stronger teal here. */
:root { --pop-other: #4961AA; --pop-ca: #00957F; }
[data-theme='dark'] { --pop-other: #6F8FDC; --pop-ca: #14A88E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --pop-other: #6F8FDC; --pop-ca: #14A88E; } }
.pop-chart { position: relative; background: var(--surface); border: var(--border-width) solid var(--divider); border-radius: var(--radius); padding: clamp(14px, 2vw, 24px); }
.pop-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 0.6rem; }
.pop-title { margin: 0; font-family: 'Geologica', 'Onest', system-ui, sans-serif; font-weight: 600; font-size: 1.12rem; color: var(--heading); line-height: 1.3; }
.pop-legend { display: flex; gap: 16px; font-size: var(--fs-meta); color: var(--text-secondary); }
.pop-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pop-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pop-legend .k-other { background: var(--pop-other); opacity: 0.6; }
.pop-legend .k-ca { background: var(--pop-ca); }
.pop-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.pop-ytitle { font-size: var(--fs-meta); color: var(--text-secondary); }
.pop-plot { width: 100%; touch-action: pan-y; }
.pop-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.pop-grid line { stroke: var(--divider); stroke-width: 1; }
.pop-grid line.zero { stroke: var(--text-secondary); stroke-opacity: 0.6; }
.pop-tick { font-size: 11.5px; fill: var(--text-secondary); font-variant-numeric: tabular-nums; }
.pop-axis-title { font-size: 12.5px; fill: var(--text-secondary); }
.pop-other { fill: var(--pop-other); fill-opacity: 0.5; stroke: var(--pop-other); stroke-opacity: 0.7; stroke-width: 0.75; }
.pop-ca { fill: var(--pop-ca); stroke: var(--surface); stroke-width: 2; }
.pop-label { fill: var(--heading); font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.pop-leader { stroke: var(--text-secondary); stroke-width: 1; }
.pop-hl { fill: none; stroke: var(--heading); stroke-width: 1.5; pointer-events: none; }
.pop-tip { position: absolute; z-index: 5; pointer-events: none; display: grid; gap: 2px; min-width: 11rem; padding: 8px 11px; border-radius: var(--radius);
  background: var(--tooltip-bg); color: var(--tooltip-text); font-size: var(--fs-meta); line-height: 1.4; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.pop-tip[hidden] { display: none; }
.pop-tip strong { font-size: 0.9rem; }
.pop-table { margin-top: 0.9rem; font-size: var(--fs-small); overflow-x: auto; }
@media (max-width: 560px) { .pop-table th, .pop-table td { padding: 6px 5px; } }
.pop-table summary { cursor: pointer; color: var(--link); font-weight: 500; }
.pop-table table { width: 100%; border-collapse: collapse; margin-top: 0.6rem; font-variant-numeric: tabular-nums; }
.pop-table th, .pop-table td { text-align: right; padding: 6px 8px; border-bottom: var(--border-width) solid var(--divider); }
.pop-table th:first-child, .pop-table td:first-child { text-align: left; }
.pop-table th { font-weight: 600; color: var(--text-secondary); font-size: var(--fs-meta); }
@media print { .pop-toggle, .pop-tip, .pop-table summary { display: none; } .pop-table table { display: table; } .pop-chart { break-inside: avoid; } }

/* mobile fit (2026-11-17): a single long word in a heading (e.g. «Конфиденциальность») must not push the page sideways */
@media (max-width: 480px) {
  h1, h2 { overflow-wrap: break-word; hyphens: auto; }
}
