@font-face {
  font-family: "Inter Tight";
  src: url("fonts/of-inter-tight-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/of-inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --field: #151513;
  --lime: #faff69;
  --grey: #414141;
  --panel: #1c1c19;
  --panel-2: #242420;
  --white: #f4f4ef;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  background: var(--field);
}

body {
  overflow-x: hidden;
  background: var(--field);
  color: var(--white);
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

/* top bar ------------------------------------------------------------ */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 0 14px;
  background: var(--field);
  border-bottom: 1px solid var(--panel-2);
}

.claim {
  margin: 0;
  font-family: "Inter Tight", sans-serif;
  font-weight: 800;
  font-size: clamp(15px, 1.35vw, 19px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--white);
}

.filter {
  display: flex;
  width: 100%;
}

.q {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--panel-2);
  border-radius: 0;
  color: var(--white);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  line-height: 1;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.q::placeholder {
  color: var(--grey);
}

.q:focus {
  border-color: var(--lime);
}

.q::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* the wall ----------------------------------------------------------- */

.wall {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  column-gap: 14px;
  row-gap: 2px;
  padding: 16px 0 calc(46vh + 30px);
  overflow-x: hidden;
}

.model {
  margin: 0;
  padding: 2px 0;
  background: none;
  border: 0;
  border-radius: 0;
  text-align: left;
  font-family: "Inter Tight", sans-serif;
  font-weight: 800;
  font-size: clamp(15px, 1.4vw, 20px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: var(--grey);
  overflow-wrap: break-word;
  cursor: pointer;
  transform-origin: left center;
  transition: color 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

.model[hidden] {
  display: none;
}

.model:focus {
  outline: none;
}

.model:focus-visible {
  outline: 1px solid var(--lime);
  outline-offset: 3px;
}

.wall.is-dimmed .model {
  opacity: 0.13;
}

.model.is-lit {
  color: var(--lime);
  opacity: 1;
  transform: scale(1.045);
  z-index: 1;
}

.wall.is-dimmed .model.is-lit {
  opacity: 1;
}

/* card --------------------------------------------------------------- */

.card {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  max-height: 46vh;
  overflow-y: auto;
  padding: 20px 18px 16px;
  background: var(--panel);
  border: 1px solid var(--panel-2);
  box-shadow: 0 -28px 40px -14px #151513;
  overscroll-behavior: contain;
}

.card-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.card-name {
  margin: 0 0 16px;
  font-family: "Inter Tight", sans-serif;
  font-weight: 800;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--white);
}

.card.is-pinned .card-name {
  color: var(--lime);
}

.specs {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.specs > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.specs dt {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
}

.specs dd {
  margin: 0;
  font-size: 14.5px;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.fits {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fits-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
}

.fits-value {
  font-family: "Inter Tight", sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--lime);
}

.home {
  margin-top: 16px;
  align-self: flex-end;
  padding-bottom: 1px;
  color: var(--grey);
  font-size: 12.5px;
  text-decoration: none;
  border-bottom: 1px solid var(--panel-2);
}

.home:hover,
.home:focus-visible {
  color: var(--lime);
  border-color: var(--lime);
  outline: none;
}

/* wide phone / tablet ------------------------------------------------ */

@media (min-width: 640px) {
  .page {
    padding: 0 32px;
  }

  .wall {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    grid-auto-flow: row;
    padding-bottom: calc(40vh + 30px);
  }

  .card {
    left: 32px;
    right: 32px;
    max-height: 40vh;
    padding: 22px 24px 18px;
  }

  .specs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px 20px;
  }

  .card-name {
    margin-bottom: 18px;
  }

  .fits {
    margin-top: 16px;
    padding-top: 12px;
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
  }

  .fits-value {
    font-size: 16px;
  }

  .home {
    margin-top: 4px;
  }
}

/* wide screens: card to the side ------------------------------------- */

@media (min-width: 1080px) {
  body {
    overflow: hidden;
  }

  .page {
    height: 100vh;
    padding: 0 44px;
    padding-right: 410px;
  }

  .bar {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    padding: 26px 0 16px;
  }

  .filter {
    flex: 0 0 auto;
    width: 200px;
  }

  .q {
    width: 200px;
  }

  .wall {
    padding: 16px 0 40px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0, #000 90%, transparent 100%);
  }

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

  .card {
    left: auto;
    right: 44px;
    top: 88px;
    bottom: auto;
    height: auto;
    width: 330px;
    max-height: none;
    overflow: visible;
    padding: 26px 24px 22px;
  }

  .card-name {
    font-size: clamp(26px, 2.4vw, 36px);
    margin-bottom: 22px;
  }

  .specs {
    grid-template-columns: 1fr 1fr;
    gap: 16px 12px;
  }

  .fits {
    margin-top: 22px;
    padding-top: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .fits-value {
    font-size: 15px;
  }

  .home {
    position: fixed;
    right: 44px;
    bottom: 24px;
    z-index: 11;
    margin: 0;
    font-size: 13px;
  }
}

/* reduced motion ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .model {
    transition: none;
  }

  .model.is-lit {
    transform: none;
  }
}
