/* Build Something Design System v1
   Shared visual language for the institution and its public properties. */

:root {
  --paper: #f4efe5;
  --ink: #1b1610;
  --gold: #a67c2e;
  --gold-dark: #79581d;
  --gold-soft: #efe2c5;
  --blue: #174a7e;
  --blue-dark: #0f365e;
  --blue-soft: #dce8f2;
  --vera-purple: #6f4ca5;
  --success: #2f6b45;
  --warning: #9a2f27;
  --paper-raised: #fbf7ef;
  --ink-muted: #655c50;
  --line: rgba(27, 22, 16, 0.18);
  --line-soft: rgba(27, 22, 16, 0.10);
  --font-editorial: "Newsreader", "Source Serif 4", Georgia, serif;
  --font-interface: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;
  --space-7: 128px;
  --radius: 3px;
  --page-max: 1100px;
  --prose-max: 68ch;
  --focus-ring: 3px solid var(--blue);
}

.bs-system {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-interface);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.bs-system :where(h1, h2, h3, .bs-display) {
  color: var(--ink);
  font-family: var(--font-editorial);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.bs-system :where(a) { color: var(--blue); text-underline-offset: 0.18em; }
.bs-system :where(img, svg, video) { max-width: 100%; }
.bs-system :where(button, input, textarea, select) { font: inherit; }
.bs-system :where(button, a, input, textarea, select):focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

.bs-shell { width: min(calc(100% - 40px), var(--page-max)); margin-inline: auto; }
.bs-prose { max-width: var(--prose-max); }
.bs-section { padding-block: clamp(var(--space-6), 10vw, var(--space-7)); }
.bs-section + .bs-section { border-top: 1px solid var(--line-soft); }
.bs-eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--ink-muted);
  font: 750 0.72rem/1.2 var(--font-interface);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.bs-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 12px 22px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 750 0.9rem/1.2 var(--font-interface);
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
}
.bs-button--primary { border-color: var(--gold); background: var(--gold); color: var(--ink); }
.bs-button--secondary { background: transparent; color: var(--ink); }
.bs-button--info { border-color: var(--blue); background: var(--blue); color: var(--paper-raised); }

.bs-card {
  padding: clamp(var(--space-3), 4vw, var(--space-4));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

.bs-field {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
}
.bs-field:focus { border-color: var(--blue); outline: var(--focus-ring); outline-offset: 2px; }

.bs-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-block: 1px solid var(--line); }
.bs-stat { padding: var(--space-3); }
.bs-stat + .bs-stat { border-left: 1px solid var(--line); }
.bs-stat__value { color: var(--blue); font: 650 clamp(2rem, 6vw, 3.75rem)/1 var(--font-editorial); }
.bs-stat__label { margin-top: var(--space-1); color: var(--ink-muted); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; }

.bs-binary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.bs-binary > :first-child { border-color: var(--gold); background: var(--gold); color: var(--ink); }
.bs-binary > :nth-child(2) { border-color: var(--blue); background: var(--blue); color: var(--paper-raised); }

.bs-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.bs-table { width: 100%; border-collapse: collapse; }
.bs-table :where(th, td) { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.bs-table th { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }

.bs-footer { padding: var(--space-5) max(20px, calc((100% - var(--page-max)) / 2)); border-top: 1px solid var(--line); color: var(--ink-muted); }

.bs-live { color: var(--blue); }
.bs-value { color: var(--gold-dark); }
.bs-success { color: var(--success); }
.bs-warning { color: var(--warning); }

@media (max-width: 640px) {
  .bs-system { font-size: 17px; }
  .bs-shell { width: min(calc(100% - 32px), var(--page-max)); }
  .bs-section { padding-block: var(--space-5); }
  .bs-binary { gap: var(--space-1); }
  .bs-binary > * { min-height: 52px; padding-inline: var(--space-2); }
  .bs-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bs-stat + .bs-stat { border-left: 0; }
  .bs-stat:nth-child(even) { border-left: 1px solid var(--line); }
  .bs-stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

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