:root {
  --accent: #0d9e30;
  --accent-muted: rgba(13, 158, 48, 0.5);

  --bg: #0c0c0c;
  --bg-elevated: #141414;
  --bg-surface: #1a1a1a;
  --fg: #e8e8e6;
  --fg-muted: #8a8a85;
  --fg-dim: #7a7a75;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);

  --font-mono: ui-monospace, 'SFMono-Regular', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 8rem;

  --content-max: 960px;
  --site-max: 1300px;
  --line-height: 1.7;
  --line-height-tight: 1.15;

  --transition-fast: 0.15s ease;

  scrollbar-color: var(--fg-dim) var(--bg-elevated);
}

[data-theme="light"] {
  --accent: #0a8026;
  --accent-muted: rgba(10, 128, 38, 0.5);

  --bg: #fafaf9;
  --bg-elevated: #f5f5f4;
  --bg-surface: #e7e7e5;
  --fg: #1c1c1a;
  --fg-muted: #6a6a65;
  --fg-dim: #9a9a95;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.18);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--accent-muted);
  color: var(--fg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  color: var(--fg);
}

h1 { font-size: clamp(2.8rem, 6vw, 5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

p { margin-bottom: var(--space-lg); }

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

a:hover, a:focus {
  border-bottom-color: var(--accent-muted);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-bottom-color: transparent;
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--bg-surface);
  padding: 0.1em 0.35em;
  border: 1px solid var(--border);
}

pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: var(--space-md);
  overflow-x: auto;
  line-height: 1.5;
  margin-bottom: var(--space-lg);
}

pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: 0.85em;
}

.container {
  width: 100%;
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  max-width: var(--content-max);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 1000;
  padding: var(--space-sm) var(--space-md);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
}

.skip-link:focus {
  top: var(--space-md);
  outline: none;
}

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.site-brand {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
  border-bottom: none;
}

.site-brand:hover {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--fg-muted);
  background: none;
  border: 1px solid var(--border);
  padding: 0;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.theme-icon.hidden {
  display: none;
}

.hero {
  padding: var(--space-4xl) 0 var(--space-3xl);
  border-bottom: 1px solid var(--border);
}

.hero-name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(3.5rem, 9vw, 7rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  color: var(--fg-muted);
  letter-spacing: 0.02em;
  max-width: 520px;
  line-height: 1.6;
}

.hero-meta {
  margin-top: var(--space-2xl);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-meta dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-xs) 0;
}

.hero-meta dt {
  color: var(--fg-muted);
}

.hero-meta dd {
  color: var(--accent);
}

.section {
  padding: var(--space-3xl) 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 400;
}

.section-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-dim);
  letter-spacing: 0.06em;
}

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

.post-item {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
}

.post-item:first-child {
  padding-top: 0;
}

.post-item:last-child {
  border-bottom: none;
}

.post-item-link {
  display: block;
  text-decoration: none;
  border-bottom: none;
}

.post-item-link:hover .post-item-title {
  color: var(--accent);
}

.post-item-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--fg);
  margin-bottom: var(--space-sm);
  transition: color var(--transition-fast);
}

.post-item-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-dim);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}


.content {
  padding: var(--space-3xl) 0;
}

.content h1 {
  margin-bottom: var(--space-2xl);
}

.content h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.content h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.content > :first-child {
  margin-top: 0;
}

.content ul, .content ol {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-lg);
}

.content li {
  margin-bottom: var(--space-sm);
}

.content li::marker {
  color: var(--fg-dim);
}

.content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: var(--space-md);
  margin: var(--space-xl) 0 var(--space-xl) var(--space-sm);
  color: var(--fg-muted);
  font-style: italic;
}

.content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-2xl) 0;
}

.content img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
}

.content figure {
  margin-bottom: var(--space-lg);
}

.content figcaption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-dim);
  margin-top: var(--space-sm);
}

.post-header {
  padding: var(--space-2xl) 0 var(--space-xl);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-2xl);
}

.post-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: var(--space-md);
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-dim);
}

.post-meta time {
  color: var(--fg-muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-xl) 0;
  margin-top: auto;
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-dim);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
  border-bottom: none;
}

.footer-links a:hover {
  color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-accent { color: var(--accent); }
.text-muted { color: var(--fg-muted); }

@media (max-width: 640px) {
  .site-header-inner {
    height: auto;
    min-height: 52px;
    padding: var(--space-sm) 0;
    gap: var(--space-md);
  }

  .site-nav {
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .site-nav a {
    padding: var(--space-xs) var(--space-xs);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
  }

  .theme-toggle {
    width: 32px;
    height: 32px;
  }

  .theme-icon {
    width: 16px;
    height: 16px;
  }

  .hero {
    padding: var(--space-3xl) 0 var(--space-2xl);
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .hero-meta dl {
    grid-template-columns: 90px 1fr;
  }

  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }
}
