:root {
  --bg: #fbfaf7;
  --fg: #1f2328;
  --muted: #66707a;
  --line: #e5e1d8;
  --accent: #0f766e;
  --accent-soft: #e7f3f1;
  --code-bg: #1d2126;
  --code-fg: #e4e6e8;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --fg: #d9dcdf;
    --muted: #8b949e;
    --line: #2a2f35;
    --accent: #5eead4;
    --accent-soft: #1b2a28;
    --code-bg: #0e1114;
    --code-fg: #e4e6e8;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

header.site {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  padding: 2.2rem 0 1.4rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--fg);
  text-decoration: none;
}

.cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

header.site nav { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; }
header.site nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
header.site nav a:hover { color: var(--accent); }

.intro { margin: 2rem 0 1.5rem; font-size: 1.05rem; }

.now {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: .9rem 1.2rem;
  margin-bottom: 2.5rem;
}
.now h2 {
  font-family: var(--mono);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 0 0 .35rem;
}
.now ul { margin: 0; padding-left: 1.1rem; }
.now li { margin: .15rem 0; }

.section-title, .page-title { font-size: 1.5rem; margin: 2rem 0 .5rem; }
.muted { color: var(--muted); }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px dashed var(--line);
}
.post-list time { font-family: var(--mono); font-size: .82rem; color: var(--muted); padding-top: .2rem; }
.post-list h3 { font-size: 1.12rem; margin: 0; line-height: 1.35; }
.post-list h3 a { color: var(--fg); text-decoration: none; }
.post-list h3 a:hover { color: var(--accent); }
.post-list p { margin: .35rem 0 0; color: var(--muted); font-size: .96rem; }

.tags span, .tag {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--accent);
  margin-right: .6rem;
}

article.post h1 { font-size: 2rem; line-height: 1.2; margin: 2.4rem 0 .5rem; letter-spacing: -.01em; }
article.post .meta { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin: 0 0 2rem; }
article.post .meta .tag { margin-right: 0; }
article.post h2 { font-size: 1.3rem; margin: 2.2rem 0 .6rem; }
article.post img { max-width: 100%; }
article.post li { margin: .25rem 0; }

code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--accent-soft);
  padding: .1em .35em;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 1rem 1.15rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: .86rem;
  line-height: 1.55;
}
pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
:not(pre) > code { overflow-wrap: anywhere; }

blockquote {
  margin: 1.5rem 0;
  padding: .2rem 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 1.2rem 0; }
th, td { border-bottom: 1px solid var(--line); padding: .45rem .6rem; text-align: left; }
th { font-weight: 600; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
}
.post-nav a { text-decoration: none; max-width: 48%; }
.post-nav .newer { text-align: right; margin-left: auto; }
.post-nav small { display: block; font-family: var(--mono); font-size: .75rem; color: var(--muted); }

.year { font-family: var(--mono); font-size: 1rem; color: var(--muted); margin: 2rem 0 .5rem; }
.archive { list-style: none; padding: 0; margin: 0; }
.archive li { display: flex; gap: 1rem; padding: .35rem 0; }
.archive time { font-family: var(--mono); font-size: .85rem; color: var(--muted); min-width: 4.5rem; padding-top: .1rem; }

footer.site {
  margin-top: 4rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .post-list li { grid-template-columns: 1fr; gap: .25rem; }
  article.post h1 { font-size: 1.6rem; }
  .post-nav { flex-direction: column; }
  .post-nav a { max-width: 100%; }
  .post-nav .newer { text-align: left; margin-left: 0; }
}
