:root {
  --bg: #f6f3ec;
  --text: #14110e;
  --muted: #6b6760;
  --rule: #d9d3c6;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 640px;
  --step: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110e;
    --text: #f0ebe1;
    --muted: #8a857c;
    --rule: #2a2620;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "ss01" on, "liga" on;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main, .site-header, .site-footer {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 2rem;
}

@media (max-width: 520px) {
  main, .site-header, .site-footer { padding-inline: 1.25rem; }
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 120ms ease;
}

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

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Header */
.site-header {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}
.wordmark {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
}

/* Intro */
.intro { margin-bottom: calc(var(--step) * 4); }
.intro h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 var(--step) 0;
  color: var(--text);
  max-width: 22ch;
}
.byline {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--muted);
}
.byline a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.byline a:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}
.byline a span { display: inline-block; transition: transform 160ms ease; }
.byline a:hover span { transform: translateX(2px); }

/* Section rule */
.section-rule {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 calc(var(--step) * 1.5) 0;
}

/* Projects */
.projects {
  list-style: none;
  padding: 0;
  margin: 0 0 calc(var(--step) * 4) 0;
  border-top: 1px solid var(--rule);
}

.projects li {
  border-bottom: 1px solid var(--rule);
}

.projects a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: baseline;
  padding: 1.25rem 0;
  color: var(--text);
}

.projects .num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  padding-top: 0.35rem;
}

.projects .body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.projects .name {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--text);
}

.projects .desc {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.projects .arrow {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--muted);
  transition: transform 180ms ease, color 180ms ease;
  padding-top: 0.15rem;
}

.projects a:hover .name {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.projects a:hover .arrow {
  transform: translateX(4px);
  color: var(--text);
}

@media (max-width: 420px) {
  .projects a { gap: 0.85rem; }
  .projects .name { font-size: 1.3rem; }
  .projects .desc { font-size: 0.8rem; }
}

/* Footer */
.site-footer {
  padding-top: 2rem;
  padding-bottom: 3rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
}

.site-footer p { margin: 0; }

.site-footer a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.site-footer a:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

.copyright { color: var(--muted); }
