/* The Scope Creep */

:root {
  --paper: #f6f3ec;
  --surface: #fffdf8;
  --ink: #1c211d;
  --muted: #646d60;
  --line: #e0dacb;
  --accent: #1f7a45;
  --accent-ink: #17603a;
  --accent-soft: #e2efe1;
  --update: #8a5200;
  --update-soft: #f6e8cf;
  --code-bg: #efebe0;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 44rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121612;
    --surface: #1a201b;
    --ink: #e8ebe3;
    --muted: #98a393;
    --line: #2c352d;
    --accent: #6fcf8f;
    --accent-ink: #8adba5;
    --accent-soft: #1d3125;
    --update: #e6b566;
    --update-soft: #33280f;
    --code-bg: #212821;
  }
  .brand-mark .vine { fill: #6fcf8f; stroke: #6fcf8f; }
}

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

/* The filter hides items with the hidden attribute. Without this, any rule
   that sets display (such as the flex rows in .directory) would override it. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
}

a { color: var(--accent-ink); text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }

.wrap {
  max-width: calc(var(--measure) + 2rem);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── Masthead ── */

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1.4rem;
  padding-bottom: 1.2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover { color: var(--ink); }

.brand-mark { width: 3.5rem; height: 3.5rem; flex: none; }
.brand-mark svg { display: block; width: 100%; height: 100%; }

.brand-name {
  display: block;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.brand-name em { color: var(--accent); font-style: italic; }

.brand-tagline {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-nav { display: flex; gap: 0.25rem; }

.site-nav a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.site-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

main { padding: 2rem 0 4rem; }

/* ── Page headings ── */

.page-head { margin-bottom: 1.5rem; }

.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.page-title.mono { font-family: var(--mono); font-size: 1.25rem; letter-spacing: 0; }

.page-sub { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.95rem; }

/* ── Filter ── */

.filter { margin-bottom: 1.5rem; }

.filter input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.filter input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.filter-empty { color: var(--muted); }

/* ── Chips and badges ── */

.chip {
  display: inline-block;
  max-width: 100%;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.chip:hover { background: var(--accent); color: var(--surface); }

.badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 0.3rem;
  background: var(--update-soft);
  color: var(--update);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.rev { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }

.byline { color: var(--muted); font-size: 0.85rem; }
.byline a { color: inherit; }
.byline a:hover { color: var(--accent); }

/* ── Post cards ── */

.day { margin: 2.25rem 0 0.75rem; }
.day:first-of-type { margin-top: 0; }

.day-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day-label span { color: var(--muted); font-weight: 500; letter-spacing: 0; text-transform: none; }

/* minmax(0, 1fr) and min-width: 0 let a card shrink to the screen. Without
   them a long draft name sets the card's minimum width and it overflows. */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }

.card {
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}

.card:hover { border-color: var(--accent); }

.card-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
}

.card-title, .card-excerpt, .agenda-draft-title, .slot-head h3, .toc a, .callout { overflow-wrap: anywhere; }

.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--accent-ink); text-decoration: underline; }

.card-excerpt { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.92rem; }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  margin-top: 0.7rem;
}

.card-meta > * { min-width: 0; }

.card-date { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }

/* ── Directory lists (drafts, authors) ── */

.directory { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }

.directory li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.directory a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.directory a:hover { text-decoration: underline; }
.directory.mono a { font-family: var(--mono); font-size: 0.88rem; font-weight: 500; }
.directory .count { color: var(--muted); font-size: 0.82rem; }

.draft-group { margin-top: 2rem; }
.draft-group > h2 { margin: 0 0 0.6rem; font-size: 1rem; }

/* ── Meetings ── */

.callouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.callout {
  display: grid;
  gap: 0.15rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: 0.75rem;
  background: var(--accent-soft);
  color: var(--ink);
  text-decoration: none;
}

.callout:hover { color: var(--ink); border-color: var(--accent-ink); }
.callout .eyebrow { margin: 0; }
.callout strong { font-family: var(--serif); font-size: 1.25rem; }
.callout span:last-child { color: var(--accent-ink); font-size: 0.92rem; }

.slots { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }

.slot {
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}

.slot-plain { padding: 0.6rem 1.1rem; background: none; border-style: dashed; }

.slot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1rem;
}

.slot-head h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.slot-plain .slot-head h3 { font-size: 0.95rem; font-weight: 600; }
.slot-meta { color: var(--muted); font-size: 0.82rem; }

.slot-notes { margin: 0.4rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.88rem; }
.slot-notes li { margin-bottom: 0.1rem; }

.agenda-draft { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.agenda-draft p { margin: 0; }
.agenda-draft-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; }
.agenda-draft-head > *, .slot-head > *, .directory li > * { min-width: 0; }

.agenda-draft-title {
  margin-top: 0.5rem !important;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.agenda-draft-title a { color: var(--ink); text-decoration: none; }
.agenda-draft-title a:hover { color: var(--accent-ink); text-decoration: underline; }

.agenda-summary { margin-top: 0.4rem; font-size: 0.95rem; }
.agenda-summary p + p { margin-top: 0.6rem; }
.agenda-summary code { font-family: var(--mono); font-size: 0.85em; }

.agenda-links { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; margin-top: 0.7rem !important; font-size: 0.88rem; }
.agenda-primary { font-weight: 700; }

.chip-plain { background: var(--code-bg); color: var(--ink); }
.badge-muted { background: var(--code-bg); color: var(--muted); }

/* ── Post ── */

.post-head { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 2px solid var(--ink); }

.post-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.7rem;
  margin-top: 0.9rem;
}

.post-source { font-size: 0.85rem; }

.toc {
  margin: 0 0 2rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 0.5rem;
  background: var(--surface);
}

.toc h2 {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding-left: 1.3rem;
  columns: 2;
  column-gap: 2rem;
  font-size: 0.92rem;
}

.toc li { margin-bottom: 0.3rem; break-inside: avoid; }
.toc li::marker { color: var(--muted); }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.prose h2 { scroll-margin-top: 1rem; }

.prose {
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.prose h2 {
  margin: 2.5rem 0 0.7rem;
  font-family: var(--sans);
  font-size: 1.3rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.prose h2:first-child { margin-top: 0; }

.prose h3 {
  margin: 2rem 0 0.5rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prose p { margin: 0 0 1.05rem; }
.prose ul, .prose ol { margin: 0 0 1.05rem; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.35rem; }
.prose strong { font-weight: 700; }

.prose blockquote {
  margin: 0 0 1.05rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  background: var(--code-bg);
  font-family: var(--mono);
  font-size: 0.8em;
}

.prose pre {
  margin: 0 0 1.05rem;
  padding: 1rem 1.1rem;
  border-radius: 0.5rem;
  background: var(--code-bg);
  overflow-x: auto;
}

.prose pre code { padding: 0; background: none; font-size: 0.82rem; line-height: 1.5; }

.prose table {
  display: block;
  width: 100%;
  margin: 0 0 1.05rem;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.9rem;
  overflow-x: auto;
}

.prose th, .prose td { padding: 0.45rem 0.7rem; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--code-bg); font-weight: 600; }

.related { margin-top: 3rem; padding-top: 1.5rem; border-top: 2px solid var(--ink); }
.related h2 { margin: 0 0 0.75rem; font-size: 1rem; }

/* ── Footer ── */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

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

.site-footer strong { color: var(--ink); }
.site-footer nav { display: flex; gap: 1rem; }

@media (max-width: 34rem) {
  .brand-mark { width: 2.75rem; height: 2.75rem; }
  .brand-name { font-size: 1.55rem; }
  .brand-tagline { font-size: 0.78rem; }
  .page-title { font-size: 1.55rem; }
  .prose { font-size: 1.05rem; }
  .toc ol { columns: 1; }
  .site-nav { margin-left: -0.75rem; }
}
