/* zeko.dev — minimal, system-font, dark-mode-by-preference */

:root {
  --bg: #fdfcf9;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --rule: #e7e4dc;
  --accent: #0a7d83;
  --code-bg: #f3f1ec;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --fg: #e8e6e1;
    --muted: #9aa0a6;
    --rule: #23272f;
    --accent: #5eead4;
    --code-bg: #161a21;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt";
}

main, .site-header, .site-footer {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
a:hover { text-decoration-color: var(--accent); }

.skip {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip:focus {
  left: 1rem; top: 1rem; width: auto; height: auto;
  background: var(--accent); color: var(--bg); padding: .5rem .75rem; border-radius: .25rem; z-index: 100;
}

/* Header */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.brand {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}
.site-nav { display: flex; gap: 1.25rem; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
}
.site-nav a:hover { color: var(--fg); }

/* Footer */
.site-footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: .9rem;
}
.site-footer p { margin: 0; }

/* Headings */
h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-top: 2.25rem;
  margin-bottom: .75rem;
}
h1 { font-size: 1.85rem; font-weight: 650; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }

/* Page header */
.page-header h1 { margin-top: 0; }
.meta {
  color: var(--muted);
  font-size: .9rem;
  margin-top: -.25rem;
}
.meta a { color: var(--muted); }
.meta a:hover { color: var(--accent); }

/* Post body */
.page-content p { margin: 1em 0; }
.page-content blockquote {
  margin: 1.5em 0;
  padding: .25em 1em;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
.page-content hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5em 0;
}
.page-content img,
.page-content video {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Code */
code, pre, kbd, samp {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono",
    "Fira Code", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .9em;
}
:not(pre) > code {
  background: var(--code-bg);
  padding: .15em .4em;
  border-radius: 3px;
}
pre {
  background: var(--code-bg);
  padding: 1em 1.1em;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; padding: 0; }

/* Post list */
.posts {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.posts li {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: .5rem 0;
  border-bottom: 1px solid var(--rule);
}
.posts li:last-child { border-bottom: 0; }
.posts time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
}
.posts a { text-decoration: none; color: var(--fg); }
.posts a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; }

@media (max-width: 540px) {
  .posts li {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Taxonomy lists */
.taxonomy-terms {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.taxonomy-terms li {
  padding: .25rem .6rem;
  background: var(--code-bg);
  border-radius: 4px;
}

/* Intro on homepage */
.intro p:first-child { margin-top: 0; }
.intro { margin-bottom: 2rem; }

/* Footnotes */
.footnote-definition {
  font-size: .9rem;
  color: var(--muted);
  margin: .5rem 0;
}
.footnote-definition p { display: inline; margin: 0 0 0 .25rem; }

/* Selection */
::selection {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--fg);
}
