/* The UK Smart Home
   Palette: "grid green" for links and the mark, "solar amber" for small highlights.
   Light and dark follow the reader's device setting. */

:root {
  --bg: #f7f6f2;
  --surface: #efede6;
  --text: #1b1f1d;
  --muted: #5f6a65;
  --rule: #dfdcd3;
  --accent: #0a7350;        /* grid green */
  --accent-strong: #065c40;
  --amber: #9a5b00;         /* solar amber */
  --amber-soft: #f2b33d;
  --measure: 42rem;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121816;
    --surface: #1a2320;
    --text: #e4ebe7;
    --muted: #93a29b;
    --rule: #28332f;
    --accent: #4cd3a0;
    --accent-strong: #7ee3bd;
    --amber: #f2b33d;
    --amber-soft: #f2b33d;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: 0.5rem 0.75rem; z-index: 10; }

/* ---------- masthead ---------- */

.masthead {
  padding: 2.75rem 0 1.25rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand .mark { width: 2.1rem; height: 2.1rem; color: var(--accent); flex: none; }
.brand .mark .bolt { fill: var(--amber-soft); }
.brand .name {
  font: 700 1.6rem/1.1 var(--display);
  letter-spacing: -0.02em;
}
.brand .name b { color: var(--accent); font-weight: 800; }

.tagline { margin: 0.6rem 0 1rem; color: var(--muted); font-size: 0.95rem; }

.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.92rem; font-weight: 600; }
.nav a { color: var(--text); text-decoration: none; }
.nav a:hover { color: var(--accent); }

/* ---------- posts ---------- */

.post .title, .page .title {
  font: 700 1.45rem/1.25 var(--display);
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}
.single .post .title, .page .title, .archive .title { font-size: 2rem; }

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

.post.linked .title a { color: var(--accent); }
.post.linked .title a:hover { color: var(--accent-strong); text-decoration: underline; }
.out { color: var(--amber); font-weight: 700; }

.kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
}

.body > :first-child { margin-top: 0; }
.body p, .body ul, .body ol { margin: 0 0 1.05em; }
.body h2 { font: 700 1.25rem/1.3 var(--display); margin: 2rem 0 0.6rem; }
.body h3 { font: 700 1.05rem/1.3 var(--display); margin: 1.6rem 0 0.5rem; }
.body img, .body video { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 1.5rem auto; }
.body figure { margin: 1.5rem 0; }
.body figcaption { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: -0.75rem; }
.body hr { border: 0; height: 1px; background: var(--rule); margin: 2rem 0; }

.body blockquote {
  margin: 1.25rem 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
.body blockquote p:last-child { margin-bottom: 0; }

.body code { font: 0.88em var(--mono); background: var(--surface); padding: 0.1em 0.35em; border-radius: 4px; }
.body pre { background: var(--surface); padding: 1rem; border-radius: 8px; overflow-x: auto; font-size: 0.85rem; }
.body pre code { background: none; padding: 0; }

.body table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 1.5rem 0; }
.body th, .body td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--rule); }
.body th { font-weight: 700; }
.body td:not(:first-child), .body th:not(:first-child) { font-variant-numeric: tabular-nums; }

.meta { color: var(--muted); font-size: 0.82rem; margin-top: 0.4rem; }
.permalink {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  margin-left: 0.35rem;
  padding: 0 0.15rem;
}
.permalink:hover { color: var(--accent); }

.more a { font-weight: 600; text-decoration: none; }

.divider { border: 0; height: 1px; background: var(--rule); margin: 2.5rem 0; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 3rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  font-weight: 600;
}
.pager a { text-decoration: none; max-width: 48%; }
.post-pager a:last-child { text-align: right; }

.empty { color: var(--muted); }

/* ---------- archive ---------- */

.archive-key { color: var(--muted); font-size: 0.9rem; margin-top: -0.25rem; }
.archive-month h2 {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.25rem 0 0.6rem;
}
.archive-month ul { list-style: none; margin: 0; padding: 0; }
.archive-month li { padding: 0.35rem 0; border-bottom: 1px solid var(--rule); display: flex; gap: 0.75rem; align-items: baseline; }
.archive-month time { color: var(--muted); font-size: 0.85rem; min-width: 3.6rem; font-variant-numeric: tabular-nums; }
.archive-month a { color: var(--text); text-decoration: none; }
.archive-month a:hover { color: var(--accent); }
.archive-month li .out { margin-left: auto; }
.tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-left: auto;
  white-space: nowrap;
}

/* ---------- footer ---------- */

.site-footer {
  margin: 4rem 0 0;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.82rem;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 520px) {
  body { font-size: 1rem; }
  .masthead { padding-top: 1.75rem; }
  .brand .name { font-size: 1.35rem; }
  .single .post .title, .page .title, .archive .title { font-size: 1.6rem; }
}
