:root {
  --bg: #f7f7f5;
  --surface: #f7f7f5;
  --text: #1f1f1f;
  --muted: #757575;
  --line: #d9d9d9;
  --accent: #2f2f2f;
  --divider-soft: #e4e4e4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  line-height: 1.8;
  letter-spacing: 0;
  font-size: 15px;
}

.container {
  width: min(760px, 90vw);
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: lowercase;
}

.nav-links {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1;
  text-transform: lowercase;
}

.theme-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  line-height: 1;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.theme-icon {
  display: inline-block;
  width: 0.68rem;
  height: 0.68rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(to right, currentColor 50%, transparent 50%);
  vertical-align: middle;
  transform: translateY(-0.04em);
}

.theme-icon[data-theme="dark"] {
  background: linear-gradient(to left, currentColor 50%, transparent 50%);
}

.nav-links a:hover,
.theme-toggle:hover,
a:hover {
  color: var(--accent);
}

.content {
  padding: 3.2rem 0 3.4rem;
}

h1, h2, h3 {
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  line-height: 1.35;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 1rem;
  font-weight: 500;
}

h2 {
  margin-top: 2.6rem;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 500;
}

h3 {
  font-size: 1rem;
  font-weight: 500;
}

a {
  color: inherit;
  text-underline-offset: 0.16em;
}

.page > p,
.post > p,
.post > ul,
.post > ol,
.post > blockquote {
  max-width: 68ch;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", Menlo, monospace;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-block {
  border-left: 0;
  padding: 0;
  margin-bottom: 1.55rem;
  background: transparent;
}

.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.24rem 0.6rem;
  background: transparent;
  color: var(--text);
  font-size: 0.74rem;
  text-transform: lowercase;
}

.btn.btn-muted {
  opacity: 0.8;
}

.section-note,
.post-meta {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.35;
}

.note-label {
  color: var(--text);
  border: 1px solid var(--divider-soft);
  border-radius: 2px;
  padding: 0.01rem 0.28rem;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  vertical-align: baseline;
  position: relative;
  top: -0.02em;
}

.post-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.notes-compact {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  border-top: 1px solid var(--divider-soft);
}

.notes-compact li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--divider-soft);
}

.notes-compact a {
  text-decoration: none;
}

.pager {
  margin-top: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pager-link {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  text-transform: lowercase;
}

.pager-link.is-disabled {
  color: var(--muted);
  opacity: 0.55;
}

.pager-index {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: lowercase;
}

.post-card {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 2px;
  padding: 0.9rem 1rem;
}

.post-card h2 {
  margin: 0.45rem 0;
}

.post-card .post-image-wrap {
  margin: 0 0 0.8rem;
}

.post-card h3 {
  margin: 0.45rem 0;
  font-size: 1rem;
}

.post-image-wrap {
  margin: 1rem 0 1.4rem;
}

.post-image,
.post img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.post pre,
.post code {
  font-family: "IBM Plex Mono", Menlo, monospace;
}

.post pre {
  background: #1d1d1d;
  color: #efefef;
  border-radius: 2px;
  padding: 0.85rem;
  overflow-x: auto;
}

.post code {
  background: #ececea;
  border-radius: 2px;
  padding: 0.05rem 0.25rem;
}

.post pre code {
  background: transparent;
  padding: 0;
}

.post-nav {
  margin-top: 2rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.post-nav-link {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-height: 3.2rem;
}

.post-nav-label {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.post-nav-link.is-disabled {
  color: var(--muted);
  opacity: 0.6;
}

blockquote {
  margin: 1.2rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
  color: #3c3a35;
}

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: transparent;
  padding: 0.8rem 0.9rem;
  border-radius: 2px;
  margin: 1rem 0;
}

.callout p {
  margin: 0.35rem 0 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}

.stat-card,
.feature-card {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  padding: 0.8rem;
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", Menlo, monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
}

.stat-value {
  margin: 0.22rem 0 0;
  font-weight: 500;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.6rem;
}

.feature-card h3 {
  margin: 0 0 0.4rem;
}

.feature-card p {
  margin: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.45rem 0 1rem;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  background: transparent;
}

.code-frame {
  margin-top: 1rem;
  border: 1px solid #2b2b2b;
  border-radius: 2px;
  overflow: hidden;
}

.code-frame-head {
  background: #2b2b2b;
  color: #dddddd;
  font-size: 0.7rem;
  display: flex;
  justify-content: space-between;
  padding: 0.42rem 0.65rem;
  letter-spacing: 0.05em;
}

.code-frame pre {
  margin: 0;
  background: #1d1d1d;
  color: #efefef;
  padding: 0.85rem;
  overflow-x: auto;
}

.breaker {
  margin: 1.3rem 0;
  border-top: 1px dashed var(--line);
}

.caption {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.83rem;
  text-align: center;
}

.post figure {
  margin: 1rem 0 1.2rem;
}

.post figure figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.83rem;
  text-align: center;
}

.side-by-side {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}

.spoiler {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.65rem 0.75rem;
  background: transparent;
}

.spoiler summary {
  cursor: pointer;
  font-size: 0.95rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.15rem 0 2rem;
  color: var(--muted);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.social-links a {
  font-family: "IBM Plex Mono", Menlo, monospace;
  font-size: 0.76rem;
}

@media (max-width: 720px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #111111;
    --text: #e6e6e6;
    --muted: #9a9a9a;
    --line: #2f2f2f;
    --accent: #d2d2d2;
    --divider-soft: #262626;
  }

  .post pre {
    background: #0c0c0c;
    color: #e8e8e8;
  }

  .post code {
    background: #212121;
    color: #ececec;
  }

  .code-frame {
    border-color: #3a3a3a;
  }

  .code-frame-head {
    background: #2a2a2a;
    color: #e0e0e0;
  }

  .code-frame pre {
    background: #151515;
    color: #ededed;
  }

  blockquote {
    color: #d4d4d4;
    border-left-color: #4a4a4a;
  }
}

html[data-theme="light"] {
  --bg: #f7f7f5;
  --surface: #f7f7f5;
  --text: #1f1f1f;
  --muted: #757575;
  --line: #d9d9d9;
  --accent: #2f2f2f;
  --divider-soft: #e4e4e4;
}

html[data-theme="dark"] {
  --bg: #111111;
  --surface: #111111;
  --text: #e6e6e6;
  --muted: #9a9a9a;
  --line: #2f2f2f;
  --accent: #d2d2d2;
  --divider-soft: #262626;
}

html[data-theme="dark"] blockquote {
  color: #d4d4d4;
  border-left-color: #4a4a4a;
}
