@font-face {
  font-family: Geist;
  src: url("./assets/fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url("./assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #121215;
  --muted: #64646f;
  --line: #e4e4eb;
  --blue: #1033ff;
  --tint: #f4f4fb;
  --edge: clamp(24px, 3.82vw, 72px);
  --project-title-size: clamp(26px, 2.2vw, 32px);
  --ease: cubic-bezier(.22, 1, .36, 1);
  font-family: Inter, sans-serif;
  color: var(--ink);
  background: var(--paper);
  scrollbar-gutter: stable;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 400 16px/1.6 Inter, sans-serif; letter-spacing: -.01em; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, figure { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
button:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
[hidden] { display: none !important; }
html:has(.project-dialog[open]) { overflow: hidden; }

.shell {
  padding-inline: var(--edge);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  min-height: 86px;
  padding-block: 14px;
}

.wordmark { width: clamp(153px, 12.6vw, 189px); height: auto; }

.intro {
  padding-block: 62px 40px;
  text-align: center;
}

.intro h1 {
  margin-inline: auto;
  max-width: 800px;
  font: 500 var(--project-title-size) / 1.1 Geist, sans-serif;
  letter-spacing: -.04em;
}

.reveal-word { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
  .reveal-enabled [data-stage-reveal]:not(.reveal-started):not(:focus-within) { opacity: 0; }
  .reveal-enabled .project-card:focus-visible [data-stage-reveal] { opacity: 1; }
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  border-block: 1px solid var(--line);
}

.filters {
  display: flex;
  align-items: center;
  min-width: 0;
  flex-wrap: nowrap;
  gap: .25rem .5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #d8dbea transparent;
  scroll-padding-inline: .4rem;
  padding: .5rem .4rem;
  margin-inline-start: -.4rem;
}

.filter {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 2.75rem;
  padding: .35rem .75rem .35rem .45rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 220ms var(--ease), color 220ms var(--ease);
}

.filter:hover { background: #f1f2f7; }
.filter[aria-pressed="true"] { color: var(--blue); background: var(--tint); }
.filter img, .all-icon { width: 1.75rem; height: 1.75rem; }
.filter img { border-radius: 50%; object-fit: cover; }
.all-icon { display: grid; place-items: center; }
.all-icon::before {
  content: "";
  width: 5px;
  height: 5px;
  background: currentColor;
  box-shadow: 8px 0, 0 8px, 8px 8px;
  transform: translate(-4px, -4px);
}

.project-count {
  flex: none;
  color: var(--muted);
  white-space: nowrap;
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(20px, 2.2vw, 40px);
  row-gap: clamp(30px, 3.3vw, 48px);
  margin: clamp(20px, 2.5vw, 36px) 0 0;
  padding: 0 0 clamp(3rem, 7vw, 6rem);
  list-style: none;
}

.project-card {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.card-art, .detail-art {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eff0f6;
}

.card-art img, .detail-art img { width: 100%; height: 100%; }
.card-art img { object-fit: cover; }
.detail-art img { object-fit: contain; }

.duration {
  position: absolute;
  inset: auto 8px 8px auto;
  padding: 2px 6px;
  background: rgb(18 18 21 / 87%);
  color: white;
  font-size: .8125rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.card-details {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}
.card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--tint);
}
.card-title {
  display: block;
  font: 500 16px / 1.35 Geist, sans-serif;
  letter-spacing: -.02em;
  transition: color 230ms var(--ease);
}
.project-card:is(:hover, :focus-visible) .card-title { color: var(--blue); }
.card-creator, .card-meta {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.card-creator { margin-top: 3px; }
.card-meta { font-variant-numeric: tabular-nums; }

.empty { color: var(--muted); margin-block: 2rem 4rem; }

.project-dialog {
  position: fixed;
  max-width: none;
  width: min(calc(100% - 3rem), 72rem);
  max-height: calc(100dvh - 3rem);
  padding: 0;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper);
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(14px) scale(.985);
  transition:
    opacity 280ms var(--ease), transform 330ms var(--ease),
    overlay 330ms allow-discrete, display 330ms allow-discrete;
}
.project-dialog[open] { opacity: 1; transform: none; }
.project-dialog::backdrop {
  background: rgb(15 18 38 / 0%);
  transition: background 300ms var(--ease), overlay 330ms allow-discrete, display 330ms allow-discrete;
}
.project-dialog[open]::backdrop { background: rgb(15 18 38 / 46%); }
@starting-style {
  .project-dialog[open] { opacity: 0; transform: translateY(14px) scale(.985); }
  .project-dialog[open]::backdrop { background: rgb(15 18 38 / 0%); }
}

.dialog-content { position: relative; padding: clamp(1.15rem, 4vw, 3rem); }
.close-button {
  position: sticky;
  top: .75rem;
  z-index: 1;
  display: block;
  margin: 0 0 -2.75rem auto;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  transition: color 220ms var(--ease), background 220ms var(--ease);
}
.close-button:is(:hover, :focus-visible) { background: var(--tint); color: var(--blue); }
.close-button span::before, .close-button span::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 1rem;
  height: 1px;
  background: currentColor;
  content: "";
}
.close-button span::before { transform: translate(-50%, -50%) rotate(45deg); }
.close-button span::after { transform: translate(-50%, -50%) rotate(-45deg); }

.project-header { padding-right: 3.25rem; margin-bottom: clamp(1.25rem, 3vw, 2.25rem); }
.project-creator { font-size: .875rem; color: var(--blue); margin-bottom: .4rem; }
.project-header h2 {
  font: 500 var(--project-title-size) / 1.1 Geist, sans-serif;
  letter-spacing: -.04em;
}

.comparison, .alternative-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.8rem, 2vw, 1.5rem);
}
.comparison > :only-child { grid-column: span 2; width: min(100%, 43rem); }
.detail-label { display: block; margin-bottom: .55rem; color: var(--muted); font-size: .875rem; }
.project-description { max-width: 64ch; margin-top: 1.25rem; font-size: 1rem; line-height: 1.55; color: var(--muted); }
.watch-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 1.25rem;
  border-bottom: 1px solid currentColor;
  color: var(--ink);
  font-size: .875rem;
  text-decoration: none;
  transition: color 230ms var(--ease);
}
.watch-link:is(:hover, :focus-visible) { color: var(--blue); }
.watch-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

.alternatives { margin-top: 1.75rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.alternatives h3 { font: 550 1.125rem / 1.2 Geist, sans-serif; margin-bottom: 1rem; }

@media (max-width: 950px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-header { min-height: 78px; }
  .intro { padding-top: 40px; }
}

@media (max-width: 620px) {
  .intro { padding-block: 32px; }
  .project-count {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .toolbar { min-height: 0; display: block; }
  .filters { margin-inline-end: -.4rem; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .project-dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
  .comparison { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
  .comparison > :only-child { grid-column: auto; }
  .alternative-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
