/* civicworkbench.com — ported from prototypes/4-editorial-titleblock.
   Flexoki palette, Charter serif, engineering title-block header. */

:root {
  color-scheme: light dark;

  /* Flexoki */
  --paper: #fffcf0;
  --ink: #100f0f;
  --base-100: #e6e4d9;
  --base-200: #cecdc3;
  --base-500: #878580;
  --base-600: #6f6e69;
  --base-900: #282726;
  --base-950: #1c1b1a;
  --blue-600: #205ea6;
  --blue-400: #4385be;
  --red-600: #af3029;
  --red-400: #d14d41;
  --bg: light-dark(var(--paper), var(--ink));
  --fg: light-dark(var(--ink), var(--base-200));
  --muted: light-dark(var(--base-600), var(--base-500));
  --rule: light-dark(var(--base-100), var(--base-900));
  --accent: light-dark(var(--blue-600), var(--blue-400));
  --accent-warm: light-dark(var(--red-600), var(--red-400));
  --serif: "Charter", "Bitstream Charter", "Sitka Text", "Cambria", "Georgia", serif;
  --mono: ui-monospace, "Cascadia Code", "Source Code Pro", "Menlo", "Consolas", monospace;
  --text: clamp(1.1875rem, 1.05rem + 0.45vw, 1.3125rem);
  --text-sm: 0.8125rem;
  --measure: 64ch;

  accent-color: var(--accent);
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: var(--text);
  line-height: 1.62;
  padding-inline: max(1.25rem, env(safe-area-inset-left));
}

.shell {
  max-width: var(--measure);
  margin-inline: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

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

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

/* Header — title block */
.site-header {
  margin-top: 2rem;
  border: 2px solid var(--fg);
}

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

.site-header .row + .row {
  border-top: 1px solid var(--fg);
}

.wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
}

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

.doc-no {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--muted);
  letter-spacing: 0.1em;
}

.site-nav {
  display: flex;
  gap: 1.4rem;
  font-family: var(--mono);
  font-size: var(--text-sm);
}

.site-nav a {
  color: var(--fg);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.site-nav a:hover {
  color: var(--accent-warm);
}

/* Landing intro: the statement is the page's h1 */
.home-intro h1 {
  padding-block: clamp(3.5rem, 10vh, 6.5rem) 1rem;
  font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.6rem);
  line-height: 1.32;
  font-weight: 400;
  text-wrap: pretty;
}

.home-intro h1 em {
  font-style: italic;
  color: var(--accent-warm);
}

.home-intro p {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--muted);
  padding-block: 0.25rem 2rem;
}

.home-intro p a {
  color: var(--muted);
}

.home-intro p a:hover {
  color: var(--accent-warm);
}

/* Section labels */
.section-label {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 0.9rem;
  margin-top: 3.2rem;
}

.asterism {
  border: 0;
  text-align: center;
  color: var(--muted);
  margin-block: 2.6rem;
}

.asterism::before {
  content: "⁂";
  font-size: 1.1rem;
}

/* Stream */
.stream {
  list-style: none;
  padding: 0;
  margin-block: 1.4rem 0;
}

.stream li {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 1.1rem;
  padding-block: 0.85rem;
}

.stream time {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--muted);
  padding-top: 0.35em;
}

.stream h3 {
  font-size: 1.14em;
  font-weight: 700;
  line-height: 1.3;
}

.stream h3 a {
  color: var(--fg);
  text-decoration: none;
}

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

.entry-meta {
  font-size: 0.85em;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Projects */
.projects {
  list-style: none;
  padding: 0;
  margin-block: 1.4rem 0;
}

.projects li {
  padding-block: 0.7rem;
}

.projects .name {
  font-weight: 700;
}

.projects .name a {
  color: var(--fg);
  text-decoration: none;
}

.projects .name a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.status {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.1em 0.45em;
  margin-left: 0.5em;
  vertical-align: 0.15em;
}

.status.active {
  color: var(--accent);
  border-color: currentcolor;
}

/* Page + article headers */
.page-header {
  padding-block: clamp(2.5rem, 7vh, 4rem) 0;
}

.page-header h1 {
  font-size: clamp(1.9rem, 1.2rem + 2.8vw, 2.8rem);
  line-height: 1.14;
  font-weight: 700;
  margin-bottom: 1.2rem;
  text-wrap: balance;
}

.article-header {
  padding-block: clamp(3rem, 8vh, 5rem) 0;
}

.eyebrow {
  font-family: var(--mono);
  font-size: var(--text-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-warm);
}

.article-header h1 {
  font-size: clamp(2.1rem, 1.2rem + 3.6vw, 3.4rem);
  line-height: 1.12;
  font-weight: 700;
  margin-block: 0.7rem 0.8rem;
  text-wrap: balance;
}

.dek {
  font-size: 1.25em;
  line-height: 1.4;
  color: var(--muted);
  font-style: italic;
  text-wrap: pretty;
}

.byline {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--muted);
  margin-block: 1.4rem 0;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

/* Prose */
.prose h2 {
  font-size: 1.45em;
  line-height: 1.25;
  margin-block: 2.4rem 0.9rem;
  text-wrap: balance;
}

.prose p {
  margin-block: 0 1.1rem;
}

.prose ul,
.prose ol {
  margin-block: 0 1.1rem;
  padding-left: 1.4em;
}

.prose li {
  margin-block: 0.35rem;
}

.entry > p:first-of-type::first-letter {
  font-size: 3.1em;
  float: left;
  line-height: 0.82;
  padding-right: 0.09em;
  font-weight: 700;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin-block: 1.6rem;
  font-size: 0.9em;
}

caption {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--muted);
  text-align: left;
  padding-bottom: 0.5rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

th {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--muted);
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Code */
pre {
  font-family: var(--mono);
  font-size: 0.82em;
  line-height: 1.55;
  background: light-dark(var(--base-950), #000);
  color: var(--base-200);
  color-scheme: dark;
  padding: 1.1rem 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-block: 1.6rem;
}

code {
  font-family: var(--mono);
}

p code,
li code {
  font-size: 0.85em;
  background: light-dark(var(--base-100), var(--base-900));
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

/* Callout */
.callout {
  border-left: 3px solid var(--accent-warm);
  padding: 0.2rem 0 0.2rem 1.3rem;
  margin-block: 2rem;
  font-size: 1.16em;
  line-height: 1.45;
  font-style: italic;
}

.callout p {
  margin: 0;
}

/* Footer */
.site-footer {
  margin-top: 4.5rem;
  border-top: 1px solid var(--rule);
  padding-block: 1.6rem 3rem;
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

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

@media (width <= 34rem) {
  .stream li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a {
    transition: color 120ms ease;
  }
}
