/* Silver Context — system.css
   Tokens + primitives. Shared across every page. */

:root {
  /* Colors — dark only */
  --bg-primary: #0A0A0A;
  --bg-secondary: #111111;
  --bg-tertiary: #1A1A1A;
  --surface: #1F1F1F;
  --border: #2A2A2A;
  --border-strong: #3A3A3A;
  --text-primary: #F5F5F5;
  --text-secondary: #8A8A8A;
  --text-tertiary: #555555;
  --accent: #8A9BB8;
  --accent-hover: #9AABCA;
  --accent-subtle: rgba(138,155,184,0.08);

  /* Type */
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radius — 4px always */
  --radius: 4px;

  /* Spacing (4px grid) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;
  --s-30: 120px;
  --s-40: 160px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
}

body { min-height: 100vh; overflow-x: hidden; }

::selection { background: var(--accent); color: var(--bg-primary); }

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

/* ————————————————————————————————————— */
/* Type scale                               */
/* ————————————————————————————————————— */

.t-hero {
  font-size: clamp(48px, 7vw, 80px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: var(--text-primary);
}
.t-display {
  font-size: clamp(40px, 5.2vw, 56px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-primary);
}
.t-h1 {
  font-size: clamp(32px, 3.6vw, 40px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text-primary);
}
.t-h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-primary);
}
.t-h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text-primary);
}
.t-body-lg {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.65;
  color: var(--text-secondary);
}
.t-body {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
}
.t-small {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.55;
  color: var(--text-secondary);
}
.t-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.t-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-tertiary);
}

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--accent); }

/* ————————————————————————————————————— */
/* Layout primitives                         */
/* ————————————————————————————————————— */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
}
.reading { max-width: 640px; }

.section { padding-block: var(--s-30); border-top: 1px solid var(--border); }
.section-narrow { padding-block: var(--s-16); border-top: 1px solid var(--border); }
.section-alt { background: var(--bg-secondary); }

.rule { border: 0; border-top: 1px solid var(--border); height: 0; margin: 0; }

/* ————————————————————————————————————— */
/* Nav                                       */
/* ————————————————————————————————————— */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.25s ease;
}
.nav.is-hidden { transform: translateY(-100%); }
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}
.nav-brand svg { width: auto; height: 20px; }
.nav-wordmark {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-8);
}
.nav-links a {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text-primary); }

.nav-mobile-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 8px 4px;
}
.nav-mobile-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,10,10,0.97);
  backdrop-filter: blur(20px);
  z-index: 200;
  padding: 80px 48px;
}
.nav-mobile-overlay.is-open { display: block; }
.nav-mobile-overlay a {
  display: block;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.nav-mobile-close {
  position: absolute;
  top: 22px; right: 48px;
  background: transparent; border: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  cursor: pointer;
}

@media (max-width: 768px) {
  .container, .nav-inner { padding: 0 24px; }
  .nav-links { display: none; }
  .nav-mobile-toggle { display: inline-flex; }
  .nav-mobile-overlay { padding: 80px 24px; }
  .nav-mobile-close { right: 24px; }
  .section { padding-block: var(--s-20); }
  .section-narrow { padding-block: var(--s-12); }
}

/* ————————————————————————————————————— */
/* Footer                                    */
/* ————————————————————————————————————— */

.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--s-16) var(--s-10);
  background: var(--bg-primary);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--s-10);
  margin-bottom: var(--s-12);
}
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--s-4);
}
.footer-col a, .footer-col p {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 0;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--text-primary); }
.footer-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: var(--s-3);
}
.footer-brand svg { width: auto; height: 18px; }
.footer-brand span {
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text-primary);
}
.footer-blurb {
  font-size: 13px; line-height: 1.6;
  color: var(--text-secondary);
  max-width: 30ch;
}
.footer-bottom {
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
}

/* ————————————————————————————————————— */
/* Code / ASCII blocks                       */
/* ————————————————————————————————————— */

pre, code, .ascii {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
pre, .ascii-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
  color: var(--text-secondary);
}
.ascii-block .hl { color: var(--text-primary); }
.ascii-block .dim { color: var(--text-tertiary); }
.ascii-block .accent { color: var(--accent); }

/* ————————————————————————————————————— */
/* Eyebrow, chip, minor elements             */
/* ————————————————————————————————————— */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--s-6);
}
.eyebrow::before {
  content: '';
  width: 14px; height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.filing {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ————————————————————————————————————— */
/* Links                                     */
/* ————————————————————————————————————— */

.link {
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.link:hover { color: var(--accent); border-color: var(--accent); }

.link-soft {
  color: var(--text-secondary);
  transition: color 0.15s;
}
.link-soft:hover { color: var(--text-primary); }
.link-soft .arrow {
  display: inline-block;
  transition: transform 0.2s;
}
.link-soft:hover .arrow { transform: translateX(3px); }

.link-accent {
  color: var(--accent);
  transition: color 0.15s;
}
.link-accent:hover { color: var(--accent-hover); }

/* ————————————————————————————————————— */
/* Utility                                   */
/* ————————————————————————————————————— */

.stack-1 > * + * { margin-top: var(--s-1); }
.stack-2 > * + * { margin-top: var(--s-2); }
.stack-3 > * + * { margin-top: var(--s-3); }
.stack-4 > * + * { margin-top: var(--s-4); }
.stack-5 > * + * { margin-top: var(--s-5); }
.stack-6 > * + * { margin-top: var(--s-6); }
.stack-8 > * + * { margin-top: var(--s-8); }
.stack-10 > * + * { margin-top: var(--s-10); }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.gap-6 { gap: var(--s-6); }

.muted { color: var(--text-tertiary); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
