:root {
  --blue: #0033A0;
  --blue-hover: #0050D0;
  --text: #111827;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --code-bg: #F5F7FA;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.7;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header ---- */
header {
  padding: 56px 0 32px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 48px;
}
header h1 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
header h1 a { color: var(--text); text-decoration: none; }
header h1 a:hover { color: var(--blue); }

.header-links {
  display: flex;
  gap: 16px;
  margin-top: 6px;
}
.header-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
}
.header-links a:hover { color: var(--blue); }

/* ---- Post list (homepage) ---- */
.post-list { list-style: none; }
.post-item { margin-bottom: 44px; }
.post-item time {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.post-item h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 4px 0 6px;
  line-height: 1.3;
}
.post-item h2 a { color: var(--text); text-decoration: none; }
.post-item h2 a:hover { color: var(--blue); }
.post-item p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.55;
}

/* ---- Post page ---- */
.back {
  display: inline-block;
  font-size: 15px;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 32px;
}
.back:hover { color: var(--blue); }

.post-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 8px;
}
.meta {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 48px;
}

/* ---- Article content ---- */
.content h2 {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 52px 0 16px;
  line-height: 1.25;
}
.content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 40px 0 12px;
}
.content p { margin-bottom: 20px; }

.content a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--blue), transparent 65%);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s;
}
.content a:hover { text-decoration-color: var(--blue); }

.content strong { font-weight: 650; }

.content blockquote {
  border-left: 3px solid var(--blue);
  padding-left: 20px;
  margin: 28px 0;
  color: var(--text-secondary);
  font-style: italic;
}
.content blockquote p:last-child { margin-bottom: 0; }

.content ul, .content ol {
  margin: 16px 0 20px;
  padding-left: 24px;
}
.content li { margin-bottom: 6px; }
.content li > ul, .content li > ol { margin: 6px 0 0; }

.content hr {
  border: none;
  border-top: 1.5px solid var(--border);
  margin: 52px 0;
}

.content img {
  max-width: 100%;
  border-radius: 6px;
  margin: 28px 0;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 16px;
}
.content th, .content td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.content th { font-weight: 600; }

/* ---- Code ---- */
.content code {
  font-family: 'SF Mono', ui-monospace, 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
  background: var(--code-bg);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.88em;
}
.content pre {
  background: var(--code-bg);
  border-radius: 10px;
  padding: 22px 24px;
  overflow-x: auto;
  margin: 28px 0;
  line-height: 1.55;
}
.content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 14px;
}

/* ---- Syntax highlighting (Pantone Blue palette) ---- */
.hljs { color: #24292f; }
.hljs-comment, .hljs-quote { color: #6e7781; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-meta .hljs-keyword { color: #0033A0; font-weight: 600; }
.hljs-string, .hljs-addition, .hljs-attr { color: #0A3069; }
.hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable { color: #0550AE; }
.hljs-type, .hljs-built_in { color: #6639BA; }
.hljs-title, .hljs-title.function_ { color: #6639BA; }
.hljs-name, .hljs-selector-class, .hljs-selector-id { color: #0033A0; }
.hljs-deletion { color: #82071E; background: #FFD7D5; border-radius: 3px; padding: 0 2px; }
.hljs-addition { background: #CCFFD8; border-radius: 3px; padding: 0 2px; }
.hljs-meta { color: #735C0F; }
.hljs-section { color: #0033A0; font-weight: 700; }
.hljs-regexp { color: #0550AE; }

/* ---- Footer ---- */
footer {
  margin-top: 80px;
  padding: 28px 0;
  border-top: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  body { font-size: 17px; }
  header { padding: 36px 0 24px; margin-bottom: 36px; }
  .post-title { font-size: 28px; }
  .content h2 { font-size: 22px; margin-top: 40px; }
  .content pre { padding: 16px 18px; }
  footer { margin-top: 56px; }
}
