/* blog.steine.casa - direction C "Plain", ported from the approved mockup
   (.scratch/launch/assets/design-mockup-approved.html). Auto light/dark. */

:root {
  --bg: #ffffff;
  --fg: #17171a;
  --muted: #6e6e76;
  --accent: #2257d6;
  --rule: #d8d8dd;
  --code-bg: #f4f4f6;
  --tk-k: #9333ea;
  --tk-s: #0f7b3d;
  --tk-f: #2257d6;
  --tk-c: #8c8c94;
  --shot-dim: 1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131316;
    --fg: #e7e7ec;
    --muted: #9a9aa3;
    --accent: #8ab0ff;
    --rule: #2c2c33;
    --code-bg: #1c1c21;
    --tk-k: #c495fb;
    --tk-s: #5fce8b;
    --tk-f: #8ab0ff;
    --tk-c: #71717a;
    /* light screenshots sit into the page instead of glowing */
    --shot-dim: 0.88;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
}

main {
  max-width: 41rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}

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

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

.home { padding-top: 2.5rem; }
.name { margin: 0; font-size: 1.35rem; font-weight: 650; letter-spacing: -0.01em; }
.tagline { margin: 0.35rem 0 0; color: var(--muted); }
.home-footer { margin: 2.5rem 0 0; font-size: 0.85rem; }
.home-footer a { color: var(--muted); }
.home-footer a:hover { color: var(--accent); text-decoration: none; }

.post-list {
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}
.post-list a { color: var(--fg); font-weight: 500; }
.post-list a:hover { color: var(--accent); text-decoration: none; }
.post-list .date {
  white-space: nowrap;
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

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

/* wider column than the home default (41rem): code-heavy posts need the room */
.post { max-width: 46rem; }
.back { display: inline-block; font-size: 0.9rem; margin-bottom: 1.1rem; }
.title {
  margin: 0 0 0.125rem;
  font-size: 1.45rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.meta {
  margin: 0 0 1rem;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.prose p { margin: 0 0 0.75rem; }
/* heading ladder: h1 mirrors the front-matter title; h3 reuses the .meta
   label motif (caps, letterspaced, muted) so levels differ in kind, not
   just size; h4/h5 exist for completeness, no post uses them yet */
.prose h1 { margin: 2rem 0 0.5rem; font-size: 1.4rem; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; }
.prose h2 { margin: 1.9rem 0 0.5rem; font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
.prose h3 { margin: 1.4rem 0 0.4rem; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.prose h4 { margin: 1.2rem 0 0.35rem; font-size: 1rem; font-weight: 650; }
.prose h5 { margin: 1rem 0 0.3rem; font-size: 0.9rem; font-weight: 650; color: var(--muted); }
.prose blockquote {
  margin: 0 0 0.75rem;
  padding: 0.1rem 0 0.1rem 0.9rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}

.prose img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
  border-radius: 6px;
  opacity: var(--shot-dim);
}
.prose figure { margin: 0.9rem 0; }
.prose figcaption { margin-top: 0.375rem; font-size: 0.85rem; color: var(--muted); }

/* ---------- code ---------- */

code {
  font-family: ui-monospace, "Cascadia Code", Menlo, monospace;
  font-size: 0.92em;
}
.prose :not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}
.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.75rem 0.875rem;
  margin: 0 0 0.75rem;
  overflow-x: auto;
  line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; display: block; }
.prose .codewrap { position: relative; }
.prose .codewrap .copy {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  font-family: ui-monospace, "Cascadia Code", Menlo, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.prose .codewrap:hover .copy,
.prose .codewrap .copy:focus-visible,
.prose .codewrap .copy.copied { opacity: 1; }
.prose .codewrap .copy:hover { color: var(--accent); }
.prose .codewrap .copy.copied { color: var(--tk-s); }
/* no hover on touch devices: keep the button visible there */
@media (hover: none) { .prose .codewrap .copy { opacity: 1; } }

/* ---------- syntax tokens (class-based highlighting) ----------
   Selectors verified against zola 0.22 build output (giallo engine);
   recolored to the approved design tokens rather than a generated theme.
   Bare .z-keyword (operators like =) stays plain fg, matching the mockup. */

.z-storage, .z-keyword.z-control { color: var(--tk-k); }
.z-string, .z-punctuation.z-definition.z-string { color: var(--tk-s); }
.z-entity.z-name, .z-support.z-function { color: var(--tk-f); }
.z-comment, .z-punctuation.z-definition.z-comment { color: var(--tk-c); font-style: italic; }
