:root {
  --bg: #ffffff;
  --fg: #15171a;
  --muted: #4a5159;
  --accent: #2563eb;
  --rule: #e2e4e8;
  --code-bg: #f5f6f8;
  --max: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315;
    --fg: #f1f3f5;
    --muted: #c2c7cc;
    --accent: #8ab4ff;
    --rule: #2a2d31;
    --code-bg: #1a1d20;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
a:hover { border-bottom-color: var(--accent); }

.back-row {
  text-align: right;
  margin-bottom: 0.75rem;
}
.back-link {
  color: var(--muted);
  font-size: 1.05rem;
}
.back-link:hover {
  color: var(--fg);
  border-bottom-color: transparent;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

.brand {
  font-weight: 600;
  color: var(--fg);
  font-size: 1.35rem;
  letter-spacing: -0.005em;
}

.site-header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.site-header nav a {
  color: var(--muted);
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
}
.site-header nav a:hover { color: var(--fg); }
.site-header nav a.active {
  color: var(--fg);
  font-weight: 600;
}

.site-header nav a.icon-link svg {
  width: 18px;
  height: 18px;
  display: block;
}

.hero h1,
.page-head h1 {
  font-size: 2rem;
  margin: 0 0 0.75rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.page-head {
  margin-bottom: 0;
}

.page-head .meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.hero p {
  color: var(--fg);
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.hero p.meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

section {
  margin-top: 3rem;
}

h2 {
  font-size: 1.4rem;
  color: var(--fg);
  margin: 0 0 1rem;
  letter-spacing: -0.005em;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

h3 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.5rem;
  letter-spacing: -0.005em;
}

p { margin: 0 0 1rem; }

ul, ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

li { margin-bottom: 0.4rem; }
li:last-child { margin-bottom: 0; }

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

pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 1em;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  font-weight: 600;
  color: var(--muted);
}

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

.experience > li {
  border-left: 2px solid var(--rule);
  padding: 0.25rem 0 0.25rem 1.25rem;
}

.experience > li > header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-bottom: 0.6rem;
  padding: 0;
  border: 0;
}

.experience h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.experience time {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.experience ul {
  margin: 0;
  padding-left: 1.1rem;
}

.experience ul li {
  margin-bottom: 0.4rem;
}

.experience ul li:last-child {
  margin-bottom: 0;
}

.changelog-layout {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1.5rem;
  align-items: start;
}

.changelog-nav {
  position: sticky;
  top: 2rem;
  font-size: 0.9rem;
}

.changelog-nav h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 0;
  padding-bottom: 0;
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.changelog-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.changelog-nav li {
  margin-bottom: 0.15rem;
}

.changelog-nav a {
  color: var(--muted);
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border-bottom: 0;
  font-variant-numeric: tabular-nums;
}

.changelog-nav a:hover {
  color: var(--fg);
  background: var(--code-bg);
}

@media (max-width: 480px) {
  .changelog-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .changelog-nav {
    position: static;
  }
}

.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--fg); }

.site-footer p { margin: 0; }
