/* FastOpenData — light editorial design system
 * Forked from RMV (dark) and inverted into a paper-and-ink editorial system.
 * Single accent color, single font family + mono for code, 1px hairlines.
 */

:root {
  /* Surfaces */
  --paper:        #F9F8F4;   /* warm off-white background */
  --paper-2:      #F2F0E9;   /* recessed band */
  --surface:      #FFFFFF;   /* card */
  --code-bg:      #0E1116;   /* the one dark element */
  --code-ink:     #E6E1DC;
  --code-dim:     #7E8794;
  --code-string:  #A3D9B1;   /* desat green for strings */
  --code-key:     #C7C7C2;
  --code-num:     #E1B07E;
  --code-comment: #5E6772;

  /* Ink */
  --ink:          #0A0A0A;
  --ink-2:        #4A4A48;
  --ink-3:        #8A8A82;
  --ink-disabled: #BDBDB5;

  /* Lines */
  --rule:         #E5E2D8;
  --rule-strong:  #C9C5B6;

  /* Accent */
  --accent:       #0E7C3A;
  --accent-2:     #0B6230;
  --accent-tint:  #E5F1E9;
  --accent-line:  #B7DAC4;

  /* Signal */
  --danger:       #B42318;
  --warn:         #B25F00;

  /* Type */
  --font-sans:    "Montserrat", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Scale */
  --text-xs:    12px;
  --text-sm:    14px;
  --text-base:  16px;
  --text-md:    17px;
  --text-lg:    19px;
  --text-xl:    22px;
  --text-2xl:   28px;
  --text-3xl:   36px;
  --text-4xl:   48px;
  --text-5xl:   64px;
  --text-6xl:   84px;

  /* Tracking */
  --tt-tight:   -0.025em;
  --tt-tighter: -0.035em;
  --tt-wide:    0.12em;

  /* Radius */
  --r-sm: 4px;
  --r:    8px;
  --r-lg: 12px;
  --r-xl: 18px;

  /* Layout */
  --max-w:  1200px;
  --max-w-narrow: 880px;
  --header-h: 60px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  font-feature-settings: "ss01" on, "cv11" on;
}

/* Font-pairing tweak: when body class set, use mono for body */
body.mono-body {
  --font-sans: "Montserrat", ui-sans-serif, system-ui, sans-serif;
}
body.mono-body p,
body.mono-body li,
body.mono-body .body-text,
body.mono-body .meta,
body.mono-body .eyebrow,
body.mono-body .data-row,
body.mono-body .quick-step p,
body.mono-body .cat-card p {
  font-family: var(--font-mono);
  font-size: 0.95em;
  letter-spacing: -0.005em;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: var(--ink);
  letter-spacing: var(--tt-tight);
  margin: 0;
  font-weight: 700;
  text-wrap: balance;
}
.display {
  font-size: clamp(40px, 7vw, var(--text-6xl));
  line-height: 1.02;
  letter-spacing: var(--tt-tighter);
  font-weight: 700;
}
h1 { font-size: var(--text-4xl); line-height: 1.05; }
h2 { font-size: var(--text-3xl); line-height: 1.1; }
h3 { font-size: var(--text-xl); line-height: 1.2; }
h4 { font-size: var(--text-lg); line-height: 1.3; font-weight: 600; }

p { margin: 0 0 1em; color: var(--ink-2); }
p.lead { font-size: var(--text-xl); line-height: 1.45; color: var(--ink-2); max-width: 56ch; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tt-wide);
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }

code, kbd, pre, samp { font-family: var(--font-mono); }
code.inline {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Layout */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}
.wrap-narrow {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  padding: 0 28px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(249, 248, 244, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  letter-spacing: var(--tt-tight);
  color: var(--ink);
  font-size: 15px;
}
.brand-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}
.brand .dot {
  color: var(--accent);
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav a {
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 500;
  position: relative;
}
.nav a:hover { color: var(--ink); }
.nav a.active {
  color: var(--ink);
}
.nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--ink);
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: 600 14px/1 var(--font-sans);
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, transform 120ms ease-out;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #2a2a28; color: var(--paper); }
.btn.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn.btn-ghost:hover { background: var(--surface); border-color: var(--ink); color: var(--ink); }
.btn.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn .arrow { transition: transform 120ms ease-out; }
.btn:hover .arrow { transform: translateX(2px); }

/* Code block */
.code {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--r);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  border: 1px solid #1A1F27;
  overflow: hidden;
}
.code-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 8px;
  border-bottom: 1px solid #1A1F27;
  background: #0A0D12;
}
.code-tab {
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--code-dim);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  background: transparent;
  border-top: 0; border-left: 0; border-right: 0;
  margin-bottom: -1px;
}
.code-tab.active {
  color: var(--code-ink);
  border-bottom-color: var(--accent);
}
.code-tab:hover { color: var(--code-ink); }
.code-toolbar {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 6px;
}
.code-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--code-dim);
  background: transparent;
  border: 1px solid #1A1F27;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.code-copy:hover { color: var(--code-ink); border-color: #2a2f37; }
.code pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-feature-settings: "ss01" on, "calt" off;
}
.code .s { color: var(--code-string); }
.code .k { color: #B89CFF; }
.code .n { color: var(--code-num); }
.code .c { color: var(--code-comment); font-style: italic; }
.code .v { color: #7CC4FF; }
.code .p { color: var(--code-key); }
.code .o { color: #C9C5B6; }
.code .f { color: #FFD580; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
}
.card-pad { padding: 24px; }

/* Section */
section.section {
  padding: 96px 0;
  border-top: 1px solid var(--rule);
}
section.section.first { border-top: 0; }
section.section.compact { padding: 64px 0; }
section.section.recessed { background: var(--paper-2); }
.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 56px;
  max-width: 720px;
}
.section-head .eyebrow { color: var(--accent); }

/* Grid utilities */
.grid {
  display: grid;
  gap: 24px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  padding: 56px 0 40px;
}
.site-footer .grid-cols {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 32px;
}
.site-footer h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: var(--tt-wide);
  color: var(--ink-3);
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-weight: 500;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer li a { font-size: 14px; color: var(--ink-2); }
.site-footer li a:hover { color: var(--ink); }
.site-footer .legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--rule);
  margin-top: 40px;
  padding-top: 24px;
  font-size: 12px;
  color: var(--ink-3);
}
@media (max-width: 900px) {
  .site-footer .grid-cols {
    grid-template-columns: 1fr 1fr;
  }
}

/* Tag / pill */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink-2);
}
.tag.tag-accent {
  background: var(--accent-tint);
  border-color: var(--accent-line);
  color: var(--accent-2);
}

/* Stat */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat {
  padding: 24px 28px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat:last-child { border-right: 0; }
.stat .num {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: var(--tt-tight);
  color: var(--ink);
  font-feature-settings: "tnum" on;
}
.stat .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
}

/* Mark / highlight green */
.mark-accent { color: var(--accent); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
