:root {
  --bg: #f9f8f5;
  --text: #111113;
  --muted: #3f3f46;
  --subtle: #52525b;
  --border: #dcd8ce;
  --accent: #0b5d56;
  --code-bg: #ebe8df;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1013;
    --text: #eceef2;
    --muted: #a1a8b5;
    --subtle: #88909e;
    --border: #20252d;
    --accent: #2dd4bf;
    --code-bg: #181c23;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1013;
  --text: #eceef2;
  --muted: #a1a8b5;
  --subtle: #88909e;
  --border: #20252d;
  --accent: #2dd4bf;
  --code-bg: #181c23;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 200ms ease, color 200ms ease;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 660px;
  margin: 0 auto;
  padding: 56px 22px 48px;
}

a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size 160ms ease;
}

a:hover {
  background-size: 100% 1px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.hero {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px;
  color: var(--subtle);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}

.theme-btn:hover {
  color: var(--text);
  border-color: var(--border);
}

.bio {
  margin: 0 0 16px;
  color: var(--muted);
  max-width: 58ch;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.9rem;
}

main section {
  padding-top: 34px;
}

h2 {
  margin: 0 0 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
}

.item {
  transition: transform 180ms ease;
}

.item:hover {
  transform: translateX(3px);
}

.item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 4px;
}

.item h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
}

.item-head a,
.date {
  font-size: 0.84rem;
}

.date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--subtle);
}

.links-inline {
  display: flex;
  gap: 12px;
}

.item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.item .meta {
  margin-top: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.77rem;
  color: var(--subtle);
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.plain {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--subtle);
}

@media (prefers-reduced-motion: reduce) {
  body,
  a,
  .item {
    transition: none;
  }
  .item:hover {
    transform: none;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 36px 18px 32px;
  }
}
