:root {
  --surface: #fcf8f7;
  --surface-low: #f7f3f1;
  --ink: #1c1b1b;
  --muted: #767871;
  --rule: #c7c7c0;
  --accent: #ab351d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--surface);
  color: var(--ink);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Geist", sans-serif;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.directory-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  flex: 0 0 56px;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}

.brand {
  justify-self: start;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.directory-nav nav {
  justify-self: start;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 48px;
  font: 500 11px/16px "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
}

.nav-link {
  height: 100%;
  min-width: 0;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.directory-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
  font: 500 10px/14px "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
}

.language {
  display: flex;
  align-items: center;
  gap: 9px;
}

.language strong {
  color: var(--accent);
}

.language span {
  color: var(--muted);
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--ink);
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
}

.directory-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 81px);
}

.directory-title {
  height: 270px;
  flex: 0 0 270px;
  display: flex;
  align-items: flex-end;
  padding: 0 48px 38px;
  border-bottom: 1px solid var(--rule);
}

.directory-title h1 {
  margin: 0;
  font: 400 60px/1 "JetBrains Mono", monospace;
  letter-spacing: -0.04em;
}

.directory-title h1 span {
  color: var(--muted);
}

.directory-grid {
  flex: 1;
  min-height: 360px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 360px;
  align-content: start;
  background-color: var(--surface);
  background-image: repeating-linear-gradient(45deg, transparent 0 11px, rgba(199, 199, 192, 0.18) 11px 12px);
}

.directory-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 360px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  transition: background 150ms ease, color 150ms ease;
}

a.directory-card:hover {
  background: var(--ink);
  color: var(--surface);
}

.card-code {
  height: 48px;
  padding: 24px 24px 0;
  font: 500 11px/16px "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  text-decoration: underline;
  text-underline-offset: 7px;
}

.card-visual {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 12px 24px;
}

.round-visual {
  width: 192px;
  height: 192px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
}

.round-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.round-visual.monogram {
  font-size: 104px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.08em;
  padding-right: 10px;
}

.round-visual.empty {
  border-color: var(--rule);
  color: var(--muted);
  font: 400 60px/1 "JetBrains Mono", monospace;
}

.card-footer {
  min-height: 86px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px 24px;
}

.card-name {
  min-width: 0;
}

.card-name strong {
  display: block;
  overflow: hidden;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-name span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font: 500 10px/14px "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
}

a.directory-card:hover .card-name span {
  color: var(--rule);
}

.card-arrow {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  font: 400 20px/1 "JetBrains Mono", monospace;
}

.compliance {
  min-height: 25px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 24px;
  border-top: 1px solid var(--rule);
  background: var(--surface-low);
  color: var(--muted);
  font: 400 10px/14px "JetBrains Mono", monospace;
}

.compliance div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

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

@media (max-width: 900px) {
  .directory-nav {
    height: auto;
    min-height: 96px;
    grid-template-columns: 1fr auto;
    grid-template-rows: 52px 44px;
    padding: 0 24px;
  }

  .directory-nav nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    gap: 8px;
    overflow-x: auto;
  }

  .directory-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .status-chip {
    display: none;
  }

  .directory-title {
    height: 210px;
    flex-basis: 210px;
    padding: 0 24px 28px;
  }

  .directory-title h1 {
    font-size: clamp(40px, 11vw, 60px);
  }

  .directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .directory-grid {
    grid-template-columns: 1fr;
  }

  .directory-card {
    border-right: 0;
  }

  .compliance {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

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