@font-face {
  font-family: "Resistance Generale";
  src: url("./fonts/resistance-generale.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Silkscreen";
  src: url("./fonts/silkscreen-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Share Tech Mono";
  src: url("./fonts/share-tech-mono-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #0b0b0b;
  --panel-strong: #111;
  --card: #161616;
  --line: #2a2a2a;
  --line-strong: #f5f5f5;
  --text: #f5f5f5;
  --muted: #858585;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body {
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--bg);
  background-size: 4rem 4rem;
  opacity: 0.18;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(circle at 50% 20%, rgba(245, 245, 245, 0.06), transparent 32rem);
  pointer-events: none;
}

a {
  color: inherit;
}

a:focus-visible {
  border-color: var(--line-strong);
  outline: none;
}

.home {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: clamp(0.7rem, 1.7vw, 1.2rem);
  width: min(100%, 64rem);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(0.65rem, 1.5vw, 1.25rem);
}

.home-head {
  display: grid;
  align-content: end;
  min-height: clamp(5rem, 16vh, 7.5rem);
  padding: clamp(0.35rem, 1vw, 0.75rem) 0;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.home-tagline {
  margin: 0;
  color: var(--muted);
  font-family: "Silkscreen", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.52rem, 1vw, 0.68rem);
  line-height: 1.25;
  text-transform: lowercase;
}

.eyebrow {
  margin-bottom: 0.35rem;
}

.home h1 {
  margin: 0;
  font-family: "Resistance Generale", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(2.25rem, 8vw, 5rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.88;
}

.home-tagline {
  margin-top: 0.4rem;
}

.directory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.75rem, 1fr));
  grid-auto-rows: minmax(6.9rem, auto);
  gap: 0.55rem;
  align-content: start;
  min-height: 0;
}

.app-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.45rem;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0.58rem;
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
}

.app-card:hover,
.app-card:focus-visible {
  border-color: var(--line-strong);
  background: var(--panel-strong);
}

.app-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
  min-width: 0;
}

.app-index {
  display: inline-grid;
  min-width: 1.7rem;
  padding: 0.18rem 0.25rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
  font-family: "Silkscreen", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.5rem;
  line-height: 1;
  text-align: center;
  text-transform: lowercase;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
}

.app-icon svg {
  width: 1.55rem;
  height: 1.55rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.app-card:hover .app-icon,
.app-card:focus-visible .app-icon {
  border-color: var(--line-strong);
}

.app-content {
  display: grid;
  align-content: end;
  min-width: 0;
  gap: 0.28rem;
}

.app-name {
  overflow: hidden;
  color: var(--text);
  font-family: "Silkscreen", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.66rem, 0.95vw, 0.78rem);
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: lowercase;
  white-space: nowrap;
}

.app-description {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.17;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 720px) {
  .home {
    gap: 0.6rem;
    padding: 0.65rem;
  }

  .home-head {
    min-height: 5rem;
  }

  .home h1 {
    font-size: clamp(2rem, 13vw, 3.3rem);
  }

  .directory {
    grid-template-columns: repeat(auto-fit, minmax(8.25rem, 1fr));
    grid-auto-rows: minmax(5.75rem, auto);
    gap: 0.45rem;
  }

  .app-card {
    gap: 0.32rem;
    padding: 0.45rem;
  }

  .app-icon {
    width: 1.9rem;
    height: 1.9rem;
  }

  .app-icon svg {
    width: 1.35rem;
    height: 1.35rem;
  }

  .app-description {
    font-size: 0.55rem;
    -webkit-line-clamp: 1;
  }
}

@media (max-width: 420px) {
  .directory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-description {
    display: none;
  }
}

@media (max-height: 620px) {
  .eyebrow,
  .home-tagline,
  .app-description {
    display: none;
  }

  .home {
    gap: 0.45rem;
  }

  .home-head {
    min-height: 0;
    padding: 0.2rem 0 0.45rem;
  }

  .home h1 {
    font-size: clamp(1.8rem, 7vw, 3.4rem);
  }

  .directory {
    grid-auto-rows: minmax(4.8rem, auto);
  }

  .app-card {
    gap: 0.25rem;
    padding: 0.4rem;
  }

  .app-icon {
    width: 1.75rem;
    height: 1.75rem;
  }

  .app-icon svg {
    width: 1.22rem;
    height: 1.22rem;
  }
}
