/* Minimal, tech-forward theme: one column, one typeface (Instrument Sans),
   one accent (cobalt). The only decoration is the cursor at the end of the
   home statement. */

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-var.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-italic-var.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #f6f7f9;
  --text: #0d1117;
  --muted: #5b6472;
  --faint: #8a93a3;
  --rule: #e3e6eb;
  --accent: #3355ff;
  --accent-soft: rgba(51, 85, 255, 0.1);
  --code-bg: #0f131a;
  --code-text: #dde3ec;
  --inline-code: #eceef2;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e12;
    --text: #e7eaf0;
    --muted: #9aa3b2;
    --faint: #6b7484;
    --rule: #1f242d;
    --accent: #7b93ff;
    --accent-soft: rgba(123, 147, 255, 0.14);
    --code-bg: #14181f;
    --code-text: #dde3ec;
    --inline-code: #191d25;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--bg); }

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.preview-banner {
  margin: 0;
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: var(--bg);
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
}

.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

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

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0;
}
.wordmark { font-weight: 600; letter-spacing: -0.01em; }
.site-header nav { display: flex; gap: 1.5rem; }
.site-header nav a, .site-footer a { color: var(--muted); transition: color 0.15s; }
.site-header nav a:hover, .site-footer a:hover { color: var(--text); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 6rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }

/* ---- home --------------------------------------------------------------- */

.hero { padding: clamp(3rem, 12vw, 8rem) 0 clamp(3rem, 10vw, 6rem); }
.hero h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2.4rem, 7vw, 4.25rem);
  font-weight: 500;
  font-stretch: 90%;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.cursor {
  display: inline-block;
  width: 0.09em;
  height: 0.82em;
  margin-left: 0.12em;
  vertical-align: -0.04em;
  background: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .cursor { animation: blink 1.1s steps(1) 4; }
  @keyframes blink { 50% { opacity: 0; } }
}

.section-title, .page-title { margin: 0 0 1.5rem; }
.section-title { font-size: 0.95rem; font-weight: 500; color: var(--muted); }
.page-title {
  margin-top: 2rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* ---- post list ---------------------------------------------------------- */

.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.post-list li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
}
.post-list time {
  padding-top: 0.2rem;
  color: var(--faint);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.post-link {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1.5px no-repeat;
  transition: background-size 0.25s ease, color 0.15s;
}
.post-link:hover { color: var(--accent); background-size: 100% 1.5px; }
.post-list p { margin: 0.35rem 0 0; color: var(--muted); }
.empty { color: var(--muted); }

.draft-tag {
  display: inline-block;
  margin: 0 0 0.4rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
}
.post-list .draft-tag { display: table; }
.post-header .draft-tag { margin: 0 0 1rem; }

.tag-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.tag-list li { display: flex; justify-content: space-between; padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.tag-list a { font-weight: 600; }
.tag-list a:hover { color: var(--accent); }
.tag-list span { color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---- a post ------------------------------------------------------------- */

.post-header { padding: clamp(2rem, 8vw, 4.5rem) 0 2.5rem; }
.post-header h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  font-weight: 600;
  font-stretch: 92%;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 1.25rem 0 0;
  color: var(--faint);
  font-size: 0.92rem;
}

.post-body { font-size: 1.125rem; line-height: 1.75; }
.post-body > :first-child { margin-top: 0; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 1.3em; }
.post-body li + li { margin-top: 0.35em; }
.post-body li::marker { color: var(--faint); }
.post-body h2, .post-body h3, .post-body h4 { letter-spacing: -0.02em; line-height: 1.25; margin: 2.4em 0 0.6em; }
.post-body h2 { font-size: 1.6rem; font-weight: 600; }
.post-body h3 { font-size: 1.25rem; font-weight: 600; }
.post-body h4 { font-size: 1.05rem; font-weight: 600; }
.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.post-body a:hover { text-decoration-color: currentColor; }
.post-body strong { font-weight: 650; }
.post-body blockquote {
  margin: 2em 0;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}
.post-body blockquote > :last-child { margin-bottom: 0; }
.post-body hr { border: 0; border-top: 1px solid var(--rule); margin: 3em 0; }
.post-body img { display: block; max-width: 100%; height: auto; margin: 2em 0; border-radius: 10px; }
.missing-image { color: var(--faint); font-style: italic; }
.post-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin: 2em 0;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.post-body th, .post-body td { padding: 0.6rem 1rem 0.6rem 0; border-bottom: 1px solid var(--rule); text-align: left; }
.post-body th { color: var(--muted); font-weight: 500; }

code { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code { padding: 0.12em 0.35em; border-radius: 5px; background: var(--inline-code); }
pre {
  margin: 2em 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-text);
  line-height: 1.6;
}
pre code { font-size: 0.85rem; }
/* Chroma. Code blocks are dark in both modes, so these are fixed colours. */
.chroma .c, .chroma .c1, .chroma .cm, .chroma .cs, .chroma .ch { color: #6b7484; font-style: italic; }
.chroma .k, .chroma .kd, .chroma .kn, .chroma .kr, .chroma .kt, .chroma .ow, .chroma .nt { color: #8ea2ff; }
.chroma .s, .chroma .s1, .chroma .s2, .chroma .sb, .chroma .sd, .chroma .se, .chroma .sh, .chroma .si, .chroma .sx { color: #a8d5b5; }
.chroma .m, .chroma .mi, .chroma .mf, .chroma .mh, .chroma .il, .chroma .kc { color: #f0c38e; }
.chroma .nf, .chroma .fm, .chroma .nc, .chroma .nb, .chroma .na { color: #e6e9ef; font-weight: 600; }
.chroma .err, .chroma .gd { color: #ff8f8f; }
.chroma .gi { color: #a8d5b5; }

.post-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-top: 4rem;
  color: var(--faint);
  font-size: 0.9rem;
}
.post-footer p { margin: 0; }
.post-tags { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.post-tags a { color: var(--muted); }
.post-tags a:hover { color: var(--accent); }

/* ---- small screens ------------------------------------------------------ */

@media (max-width: 40rem) {
  .post-list li { grid-template-columns: 1fr; }
  .post-list time { padding: 0 0 0.25rem; font-size: 0.85rem; }
  .post-body { font-size: 1.0625rem; }
}
