/* ---- tokens ---- */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #14171c;
  --muted: #5c6472;
  --accent: #3b5bdb;
  --accent-soft: #eaeeff;
  --shadow: 0 1px 2px rgba(16, 20, 30, .05), 0 8px 24px rgba(16, 20, 30, .06);
  --radius: 14px;
  --maxw: 980px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root[data-theme="dark"] {
  --bg: #0d1015;
  --bg-soft: #131820;
  --surface: #141923;
  --border: #232b38;
  --text: #e8ecf2;
  --muted: #98a3b3;
  --accent: #7c93ff;
  --accent-soft: #1b2340;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 0; }

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

/* ---- nav ---- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: var(--maxw); margin: 0 auto; padding: 1rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
}
.nav__brand {
  font-family: var(--mono); font-weight: 500; font-size: 1rem;
  text-decoration: none; letter-spacing: -.02em;
}
.nav__brand span { color: var(--muted); }
.nav nav { display: flex; align-items: center; gap: 1.25rem; }
.nav nav a {
  text-decoration: none; color: var(--muted); font-size: .9rem; font-weight: 500;
  transition: color .15s ease;
}
.nav nav a:hover { color: var(--text); }
.theme-toggle {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font-size: .9rem;
  transition: color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--muted); }

/* ---- layout ---- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; border-top: 1px solid var(--border); }
.section h2 { font-size: 1.35rem; margin-bottom: 1.25rem; }
.section__head h2 { margin-bottom: 0; }
.section__head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 1rem; margin-bottom: 2rem;
}
.prose { color: var(--muted); max-width: 62ch; }
.prose p { margin: 0 0 1rem; }

/* ---- hero ---- */
.hero { padding: 5rem 0 4.5rem; }
.hero__eyebrow {
  font-family: var(--mono); font-size: .8rem; color: var(--accent);
  margin: 0 0 .75rem; text-transform: lowercase;
}
.hero__title { font-size: clamp(2.6rem, 8vw, 4.25rem); font-weight: 700; }
.hero__tagline {
  margin: 1.25rem 0 2rem; max-width: 46ch;
  font-size: 1.125rem; color: var(--muted);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.btn {
  display: inline-block; padding: .65rem 1.25rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  text-decoration: none; font-size: .925rem; font-weight: 500;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--muted); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { border-color: var(--accent); opacity: .92; }

/* ---- filters ---- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters button {
  font: inherit; font-size: .8rem; padding: .3rem .8rem; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  cursor: pointer; transition: all .15s ease;
}
.filters button:hover { color: var(--text); border-color: var(--muted); }
.filters button[aria-pressed="true"] {
  background: var(--accent-soft); border-color: transparent; color: var(--accent);
}

/* ---- project grid ---- */
.grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  display: flex; flex-direction: column; gap: .75rem;
  padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.card--featured { grid-column: span 2; background: var(--bg-soft); }
@media (max-width: 640px) { .card--featured { grid-column: span 1; } }

.card__top { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.card__title { font-size: 1.05rem; font-weight: 600; }
.card__year { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.card__blurb { margin: 0; color: var(--muted); font-size: .925rem; }
.card__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .25rem; }
.tag {
  font-family: var(--mono); font-size: .7rem; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: .15rem .55rem;
}
.card__links { display: flex; gap: 1rem; }
.card__links a {
  font-size: .85rem; font-weight: 500; color: var(--accent);
  text-decoration: none; border-bottom: 1px solid transparent;
}
.card__links a:hover { border-color: currentColor; }

.empty { color: var(--muted); font-size: .925rem; }

/* ---- contact ---- */
.links { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .5rem; }
.links a {
  display: inline-flex; align-items: baseline; gap: .75rem; text-decoration: none;
}
.links .label { font-size: .925rem; font-weight: 500; min-width: 5rem; }
.links .handle { font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.links a:hover .handle { color: var(--accent); }

/* ---- footer ---- */
.footer {
  position: relative;
  max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1.5rem 3rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  color: var(--muted); font-size: .85rem;
}
/* inset rule so it lines up with the section dividers inside <main> */
.footer::before {
  content: ""; position: absolute; top: 0; left: 1.5rem; right: 1.5rem;
  height: 1px; background: var(--border);
}
.footer p { margin: 0; }
