@font-face {
  font-family: Fraunces;
  src: url("./ruta-de-la-seda/fable/fonts/fraunces-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Fraunces;
  src: url("./ruta-de-la-seda/fable/fonts/fraunces-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("./ruta-de-la-seda/fable/fonts/plexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f3eb;
  --ink: #211b29;
  --muted: #5c5264;
  --accent: #6a4486;
  --line: #d9d1d6;
  --surface: #fffaf5;
  color: var(--ink);
  background: var(--paper);
  font-family: system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 85% 0%, #eee3f4 0, transparent 53%);
}

.wrap {
  width: min(75rem, 100% - 5rem);
  margin-inline: auto;
}

a {
  color: inherit;
}

:where(a, button, input, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.topbar {
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand,
.topbar__link {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}

.brand {
  font: 600 1.15rem/1.2 Fraunces, Georgia, serif;
}

.brand__mark {
  width: 1rem;
  aspect-ratio: 1;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 29%, transparent 31%);
}

.topbar__link {
  color: var(--accent);
  font-size: .83rem;
  font-weight: 650;
}

.intro {
  padding-block: clamp(2.8rem, 5.5vw, 4.5rem) clamp(2.4rem, 4.5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
}

h1 {
  font-size: clamp(2.8rem, 6.7vw, 6rem);
  font-weight: 530;
  line-height: .99;
  letter-spacing: -.06em;
  text-wrap: balance;
}

h1 em {
  color: var(--accent);
  font-weight: inherit;
}

.intro p {
  max-width: 39rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.9vw, 1.2rem);
  line-height: 1.55;
}

.catalog {
  padding-block: 2rem 4rem;
  scroll-margin-top: 1rem;
}

.catalog__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.catalog__heading h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 550;
  letter-spacing: -.04em;
}

.catalog__heading [role="status"] {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
}

.filters {
  display: grid;
  grid-template-columns: minmax(13rem, 1.65fr) repeat(2, minmax(0, 1fr));
  gap: .85rem;
  margin-bottom: 1.45rem;
}

.filter {
  display: grid;
  gap: .35rem;
  min-width: 0;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
}

.filter :is(input, select) {
  width: 100%;
  min-height: 2.9rem;
  padding: .6rem .75rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .35rem;
  font: 400 .94rem/1.3 system-ui, sans-serif;
}

.filter select {
  padding-inline-end: 1.7rem;
}

.catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.catalog__item {
  container-type: inline-size;
}

.experiment {
  display: grid;
  height: 100%;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--surface);
  box-shadow: 0 .5rem 1.5rem #3823460e;
}

.experiment__cover {
  position: relative;
  display: block;
  min-width: 0;
  background: #151724;
  border-radius: .65rem .65rem 0 0;
}

.experiment__cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  border-radius: inherit;
}

.experiment__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: clamp(1.25rem, 3.2vw, 2.35rem);
}

.experiment__video {
  margin: 0 0 .65rem;
  color: var(--accent);
  font: 500 .73rem/1.5 "IBM Plex Mono", monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.experiment__body h3 {
  font-size: clamp(2rem, 4.2vw, 3.55rem);
  font-weight: 550;
  line-height: 1.04;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.experiment__body h3 + p {
  margin: .85rem 0 1.3rem;
  color: var(--muted);
  line-height: 1.55;
}

.experiment__open,
.empty button {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-height: 2.75rem;
  margin-top: auto;
  padding: .55rem .85rem;
  background: #352545;
  color: #fffaf5;
  border: 1px solid transparent;
  border-radius: .35rem;
  font: 650 .86rem/1.3 system-ui, sans-serif;
  text-decoration: none;
}

.experiment:is(:hover, :focus-visible) .experiment__open,
.empty button:hover {
  background: var(--accent);
}

@container (min-width: 47rem) {
  .experiment {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }

  .experiment__cover {
    border-radius: .65rem 0 0 .65rem;
  }

  .experiment__cover img {
    position: absolute;
    inset: 0;
    height: 100%;
  }
}

.empty {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: .5rem;
}

.empty p {
  margin: 0 0 .8rem;
  color: var(--muted);
}

.empty button {
  cursor: pointer;
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .35rem .65rem;
  padding-block: .75rem 1.5rem;
  color: var(--muted);
  font: 400 .75rem/1.5 system-ui, sans-serif;
}

.legal-footer a {
  text-decoration: none;
}

.legal-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 42rem) {
  .wrap {
    width: calc(100% - 2rem);
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 22rem) {
  .filters {
    grid-template-columns: 1fr;
  }
}
