:root {
  --bg: #fcfcfd;
  --text: #16181d;
  --muted: #636b78;
  --line: #e5e7eb;
  --line-strong: #d8dce3;
  --accent: #111827;
  --accent-soft: #f3f4f6;
  --code-bg: #f6f8fb;
  --max-width: 760px;
  --wide-width: 920px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

header,
section,
footer,
aside {
  width: auto;
  float: none;
  position: static;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 17px;
  line-height: 1.75;
}

img,
iframe {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover {
  color: #000;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.8rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
}

code,
pre,
.site-title,
.site-nav,
.kicker,
.post-list-date,
.post-meta,
.intro-meta,
.footer-links {
  font-family: "IBM Plex Mono", monospace;
}

code {
  padding: 0.12rem 0.28rem;
  border-radius: 4px;
  background: var(--code-bg);
  font-size: 0.9em;
}

pre {
  margin: 1.6rem 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
  font-size: 0.9rem;
  line-height: 1.65;
}

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

blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
}

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

table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
}

th,
td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

figure {
  margin: 1.8rem 0;
}

figure img,
.post-cover img,
.post-content > img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}

figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-shell {
  padding: 0 20px 48px;
}

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

.site-header-inner,
.site-frame,
.site-footer {
  width: 100%;
  max-width: var(--wide-width);
  margin: 0 auto;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 20px 0;
}

.site-title {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
}

.site-frame {
  max-width: var(--max-width);
  padding-top: 42px;
}

.layout-post .site-frame {
  max-width: 820px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0;
  max-width: 36rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.88rem;
}

.footer-links a {
  color: var(--muted);
}

.kicker {
  margin-bottom: 0.9rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-intro {
  margin-bottom: 2.2rem;
}

.home-pattern {
  margin-bottom: 1rem;
}

.home-pattern img {
  display: block;
  width: min(220px, 52vw);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.intro-copy {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.03rem;
}

.intro-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.home-links {
  margin-bottom: 2rem;
  color: var(--muted);
}

.home-links p {
  margin: 0;
}

.post-index {
  border-top: 1px solid var(--line);
}

.list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0 0.8rem;
}

.list-heading h2 {
  font-size: 1.15rem;
  margin: 0;
}

.list-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-list {
  display: grid;
}

.post-list-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1rem 0 1.15rem;
  border-top: 1px solid var(--line);
}

.post-list-date {
  padding-top: 0.15rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.post-list-body {
  min-width: 0;
}

.post-list-body h3 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}

.post-list-body h3 a {
  text-decoration: none;
}

.post-list-topics,
.post-meta {
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.post-list-summary {
  margin: 0;
  color: var(--muted);
}

.post {
  min-width: 0;
}

.post-back {
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.post-back a {
  color: var(--muted);
}

.post-header {
  margin-bottom: 1.6rem;
  max-width: 42rem;
}

.post-header h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.8rem);
}

.post-cover {
  margin: 0 0 1.7rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.post-content {
  min-width: 0;
}

.post-content > :first-child {
  margin-top: 0;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 2rem;
}

.post-content ul,
.post-content ol {
  padding-left: 1.25rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content .gist-embed,
.post-content .youtube-embed,
.post-content .slides-embed {
  margin: 1.6rem 0;
}

.post-pagination {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.pagination-link {
  display: block;
  color: var(--text);
  text-decoration: none;
}

.pagination-link span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.pagination-link strong {
  font-size: 0.98rem;
  line-height: 1.5;
}

.pagination-link-next {
  text-align: right;
}

.comments-panel {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.comments-panel h2 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.youtube-embed,
.slides-embed {
  position: relative;
  width: 100%;
  height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.youtube-embed {
  padding-bottom: 56.25%;
}

.slides-embed {
  padding-bottom: 59.38%;
}

.youtube-embed iframe,
.slides-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.gist-embed {
  overflow-x: auto;
}

.gist-embed .gist {
  margin: 0 !important;
}

.highlight {
  background: transparent;
}

.highlight .c,
.highlight .cm,
.highlight .c1 {
  color: #7c8593;
  font-style: italic;
}

.highlight .k,
.highlight .kd,
.highlight .kr,
.highlight .kp {
  color: #8b3d00;
  font-weight: 700;
}

.highlight .nf,
.highlight .nc,
.highlight .ne {
  color: #0f5c79;
  font-weight: 700;
}

.highlight .s,
.highlight .s1,
.highlight .s2 {
  color: #9a3412;
}

.highlight .m,
.highlight .mi,
.highlight .mf {
  color: #166534;
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .site-shell {
    padding: 0 14px 32px;
  }

  .site-header-inner,
  .list-heading,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-frame {
    padding-top: 28px;
  }

  .post-list-item {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .post-pagination {
    grid-template-columns: 1fr;
  }

  .pagination-link-next {
    text-align: left;
  }

  pre {
    padding: 0.9rem;
    font-size: 0.85rem;
  }
}
