/* Shared colors: change these to adjust the whole site's theme. */
:root {
  --page: #ffffff;
  --sidebar: #f0f6ff;
  --text: #101828;
  --muted: #475569;
  --border: #dce5f0;
  --blue: #0866e8;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--page);
}

img {
  display: block;
  flex-shrink: 0;
}

a {
  color: var(--blue);
  text-underline-offset: 0.2em;
}

a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1.5rem;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0.4rem;
  font-size: 1.125rem;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

p {
  color: var(--muted);
}

/* The first keyboard link lets visitors bypass the navigation. */
.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  z-index: 2;
  padding: 0.75rem 1rem;
  background: white;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Navigation is a top bar on phones, a sidebar on larger screens. */
.sidebar {
  padding: 1.25rem 1.25rem 0;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  margin-bottom: 1.25rem;
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.navigation {
  display: flex;
  gap: 0.5rem;
}

.navigation a {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.75rem;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.navigation a:hover {
  background: #e6effc;
}

.navigation a[aria-current="page"] {
  border-color: var(--blue);
  color: var(--blue);
  background: #e1edff;
}

.main-content {
  min-width: 0;
  padding: 1.75rem 1.25rem;
}

.project-grid {
  display: grid;
  gap: 1.25rem;
  max-width: 78rem;
}

.project-card {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.125rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: white;
}

.project-icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 0.75rem;
}

.project-icon img {
  width: 2.5rem;
  height: 2.5rem;
}

.icon-dice {
  background: #ffe4e6;
}

.icon-terminal {
  background: #e1f5e5;
}

.icon-game {
  background: #fff2c9;
}

.project-details p {
  margin-bottom: 0.875rem;
  font-size: 1rem;
}

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

.tags li {
  padding: 0.15rem 0.65rem;
  border-radius: 1rem;
  color: #064ba8;
  background: #e8f1ff;
  font-size: 0.875rem;
  font-weight: 500;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 0.625rem;
  margin-top: auto;
}

.button {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid #c2cfdf;
  border-radius: 0.45rem;
  color: var(--text);
  background: white;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  border-color: #91a8c4;
  background: #f0f5fc;
}

.button-primary {
  border-color: var(--blue);
  color: white;
  background: var(--blue);
}

.button-primary:hover {
  border-color: #0052c4;
  background: #0052c4;
}

.button-primary img {
  filter: brightness(0) invert(1);
}

.link-list {
  max-width: 40rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list li {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
}

.link-list li + li {
  margin-top: 1rem;
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
  font-weight: 600;
}

.link-list p {
  margin: 0.25rem 0 0;
}

/* Cards become vertical and sit side by side when there is enough room. */
@media (min-width: 48rem) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card {
    display: flex;
    flex-direction: column;
    min-height: 22rem;
    padding: 1.5rem;
    gap: 1.25rem;
  }

  .project-icon {
    width: 5.5rem;
    height: 5.5rem;
  }

  .project-icon img {
    width: 3rem;
    height: 3rem;
  }

  h2 {
    font-size: 1.25rem;
  }
}

@media (min-width: 60rem) {
  body {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 2rem 1.25rem;
    border-right: 1px solid var(--border);
    border-bottom: 0;
  }

  .brand {
    margin-bottom: 2rem;
  }

  .navigation {
    flex-direction: column;
  }

  .navigation a {
    justify-content: flex-start;
    border-bottom: 0;
    border-left: 3px solid transparent;
    border-radius: 0.5rem;
  }

  .main-content {
    padding: 2rem;
  }
}

@media (min-width: 76rem) {
  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
