/* ── Synthwave (default) ──────────────────────────────────────── */
:root {
  --bg-color:   #0b0a18;
  --bg-raised:  #12102a;
  --text-main:  #ddd8f5;
  --text-muted: #7a6fa8;
  --accent:     #ff2d9b;
  --accent-2:   #39d5ff;
  --border:     #2a1f4a;
  --code-bg:    #16122e;

  --heading-color:  var(--accent-2);
  --code-color:     var(--accent);
  --drop-cap-color: var(--accent);

  /* syntax */
  --syn-keyword:  #ff2d9b;
  --syn-name:     #ddd8f5;
  --syn-string:   #ffe080;
  --syn-number:   #39d5ff;
  --syn-comment:  #4d3f6e;
  --syn-punct:    #b8aee0;
  --syn-func:     #c77dff;
  --syn-class:    #ff9f43;
  --syn-attr:     #39d5ff;
  --syn-tag:      #39d5ff;
}

/* ── Light (previous) ─────────────────────────────────────────── */
:root.theme-light {
  --bg-color:   #ffffff;
  --bg-raised:  #f6f8fa;
  --text-main:  #333333;
  --text-muted: #666666;
  --accent:     #005cc5;
  --accent-2:   #005cc5;
  --border:     #e1e4e8;
  --code-bg:    #f6f8fa;

  --heading-color:  #111111;
  --code-color:     #c92a2a;
  --drop-cap-color: #111111;

  /* syntax */
  --syn-keyword:  #d73a49;
  --syn-name:     #24292e;
  --syn-string:   #032f62;
  --syn-number:   #005cc5;
  --syn-comment:  #6a737d;
  --syn-punct:    #24292e;
  --syn-func:     #6f42c1;
  --syn-class:    #e36209;
  --syn-attr:     #005cc5;
  --syn-tag:      #22863a;
}

/* ── Base ─────────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-color);
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  overflow-y: scroll;
}

div.wrapper {
  display: flex;
  min-height: calc(100vh - 4rem);
  flex-direction: column;
}

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

h1, h2, h3, h4, strong {
  color: var(--heading-color);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 600;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* ── Layout ───────────────────────────────────────────────────── */
div.postlist, div.post { flex: 1; }
div.postlist { margin-top: 0; padding-top: 0; }

div.footer {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.9em;
  text-align: center;
}

/* ── Theme toggle ─────────────────────────────────────────────── */
#theme-toggle { display: none; }

.theme-label {
  position: fixed;
  top: 0.85rem;
  right: 1rem;
  cursor: pointer;
  font-size: 0.72em;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  user-select: none;
  z-index: 100;
}
.theme-label::before { content: "◑ light"; }
:root.theme-light .theme-label::before { content: "◑ dark"; }
.theme-label:hover {
  color: var(--accent);
}

.rss-link {
  position: fixed;
  top: 0.85rem;
  right: 3.5rem;
  cursor: pointer;
  font-size: 0.72em;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  user-select: none;
  z-index: 100;
}
.rss-link:hover {
  color: var(--accent);
}

/* ── Site header ──────────────────────────────────────────────── */
header.site-header {
  margin-bottom: 3rem;
}

div.crumbs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85em;
  color: var(--text-muted);
}
div.crumbs img {
  display: block;
  border-radius: 50%;
  margin-right: 0.1rem;
}
div.crumbs a { color: var(--text-muted); }
div.crumbs a:hover {
  color: var(--accent);
}

.site-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.site-status {
  font-size: 0.6em;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.1rem;
}

/* ── Menu ─────────────────────────────────────────────────────── */
nav.menu {
  margin-left: auto;
}
nav.menu ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.25rem 1rem;
}
nav.menu li a {
  font-size: 0.75em;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}
nav.menu li a:hover {
  color: var(--accent);
}

/* ── Post list ────────────────────────────────────────────────── */
div.postlist ul { list-style: none; padding: 0; margin: 0; }
div.postlist li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
div.postlist li:first-child { border-top: 1px solid var(--border); }
div.postlist .date {
  color: var(--text-muted);
  font-size: 0.8em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 4.5rem;
}
div.postlist li a:not(.tag) { flex: 1; }

a.tag {
  display: inline-block;
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0.15em 0.55em;
  white-space: nowrap;
  text-decoration: none;
}
a.tag:hover {
  color: var(--accent-2);
  border-color: var(--accent-2);
  text-decoration: none;
}

/* ── Pagination ───────────────────────────────────────────────── */
nav.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  font-size: 0.9em;
  color: var(--text-muted);
}

/* ── Post ─────────────────────────────────────────────────────── */
div.post .date {
  color: var(--text-muted);
  font-size: 0.9em;
  margin-bottom: 2rem;
  display: block;
}

div.post .prevnext {  
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
}

div.post img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1rem 0;
  background-color: transparent;
}

div.post .postcontent { clear: both; }
div.post .postcontent p { margin-bottom: 1.2em; }
div.post .postcontent ul, div.post .postcontent ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2em;
}

div.post .postcontent > p:first-child::first-letter {
  font-size: 2.5em;
  font-weight: 600;
  color: var(--drop-cap-color);
  float: left;
  margin-right: 0.1em;
  line-height: 1;
}

blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: 0.5em 1em;
  color: var(--text-muted);
  background-color: var(--bg-raised);
  border-radius: 0 4px 4px 0;
}
blockquote cite::before { content: "- "; }

/* ── Code ─────────────────────────────────────────────────────── */
code, pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

code {
  background-color: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: var(--code-color);
}

pre {
  background-color: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  line-height: 1.5;
}

pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
  text-shadow: none;
}

code.has-jax {
  font: inherit;
  font-size: 100%;
  background: inherit;
  border: inherit;
  color: inherit;
}

/* ── Syntax highlighting ──────────────────────────────────────── */
.chroma .k, .chroma .kd, .chroma .kn, .chroma .kp, .chroma .kr, .chroma .kv { color: var(--syn-keyword); }
.chroma .n, .chroma .nx { color: var(--syn-name); }
.chroma .s, .chroma .s2, .chroma .sa, .chroma .sb, .chroma .sc, .chroma .dl,
.chroma .sd, .chroma .se, .chroma .sh, .chroma .si, .chroma .sx, .chroma .sr,
.chroma .s1, .chroma .ss { color: var(--syn-string); }
.chroma .m, .chroma .mb, .chroma .mf, .chroma .mh, .chroma .mi, .chroma .il, .chroma .mo { color: var(--syn-number); }
.chroma .c, .chroma .ch, .chroma .cm, .chroma .cp, .chroma .cpf, .chroma .c1, .chroma .cs { color: var(--syn-comment); font-style: italic; }
.chroma .o, .chroma .ow { color: var(--syn-keyword); }
.chroma .p, .chroma .pi { color: var(--syn-punct); }
.chroma .nf, .chroma .fm { color: var(--syn-func); }
.chroma .nc { color: var(--syn-class); }
.chroma .nd { color: var(--syn-class); }
.chroma .na { color: var(--syn-attr); }
.chroma .nt { color: var(--syn-tag); }

/* ── Recipes ──────────────────────────────────────────────────── */
div.recipes ul { list-style-type: none; padding: 0; margin-bottom: 20px; }
div.recipes ul li {
  border-bottom: 1px dotted var(--border);
  padding: 0.5rem 0;
  display: flex;
  justify-content: space-between;
}
div.recipes ul li span.percent { color: var(--text-muted); }