/* Styles for the home page, the Log, the Tools page and posts.
   Colours match the Resistor Combination Finder so the whole site feels like one thing. */

:root {
  --bg: #f4f5f7; --panel: #ffffff; --ink: #14171c; --muted: #5d6470; --line: #dde0e5; --soft: #eceef2;
  --accent: #1f5bd0;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1217; --panel: #171b21; --ink: #e5e8ed; --muted: #959ca7; --line: #2a3039; --soft: #20252d;
  --accent: #5b98ff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--accent); text-underline-offset: 3px; }

.page { max-width: 880px; margin: 0 auto; padding: 48px 16px 64px; }

/* home */
.hero { margin-bottom: 48px; }
.hero h1 { font-size: clamp(32px, 6vw, 46px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 12px; }
.lede { font-size: 18px; color: var(--muted); margin: 0; max-width: 36em; }
section + section { margin-top: 48px; }
.sec-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
}
.sec-head h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.sec-head a { font-size: 14px; text-decoration: none; }
.sec-head + div > .cards { margin-top: 16px; }

/* list pages */
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: clamp(28px, 5vw, 38px); letter-spacing: -0.025em; line-height: 1.15; margin: 0 0 6px; }
.page-head p { color: var(--muted); margin: 0; }
.year { font: 600 13px var(--mono); color: var(--muted); margin: 32px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item {
  display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 2px 20px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.post-item time { color: var(--muted); font: 13px/1.9 var(--mono); }
.post-item a { color: var(--ink); text-decoration: none; font-weight: 650; font-size: 17px; }
.post-item a:hover { color: var(--accent); text-decoration: underline; }
.post-item p { grid-column: 2; margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 560px) {
  .post-item { grid-template-columns: minmax(0, 1fr); }
  .post-item p { grid-column: 1; }
}
.empty-note { color: var(--muted); }

/* posts */
.post { max-width: 680px; }
.post h1 { font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.025em; line-height: 1.12; margin: 10px 0 8px; }
.post-meta { color: var(--muted); font-size: 14px; margin: 0; }
.post-meta a { text-decoration: none; }
.post-body { margin-top: 28px; font-size: 17px; }
.post-body h2 { font-size: 22px; letter-spacing: -0.01em; line-height: 1.3; margin: 36px 0 8px; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 16px; }
.post-body li { margin-bottom: 4px; }
.post-body code { font: 0.88em var(--mono); background: var(--soft); padding: 0.1em 0.35em; border-radius: 4px; }
.post-body pre { background: var(--soft); padding: 14px 16px; border-radius: 8px; overflow-x: auto; font-size: 14px; }
.post-body pre code { background: none; padding: 0; }
.post-body img { max-width: 100%; height: auto; border-radius: 8px; }
.callout {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 12px 16px; margin: 0 0 16px;
}
