@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 700 800;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}

:root {
  --bg: #0e0e0c;
  --fg: #f2efe6;
  --muted: #8f8c82;
  --line: #2a2926;
  --gutter: clamp(16px, 3.2vw, 44px);
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

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

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

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

/* Top bar */
.top,
.bottom {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 20px var(--gutter);
  color: var(--muted);
}
.top p,
.bottom p {
  margin: 0;
}
.top code {
  color: var(--fg);
  font: inherit;
}
.mark {
  font-weight: 500;
  color: var(--fg);
}

/* Rows */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.rows li {
  border-bottom: 1px solid var(--line);
  animation: enter 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.rows li:nth-child(1) { animation-delay: 0.05s; }
.rows li:nth-child(2) { animation-delay: 0.1s; }
.rows li:nth-child(3) { animation-delay: 0.15s; }
.rows li:nth-child(4) { animation-delay: 0.2s; }
.rows li:nth-child(5) { animation-delay: 0.25s; }
.rows li:nth-child(6) { animation-delay: 0.3s; }
.rows li:nth-child(7) { animation-delay: 0.35s; }
.rows li:nth-child(8) { animation-delay: 0.4s; }

.rows a {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 21rem) 2rem;
  align-items: center;
  column-gap: 24px;
  padding: clamp(14px, 2.2vw, 28px) var(--gutter);
  transition: color 0.25s;
}

/* The colour wipe that fills the row on hover */
.rows a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--c);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.n {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: color 0.25s;
}
/* Always-visible colour key, so touch screens get the palette too */
.n::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  transition: background-color 0.25s;
}

.name {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8.4vw, 6.75rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  padding-bottom: 0.06em;
  overflow-wrap: anywhere;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.name small {
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(0.75rem, 1.1vw, 0.9rem);
  letter-spacing: 0;
  margin-left: 0.5em;
  color: var(--muted);
  transition: color 0.25s;
}

.desc {
  color: var(--muted);
  transition: color 0.25s;
}

.go {
  justify-self: end;
  font-size: 1.5rem;
  line-height: 1;
  opacity: 0;
  transform: translate(-8px, 8px);
  transition: opacity 0.25s, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (hover: hover) {
  .rows a:hover,
  .rows a:focus-visible {
    color: var(--bg);
  }
  .rows a:hover::before,
  .rows a:focus-visible::before {
    transform: scaleY(1);
  }
  .rows a:hover .n,
  .rows a:focus-visible .n,
  .rows a:hover .name small,
  .rows a:focus-visible .name small,
  .rows a:hover .desc,
  .rows a:focus-visible .desc {
    color: rgba(14, 14, 12, 0.78);
  }
  .rows a:hover .n::before,
  .rows a:focus-visible .n::before {
    background: var(--bg);
  }
  .rows a:hover .name,
  .rows a:focus-visible .name {
    transform: translateX(10px);
  }
  .rows a:hover .go,
  .rows a:focus-visible .go {
    opacity: 1;
    transform: none;
  }
}

/* Footer */
.bottom nav {
  display: flex;
  gap: 20px;
}
.bottom a {
  border-bottom: 1px solid var(--line);
  transition: color 0.2s, border-color 0.2s;
}
.bottom a:hover {
  color: var(--fg);
  border-color: var(--fg);
}

/* Narrow screens: stack the description under the name */
@media (max-width: 760px) {
  .rows a {
    grid-template-columns: minmax(0, 1fr) 1.5rem;
    grid-template-areas:
      "n    go"
      "name name"
      "desc desc";
    row-gap: 8px;
    padding-top: 18px;
    padding-bottom: 22px;
  }
  .n { grid-area: n; }
  .name { grid-area: name; font-size: clamp(2.6rem, 13vw, 4.5rem); }
  .desc { grid-area: desc; }
  .go { grid-area: go; opacity: 1; transform: none; color: var(--muted); font-size: 1.1rem; }
  .name small { display: block; margin: 8px 0 0; }
  .top p { text-align: right; }
}

@keyframes enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

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