:root {
  color-scheme: light dark;
  --bg: #fafaf9;
  --text: #0a0a0a;
  --muted: #6b6b6b;
  --border: #0a0a0a;
  --hover: rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --text: #ededed;
    --muted: #888888;
    --border: #ededed;
    --hover: rgba(255, 255, 255, 0.065);
  }
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.container {
  width: min(720px, 88vw);
  margin: 0 auto;
}

/* ─── Header ─── */

.site-header {
  border-bottom: 1px solid color-mix(in srgb, var(--text) 12%, var(--bg));
  padding-top: env(safe-area-inset-top);
}

@supports (padding: max(0px)) {
  .site-header {
    padding-top: max(env(safe-area-inset-top), 0px);
  }
}

.bar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.5;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
}

/* ─── Content ─── */

.content {
  padding: 4rem 0 6rem;
  animation: enter 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .content {
    animation: none;
  }
}

.kicker {
  font-family: "Geist Mono", monospace;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

/* ─── Post List ─── */

.post-list {
  padding: 0;
  list-style: none;
}

.post-list li + li {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid color-mix(in srgb, var(--text) 10%, var(--bg));
}

.post-list a {
  display: block;
  color: var(--text);
  text-decoration: none;
}

.post-date {
  display: block;
  font-family: "Geist Mono", monospace;
  font-size: 0.8125rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.post-title {
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.post-list a:hover .post-title {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.post-excerpt {
  color: var(--muted);
  line-height: 1.6;
  max-width: 60ch;
}

/* ─── Article Entry ─── */

.entry {
  max-width: 65ch;
}

.entry h1 {
  margin-bottom: 2.5rem;
}

.entry h1 + p {
  font-size: 1.125rem;
  line-height: 1.7;
}

.entry p {
  margin-bottom: 1.2rem;
  color: var(--text);
  line-height: 1.75;
}

.entry a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.15s ease;
}

.entry a:hover {
  text-decoration-color: var(--muted);
}

.entry .back-link {
  display: inline-block;
  margin-top: 3rem;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.entry .back-link:hover {
  color: var(--text);
}

/* ─── Footer ─── */

.site-footer {
  border-top: 1px solid color-mix(in srgb, var(--text) 12%, var(--bg));
}

.site-footer .bar {
  min-height: 64px;
}

.site-footer span {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ─── Focus ─── */

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

/* ─── Mobile ─── */

@media (max-width: 600px) {
  .content {
    padding: 3rem 0 4rem;
  }

  .post-list li + li {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
  }

  .entry h1 {
    margin-bottom: 2rem;
  }
}
