:root {
  --ink: #080808;
  --paper: #f4f4f1;
  --panel: #deded8;
  --line: #1a1a1a;
  --muted: #62625e;
  --signal: #a92a20;
  --white: #ffffff;
  --space-1: .5rem;
  --space-2: .75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

button, input, select { font: inherit; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: -5rem;
  background: var(--white);
  border: 2px solid var(--ink);
  padding: .75rem 1rem;
}

.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: .75rem clamp(1rem, 3vw, 3rem);
  background: var(--ink);
  color: var(--white);
  border-bottom: 4px solid var(--signal);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  text-decoration: none;
  letter-spacing: .04em;
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border: 1px solid #5b5b5b;
  filter: contrast(1.12) grayscale(1);
}

.brand span { display: grid; line-height: 1.05; }
.brand strong { font-family: "Arial Narrow", Arial, sans-serif; font-size: 1.15rem; letter-spacing: .08em; }
.brand small { margin-top: .32rem; color: var(--signal); font-size: .72rem; font-weight: 800; letter-spacing: .16em; }

nav { display: flex; gap: clamp(.75rem, 2.2vw, 2rem); }
nav a, footer a { font-size: .88rem; font-weight: 700; text-underline-offset: .28rem; }
nav a:hover, footer a:hover { color: #e15a4e; }

.search-stage {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(340px, 1.25fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
  min-height: 350px;
  padding: clamp(2.75rem, 6vw, 5rem) clamp(1rem, 5vw, 5rem);
  background: var(--ink);
  color: var(--white);
  border-bottom: 1px solid #4b4b4b;
}

.account, .section-kicker {
  margin: 0 0 var(--space-2);
  color: var(--signal);
  font-family: "Arial Narrow", Arial, sans-serif;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2, h3 { font-family: "Arial Narrow", Arial, sans-serif; line-height: 1; }
h1 { max-width: 10ch; margin: 0 0 var(--space-4); font-size: clamp(2.8rem, 5vw, 4.5rem); letter-spacing: -.045em; }
.title-block > p:last-child { max-width: 38rem; margin: 0; color: #cbc9c2; font-size: 1.05rem; }

.search-panel label { display: block; margin-bottom: .75rem; font-size: .9rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.search-row { position: relative; }
.search-row input {
  width: 100%;
  min-height: 68px;
  padding: 0 7rem 0 1.25rem;
  border: 2px solid var(--white);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
}
.search-row input::placeholder { color: #73736f; }
.search-row input:focus { border-color: var(--white); outline: none; box-shadow: inset 0 -5px 0 var(--signal); }
.clear-button {
  position: absolute;
  right: .65rem;
  top: .65rem;
  bottom: .65rem;
  min-width: 5.2rem;
  border: 0;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  cursor: pointer;
}
.clear-button:hover { background: var(--signal); color: var(--white); }
.search-hint { margin: .75rem 0 0; color: #aeadab; font-size: .85rem; }

.catalogue { padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1rem, 3vw, 3rem) var(--space-7); background: var(--paper); }
.catalogue-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: var(--space-5); }
h2 { margin: 0; font-size: clamp(2.1rem, 4vw, 3.7rem); letter-spacing: -.035em; }
.result-count { margin: 0; color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-filters { display: flex; gap: .35rem; overflow-x: auto; padding: .2rem 0; scrollbar-width: thin; }
.section-filters button {
  flex: 0 0 auto;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: .6rem .8rem;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
}
.section-filters button:hover { background: var(--panel); }
.section-filters button[aria-pressed="true"] { background: var(--signal); border-color: var(--signal); color: var(--white); }

.sort-control { display: grid; flex: 0 0 180px; gap: .25rem; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.sort-control select { min-height: 42px; border: 1px solid var(--ink); border-radius: 0; background: var(--white); padding: 0 .6rem; font-size: .86rem; text-transform: none; }

.status, .empty-state { border: 2px solid var(--ink); padding: 1.25rem; background: var(--white); }
.status { margin-bottom: var(--space-4); }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.product-card { min-width: 0; padding: 1rem; background: var(--white); }
.product-card:hover .product-image-wrap { border-color: var(--signal); }
.product-image-link { display: block; text-decoration: none; }
.product-image-wrap { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #ededeb; border: 2px solid transparent; }
.product-image { width: 100%; height: 100%; object-fit: contain; }
.image-fallback { position: absolute; inset: 0; display: none; align-items: end; justify-content: center; padding: 1rem; background: #090909 url("assets/gatsby-dept-logo.png") center / cover no-repeat; color: #fff; font-family: "Arial Narrow", Arial, sans-serif; font-size: .68rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.image-fallback:not([hidden]) { display: flex; }
.image-fallback { text-shadow: 0 1px 3px #000; }
.product-meta { display: flex; justify-content: space-between; gap: 1rem; margin: .75rem 0 .45rem; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.product-meta p { margin: 0; }
.product-name { min-height: 2.4em; margin: 0 0 1.1rem; font-size: clamp(1.25rem, 1.8vw, 1.75rem); letter-spacing: -.02em; overflow-wrap: anywhere; }
.product-bottom { display: flex; align-items: end; justify-content: space-between; gap: .75rem; }
.product-price { margin: 0; font-size: 1.02rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.product-notes { min-height: 1.2em; margin: .12rem 0 0; color: var(--muted); font-size: .74rem; }
.product-link { display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: .55rem .7rem; border: 1px solid var(--signal); background: var(--signal); color: var(--white); font-size: .8rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.product-link:hover { background: #7d1e17; border-color: #7d1e17; }
.alternate-links { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.alternate-links summary { width: fit-content; cursor: pointer; color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.alternate-links summary:hover, .alternate-links summary:focus-visible { color: var(--signal); }
.alternate-list { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .65rem; }
.alternate-list a { border: 1px solid var(--ink); padding: .4rem .55rem; color: var(--ink); font-size: .72rem; font-weight: 800; text-decoration: none; }
.alternate-list a:hover, .alternate-list a:focus-visible { background: var(--ink); color: var(--white); }
.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state h3 { margin: 0 0 .6rem; font-size: 2rem; }
.empty-state p { margin: 0 auto 1.3rem; max-width: 34rem; color: var(--muted); }
.empty-state button, .load-more { border: 2px solid var(--ink); border-radius: 0; background: var(--ink); color: var(--white); padding: .8rem 1.2rem; font-weight: 800; cursor: pointer; }
.empty-state button:hover, .load-more:hover { background: var(--signal); border-color: var(--signal); }
.load-more-wrap { display: flex; justify-content: center; padding-top: 2rem; }

.about-section { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(0, 1.2fr); gap: clamp(2rem, 8vw, 8rem); padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 5vw, 5rem); background: var(--ink); color: var(--white); border-top: 4px solid var(--signal); }
.about-section .section-kicker { color: #e15a4e; }
.about-section p { color: #cdcdc8; }
.about-section strong, .about-section a { color: var(--white); }
.about-section p { max-width: 48rem; }
.source-link { margin-top: 1.6rem; }
.source-link a { font-weight: 800; text-underline-offset: .25rem; }

footer { display: flex; justify-content: space-between; gap: 2rem; padding: 1.5rem clamp(1rem, 3vw, 3rem); background: #171717; color: var(--white); border-top: 1px solid #444; }
footer p { margin: 0; }
footer div { display: flex; flex-wrap: wrap; gap: 1.25rem; }

.cookie-banner { position: fixed; z-index: 50; left: 1rem; right: 1rem; bottom: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; max-width: 920px; margin: 0 auto; padding: .9rem 1rem; background: var(--white); border: 1px solid var(--ink); border-top: 4px solid var(--signal); }
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; font-size: .9rem; }
.cookie-banner div { display: flex; gap: .5rem; flex: 0 0 auto; }
.cookie-banner button { border: 1px solid var(--ink); background: transparent; padding: .65rem .75rem; font-weight: 800; cursor: pointer; }
.cookie-banner button:last-child { background: var(--ink); color: var(--white); }
.cookie-banner button:hover { background: var(--signal); border-color: var(--signal); color: var(--white); }

.legal-page main { max-width: 850px; margin: 0 auto; padding: clamp(3rem, 8vw, 7rem) 1rem; }
.legal-page h1 { max-width: none; font-size: clamp(2.8rem, 6vw, 5rem); }
.legal-page h2 { margin: 2.4rem 0 .75rem; font-size: 1.65rem; }
.legal-page p, .legal-page li { color: #343330; }
.legal-page .updated { margin-bottom: 3rem; color: var(--muted); font-size: .9rem; }
.legal-page .back-link { display: inline-block; margin-top: 2rem; font-weight: 800; text-underline-offset: .25rem; }

@media (max-width: 1050px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .site-header { position: relative; align-items: center; }
  nav a:not(:first-child) { display: none; }
  .search-stage { grid-template-columns: 1fr; min-height: 0; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { align-items: stretch; flex-direction: column; }
  .section-filters { width: 100%; }
  .sort-control { flex-basis: auto; width: 100%; }
  .about-section { grid-template-columns: 1fr; }
  .cookie-banner { align-items: stretch; flex-direction: column; gap: 1rem; }
  .cookie-banner div { justify-content: flex-end; }
}

@media (max-width: 520px) {
  .brand img { width: 46px; height: 46px; }
  .search-stage { padding-top: 2.5rem; }
  h1 { font-size: 2.85rem; }
  .catalogue-heading { align-items: flex-start; flex-direction: column; gap: .5rem; }
  .product-grid { grid-template-columns: 1fr; }
  .product-name { min-height: 0; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
