/* Blog pages — self-contained. index.html keeps its own inline CSS and the
   Material components; article pages load nothing but this file, so the
   dark yellow palette is redeclared here rather than shared.

   There is no .cta rule on purpose. Articles carry no pitch: see
   ../../CLAUDE.md, "Writing articles". */

:root {
  color-scheme: light dark;
  --content-w: 720px;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}

html.light {
  --primary: #857100;
  --on-primary: #ffffff;
  --secondary-container: #f2e8ac;
  --on-secondary-container: #4d4200;
  --background: #fcfaee;
  --surface-lowest: #ffffff;
  --surface-high: #eee8c6;
  --on-background: #201e0c;
  --on-surface-variant: #555038;
  --outline-variant: #ded6aa;
  --code-bg: #23200a;
  --code-fg: #f4efd8;
  --code-accent: #e8c93c;
  --code-border: transparent;
}

html.dark {
  --primary: #e8c93c;
  --on-primary: #302900;
  --secondary-container: #1c1b0f;
  --on-secondary-container: #f9f1b4;
  --background: #121108;
  --surface-lowest: #0d0c04;
  --surface-high: #262414;
  --on-background: #f0ecd6;
  --on-surface-variant: #c5bf9d;
  --outline-variant: #363218;
  --code-bg: #0d0c04;
  --code-fg: #f0ecd6;
  --code-accent: #e8c93c;
  --code-border: #363218;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--on-background);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }

/* ---------- header ---------- */
header.bar {
  /* the bright yellow base, in both themes: dark text, 9.3:1 */
  background: #e9c822;
  color: #2a2400;
}
.bar-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #2a2400;
  text-decoration: none;
}
.brand .mark {
  font: 700 0.95rem/1 var(--mono);
  color: #6b5a00;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 0.4rem;
  padding: 0.25rem 0.35rem;
}
.bar-actions { display: flex; align-items: center; gap: 0.9rem; }
.bar-link {
  color: #4a3f00;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.bar-link:hover { color: #000000; text-decoration: underline; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #4a3f00;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.12); color: #000000; }
.icon-btn svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
html.light .icon-btn .i-sun, html.dark .icon-btn .i-moon { display: none; }

/* ---------- layout ---------- */
main, footer {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.kicker {
  font: 500 0.75rem/1.5 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 0.75rem;
}
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { text-decoration: underline; }

h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}
h2 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.75rem;
}
p { margin: 0 0 1.1rem; }
.lede { font-size: 1.15rem; color: var(--on-surface-variant); }

ul, ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
li { margin-bottom: 0.35rem; }

code {
  font: 400 0.875em/1.5 var(--mono);
  background: var(--surface-high);
  border-radius: 0.25rem;
  padding: 0.1em 0.35em;
}

pre {
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--code-border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font: 400 0.85rem/1.7 var(--mono);
  margin: 0 0 1.25rem;
}
pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
pre .c { color: var(--code-accent); }

/* ---------- the "what breaks" callout ---------- */
.gotcha {
  border-left: 3px solid var(--primary);
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  border-radius: 0 0.75rem 0.75rem 0;
  padding: 1.1rem 1.35rem;
  margin: 0 0 1.25rem;
}
.gotcha p:last-child { margin-bottom: 0; }
.gotcha strong { font-weight: 600; }

/* ---------- closing references, not a CTA ---------- */
.refs {
  border-top: 1px solid var(--outline-variant);
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  font-size: 0.95rem;
  color: var(--on-surface-variant);
}
.refs p { margin-bottom: 0.5rem; }
.refs ul { margin-bottom: 0; }

table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}
th, td {
  border-bottom: 1px solid var(--outline-variant);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
th { font-weight: 600; }
.table-wrap { overflow-x: auto; margin-bottom: 1.25rem; }

.meta { font-size: 0.85rem; color: var(--on-surface-variant); margin-bottom: 2rem; }

/* ---------- article index ---------- */
.group { margin-bottom: 2.5rem; }
.group h2 { margin-top: 0; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li {
  border-top: 1px solid var(--outline-variant);
  padding: 1rem 0;
  margin: 0;
}
.post-list a {
  font-size: 1.05rem;
  font-weight: 500;
  text-decoration: none;
}
.post-list a:hover { text-decoration: underline; }
.post-list p {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--on-surface-variant);
}
footer {
  border-top: 1px solid var(--outline-variant);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--on-surface-variant);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}
