@font-face {
  font-family: "DM Sans";
  src: url("fonts/DM_Sans/DMSans-VariableFont_opsz,wght.ttf") format("truetype-variations");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("fonts/DM_Sans/DMSans-Italic-VariableFont_opsz,wght.ttf") format("truetype-variations");
  font-weight: 100 1000;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Monofonto";
  src: url("fonts/monofonto%20rg.otf") format("opentype");
  font-display: swap;
}

:root {
  --bg: #e1dbcf;
  --fg: #1a1a1a;
  --muted: #8a8275;
  --hairline: #dcd3c0;
  --tile: #e8e0cd;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Monofonto", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover { opacity: 0.5; }

.tile:hover { opacity: 1; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

button:hover { opacity: 0.5; }

/* ---------- NAV ---------- */

.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 32px 48px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav__left { justify-self: start; }
.nav__center { display: flex; gap: 32px; }
.nav__right { justify-self: end; }

.nav__link.is-active { text-decoration: underline; }

.nav__logo {
  display: inline-block;
  line-height: 0;
}
.nav__logo img {
  display: block;
  height: 22px;
  width: auto;
}

/* ---------- LAYOUT ---------- */

.page {
  padding: 0 48px 96px;
}

.page--narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 48px 96px;
}

/* ---------- FILTER BAR ---------- */

.filter-bar {
  display: flex;
  gap: 28px;
  padding-top: 48px;
  align-items: flex-start;
}

.dropdown {
  position: relative;
}

.dropdown__trigger {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.1s;
}

.dropdown__trigger:hover { color: var(--fg); opacity: 1; }

.dropdown__trigger.is-active {
  color: var(--fg);
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px;
}

.dropdown__menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-width: 110px;
  padding: 6px 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 100;
}

.dropdown.is-open .dropdown__menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown__item {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  background: none;
  border: none;
  padding: 7px 0;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: opacity 0.1s;
}

.dropdown__item:hover { opacity: 0.5; }

.dropdown__item.is-active {
  border-bottom: 1px solid var(--fg);
  padding-bottom: 5px;
}

.dropdown__item--disabled {
  color: var(--muted);
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* ---------- GRID ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile-min, 200px), 1fr));
  column-gap: 32px;
  row-gap: 32px;
  padding-top: 48px;
}

.tile {
  display: block;
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 240px;
}

.tile__media {
  position: relative;
  overflow: hidden;
}

.tile__media::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  pointer-events: none;
  transition: border-color 0.1s;
}

.tile:hover .tile__media::after {
  border-color: rgba(0, 0, 0, 0.12);
}

.tile__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--tile);
  object-fit: cover;
}

.tile__label {
  margin-top: 24px;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.tile__name {
  margin-top: 6px;
  text-align: center;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- BROWSE: LOCKED VIEWPORT, ONLY THE GRID SCROLLS ---------- */

body.browse {
  --browse-max: 1080px;
  --tile-min: 200px;
  --gutter: 48px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Center nav, content, and footer in one narrow column so they stay aligned */
body.browse .nav,
body.browse .page,
body.browse .footer {
  width: 100%;
  max-width: var(--browse-max);
  margin-inline: auto;
}

body.browse .nav,
body.browse .footer {
  flex: 0 0 auto;
}

body.browse .footer {
  margin-top: 0;
}

body.browse .page {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 0 0 var(--gutter);
}

body.browse .filter-bar {
  flex: 0 0 auto;
  margin-bottom: 48px;
}

body.browse .grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-top: 24px;
  padding-right: var(--gutter);
  padding-bottom: 32px;
}

@media (max-width: 900px) {
  body.browse { --gutter: 24px; }
}

/* Thin, square, grey scrollbar with no track/lane (WebKit / Blink).
   The standard scrollbar-width / scrollbar-color props are
   intentionally NOT set: defining them makes Chrome ignore
   ::-webkit-scrollbar and use the rounded OS scrollbar. Square
   corners are WebKit-only. */
body.browse .grid::-webkit-scrollbar {
  width: 10px;
}

body.browse .grid::-webkit-scrollbar-track {
  background: transparent;
}

body.browse .grid::-webkit-scrollbar-thumb {
  background: var(--muted);
  border: 0;
  border-radius: 0;
}

body.browse .grid::-webkit-scrollbar-thumb:hover {
  background: #6f6857;
}

body.browse .grid::-webkit-scrollbar-button,
body.browse .grid::-webkit-scrollbar-corner {
  display: none;
  background: transparent;
}

/* ---------- DETAIL ---------- */

.detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  padding-top: 64px;
  align-items: start;
}

.detail__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--tile);
  object-fit: cover;
}

.detail__media {
  display: flex;
  flex-direction: column;
}

.detail__sample-notice {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.detail__code {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.detail__name {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  margin: 8px 0 12px;
  letter-spacing: -0.01em;
}

.specs {
  border-top: 1px solid var(--hairline);
  margin-bottom: 32px;
}

.specs--grouped {
  margin-top: 8px;
}

.specs__group {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  padding: 16px 0 6px;
  border-bottom: 1px solid var(--hairline);
}
.specs__group:first-child { padding-top: 4px; }

.specs__row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}

.specs__key {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.specs__val {
  font-family: var(--sans);
  font-size: 13px;
}

.detail__desc {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 52ch;
}

.btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 4px;
  cursor: pointer;
}

.btn--block {
  display: inline-block;
}

.back {
  display: inline-block;
  margin-top: 64px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- TECH SPECS ---------- */

.tech-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-top: 24px;
}

/* ---------- CART ---------- */

.cart {
  padding-top: 80px;
}

.cart__empty {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 32px 0;
}

.cart__row {
  display: grid;
  grid-template-columns: 80px 1fr 120px 80px;
  gap: 24px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--hairline);
}

.cart__row:first-of-type { border-top: 1px solid var(--hairline); }

.cart__code {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.cart__name { font-size: 14px; }

.cart__qty {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.cart__remove {
  justify-self: end;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.cart__checkout {
  display: block;
  text-align: right;
  padding: 16px 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- CHECKOUT ---------- */

.checkout {
  padding-top: 80px;
}

.checkout__field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 32px 0;
}

.checkout__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.checkout__input {
  font-family: var(--sans);
  font-size: 16px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--fg);
  background: transparent;
  outline: none;
  width: 100%;
  max-width: 480px;
}

.checkout__success {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 32px 0 8px;
}

.checkout__followup {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--fg);
}

.checkout__error {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b04545;
  margin: 12px 0 24px;
  max-width: 520px;
  line-height: 1.6;
}

.requested {
  margin-top: 24px;
  padding: 16px 0 8px;
}

.requested__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.requested__row {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  gap: 24px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}

.requested__code {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.requested__name { font-size: 14px; }

.requested__qty {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: right;
}

/* ---------- ABOUT ---------- */

.about {
  padding-top: 80px;
}

.about h1 {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 32px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 22ch;
}

.about h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 40px 0 12px;
}

.about p {
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 20px;
}

.about a {
  border-bottom: 1px solid var(--fg);
  padding-bottom: 1px;
}

/* ---------- CUSTOM CURSOR ---------- */

@media (pointer: fine) {
  body,
  a,
  button { cursor: none; }
}

.cursor {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
}

.cursor-dot {
  width: 5px;
  height: 5px;
  background-color: #000;
  border-radius: 50%;
  position: absolute;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease-out, background-color 0.2s ease;
  will-change: transform;
}

.cursor-ring {
  width: 16px;
  height: 16px;
  border: 1px solid #000;
  border-radius: 50%;
  position: absolute;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 0.15s ease-out, border-color 0.2s ease;
  will-change: transform;
}

.cursor-ring.is-hovering {
  transform: translate(-50%, -50%) scale(1.75);
}

@media (max-width: 768px), (pointer: coarse) {
  .cursor { display: none; }
  body,
  a { cursor: auto; }
  button { cursor: pointer; }
}

/* ---------- FOOTER ---------- */

.footer {
  margin-top: 96px;
  padding: 32px 48px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer > span { flex: 1; }
.footer > span:last-child { text-align: right; }

.footer__more-info {
  flex: 1;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 900px) {
  .nav { padding: 24px 24px; }
  .page, .page--narrow { padding: 0 24px 64px; }
  .footer { padding: 24px; }
  .detail {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 32px;
  }
  .tech-specs {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .cart__row {
    grid-template-columns: 60px 1fr 80px 60px;
  }
}

@media (max-width: 600px) {
  .nav {
    padding: 20px 20px;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    column-gap: 18px;
  }
  .nav__center {
    grid-column: auto;
    justify-self: center;
    justify-content: center;
    gap: 20px;
    margin-top: 0;
  }
  .nav__left { display: block; }
  .nav__right { justify-self: end; }
  .nav__link { white-space: nowrap; }
  .grid {
    row-gap: 28px;
  }
  .cart__row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px 16px;
  }
  .cart__code { grid-column: 1; grid-row: 1; }
  .cart__name { grid-column: 1; grid-row: 2; }
  .cart__qty { grid-column: 2; grid-row: 1; text-align: right; }
  .cart__remove { grid-column: 2; grid-row: 2; }
}

@media (max-width: 768px) {
  /* Unlock the browse viewport so the full page scrolls naturally */
  body.browse {
    height: auto;
    overflow: visible;
    display: block;
    --tile-min: 140px;
  }

  body.browse .nav,
  body.browse .page,
  body.browse .footer {
    max-width: none;
  }

  body.browse .page {
    flex: none;
    display: block;
    min-height: auto;
    padding: 0 20px 64px;
  }

  body.browse .filter-bar {
    padding-top: 32px;
    margin-bottom: 24px;
  }

  body.browse .grid {
    flex: none;
    overflow: visible;
    min-height: auto;
    padding: 0;
    column-gap: 16px;
    row-gap: 20px;
  }

  body.browse .footer {
    margin-top: 48px;
    flex: none;
  }
}
