:root {
  --display: 'Bricolage Grotesque', var(--font);
  --body: 'IBM Plex Sans', var(--font);
}

body {
  font-family: var(--body);
  font-size: 16px;
}

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

/* Hero: the title is drawn by a live particle sketch on a graph-paper background */

.hero {
  position: relative;
  min-height: min(560px, 80svh);
  display: grid;
  align-items: end;
  overflow: hidden;
  background:
    linear-gradient(to bottom, transparent 60%, var(--bg)),
    repeating-linear-gradient(to right, rgb(255 255 255 / 0.035) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(to bottom, rgb(255 255 255 / 0.035) 0 1px, transparent 1px 32px);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.hero-content {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 56px;
  pointer-events: none;
}

.hero-content a {
  pointer-events: auto;
}

/* The heading stays real text for accessibility; once the sketch has drawn it, it becomes invisible */
.hero-title {
  margin: 0;
  font: 800 clamp(48px, 16.5vw, 168px) / 0.88 var(--display);
  font-variation-settings: 'opsz' 96;
  letter-spacing: -0.045em;
}

.hero.is-drawn .hero-title {
  color: transparent;
}

.hero-text {
  max-width: 56ch;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.hero-links {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  font-weight: 600;
}

.hero-links a {
  color: var(--text);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.hero-links a:hover {
  color: var(--accent);
}

/* Collection */

.collection {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px 0;
}

.filters {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 -24px 32px;
  padding: 14px 24px;
  border: 0;
  background: rgb(12 17 28 / 0.88);
  backdrop-filter: blur(10px);
}

.filters input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filters label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  user-select: none;
}

.filters label::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, var(--muted));
}

.filters label span {
  color: var(--muted);
  font-size: 13px;
}

.filters label:hover {
  color: var(--text);
  border-color: var(--muted);
}

.filters input:checked + label {
  border-color: var(--dot, var(--text));
  color: var(--text);
  background: color-mix(in srgb, var(--dot, var(--text)) 14%, transparent);
}

.filters input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 48px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-card {
  display: flex;
  flex-direction: column;
}

.project-card[hidden] {
  display: none;
}

.thumb {
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}

.thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.thumb:hover img {
  scale: 1.04;
  transition: scale 0.4s ease;
}

.category {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 4px;
  color: var(--dot);
  font-size: 14px;
  font-weight: 500;
}

.category::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot);
}

.project-card h2 {
  margin: 0;
  font: 700 26px / 1.15 var(--display);
  letter-spacing: -0.02em;
}

.project-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.project-card h2 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--dot);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.summary {
  margin: 6px 0 0;
  color: var(--muted);
}

details {
  margin-top: 12px;
  border-top: 1px solid var(--border);
}

summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  margin-left: auto;
  color: var(--dot);
  font-size: 18px;
  line-height: 1;
}

details[open] summary::after {
  content: '\2212';
}

details p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.footer {
  max-width: 1200px;
  margin: 96px auto 0;
  padding: 24px 24px 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.footer p {
  margin: 0;
}

@media (max-width: 640px) {
  .filters {
    position: static;
    margin-bottom: 16px;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thumb:hover img {
    scale: none;
  }
}
