:root {
  --bg: #fafaf9;
  --fg: #18181b;
  --muted: #4f4f57;
  --line: #e4e4e7;
  --panel: #f0f0ee;
  --accent: #2f5bea;
  --frame: #f0f0ee; /* image frames stay light in dark mode too */
  --frame-line: #e4e4e7;
  --frame-text: #4f4f57;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f10;
    --fg: #ededed;
    --muted: #a1a1aa;
    --line: #27272a;
    --panel: #18181b;
    --accent: #7c9bff;
    --frame-line: transparent;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

p {
  margin: 0;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- hero ---------- */
.hero {
  padding: 5rem 0 4rem;
}
.eyebrow,
.label,
.stack {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}
h1 {
  margin: 0.5rem 0 1.25rem;
  font-family: var(--display);
  font-size: clamp(2.25rem, 7vw, 4.25rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.bio {
  max-width: 36rem;
  font-size: 1.125rem;
}
.background {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}
.links a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.links a:hover {
  border-color: var(--fg);
}
.links a::after,
.buttons a::after {
  content: " ↗";
  color: var(--muted);
}

/* ---------- sections ---------- */
.section {
  padding: 4rem 0;
  border-top: 1px solid var(--line);
}
h2 {
  margin: 0.25rem 0 0.5rem;
  font-family: var(--display);
  font-size: 2.25rem;
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.lede {
  color: var(--muted);
  margin-bottom: 2.5rem;
}
.more {
  margin-top: 2.5rem;
}
.more a {
  color: var(--muted);
  text-decoration: none;
}
.more a:hover {
  color: var(--fg);
}

/* ---------- project cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 3rem 2rem;
}
.project {
  display: flex;
  flex-direction: column;
}
.shot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  margin-bottom: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--frame-line);
  border-radius: 10px;
  background: var(--frame);
  text-decoration: none;
}
.shot span {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--frame-text);
}
.shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: inherit; /* covers the fallback label, even for transparent images */
  transition: transform 0.3s ease;
}
/* wide artwork (not a screenshot): show it whole, centred on the panel colour */
.shot--art img {
  object-fit: contain;
  padding: 0 6%;
}
/* show the whole image inside the frame, with a little breathing room */
.shot--fit img {
  object-fit: contain;
  padding: 4%;
}
/* tall screenshot: fill the width, keep the top, crop the bottom */
.shot--top img {
  object-position: top;
  transform-origin: top;
}
.shot:hover img {
  transform: scale(1.02);
}
.project h3 {
  margin: 0 0 0.375rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.project > p:not(.stack):not(.built) {
  color: var(--muted);
  font-size: 0.9375rem;
}
.project .stack {
  margin-top: 0.875rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg);
}
.project .built {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.built a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
.built a:hover {
  text-decoration-color: var(--fg);
}
/* outline the library card jumped to from "Built with" */
.project:target .shot {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: auto 0 0;
  padding-top: 1rem;
}
.buttons a {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8125rem;
  text-decoration: none;
}
.buttons a:hover {
  border-color: var(--fg);
}

/* ---------- footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-top: 2rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}
.footer .links {
  margin: 0;
}
.footer .links a {
  color: var(--fg);
}

@media (max-width: 560px) {
  .br-wide {
    display: none;
  }
  .hero {
    padding: 3rem 0 3rem;
  }
  .section {
    padding: 3rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .shot img {
    transition: none;
  }
}
