/* ---------- Fonts ---------- */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0a;
  --bg-elevated: #101010;
  --bg-hover: #161616;
  --border: #1f1f1f;
  --border-strong: #2a2a2a;
  --text: #e6e6e6;
  --text-muted: #8a8a8a;
  --text-faint: #5a5a5a;
  --accent: #f4f4f4;
  --accent-soft: #cfcfcf;
  --max-width: 640px;
  --max-width-wide: 840px;
  --radius: 10px;
  --font-sans:
    "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    sans-serif;
  --font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, "Cascadia Mono",
    Consolas, monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 150ms ease, color 150ms ease;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

main.container {
  padding-top: 48px;
  padding-bottom: 96px;
}

/* ---------- Header ---------- */
.site-header {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.site-header .container {
  max-width: var(--max-width-wide);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-title {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text);
  border-bottom: none;
}

.site-nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

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

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 80px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.site-footer .container {
  max-width: var(--max-width-wide);
  display: flex;
  justify-content: center;
  gap: 10px;
}

.footer-sep {
  color: var(--text-faint);
}

/* ---------- Intro ---------- */
.intro {
  padding: 32px 0 48px;
  text-align: center;
}

.intro-title {
  font-size: 40px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}

.intro-lede {
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.55;
  max-width: 520px;
  margin: 0 auto;
}

/* ---------- Hero card ---------- */
.hero {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  margin: 8px 0 48px;
  transition: border-color 180ms ease, transform 180ms ease;
}

.hero:hover {
  border-color: var(--border-strong);
  border-bottom-color: var(--border-strong);
}

.hero-cover {
  background: #050505;
  aspect-ratio: 16 / 9;
  display: block;
  overflow: hidden;
}

.hero-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-body {
  padding: 28px 28px 32px;
}

.hero-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hero-title {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.hero-description {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

.hero-meta {
  margin: 0;
  color: var(--text-faint);
  font-size: 13px;
}

/* ---------- Archive list ---------- */
.archive {
  margin-top: 56px;
}

.archive-title {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

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

.post-row {
  border-bottom: 1px solid var(--border);
}

.post-row a {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 20px 0;
  align-items: baseline;
  border-bottom: none;
}

.post-row a:hover {
  border-bottom: none;
}

.post-row a:hover .row-title {
  color: var(--accent);
}

.row-date {
  color: var(--text-faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.row-title {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  transition: color 150ms ease;
}

.row-description {
  display: block;
  grid-column: 2;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .post-row a {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .row-description {
    grid-column: 1;
  }
}

.empty {
  color: var(--text-muted);
  text-align: center;
  padding: 80px 0;
}

/* ---------- Post page ---------- */
.post {
  padding-top: 16px;
}

.post-header {
  text-align: center;
  margin-bottom: 40px;
}

.post-kicker {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 18px;
}

.post-kicker a {
  color: var(--text-muted);
}

.post-kicker .sep {
  color: var(--text-faint);
  margin: 0 6px;
}

.post-title {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 18px;
}

.post-meta {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 18px;
}

.post-byline {
  color: var(--text-faint);
  font-size: 13px;
  margin: 0;
}

.post-byline .sep {
  margin: 0 8px;
}

.post-cover {
  margin: 0 0 40px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.post-cover img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- Prose ---------- */
.prose {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}

.prose > * + * {
  margin-top: 1.25em;
}

.prose p {
  margin: 0 0 1.2em;
}

.prose h2 {
  font-size: 22px;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 2em 0 0.6em;
  line-height: 1.3;
}

.prose h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 1.8em 0 0.5em;
  line-height: 1.35;
}

.prose a {
  color: var(--text);
  border-bottom: 1px solid var(--text-faint);
}

.prose a:hover {
  border-bottom-color: var(--text);
}

.prose strong {
  font-weight: 600;
  color: var(--text);
}

.prose em {
  font-style: italic;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
  margin: 0 0 1.2em;
}

.prose li {
  margin: 0.35em 0;
}

.prose li::marker {
  color: var(--text-faint);
}

.prose blockquote {
  margin: 1.5em 0;
  padding: 0 0 0 1em;
  border-left: 2px solid var(--border-strong);
  color: var(--text-muted);
  font-style: italic;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

.prose img {
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 1.5em auto;
}

.prose figure {
  margin: 1.5em 0;
}

.prose figcaption {
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
}

/* Inline code */
.prose code:not(pre > code) {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

/* Shiki-rendered code blocks */
.prose pre {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
  padding: 18px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow-x: auto;
  margin: 1.5em 0;
}

.prose pre code {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  border: none;
  padding: 0;
}

/* ---------- Tags ---------- */
.post-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: border-color 150ms ease, color 150ms ease;
}

.tag:hover {
  color: var(--text);
  border-color: var(--border-strong);
  border-bottom-color: var(--border-strong);
}

/* ---------- 404 ---------- */
.not-found {
  text-align: center;
  padding: 96px 0;
}

.not-found-code {
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  margin: 0 0 8px;
}

.not-found-title {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.not-found-lede {
  color: var(--text-muted);
  margin: 0 0 28px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  transition: background 150ms ease, border-color 150ms ease;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-faint);
  border-bottom-color: var(--text-faint);
}

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