:root {
  color-scheme: light dark;
  --background: #f7f5f1;
  --foreground: #282624;
  --muted: #6e6963;
  --border: #d5d0c9;
  --accent: #e8e3dc;
  --button: #282624;
  --button-text: #f7f5f1;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 0.13em;
}

a:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
.wordmark {
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.8rem, 7vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 400;
  line-height: 1.2;
}

h3 {
  margin-bottom: 0.1rem;
  font-size: 1.08rem;
}

.page {
  width: min(100% - 2.5rem, 860px);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 1rem;
  z-index: 10;
  padding: 0.6rem 0.9rem;
  background: var(--button);
  color: var(--button-text);
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  max-width: 650px;
  padding: clamp(2.75rem, 7vw, 4.25rem) 0;
}

.hero > p:not(.eyebrow),
.projects-intro > p:not(.eyebrow) {
  max-width: 610px;
  font-size: clamp(1.15rem, 3vw, 1.35rem);
}

.eyebrow {
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-link {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 0.2rem;
  background: var(--button);
  color: var(--button-text);
  font-weight: 700;
  text-decoration: none;
}

.previous {
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--border);
}

.previous > h2 {
  margin-bottom: 1rem;
}

.history-list,
.project-list {
  border-top: 1px solid var(--border);
}

.history-item {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr);
  gap: 2rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.history-item p {
  margin: 0;
  color: var(--muted);
}

.history-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.projects-intro {
  padding: clamp(2.25rem, 6vw, 3.5rem) 0 1.5rem;
}

.project-item {
  display: grid;
  grid-template-columns: minmax(115px, 0.4fr) minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.project-item:hover {
  background: var(--accent);
}

.project-item h2 {
  margin: 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
}

.project-item p {
  margin: 0;
  color: var(--muted);
}

.open-link {
  color: var(--muted);
  font-size: 0.85rem;
}

.projects-footer {
  margin-top: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #1d1c1a;
    --foreground: #f1eee9;
    --muted: #b4aea5;
    --border: #494641;
    --accent: #292724;
    --button: #f1eee9;
    --button-text: #1d1c1a;
  }
}

@media (max-width: 580px) {
  body {
    line-height: 1.6;
  }

  .hero {
    padding: 3.5rem 0;
  }

  .projects-intro {
    padding: 3rem 0 2rem;
  }

  .history-item,
  .project-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.75rem;
  }
}

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