:root {
  --bg: #0b0d10;
  --bg-alt: #14171c;
  --fg: #e6e6e6;
  --fg-dim: #8b95a1;
  --accent: #7ee787;
  --border: #23272e;
  --code-bg: #14171c;
}

:root[data-theme="light"] {
  --bg: #f8f7f4;
  --bg-alt: #edece7;
  --fg: #1b1f23;
  --fg-dim: #5b6570;
  --accent: #1a7f4e;
  --border: #dcdad4;
  --code-bg: #edece7;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f8f7f4;
    --bg-alt: #edece7;
    --fg: #1b1f23;
    --fg-dim: #5b6570;
    --accent: #1a7f4e;
    --border: #dcdad4;
    --code-bg: #edece7;
  }
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo,
    Consolas, "DejaVu Sans Mono", monospace;
  font-size: 16px;
  line-height: 1.65;
  transition: background 0.15s ease, color 0.15s ease;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
a:hover { border-bottom-color: var(--accent); }

header.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--fg);
  border-bottom: none;
}
.logo .prompt { color: var(--accent); }
.logo .cursor {
  display: inline-block;
  width: 0.55em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

nav.site-nav {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.92rem;
}
nav.site-nav a { color: var(--fg-dim); }
nav.site-nav a:hover, nav.site-nav a.active { color: var(--accent); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  text-transform: uppercase;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}
.lang-current { color: var(--accent); font-weight: 700; }
.lang-other { color: var(--fg-dim); border-bottom: none; }
.lang-other:hover { color: var(--accent); }
.lang-sep { color: var(--border); }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-dim);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

.tagline { color: var(--fg-dim); margin: -1.75rem 0 2.5rem; font-size: 0.95rem; }

h1, h2, h3, h4 { line-height: 1.3; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; margin-top: 2.2rem; }
h3 { font-size: 1.1rem; }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
}
.post-list li:last-child { border-bottom: none; }
.post-list a { color: var(--fg); border-bottom: none; }
.post-list a:hover { color: var(--accent); }
.post-list time { color: var(--fg-dim); font-size: 0.85rem; white-space: nowrap; }
.post-list .section-tag {
  color: var(--fg-dim);
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 0.35rem;
  margin-right: 0.5rem;
}

.post-meta { color: var(--fg-dim); font-size: 0.88rem; margin-bottom: 2rem; }

.section-intro { color: var(--fg-dim); margin-bottom: 2rem; }

img { max-width: 100%; height: auto; border-radius: 6px; }
/* Old posts carry inline float:left/right styles from a previous theme.
   Floated text-wrap around images is fragile (can collapse a squeezed
   paragraph's width to 0 and explode its height) so it's disabled
   everywhere in favor of simple centered block images. */
article img[style*="float"] {
  float: none !important;
  display: block;
  margin: 1.5rem auto;
  max-height: 420px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.88rem;
}
code {
  background: var(--code-bg);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}
pre code { background: none; padding: 0; }

blockquote {
  margin: 1.5rem 0;
  padding: 0.4rem 1rem;
  border-left: 3px solid var(--accent);
  color: var(--fg-dim);
}

hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

footer.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--fg-dim);
  font-size: 0.85rem;
}
.socials { display: flex; gap: 1rem; }
.socials a { color: var(--fg-dim); }
.socials a:hover { color: var(--accent); }

@media (max-width: 480px) {
  .wrap { padding: 1.5rem 1rem 3rem; }
}
