/* Helm & Proof — one stylesheet, system fonts, no external resources. */

:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --fg: #1d2330;
  --muted: #5a6272;
  --accent: #1f4e79;
  --accent-hover: #12304d;
  --rule: #dcd8ce;
  --panel: #f1eee6;
  --measure: 68ch;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c;
    --fg: #e6e4de;
    --muted: #a3a9b7;
    --accent: #8cbbe8;
    --accent-hover: #bcd8f2;
    --rule: #2c3340;
    --panel: #1a1f29;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 3rem);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex: 1 0 auto;
  padding-bottom: 3rem;
}

/* Links */
a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.07em;
}

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

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Header and wordmark */
.site-header {
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--fg);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--fg);
}

.wordmark .amp {
  color: var(--accent);
  padding: 0 0.12em;
}

.site-nav {
  font-family: var(--sans);
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.25rem;
}

.site-nav a:first-child {
  margin-left: 0;
}

.site-nav a:hover {
  color: var(--fg);
  text-decoration: underline;
}

/* Typography */
h1,
h2,
h3 {
  font-family: var(--sans);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.9rem, 5vw + 0.5rem, 2.7rem);
  margin: 2.5rem 0 1rem;
}

h2 {
  font-size: 1.45rem;
  margin: 2.5rem 0 0.75rem;
}

p,
ul,
ol {
  margin: 0 0 1.15rem;
  max-width: var(--measure);
}

strong {
  font-weight: 700;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* Hero */
.hero {
  padding: 3rem 0 1.5rem;
}

.hero .brand {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 7vw + 0.5rem, 3.8rem);
  line-height: 1.1;
}

.hero .lede {
  font-size: 1.3rem;
  color: var(--fg);
  max-width: var(--measure);
}

/* Callout panel */
.panel {
  background: var(--panel);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  max-width: var(--measure);
  border-radius: 0 4px 4px 0;
}

.panel p:last-child {
  margin-bottom: 0;
}

/* Article */
.article-header {
  padding-top: 0.5rem;
}

.article-header h1 {
  margin-bottom: 0.5rem;
}

.subtitle {
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
  margin: 0 0 1rem;
}

.byline {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-style: normal;
  color: var(--muted);
  margin: 0 0 2rem;
}

.article-body h2 {
  margin-top: 2.75rem;
}

.article-end {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  max-width: none;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--fg);
}

/* Small screens */
@media (max-width: 34rem) {
  body {
    font-size: 1.0625rem;
  }

  .wrap {
    padding: 0 1.1rem;
  }

  .hero {
    padding-top: 2rem;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .site-nav,
  .site-footer {
    display: none;
  }

  a {
    color: #000;
  }
}
