@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Only fetched when a name needs it (e.g. the macron in "Alāta"). */
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;
  --bg: #f5f4f0;
  --fg: #141413;
  --muted: #74726c;
  --line: rgb(20 20 19 / 0.1);
  --well: #e8e6df;
  --accent: #1c7c54;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0d;
    --fg: #ededeb;
    --muted: #8c8c88;
    --line: rgb(255 255 255 / 0.1);
    --well: #17171a;
    --accent: #6fdc9f;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Instrument Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

.wrap {
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}

/* ---------- header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.brand svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex: none;
}

.count {
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

/* Page heading for screen readers only; the header already names the site. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 14px;
  margin: clamp(12px, 3vw, 40px) 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 700px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px 22px;
  }
}

@media (min-width: 1080px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 48px 26px;
  }
}

.card {
  display: block;
  border-radius: 12px;
  outline-offset: 6px;
}

.card:focus-visible {
  outline: 2px solid var(--accent);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 10px;
  background: var(--well);
}

/* Hairline so dark shots keep an edge on the dark page, light on light. */
.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 0;
}

.name {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
}

@media (min-width: 700px) {
  .name {
    font-size: 1rem;
  }
}

/* Index number that gives way to an arrow on hover. */
.tag {
  display: grid;
  flex: none;
  place-items: center end;
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.tag > * {
  grid-area: 1 / 1;
  transition: opacity 0.25s ease, transform 0.35s var(--ease);
}

.tag svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  opacity: 0;
  transform: translate(-4px, 4px);
}

@media (hover: hover) {
  .card:hover .thumb img {
    transform: scale(1.04);
  }

  .card:hover .tag span {
    opacity: 0;
  }

  .card:hover .tag svg {
    opacity: 1;
    transform: none;
  }
}

.card:focus-visible .tag span {
  opacity: 0;
}

.card:focus-visible .tag svg {
  opacity: 1;
  transform: none;
}

/* ---------- footer ---------- */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(56px, 9vw, 120px);
  padding-block: 24px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.foot a:hover,
.foot a:focus-visible {
  color: var(--fg);
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  min-height: 60vh;
  align-content: center;
  gap: 20px;
}

.lost h1 {
  margin: 0;
  font-size: clamp(2.125rem, 6vw, 4.25rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.lost a {
  justify-self: start;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

.lost a:hover,
.lost a:focus-visible {
  color: var(--fg);
  border-color: currentColor;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .grid > li {
    animation: rise 0.7s var(--ease) both;
    animation-delay: calc(min(var(--i, 0), 11) * 45ms);
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .thumb img,
  .tag > * {
    transition: none;
  }
}
