/* things — a collection of practical consumerism
   Neutral gallery: white page, lit plates, near-black ink. */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-y: scroll;
}
body, h1, h2, h3, p, ul, ol, li, figure, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --paper:    #ffffff;
  --paper-2:  #ffffff;
  --plate:    #ffffff;
  --ink:      #111111;
  --ink-2:    #57544e;
  --ink-3:    #918d85;
  --rule:     #e3e0d9;
  --rule-2:   #d3cfc6;
  --accent:   #3f5c4a;
  --accent-2: #587a63;
  --shadow:   0 1px 2px rgba(28, 25, 20, 0.04), 0 8px 24px -12px rgba(28, 25, 20, 0.14);
  --shadow-lift: 0 2px 4px rgba(28, 25, 20, 0.05), 0 18px 40px -16px rgba(28, 25, 20, 0.22);

  --font: "Century Gothic", CenturyGothic, "URW Gothic", AppleGothic,
          ui-rounded, "Avenir Next", Avenir, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --page:  1180px;
  --gutter: clamp(1.25rem, 4vw, 2.75rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
/* ---------- base ---------- */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.home-main { min-height: calc(100vh + 8rem); }

::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); }

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- masthead ---------- */
.masthead {
  position: relative;
  background: var(--paper);
}
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 72px;
}
.wordmark {
  position: absolute;
  left: max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter)));
  top: 50%;
  display: inline-flex;
  align-items: center;
  transform: translateY(-50%);
}
.wordmark__logo {
  width: 28px;
  height: 28px;
}
.back-link {
  position: static;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  margin-top: 3.5rem;
  padding: 0.62rem 0.9rem;
  color: var(--ink-2);
  font-size: 0.82rem;
  line-height: 1;
  background: transparent;
  border: 1px solid #e8e8e8;
  border-radius: 999px;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}
.back-link span:first-child { font-size: 1.15rem; line-height: 0.7; }
.back-link:hover { color: var(--ink); background: #eeeeee; border-color: #dedede; }
@media (max-width: 900px) {
  .back-link {
    position: absolute;
    top: -3.85rem;
    left: 50%;
    margin-top: 0;
    transform: translateX(-50%);
  }
}

/* ---------- opening statement ---------- */
.opening {
  padding-top: clamp(2rem, 5vw, 3.75rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
}
.opening h1 {
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  line-height: 1.24;
  font-weight: 700;
  letter-spacing: -0.024em;
  text-wrap: balance;
}
/* ---------- catalog toolbar ---------- */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.45rem 0.7rem;
}
.filters {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  font-size: 0.82rem;
}
.filters__list { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.55rem; overflow: hidden; }
.filters__list::-webkit-scrollbar { display: none; }
.filter {
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
  padding: 0.45rem 0.8rem;
  white-space: nowrap;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 0.55rem;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.filter::after {
  display: none;
}
.filter:hover { color: var(--ink); border-color: var(--ink-3); background: var(--paper-2); }
.filter[aria-pressed="true"] {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
  font-weight: 700;
}
.catalog-search {
  flex: 0 1 min(15rem, 28vw);
  display: flex;
  align-items: center;
  height: 2.25rem;
  min-width: 6rem;
  padding-inline: 0.75rem;
  border: 1px solid var(--rule-2);
  border-radius: 0.55rem;
  background: var(--paper);
  transition: border-color 0.18s ease;
}
.catalog-search:focus-within { border-color: var(--ink); }
.catalog-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
}
.catalog-search input::placeholder { color: var(--ink-3); }
.catalog-sort {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.catalog-sort__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.25rem;
  padding: 0.4rem 0.85rem 0.4rem 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
  transition: background-color 0.18s ease;
}
.catalog-sort__trigger:hover { background: #f3f3f3; }
.catalog-sort__trigger-label { color: var(--ink-2); }
.catalog-sort__trigger strong { font-weight: 600; }
.catalog-sort__chevron {
  width: 0.52rem;
  height: 0.52rem;
  margin-left: 0.25rem;
  border-right: 1.5px solid var(--ink-2);
  border-bottom: 1.5px solid var(--ink-2);
  transform: translateY(-0.12rem) rotate(45deg);
}
.catalog-sort__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.6rem);
  right: 0;
  width: max-content;
  min-width: 14rem;
  padding: 0.45rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 1rem;
  box-shadow: 0 14px 34px rgba(28, 25, 20, 0.12);
}
.catalog-sort__menu[hidden] { display: none; }
.catalog-sort__option {
  position: relative;
  display: block;
  width: 100%;
  padding: 0.72rem 2.25rem 0.72rem 0.8rem;
  color: var(--ink);
  border-radius: 0.65rem;
  text-align: left;
  font-size: 0.86rem;
}
.catalog-sort__option:hover,
.catalog-sort__option:focus-visible { background: #f3f3f3; }
.catalog-sort__option[aria-checked="true"] { font-weight: 600; }
.catalog-sort__option[aria-checked="true"]::after {
  content: "✓";
  position: absolute;
  right: 0.8rem;
  color: var(--ink-2);
  font-size: 1.1rem;
  line-height: 1;
}

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.7rem, 1.5vw, 1.1rem);
  padding-top: clamp(1.25rem, 2.5vw, 2rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.home-main + .footer { margin-top: clamp(6rem, 12vw, 12rem); }

.card {
  display: block;
  background: var(--plate);
  border: 1px solid var(--rule);
  padding: 0.5rem;
  transition: border-width 0.22s var(--ease);
}
.card:hover,
.card:focus-visible { border-width: 2px; }
.card__plate {
  position: relative;
  aspect-ratio: 1;
  background: #ffffff;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  padding: 8%;
}
.card__plate img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: scale 0.22s var(--ease);
}
.card:hover .card__plate img,
.card:focus-visible .card__plate img { scale: 1.02; }
.card[data-slug="logitech-pro-x-superlight"] .card__plate img { transform: scale(1.35); }
.card[data-slug="beats-pill"] .card__plate img { transform: scale(1.2); }
.card[data-slug="iphone-17"] .card__plate img { transform: scale(1.12); }
.card[data-slug="abercrombie-open-hem-sweatpants"] .card__plate img { transform: scale(1.12); }

.card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.45rem 0.15rem;
  margin-top: 0;
}
.card__name {
  min-width: 0;
  font-size: 0.93rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card__price {
  flex: none;
  font-size: 0.82rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (max-width: 680px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .catalog-search { flex-basis: 10rem; }
}
@media (max-width: 760px) {
  .catalog-search { flex-basis: 8rem; }
  .filters__list .filter:nth-child(5) { display: none; }
}
@media (max-width: 640px) {
  .catalog-toolbar { gap: 0.6rem; }
  .catalog-search { flex-basis: 6.5rem; }
  .filters__list { gap: 0.4rem; }
  .filter { padding-inline: 0.62rem; }
  .filters__list .filter:nth-child(4) { display: none; }
  .catalog-sort__trigger { gap: 0.3rem; padding-inline: 0.7rem; }
  .catalog-sort__chevron { margin-left: 0.1rem; }
}
@media (max-width: 480px) {
  .catalog-search { flex-basis: 5.5rem; min-width: 5.5rem; }
  .filters__list .filter:nth-child(3) { display: none; }
  .catalog-sort__trigger-label { display: none; }
  .catalog-sort__trigger { min-width: 6.8rem; }
}
@media (max-width: 400px) {
  .catalog-search { flex-basis: 5rem; min-width: 5rem; }
  .filters__list .filter:nth-child(2) { display: none; }
  .catalog-sort__trigger { min-width: 6.4rem; }
}
@media (max-width: 640px) {
  .catalog-sort__menu { right: 0; }
}

/* ---------- footer ---------- */
.footer {
  background: var(--paper);
  padding-block: clamp(2rem, 4vw, 3rem);
}
.footer__fine {
  margin-top: 0;
  padding-top: 0;
  font-size: 0.72rem;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- detail page ---------- */
.detail {
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
  padding-bottom: clamp(2rem, 5vw, 3rem);
}

.detail__focus {
  position: relative;
  top: -1rem;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: clamp(1.25rem, 3vw, 2.75rem);
  align-items: stretch;
}
@media (max-width: 900px) {
  .detail__focus { grid-template-columns: 1fr; gap: 2rem; }
}

.detail__visual { position: sticky; top: 82px; }
@media (max-width: 900px) { .detail__visual { position: static; } }
.detail__headline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin-bottom: 1.25rem;
}
.detail__headline .detail__title {
  min-width: 0;
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail__headline .detail__price {
  flex: none;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.2;
}
.viewer__plate {
  position: relative;
  aspect-ratio: 1;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
.viewer__photo {
  position: absolute;
  inset: 6%;
  width: 88%;
  height: 88%;
  object-fit: contain;
  transition: opacity 0.4s var(--ease);
}

.detail__copy {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
@media (min-width: 901px) {
  .detail__copy { transform: translateX(-2rem); }
}
.detail__description {
  width: 100%;
  max-width: 32rem;
  margin-top: 0;
}
.detail__description p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.72;
  color: var(--ink-2);
}

.buys {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.55rem;
  width: 100%;
  margin-top: 1.5rem;
}
.buy {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.62rem 1.05rem;
  border-radius: 4px;
  border: 1px solid var(--rule-2);
  font-size: 0.85rem;
  transition: background-color 0.22s ease, color 0.22s ease,
              border-color 0.22s ease;
}
.buy--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  font-weight: 700;
}
.buy--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.buy:not(.buy--primary):hover { border-color: var(--ink); }
.buy svg { flex: none; opacity: 0.6; }
.price-estimate {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.28rem;
  margin-top: 1rem;
  font-size: 0.94rem;
  line-height: 1.72;
  color: var(--ink-2);
  text-align: left;
}
.price-estimate__time {
  color: #b4552f;
  font-weight: 700;
}
.price-estimate__target {
  color: var(--accent);
  font-weight: 700;
}
@media (max-width: 900px) {
  .detail__copy { min-height: 0; }
}

/* ---------- misc pages ---------- */
.prose { max-width: 38rem; padding-top: clamp(3rem, 8vw, 5rem); padding-bottom: clamp(4rem, 9vw, 7rem); }
.prose h1 { font-size: clamp(1.6rem, 3.4vw, 2.15rem); font-weight: 700; letter-spacing: -0.024em; line-height: 1.2; }
.prose p { margin-top: 1.1rem; font-size: 0.95rem; line-height: 1.72; color: var(--ink-2); }
.prose h2 { margin-top: 2.5rem; font-size: 0.95rem; font-weight: 700; padding-bottom: 0.7rem; border-bottom: 1px solid var(--rule); }

.empty { padding: 4rem 0; color: var(--ink-3); font-size: 0.9rem; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(10px); }
.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.card.reveal.in {
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease),
              border-width 0.22s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
