:root {
  --bg: #fbfbfa;
  --text: #1d2126;
  --muted: #5d6670;
  --border: #dfe2e5;
  --accent: #0a7a6b;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max-width: 60rem;
  --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --text: #e8eaec;
    --muted: #9aa4ad;
    --border: #2a3036;
    --accent: #3fd0bb;
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
}

a { color: inherit; }
a:hover { color: var(--accent); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.preferred { color: var(--accent); }

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.social {
  display: flex;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: var(--muted);
}

.social svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
}

.site-header nav a {
  text-decoration: none;
  color: var(--muted);
}

.site-header nav a:hover { color: var(--accent); }

.site-header nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

/* Main */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main section { padding: 3rem 0; }

main section + section { border-top: 1px solid var(--border); }

.lead {
  max-width: 42rem;
  margin: 0;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  line-height: 1.45;
}

#about p:not(.lead) {
  max-width: 42rem;
  margin: 1.25rem 0 0;
  font-size: 1.1rem;
}

#about p a { color: var(--accent); }

h2 {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.projects {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  align-items: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.projects > li {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.projects > li[hidden],
main > section[hidden] { display: none; }

.filters { padding: 1.5rem 0 0; }

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-group + .filter-group { margin-top: 0.75rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.chip:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.chip:disabled { opacity: 0.35; cursor: default; }

.chip[hidden] { display: none; }

.chip.more { border-style: dashed; color: var(--muted); }

.chip .count { font-size: 0.75rem; opacity: 0.7; }

.empty { padding: 3rem 0; color: var(--muted); }

.projects h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.projects p { margin: 0 0 1rem; color: var(--muted); }

.projects p.clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}

.projects .toggle {
  align-self: flex-start;
  margin: -0.25rem 0 1rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.projects .toggle:hover { text-decoration: underline; }

.projects .badge {
  align-self: flex-start;
  margin-bottom: 0.5rem;
  padding: 0.1rem 0.6rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.75rem;
}

.projects .thumb {
  width: 100%;
  margin-bottom: 1rem;
  border-radius: 0.35rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--text);
  font-size: 0.8rem;
}

/* Footer */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p { margin: 0; }
