:root {
  color-scheme: light;
  --background: #f5f2eb;
  --text: #171716;
  --muted: #686660;
  --line: #d8d3c9;
  --surface: rgb(255 255 255 / 48%);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.home {
  display: flex;
  flex-direction: column;
  width: min(100% - 40px, 700px);
  min-height: 100vh;
  margin: 0 auto;
}

header {
  display: flex;
  align-items: center;
  min-height: 92px;
}

.wordmark {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-decoration: none;
}

.intro {
  padding: 92px 0 94px;
}

h1,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 7.5vw, 4.2rem);
  font-weight: 560;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.intro p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
}

.project-directory {
  padding-bottom: 80px;
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

button {
  font: inherit;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.filter-button:hover {
  border-color: #aaa399;
  color: var(--text);
}

.filter-button[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
}

.filter-count {
  font-size: 0.75rem;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.filter-count::before {
  content: "·";
  margin-right: 8px;
}

.projects {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease,
    transform 160ms ease;
}

.project:hover,
.project:has(.project-title-link:focus-visible) {
  border-color: #aaa399;
  background: rgb(255 255 255 / 76%);
  transform: translateY(-2px);
}

.filter-button:focus-visible,
.project-type:focus-visible,
.project-title-link:focus-visible::after {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}

.project-title-link {
  text-decoration: none;
}

.project-title-link:focus-visible {
  outline: none;
}

.project-title-link::after {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  content: "";
}

.project-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.project-type {
  position: relative;
  z-index: 1;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.61rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.project-type:hover:not(:disabled) {
  border-color: #aaa399;
  background: var(--background);
  color: var(--text);
}

.project-type:disabled {
  cursor: default;
}

.project img {
  display: block;
  width: 58px;
  height: 58px;
  border-radius: 13px;
  object-fit: cover;
}

.project-name {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.project img.project-island-icon {
  object-fit: contain;
  background: #e6eadf;
  padding: 2px;
}

.project-status {
  width: fit-content;
  margin-top: 3px;
  color: #59674b;
  font-size: 0.61rem;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.project-name h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.project-name small,
.project-link,
footer {
  color: var(--muted);
  font-size: 0.8rem;
}

.project-link {
  white-space: nowrap;
}

footer {
  margin-top: auto;
  padding: 28px 0 36px;
}

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

@media (max-width: 560px) {
  .home {
    width: min(100% - 32px, 700px);
  }

  header {
    min-height: 76px;
  }

  .intro {
    padding: 68px 0 72px;
  }

  .project-directory {
    padding-bottom: 64px;
  }

  .project {
    grid-template-columns: auto 1fr;
    padding: 16px;
  }

  .project img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  .project-link {
    display: none;
  }

  .filter-button {
    gap: 6px;
    padding-inline: 12px;
  }

  .filter-count::before {
    margin-right: 6px;
  }

  .project-type {
    min-height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
