:root {
  --paper: #f7f2e8;
  --ink: #443d32;
  --muted: #71665a;
  --rule: #443d3229;
  --sans: 'Cup Helvetica Neue', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Cup PS Times', Georgia, serif;
  font: 400 14px/1.4 var(--sans);
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; }
a, button { color: inherit; }
button { border: 0; background: none; cursor: pointer; font: inherit; }
a:focus-visible, button:focus-visible { outline: 1px solid #77624b; outline-offset: 4px; }
.projects-header {
  position: fixed;
  z-index: 3;
  inset: 0 0 auto;
  padding: 40px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.projects-back { position: relative; pointer-events: auto; text-decoration: none; }
.projects-back::after,
.project-name::after {
  content: '';
  position: absolute;
  inset: auto 0 -.42em;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .2s ease;
}
.projects-back:is(:hover, :focus-visible)::after,
.project-list a:is(:hover, :focus-visible) .project-name::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.project-index {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  padding: 25vh 16px 80px;
}
.project-list {
  list-style: none;
  padding: 0 16px 0 0;
  max-width: 2056px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transform: translateX(-50px);
  transition: opacity .5s cubic-bezier(.445, .05, .55, .95);
}
.is-sorting > .project-list { opacity: 0; pointer-events: none; }
.project-list :is(li, .category-row) {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 16px;
  align-items: end;
  padding: clamp(4.2px, .9722vw, 18.62px) 0;
}
.project-category {
  grid-column: 6 / 8;
  padding-right: 3em;
  opacity: .5;
  line-height: .95;
  transition: opacity .4s ease;
}
.project-list.has-hover li:not(.is-hovered) .project-category { opacity: .1; transition-duration: .2s; }
.project-list a {
  grid-column: 8 / 13;
  justify-self: start;
  text-decoration: none;
  font: 400 clamp(20px, 1.5278vw, 29.26px)/.665 var(--serif);
}
.project-name { position: relative; display: inline-block; }
@media (max-width: 1024px) {
  .projects-header { padding: 32px; }
  .project-index { padding-inline: 32px; }
  .project-list { gap: 25px; padding: 0; transform: none; }
  .project-category { display: none; }
  .project-list a { grid-column: 1 / 13; line-height: 1.1; }
}
@media (min-width: 2560px) {
  .projects-header { padding: 60px; }
}
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
  :is(.project-index, .project-collection)[tabindex] { cursor: pointer; }
}

.project-surface { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.project-animals {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.surface-light {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at var(--light-x, 28%) var(--light-y, 42%), #fff9ef28, #fff9ef00 52%);
}
.project-cursor {
  position: fixed;
  z-index: 19;
  top: -13px;
  left: -13px;
  width: 26px;
  height: 26px;
  display: none;
  pointer-events: none;
}
.project-cursor::after {
  content: '';
  position: absolute;
  top: calc(50% - 1.5px);
  left: calc(50% - 1.5px);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink);
  transform: translate(var(--dot-x, 0px), var(--dot-y, 0px));
}
.project-preview { display: none; }
@media (hover: hover) and (pointer: fine) {
  .project-cursor.is-visible { display: block; }
}
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
  .project-cursor[data-sort-label]::before {
    content: attr(data-sort-label);
    position: absolute;
    left: 34px;
    top: 5px;
    color: var(--ink);
    white-space: nowrap;
  }
  .project-preview {
    display: block;
    position: absolute;
    left: calc(8.3333% - 17px);
    top: calc(25vh + clamp(3px, .6944vw, 13.3px));
    width: min(22.7778vw, 436px);
    margin: 0;
    opacity: 0;
    transition: opacity .2s ease .075s;
    pointer-events: none;
  }
  .project-collection .project-preview { top: clamp(3px, .6944vw, 13.3px); }
  .project-preview.is-active { opacity: 1; transition-delay: 0s; }
  .project-preview-media, .project-preview-placeholder { aspect-ratio: 16 / 9; overflow: hidden; }
  .project-preview-placeholder { border: 1px solid var(--rule); background: #443d3208; }
  .project-preview :is(img, video) {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
  }
  .project-preview.is-active :is(img, video) { animation: preview-scale .6s ease-out; }
  .project-preview figcaption { margin-top: 20px; line-height: 1.1; }
  .project-preview.is-active figcaption span { animation: preview-word .6s ease both; }
  @keyframes preview-scale { from { transform: scale(1.15); } }
  @keyframes preview-word { from { opacity: 0; } }
}

.project-detail {
  width: min(680px, calc(100% - 36px));
  max-height: calc(100% - 70px);
  background: #f1e9de;
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 0;
}
.project-detail::backdrop { background: #443d3259; backdrop-filter: blur(4px); }
.detail-inner { padding: clamp(20px, 5vw, 42px); }
.detail-inner form { text-align: right; }
.detail-inner form button { min-height: 36px; padding: 0; }
.detail-inner h2 { margin: 0; font: 400 clamp(36px, 7vw, 58px)/1 var(--serif); }
#detail-category, #detail-description { color: var(--muted); }
#detail-media :is(img, video) { display: block; width: 100%; max-height: 52vh; object-fit: contain; background: var(--paper); }

.category-kind { display: none; }
.category-links .project-category {
  color: var(--muted);
  line-height: 1.25;
  opacity: 1;
}
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
  .category-links .project-category { color: inherit; line-height: .95; opacity: .5; }
  .category-links .category-description { display: none; }
  .category-kind { display: inline; }
}
.category-page { display: flex; flex-direction: column; }
.category-heading { width: 100%; margin-bottom: 28px; }
.category-heading h1, .category-empty {
  grid-column: 8 / 13;
  margin: 0;
}
.category-heading h1 { font: 400 clamp(25px, 2vw, 37px)/1.1 var(--serif); }
.category-empty { color: var(--muted); }
.project-collection { position: relative; }
.category-footer { margin-top: auto; padding-top: 56px; }

@media (max-width: 1024px) {
  .category-heading h1, .category-empty { grid-column: 1 / 13; }
  .category-links .project-category, .category-footer .project-category {
    display: block;
    grid-column: 1 / 13;
    margin-bottom: 10px;
  }
}
@media (max-width: 760px) {
  .project-surface { clip-path: inset(0 0 57%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .project-cursor, .project-animals { display: none !important; }
}
