:root {
  --page: #f2f2f2;
  --card: #ffffff;
  --text: #101010;
  --muted: #717171;
  --line: #dededc;
  --soft: #f7f7f6;
  --gold: #b58b3b;
  --green: #25d16f;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  --control-value-width: 178px;
  --control-value-height: 44px;
}

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

html {
  background: var(--page);
  color: var(--text);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.site-header {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  width: 100%;
  padding: 17px 36px 0;
}

.mark {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
}

.mark::before,
.mark::after,
.mark span::before,
.mark span::after {
  position: absolute;
  top: 15px;
  left: 4px;
  width: 24px;
  height: 1.5px;
  content: "";
  background: #161616;
  transform-origin: center;
}

.mark::after {
  transform: rotate(90deg);
}

.mark span::before {
  transform: rotate(45deg);
}

.mark span::after {
  transform: rotate(-45deg);
}

.nav-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.nav-pill,
.search-button,
.category-pill,
.sort-control,
.search-field {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  box-shadow: var(--shadow);
}

.nav-pill {
  height: 38px;
  padding: 0 14px;
  border-color: transparent;
  border-radius: 0;
}

.nav-pill.active {
  background: var(--card);
  color: var(--text);
}

.search-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  justify-self: end;
  border-color: transparent;
  border-radius: 0;
}

.search-button svg,
.copy-button svg,
.open-button svg,
.category-pill svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main {
  width: 100%;
  padding: 72px 36px 48px;
}

.hero {
  display: flex;
  width: 100%;
  max-width: none;
  margin: 0 auto 56px;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}

.hero > * {
  min-width: 0;
}

.hero-lockup {
  display: block;
  width: 100%;
  max-width: 100%;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.44);
  font-size: 14px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 0;
  background: var(--green);
}

h1 {
  width: 100%;
  max-width: 100%;
  margin: 0 0 14px;
  font-size: clamp(54px, calc((100vw - 72px) / 5.76), 360px);
  line-height: 0.84;
  font-weight: 500;
  letter-spacing: -0.073em;
  overflow-wrap: break-word;
  text-wrap: nowrap;
  white-space: nowrap;
}

.hero p {
  width: auto;
  margin: 0;
  color: var(--text);
  font-size: clamp(24px, 2.1vw, 38px);
  line-height: 1;
  text-decoration: none;
}

.hero p a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.12em;
}

.search-field {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 64px;
  padding: 0 22px;
  border-color: var(--line);
  border-radius: 0;
  background: var(--card);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-field input::placeholder {
  color: #7c7c7c;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 280px) minmax(260px, 280px);
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.category-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 38px;
  padding: 0 13px;
  gap: 7px;
  border-radius: 0;
  font-size: 15px;
}

.category-pill.active {
  border-color: transparent;
  background: var(--card);
  color: var(--text);
}

.category-pill .count {
  color: #9a9a9a;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  width: 100%;
  height: 64px;
  padding: 0 10px 0 22px;
  gap: 12px;
  border-color: var(--line);
  background: var(--card);
  border-radius: 0;
  white-space: nowrap;
}

.sort-control span {
  flex: 1 1 auto;
  color: var(--muted);
}

.sort-control select {
  flex: 0 0 var(--control-value-width);
  width: var(--control-value-width);
  min-width: var(--control-value-width);
  height: var(--control-value-height);
  padding: 0 16px;
  border: 0;
  outline: 0;
  background: var(--soft);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  line-height: var(--control-value-height);
  text-align: right;
  text-align-last: right;
  appearance: none;
}

.grid {
  display: block;
  column-count: 3;
  column-gap: 16px;
}

.card {
  position: relative;
  display: inline-block;
  width: 100%;
  min-width: 0;
  margin: 0 0 16px;
  overflow: hidden;
  border-radius: 0;
  background: var(--card);
  break-inside: avoid;
  page-break-inside: avoid;
}

.card-actions {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
}

.copy-button,
.open-button {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: rgba(244, 244, 243, 0.88);
  backdrop-filter: blur(12px);
  color: #808080;
  text-decoration: none;
}

.copy-button.copied {
  background: #101010;
  color: #ffffff;
}

.media-frame {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: #f4f4f3;
}

.media-frame img {
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.media-frame.text-only {
  display: flex;
  padding: 26px;
  align-items: flex-end;
  background: #111111;
}

.quote-card {
  width: 100%;
  color: #ffffff;
  font-size: 28px;
  line-height: 1.08;
  font-weight: 500;
  text-align: left;
}

.quote-card small {
  display: block;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  line-height: 1.4;
}

.card footer {
  padding: 16px 26px 24px;
}

.meta {
  min-height: 21px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}

.title-row h2 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 400;
}

.score {
  align-self: end;
  color: var(--text);
  font-family: "SF Mono", "IBM Plex Mono", monospace;
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px 36px 44px;
  color: var(--muted);
  font-size: 14px;
}

.empty {
  padding: 84px 20px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .grid {
    column-count: 2;
  }
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 34px 1fr 34px;
    padding: 14px 18px 0;
  }

  .nav-pills {
    gap: 2px;
  }

  .nav-pill {
    height: 34px;
    padding: 0 9px;
    font-size: 13px;
  }

  .search-button {
    width: 34px;
    height: 34px;
  }

  .search-button svg {
    width: 16px;
    height: 16px;
  }

  main {
    padding: 64px 14px 36px;
  }

  .hero {
    margin-bottom: 54px;
  }

  .status-pill {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .status-pill span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(42px, calc((100vw - 28px) / 5.76), 128px);
    line-height: 0.86;
  }

  .toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
  }

  .search-field input {
    margin: 0;
    padding: 0;
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
  }

  .search-field input::-webkit-search-cancel-button,
  .search-field input::-webkit-search-decoration,
  .search-field input::-webkit-search-results-button,
  .search-field input::-webkit-search-results-decoration {
    display: none;
    -webkit-appearance: none;
  }

  .filters {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

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

  .grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    column-count: initial;
    column-gap: initial;
  }

  .card {
    display: block;
    min-height: 0;
    margin: 0;
    break-inside: auto;
    page-break-inside: auto;
  }

  .media-frame {
    min-height: 0;
    padding: 0;
  }

  .media-frame.text-only {
    padding: 24px;
  }

  .card footer {
    padding: 14px 18px 18px;
  }
}
