/* Shared stylesheet for all statically-served pages.
   Brand palette shared with CRASH Lab (crashlab.in).
   Token values MUST stay in sync with index.css (:root). */
:root {
  --navy: #081d3a;
  --slate-blue: #234c6a;
  --canvas: #fafaf8;
  --surface: #ffffff;
  --elevated: #f3f4f6;
  --text: #0f172a;
  --text-2: #2d3640;
  --text-3: #4a5568;
  --text-faint: #5f6b7d;
  --rule: #e5e7eb;
  --rule-subtle: #eef2f7;
  --orange: #ea580c;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Lexend", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

/* Long-form prose is serif; headings and UI chrome are geometric sans. */
body {
  font-family: var(--font-serif);
  background: var(--canvas);
  color: var(--text);
  margin: 0;
  line-height: 1.65;
}

main, footer.page-footer {
  display: block;
  max-width: 68ch;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

main { padding-bottom: 64px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.25rem; margin: 2rem 0 0.5rem; font-weight: 700; }
h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
}
h3 { font-size: 1.15rem; font-weight: 600; margin-top: 1.75rem; }

p.lede {
  font-family: var(--font-sans);
  color: var(--text-3);
  font-size: 0.95rem;
  line-height: 1.6;
}

a { color: var(--slate-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--slate-blue); outline-offset: 2px; }

ul { padding-left: 1.25rem; }
li { margin: 0.6rem 0; }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--text-3);
}

.meta {
  font-family: var(--font-sans);
  color: var(--text-3);
  font-size: 0.85rem;
}

.tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--navy);
  background: var(--elevated);
  padding: 2px 8px;
  border-radius: 0;
}

footer.page-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans);
  color: var(--text-faint);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  justify-content: space-between;
}

footer.page-footer a { color: var(--text-3); }

/* Nav (shared) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 248, 0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-sans);
}
.site-bar {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
  color: var(--navy);
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand .ringmark { flex-shrink: 0; display: block; }

.nav-toggle {
  display: none;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--surface);
  padding: 6px 12px;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--navy);
}
.menu {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}
.menu a {
  font-weight: 400;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-3);
}
.menu a:hover { color: var(--navy); }
.menu a.active {
  color: var(--navy);
  font-weight: 500;
  box-shadow: inset 0 -2px 0 var(--orange);
}
@media (max-width: 720px) {
  .site-bar { flex-wrap: wrap; }
  .nav-toggle { display: inline-block; }
  .site-bar > nav { display: none; flex-basis: 100%; order: 10; }
  .site-header.is-open .site-bar > nav { display: block; }
  .menu { flex-direction: column; gap: 0; border-top: 1px solid var(--rule); padding-top: 8px; margin-top: 8px; }
  .menu a { display: block; padding: 8px 0; }
  .menu a.active { box-shadow: none; }
}
