/* ═══════════════════════════════════════════════════════════════════
   BARGO Research Document Theme
   Regulatory-document-cover grammar (D-5): warm cream paper, ink text,
   forest-green primary, Cor-Ten accent (used sparingly), hairline rules,
   near-flat surfaces, self-hosted Inter / Source Serif 4 / JetBrains Mono.
   Tokens mirror site/src/styles/global.css. Replaces the vendored UNBIN
   emerald-SaaS theme on the Unbin→BARGO rebrand (2026-06-04).
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* ── Surfaces (warm cream, per bargo.lv) ──────────────────────── */
  --bg-primary: #f5f1ea;        /* paper */
  --bg-secondary: #ede7d8;      /* paper-warm */
  --bg-card: #ebe6dd;           /* paper-card */
  --bg-card-hover: #e4ded2;
  --bg-input: #e4ded2;
  --bg-dark: #0f1411;           /* hero-ground (dark plate) */
  --bg-dark-secondary: #0b0f0c;

  /* ── Hairlines ────────────────────────────────────────────────── */
  --border: rgba(26, 26, 26, 0.14);
  --border-light: rgba(26, 26, 26, 0.08);

  /* ── Ink ──────────────────────────────────────────────────────── */
  --text-primary: #1a1a1a;      /* ink */
  --text-secondary: #3f3f3f;    /* ink-soft */
  --text-muted: #5e5e5e;       /* AA on cream + card (≥4.5:1) — raised per visual-design-reviewer */
  --text-dim: #8a8a8a;
  --text-on-dark: #ede7d8;      /* paper-warm on dark plate */

  /* ── Forest primary + Cor-Ten accent (accent used sparingly) ──── */
  --primary: #2d4a3e;
  --primary-soft: rgba(45, 74, 62, 0.10);
  --accent: #c2410c;
  --accent-hover: #9a330a;
  --accent-light: rgba(194, 65, 12, 0.10);
  --accent-glow: rgba(194, 65, 12, 0.06);

  /* Back-compat aliases for rules inherited from the old template
     (so every existing selector resolves to a BARGO value). */
  --brand-600: var(--accent);
  --brand-100: var(--primary-soft);
  --brand-glow: var(--primary-soft);
  --brand-gradient: var(--primary);

  /* ── Geometry: near-flat, small radii, hairline shadows ───────── */
  --radius: 4px;
  --radius-sm: 3px;
  --radius-lg: 6px;
  --radius-xl: 8px;
  --radius-full: 9999px;
  --shadow: none;
  --shadow-md: 0 1px 2px rgba(26, 26, 26, 0.05);
  --shadow-lg: 0 2px 10px rgba(26, 26, 26, 0.08);
  --shadow-glow: 0 0 0 1px rgba(45, 74, 62, 0.12);

  /* ── Type: self-hosted (see /fonts/fonts.css) ─────────────────── */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --max-width: 1200px;
  --content-width: 760px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
}


/* ══════════════════════════════════════════════════════════════════
   NAVBAR (BARGO research back-link uses inline styles in the page;
   these cover any residual .landing-nav from the template)
   ══════════════════════════════════════════════════════════════════ */
.landing-nav {
  position: sticky;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.nav-links { display: flex; align-items: center; gap: 24px; }

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text-primary); }

.nav-cta {
  padding: 7px 16px !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border) !important;
  transition: all 0.2s !important;
}

.nav-cta:hover { border-color: var(--accent) !important; color: var(--accent) !important; }

.nav-cta.primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--text-on-dark) !important;
}

.nav-cta.primary:hover { background: var(--accent) !important; border-color: var(--accent) !important; }


/* ══════════════════════════════════════════════════════════════════
   ARTICLE HERO — dark plate header (the document "cover")
   ══════════════════════════════════════════════════════════════════ */
.doc-article-header {
  background: var(--bg-dark);
  padding: 56px 32px 60px;
  border-bottom: 1px solid var(--primary);
}

.doc-article-header-inner { max-width: var(--content-width); margin: 0 auto; }

.doc-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
}

/* Restrained regulatory chip — one consistent BARGO style, no rainbow
   SaaS tags. Variant classes (green/blue/orange/purple/gray) all resolve
   to the same mono, uppercase, hairline chip on the dark cover. */
.doc-tag,
.doc-tag.green, .doc-tag.blue, .doc-tag.orange, .doc-tag.purple, .doc-tag.gray {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(237, 231, 216, 0.10);
  border: 1px solid rgba(237, 231, 216, 0.20);
  color: var(--text-on-dark);
}

.doc-date, .doc-read {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(237, 231, 216, 0.55);
}

.doc-article-header h1 {
  font-size: 40px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text-on-dark);
  margin-bottom: 18px;
}

.doc-lead {
  font-family: var(--font-serif);
  font-size: 19px;
  color: rgba(237, 231, 216, 0.72);
  line-height: 1.5;
  max-width: 640px;
}


/* ══════════════════════════════════════════════════════════════════
   CONTENT BODY
   ══════════════════════════════════════════════════════════════════ */
.doc-content { max-width: var(--content-width); margin: 0 auto; padding: 52px 24px 80px; }

hr { border: none; border-top: 1px solid var(--border-light); margin: 36px 0; }

h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 46px;
  margin-bottom: 14px;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

p { margin-bottom: 16px; color: var(--text-secondary); }

ul, ol { margin-bottom: 16px; padding-left: 24px; }
li { margin-bottom: 6px; color: var(--text-secondary); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

strong { color: var(--text-primary); font-weight: 600; }

code {
  background: var(--primary-soft);
  border: 1px solid var(--border-light);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: var(--font-mono);
  color: var(--primary);
}

pre {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 16px;
  font-size: 13.5px;
  font-family: var(--font-mono);
}

pre code { background: none; border: none; padding: 0; color: inherit; }

/* Verbatim regulatory quote — the load-bearing trust element. Forest
   left-rule on warm card, serif text. */
blockquote {
  border-left: 3px solid var(--primary);
  padding: 14px 22px;
  margin: 22px 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
  font-family: var(--font-serif);
}

blockquote .doc-source,
blockquote span {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.02em;
}


/* ── Callout Box ──────────────────────────────────────────────── */
.doc-callout {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 14.5px;
  color: var(--text-primary);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.doc-callout::before { content: ''; }
.doc-callout strong { color: var(--primary); display: block; margin-bottom: 4px; }

.doc-callout.warning { background: var(--accent-light); border-left-color: var(--accent); }
.doc-callout.warning strong { color: var(--accent-hover); }


/* ── Stat Cards ───────────────────────────────────────────────── */
.doc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.doc-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.doc-stat .stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.doc-stat .stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.doc-source { font-size: 13px; color: var(--text-muted); font-style: italic; }


/* ── Tables ────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
  border: 1px solid var(--border);
}

th, td { padding: 11px 16px; text-align: left; }

th {
  font-family: var(--font-mono);
  font-weight: 400;
  background: var(--bg-dark);
  color: var(--text-on-dark);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

td { border-bottom: 1px solid var(--border-light); color: var(--text-secondary); }

tr:last-child td { border-bottom: none; }
tr:nth-child(even) { background: rgba(26, 26, 26, 0.025); }


/* ── Pillar / Card Grid ────────────────────────────────────────── */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.pillar {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pillar h4 { margin: 0 0 0.5rem 0; color: var(--text-primary); font-size: 1rem; font-weight: 600; }
.pillar p { margin: 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; }

.pillar .pillar-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--accent-hover);
  background: var(--accent-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}


/* ── Flow Steps (horizontal) ───────────────────────────────────── */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin: 2rem 0; }

.flow-step {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.flow-step .flow-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--text-on-dark);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.flow-step h5 { margin: 0 0 0.25rem 0; font-size: 0.95rem; color: var(--text-primary); }
.flow-step p { margin: 0; font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; }

@media (max-width: 720px) { .flow { grid-template-columns: repeat(2, 1fr); } }


/* ── Figure / Image ────────────────────────────────────────────── */
.doc-figure {
  margin: 2.25rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-dark);
}

.doc-figure img { width: 100%; height: auto; display: block; }

.doc-figure figcaption {
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: rgba(237, 231, 216, 0.7);
  background: var(--bg-dark);
  border-top: 1px solid rgba(237, 231, 216, 0.10);
}

.doc-figure figcaption strong { color: var(--text-on-dark); font-weight: 600; }


/* ── Dark Banner (CTA section) ─────────────────────────────────── */
.deliver-banner {
  margin: 3rem 0;
  padding: 2.5rem;
  border-radius: var(--radius);
  background: var(--bg-dark);
  border: 1px solid var(--primary);
  color: var(--text-on-dark);
  text-align: center;
}

.deliver-banner h3 { font-size: 1.5rem; font-weight: 500; margin: 0 0 0.75rem; color: var(--text-on-dark); }

.deliver-banner p {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(237, 231, 216, 0.75);
  max-width: 640px;
  margin: 0 auto;
}


/* ══════════════════════════════════════════════════════════════════
   FOOTER (BARGO research footer uses inline styles in the page;
   these cover any residual .landing-footer from the template)
   ══════════════════════════════════════════════════════════════════ */
.landing-footer { padding: 48px 0 32px; border-top: 1px solid var(--border); background: var(--bg-secondary); }

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 48px;
}

.footer-brand p { font-size: 0.8rem; color: var(--text-muted); margin-top: 10px; line-height: 1.6; }
.footer-legal { margin-top: 20px !important; font-size: 0.7rem !important; color: var(--text-dim) !important; }

.footer-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 3px 0;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--accent); }


/* ── Legal Doc Specific ─────────────────────────────────────────── */
.legal-section { counter-reset: legal-clause; }
.legal-section h3::before {
  counter-increment: legal-clause;
  content: counter(legal-clause) ". ";
  color: var(--text-muted);
}


/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .doc-article-header h1 { font-size: 28px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
  .doc-stats { grid-template-columns: repeat(2, 1fr); }
}


/* ══════════════════════════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════════════════════════ */
@media print {
  .landing-nav, .landing-footer, .bargo-research-nav { display: none; }
  .doc-article-header { background: #fff; padding: 20px 0; border-bottom: 1px solid var(--border); }
  .doc-article-header h1, .doc-lead { color: var(--text-primary); }
  .doc-meta .doc-tag { color: var(--text-primary); border-color: var(--border); background: none; }
  body { background: #fff; font-size: 12pt; }
  .doc-content { padding: 20px 0; }
  a { color: inherit; text-decoration: underline; }
  h2 { font-size: 20pt; }
  th { background: #fff; color: var(--text-primary); border-bottom: 2px solid var(--border); }
}
