@import url("https://cdn.jsdelivr.net/npm/@fontsource/commit-mono@latest/400.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/commit-mono@latest/700.css");

:root {
  color-scheme: light;
  --paper: #ebe9e5;
  --paper-strong: #f5f3ef;
  --ink: #20211f;
  --muted: #6d6c66;
  --line: #b9b7b0;
  --accent: #c6543d;
  --accent-soft: #ead1c8;
  --shadow: rgba(32, 33, 31, 0.1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #20211f;
  --paper-strong: #2a2b28;
  --ink: #eeece6;
  --muted: #aaa79e;
  --line: #575750;
  --accent: #f28a70;
  --accent-soft: #55372f;
  --shadow: rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.5), transparent 24rem),
    var(--paper);
  color: var(--ink);
  font-family: "Commit Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 15px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover, a:focus-visible { color: var(--accent); }

button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: .35rem .6rem;
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus { top: 1rem; }

.site-shell {
  width: min(100% - 2.5rem, 760px);
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.6rem 0 1.25rem;
}

.wordmark {
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
}

.wordmark::before { content: "~/"; color: var(--accent); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .85rem 1.15rem;
  font-size: .82rem;
}

.site-nav a { text-underline-offset: 4px; }

.theme-toggle {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
}

.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--accent); }

main { padding: 3.5rem 0 4.5rem; }

.hero {
  display: grid;
  gap: 1.2rem;
  margin-bottom: 5.5rem;
}

.hero-label, .section-label {
  margin: 0;
  color: var(--accent);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(2.25rem, 8vw, 4rem);
  line-height: 1;
  letter-spacing: -.08em;
  white-space: nowrap;
}

.hero-intro {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-intro strong { color: var(--ink); }

.content-section { margin-top: 4.5rem; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: .86rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.section-heading span { color: var(--muted); font-size: .75rem; }

.post-list { display: grid; }

.post {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .8rem;
  padding: 1.5rem 0 1.65rem;
  border-bottom: 1px solid var(--line);
}

.post-index { color: var(--accent); }

.post h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 500;
}

.post h3 a { text-decoration: none; }
.post h3 a::before { content: "["; color: var(--accent); }
.post h3 a::after { content: "]"; color: var(--accent); }

.post p { margin: .45rem 0 .75rem; color: var(--muted); }

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  color: var(--muted);
  font-size: .76rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 2rem;
}

.about-grid p { margin: 1rem 0 0; }

.link-list {
  display: grid;
  gap: .55rem;
  align-content: start;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.link-list a::before { content: "↳ "; color: var(--accent); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 0 2.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
}

.article-page main { padding-top: 3.5rem; }

.article-header {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  max-width: 18ch;
  margin: .5rem 0 1rem;
  font-size: clamp(2.25rem, 8vw, 4.3rem);
  line-height: 1;
  letter-spacing: -.08em;
}

.article-meta { color: var(--muted); font-size: .78rem; }

.article-body {
  max-width: 64ch;
  padding: 2rem 0 3rem;
}

.article-body p { margin: 0 0 1.35rem; }

.back-link { color: var(--accent); font-size: .82rem; }
.back-link::before { content: "← "; }

@media (max-width: 620px) {
  .site-shell { width: min(100% - 1.5rem, 760px); }
  .site-header { align-items: flex-start; }
  .site-nav { gap: .35rem .75rem; }
  main { padding-top: 2.25rem; }
  .hero { margin-bottom: 4rem; }
  .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .site-footer { display: grid; gap: .25rem; }
}

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