:root {
  color-scheme: light;
  --background: #fff;
  --foreground: #18181b;
  --muted: #71717a;
  --border: #e4e4e7;
  --surface: #f4f4f5;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #09090b;
  --foreground: #fafafa;
  --muted: #a1a1aa;
  --border: #27272a;
  --surface: #18181b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --background: #09090b;
    --foreground: #fafafa;
    --muted: #a1a1aa;
    --border: #27272a;
    --surface: #18181b;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
a, button, input { touch-action: manipulation; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 3px;
  border-radius: 4px;
}
.shell {
  max-width: 900px;
  margin: auto;
  min-height: 100svh;
  border-inline: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr minmax(160px, 240px) 36px;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  min-height: 64px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.brand { display: inline-flex; align-items: center; width: fit-content; }
.brand img { display: block; width: 40px; height: 40px; border-radius: 6px; }
.search-form { position: relative; min-width: 0; }
.search-form svg { width: 16px; height: 16px; position: absolute; left: 10px; top: 10px; color: var(--muted); pointer-events: none; }
.search-form input {
  display: block;
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 6px 9px 6px 33px;
  font-size: 14px;
}
.search-form input::placeholder { color: var(--muted); opacity: 1; }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--surface); }
.theme-toggle svg { width: 17px; height: 17px; }
.sun, [data-theme="dark"] .moon { display: none; }
[data-theme="dark"] .sun { display: block; }
main { flex: 1; padding: 32px 24px 64px; min-width: 0; }
main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 8px 16px; background: var(--foreground); color: var(--background); z-index: 20; }
.skip-link:focus { top: 12px; }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h1 { font-size: 28px; line-height: 1.25; letter-spacing: -.8px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.list-heading { margin-bottom: 20px; }
.list-heading h1 { font-size: 22px; letter-spacing: -.5px; }
#result-count { font-size: 12px; color: var(--muted); }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { border-bottom: 1px solid var(--border); }
.post-list li:first-child { border-top: 1px solid var(--border); }
.post-row { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 15px 0; }
.post-row:hover .post-title { text-decoration: underline; text-underline-offset: 4px; }
.post-title { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
time { font-size: 13px; color: var(--muted); }
.post-row time { white-space: nowrap; flex-shrink: 0; font-size: 12px; }
#empty-message { color: var(--muted); font-size: 14px; padding-top: 12px; }
.no-script { font-size: 13px; color: var(--muted); }
.site-footer { border-top: 1px solid var(--border); padding: 16px 24px; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.site-footer a:hover, .back-link:hover { color: var(--foreground); }
.back-link { font-size: 13px; color: var(--muted); }
.article-header { margin: 24px 0 28px; }
.article-header h1 { margin-bottom: 10px; }
.prose { overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.25em; }
.prose h2, .prose h3, .prose h4 { font-weight: 600; line-height: 1.35; letter-spacing: -.4px; margin: 1.75em 0 .7em; scroll-margin-top: 88px; }
.prose h2 { font-size: 24px; }
.prose h3 { font-size: 20px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: 6px; }
.prose blockquote { margin: 24px 0; border-left: 2px solid var(--border); padding-left: 20px; color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.prose code { font: .85em/1.6 "SFMono-Regular", Consolas, monospace; background: var(--surface); padding: 2px 4px; border-radius: 4px; }
.prose pre { max-width: 100%; overflow-x: auto; padding: 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.prose pre code { padding: 0; background: none; overflow-wrap: normal; }
.highlight .c, .highlight .c1, .highlight .cm { color: var(--muted); }
.highlight .k, .highlight .kd, .highlight .kn { font-weight: bold; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 8px 12px; border: 1px solid var(--border); }
.not-found h1 { margin-bottom: 12px; }
.not-found p { color: var(--muted); }
@media (max-width: 540px) {
  html { scroll-padding-top: 132px; }
  .site-header { grid-template-columns: 1fr 36px; gap: 10px; padding: 10px 20px; }
  .search-form { grid-column: 1 / -1; grid-row: 2; }
  .theme-toggle { grid-column: 2; grid-row: 1; }
  .search-form input { font-size: 16px; }
  main { padding: 28px 20px 48px; }
  .site-footer { padding-inline: 20px; }
  .post-row { align-items: flex-start; gap: 14px; }
  .post-row time { margin-top: 3px; font-size: 11px; }
  .article-header h1 { font-size: 26px; }
  .prose h2, .prose h3, .prose h4 { scroll-margin-top: 132px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

.loading-skeleton { border-top: 1px solid var(--border); }
.skeleton-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 57px; border-bottom: 1px solid var(--border); }
.skeleton-row span { display: block; height: 12px; border-radius: 4px; background: var(--surface); animation: skeleton-pulse 1.2s ease-in-out infinite alternate; }
.skeleton-row span:first-child { width: 55%; }
.skeleton-row:nth-child(2) span:first-child { width: 42%; }
.skeleton-row:nth-child(3) span:first-child { width: 65%; }
.skeleton-row span:last-child { width: 76px; flex-shrink: 0; }
@keyframes skeleton-pulse { to { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .skeleton-row span { animation: none; } }
