:root {
  /* Lil'Log / PaperMod light palette */
  --theme: rgb(255, 255, 255);
  --entry: rgb(255, 255, 255);
  --primary: rgb(30, 30, 30);
  --secondary: rgb(108, 108, 108);
  --tertiary: rgb(214, 214, 214);
  --content: rgb(31, 31, 31);
  --hljs-bg: rgb(28, 29, 33);
  --code-bg: rgb(245, 245, 245);
  --border: rgb(238, 238, 238);
  --accent: #286ee0;

  --bg: var(--theme);
  --bg-sheet: var(--entry);
  --ink: var(--primary);
  --ink-muted: var(--secondary);
  --rule: var(--border);
  --link: var(--primary);
  --focus: var(--accent);
  --radius: 8px;
  --measure: 45rem;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --font-display: system-ui, -apple-system, "Segoe UI", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI",
    "Yu Gothic", Meiryo, sans-serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
    "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --theme: rgb(29, 30, 32);
    --entry: rgb(46, 46, 51);
    --primary: rgb(218, 218, 219);
    --secondary: rgb(155, 156, 157);
    --tertiary: rgb(65, 66, 68);
    --content: rgb(196, 196, 197);
    --hljs-bg: rgb(46, 46, 51);
    --code-bg: rgb(55, 56, 62);
    --border: rgb(51, 51, 51);
    --accent: #6ea8ff;
  }
}

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

html {
  color-scheme: light dark;
  background: var(--theme);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--content);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
  background: var(--theme);
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--secondary);
  transition: border-color 160ms ease, color 160ms ease;
}

a:hover {
  border-bottom-color: var(--primary);
}

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--pad);
  top: 0.75rem;
  transform: translateY(-150%);
  background: var(--primary);
  color: var(--theme);
  border-bottom: 0;
  padding: 0.4rem 0.7rem;
  z-index: 10;
}

.skip-link:focus {
  transform: translateY(0);
}

.wrap {
  width: min(100% - (var(--pad) * 2), var(--measure));
  margin-inline: auto;
}

.site-header,
.site-footer,
main {
  position: relative;
  z-index: 1;
}

.site-header {
  padding: 1.75rem 0 1.25rem;
}

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - (var(--pad) * 2), calc(var(--measure) + 4rem));
}

.site-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 0;
  animation: brand-in 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.site-brand:hover {
  border-bottom: 0;
  color: var(--primary);
}

.site-nav {
  display: flex;
  gap: 1.1rem;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.site-nav a {
  text-decoration: none;
  color: var(--secondary);
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

main {
  padding: 0.5rem 0 3.5rem;
  animation: rise-in 650ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sheet {
  background: var(--entry);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.home-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 1.35rem + 1.4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--primary);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0 0 1.5rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--secondary);
  border-bottom: 0;
  border-radius: 6px;
  transition: color 160ms ease, background-color 160ms ease;
}

.social-link:hover {
  color: var(--primary);
  border-bottom: 0;
  background: var(--code-bg);
}

.social-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.post-entry {
  margin: 0;
  background: var(--entry);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 100ms ease, border-color 160ms ease;
}

.post-entry:hover {
  border-color: var(--tertiary);
}

.post-entry-link {
  display: grid;
  gap: 0.55rem;
  padding: clamp(0.5rem, 1vw, 1rem);
  text-decoration: none;
  border-bottom: 0;
  color: inherit;
}

.post-entry-link:hover {
  border-bottom: 0;
}

.post-list .post-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--primary);
  border-bottom: 0;
}

.post-summary {
  margin: 0;
  color: var(--secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.post-meta {
  margin: 0.15rem 0 0;
  color: var(--secondary);
  font-size: 0.82rem;
  line-height: 1.5;
}

.post-meta time {
  font-style: normal;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0 1.25rem 0.6rem;
}

.post-entry .tag-list {
  padding-top: 0;
}

.article-header .tag-list {
  margin-top: 0.85rem;
  padding: 0;
}

.tag-list a {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--secondary);
  font-size: 0.78rem;
  line-height: 1.4;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.tag-list a:hover {
  color: var(--primary);
  border-color: var(--tertiary);
}

.tag-index {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tag-index li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.tag-index li:first-child {
  padding-top: 0;
}

.tag-index a {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--secondary);
}

.tag-index a:hover {
  border-bottom-color: var(--primary);
}

.tag-count {
  color: var(--secondary);
  font-size: 0.9rem;
}

.tag-index-empty {
  color: var(--secondary);
  border-bottom: 0;
}

.article-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.article-title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 1.35rem + 1.4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--primary);
}

.article-meta {
  margin: 0;
  color: var(--secondary);
  font-size: 0.95rem;
}

.article-body {
  color: var(--content);
}

.article-body > *:first-child {
  margin-top: 0;
}

.article-body > *:last-child {
  margin-bottom: 0;
}

.article-body h2,
.article-body h3 {
  font-family: var(--font-display);
  color: var(--primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: 2rem;
}

.article-body p,
.article-body ul,
.article-body ol {
  margin: 0 0 1.1rem;
}

.article-body a {
  color: inherit;
  border-bottom: 1px solid var(--secondary);
}

.article-body a:hover {
  color: var(--secondary);
  border-bottom-color: var(--primary);
}

.article-body code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78em;
  background: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: var(--radius);
}

.article-body pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  background: var(--hljs-bg);
  color: #d5d5d6;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.55;
}

.article-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.article-body blockquote {
  margin: 0 0 1.1rem;
  padding: 0 0 0 14px;
  border-left: 3px solid var(--primary);
  color: var(--secondary);
}

.pagination {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.92rem;
}

.site-footer {
  padding: 1.25rem 0 2.5rem;
  color: var(--secondary);
  font-size: 0.9rem;
}

.site-footer .wrap {
  width: min(100% - (var(--pad) * 2), calc(var(--measure) + 4rem));
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
}

.footer-meta {
  margin: 0;
}

@keyframes brand-in {
  from {
    opacity: 0;
    letter-spacing: 0.08em;
    transform: translateY(0.35rem);
  }
  to {
    opacity: 1;
    letter-spacing: -0.03em;
    transform: translateY(0);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
