/* The crop mark tabs: the filters of a design studio's work on a white page, in a minimal style. The chosen
   filter is framed by four printer's crop marks in vermilion; the work below is a grid of hairline frames, each
   project name set as a little type specimen of its own. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #141414;           /* the chosen filter and the project names */
  --muted: #8f8b84;         /* the other filters, the years and the tags */
  --rule: #e4e2dd;          /* the hairline frames of the projects */
  --accent: #e5402a;        /* the crop marks and the count of the chosen filter */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Archivo Variable', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* the column never grows with the row of filters */
  justify-items: center;
  align-content: center;
  padding: 48px 16px;
}

.folio {
  width: min(660px, 100%);
}

/* ---------------------------------------------------------------- the filters and the crop marks */
.filters {
  position: relative;
  display: flex;
  justify-content: safe center;
  gap: 6px;
  padding: 18px 18px;       /* room for the crop marks, which stand off the corners of the chosen filter */
  margin: 0 -18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.marks {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}

.marks path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  stroke-linecap: butt;
  shape-rendering: crispEdges;
}

.tab {
  position: relative;
  flex: none;
  display: inline-grid;
  padding: 7px 12px 8px 13px;
  border: 0;
  border-radius: 1px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.35s ease;
}

/* the word with its count and, under it, an invisible copy at the heaviest weight: the tab is always as wide as
   its chosen word, so taking weight never pushes the other tabs */
.tab__label,
.tab__ghost {
  grid-area: 1 / 1;
  justify-self: center;
  display: inline-flex;
  align-items: flex-start;
}

.tab__word {
  font-variation-settings: 'wght' 360, 'wdth' 100;
}

.tab__ghost {
  visibility: hidden;
}

.tab__ghost .tab__word {
  font-variation-settings: 'wght' 760, 'wdth' 104;
}

.tab__n {
  margin-left: 3px;
  font-size: 10px;
  line-height: 1;
  font-variation-settings: 'wght' 520, 'wdth' 100;
  font-variant-numeric: tabular-nums;
  position: relative;
  top: 1px;
  color: var(--muted);
  transition: color 0.35s ease;
}

.tab[aria-selected='true'] {
  color: var(--ink);
}

.tab[aria-selected='true'] .tab__n {
  color: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .tab:not([aria-selected='true']):hover {
    color: #4d4a45;
  }
}

.tab:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 1px;
}

/* ---------------------------------------------------------------- the work */
.work {
  position: relative;
  isolation: isolate;          /* the projects that leave fade behind the ones sliding in */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  margin-top: 10px;
  outline: none;
}

.work:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: 6px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 4 / 3;
  min-width: 0;
  margin: 0;
  padding: 12px 14px 13px;
  border: 1px solid var(--rule);
  background: var(--page);
}

.card[hidden] {
  display: none;
}

.card__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 10.5px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  font-variation-settings: 'wght' 440, 'wdth' 100;
  color: var(--muted);
}

.card__tags span {
  transition: color 0.4s ease;
}

.card__tags .is-lit {
  color: var(--ink);
}

.card__year {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.card__name {
  margin: 0;
  font-size: 21px;
  font-weight: normal;
  line-height: 1.02;
  letter-spacing: -0.01em;
  font-variation-settings: 'wght' var(--wght, 500), 'wdth' var(--wdth, 100);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .filters {
    gap: 0;
    padding: 18px 16px;
    margin: 0 -16px;
  }

  .tab {
    font-size: 15px;
    padding: 6px 6px 7px 7px;
  }

  .tab__n {
    margin-left: 1px;
    font-size: 9px;
  }

  .work {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .card {
    padding: 10px 11px 11px;
  }

  .card__name {
    font-size: 17px;
  }
}
