:root {
  --bg: #f4f4f4;
  --ink: #171717;
  --muted: #6e6e73;
  --hairline: #e3e3e3;
  --card: rgb(255 255 255 / 0.72);
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161616;
    --ink: #ececec;
    --muted: #a0a0a6;
    --hairline: #2b2b2b;
    --card: rgb(255 255 255 / 0.035);
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-stretch: 87.5%;
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 16px 40px;
}

/* Intro */

.intro {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 64px;
}

.avatar {
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--card);
}

.intro-text {
  max-width: 62ch;
}

h1 {
  margin: 0 0 12px;
  font-stretch: 112.5%;
  font-weight: 760;
  font-size: clamp(1.9rem, 1.1rem + 3.4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.bio {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14.5px;
  text-wrap: pretty;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  opacity: 0.86;
}

/* Projects */

h2 {
  margin: 0 0 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border: 1px solid color-mix(in oklch, var(--brand) 22%, var(--hairline));
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--brand) 6%, var(--card));
  transition: border-color 0.15s ease;
}

.card:has(.card-link):hover {
  border-color: color-mix(in oklch, var(--brand) 60%, var(--hairline));
}

.card:has(.card-link:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* The whole card is the click target; the title link stretches over it. */
.card-link {
  text-decoration: none;
}

.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.card-link:focus-visible {
  outline: none;
}

.card-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Logo tiles stay light in dark mode so dark logo marks stay legible. */
.tile {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: color-mix(in oklch, var(--brand) 16%, white);
  border: 1px solid color-mix(in oklch, var(--brand) 26%, white);
}

.tile img {
  display: block;
  object-fit: contain;
}

.tile-bare {
  background: none;
  border: 0;
}

h3 {
  margin: 0;
  font-size: 15px;
  font-stretch: 100%;
  font-weight: 650;
  line-height: 1.3;
}

.category {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.blurb {
  margin: 0;
  flex: 1;
  text-wrap: pretty;
}

.stats {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid color-mix(in oklch, var(--brand) 16%, var(--hairline));
}

.stats dt {
  color: var(--muted);
  font-size: 11.5px;
}

.stats dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Corner tab for the two projects that aren't fully live. */
.tag {
  position: absolute;
  top: -1px;
  right: -1px;
  padding: 3px 10px;
  border-radius: 0 var(--radius) 0 8px;
  font-size: 11px;
  font-weight: 600;
}

.tag-soon {
  background: #e3e8f7;
  color: #1f345c;
}

.tag-wip {
  background: #fdf0c4;
  color: #7a5200;
}

/* Footer */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 12px;
}

.footer p {
  margin: 0;
}

.footer a {
  text-underline-offset: 3px;
}

.footer a:hover {
  color: var(--ink);
}

@media (max-width: 600px) {
  .page {
    padding-top: 40px;
  }

  .intro {
    flex-direction: column;
    gap: 18px;
    margin-bottom: 48px;
  }

  .avatar {
    width: 60px;
    height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }
}
