/* Vitrine — minimal functional layout.
   Colors/spacing live in custom properties so a later visual pass is a token swap. */

/* Supply (display) — headings & store names. Bolder weights. */
@font-face {
  font-family: "Supply";
  src: url("/fonts/Supply-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Supply";
  src: url("/fonts/Supply-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Supply";
  src: url("/fonts/Supply-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
/* 3270 (body) — everything else. */
@font-face {
  font-family: "3270";
  src: url("/fonts/3270-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e4e4e7;
  --accent: #1a1a1a;
  --accent-fg: #ffffff;
  --chip-bg: #f4f4f5;
  --radius: 6px;
  --gap: 0.75rem;
  --maxw: 1100px;
  --font-body: "3270", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-display: "Supply", system-ui, -apple-system, sans-serif;

  /* CGA palette, bright set (colors 9–14). Cohesive by construction:
     every channel is either 0x55 or 0xFF. */
  --cga-blue:    #5555ff; /*  9  light blue    */
  --cga-green:   #55ff55; /* 10  light green   */
  --cga-cyan:    #55ffff; /* 11  light cyan    */
  --cga-red:     #ff5555; /* 12  light red     */
  --cga-magenta: #ff55ff; /* 13  light magenta */
  --cga-yellow:  #ffff55; /* 14  yellow        */
}

/* One CGA color per tag. --tag-color drives button and icon styling. */
[data-tag="clothing"]    { --tag-color: var(--cga-blue); }
[data-tag="shoes"]       { --tag-color: var(--cga-red); }
[data-tag="jewelry"]     { --tag-color: var(--cga-yellow); }
[data-tag="bags"]        { --tag-color: var(--cga-green); }
[data-tag="eyewear"]     { --tag-color: var(--cga-cyan); }
[data-tag="accessories"] { --tag-color: var(--cga-magenta); }

* { box-sizing: border-box; }

/* Form controls don't inherit font-family by default. */
input, button, select, textarea { font-family: inherit; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.45;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.site-header h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
}

/* Expandable "about" / style-target description */
.about { margin: 0 0 1.25rem; max-width: 72ch; }
.about > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--muted);
  line-height: 1.5;
}
.about > summary::-webkit-details-marker { display: none; }
.about-summary strong { color: var(--fg); font-weight: 600; }
.about-toggle {
  flex: 0 0 auto;
  margin-top: 0.15rem;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  padding: 3px;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.about[open] .about-toggle { transform: rotate(-135deg); }
.about-body { margin-top: 0.75rem; color: var(--muted); }
.about-body p { margin: 0 0 0.75rem; }

.influences { margin-top: 0.9rem; }
.influences-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.influence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.influence-list li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  font-size: 0.8rem;
  padding: 0.2rem 0.55rem;
  background: #fff;
  border: 1px solid var(--fg);   /* squared off, black outline */
  color: var(--fg);
}
.influence-list .ref {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.influence-list .ref::before { content: "["; }
.influence-list .ref::after  { content: "]"; }

/* Filters */
.filters { display: flex; flex-direction: column; gap: var(--gap); margin-bottom: 1.25rem; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.search-box {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.5rem 0.35rem;
  font-size: 1rem;
  border: 0;
  background: transparent;
  color: var(--fg);
}
.search-box:focus { outline: none; }

.tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  border: 1px solid var(--fg);   /* black outline */
  border-radius: 0;               /* square corners */
  background: #fff;
  color: var(--fg);               /* black text */
  cursor: pointer;
}
.tag-btn:hover { border-color: var(--tag-color); }
.tag-btn.active {
  border-color: var(--tag-color);
  background: var(--tag-color);   /* solid tag color */
  color: #0a0a0a;                 /* black text */
}
/* Icons default to the tag color (.tag-icon); on a selected chip, go black. */
.tag-btn.active .tag-icon { color: #0a0a0a; }

.slider-row label { color: var(--muted); font-size: 0.9rem; }
#office-value {
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
  width: 4ch;                 /* fixed so "Any"/"XH+" don't shift the row */
  text-align: left;
}

/* Range slider — square, black-on-white to match the other filter controls. */
.slider-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 1 200px;
  height: 1.2rem;
  background: transparent;
  cursor: pointer;
}
.slider-row input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: #fff;
  border: 1px solid var(--fg);
  border-radius: 0;
}
.slider-row input[type="range"]::-moz-range-track {
  height: 6px;
  background: #fff;
  border: 1px solid var(--fg);
  border-radius: 0;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 16px;
  margin-top: -6px;               /* center the thumb on the track */
  background: var(--fg);
  border: 1px solid var(--fg);
  border-radius: 0;
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 16px;
  background: var(--fg);
  border: 1px solid var(--fg);
  border-radius: 0;
}
.slider-row input[type="range"]:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.meta-row { justify-content: space-between; }
.count {
  color: var(--fg);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.reset-btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  border: 1px solid var(--fg);   /* black outline */
  border-radius: 0;               /* square corners */
  background: #fff;
  color: var(--fg);               /* black text */
  cursor: pointer;
}
.reset-btn:hover { background: var(--fg); color: var(--bg); }

/* Table */
.table-wrap { overflow-x: auto; }
.shop-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;               /* explicit column widths, no overflow */
  font-size: 0.92rem;
}
.shop-table th, .shop-table td {
  text-align: left;
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
/* Column widths (table-layout: fixed). Description col has no width → takes the rest. */
.col-store { width: max(21%, 176px); }   /* never too narrow for a name like "A.W.A.K.E. MODE" */
.col-type  { width: 132px; }
.col-style { width: 74px; }
.col-min   { width: 62px; }
.col-max   { width: 72px; }
.col-cur   { width: 42px; }
.col-sale  { width: 54px; }
/* Knockout header row — black bar, white labels. */
.shop-table thead th {
  position: sticky;
  top: 0;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  white-space: nowrap;
  border-bottom: none;
}
.shop-table th:not(.no-sort) { cursor: pointer; user-select: none; }
.shop-table th:not(.no-sort):hover { text-decoration: underline; }
.sort-ind {
  display: inline-block;
  width: 0.7em;
  text-align: center;
  color: var(--bg);
  font-size: 0.8em;
}

.brand-inner { display: flex; align-items: center; }
.c-brand a {
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;   /* break long single-word names in a narrow column */
}
.c-brand a:hover { text-decoration: underline; }
.fav-slot {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.favicon { max-width: 16px; max-height: 16px; object-fit: contain; border-radius: 3px; }
.c-type { white-space: nowrap; }
/* Fixed 6-slot tag matrix: present = tag-color square + black icon, absent = black. */
.tag-matrix { display: flex; gap: 2px; }
.tsq {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  background: #000;              /* absent slot */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tsq.present { background: var(--tag-color); color: #000; }
.tsq svg { width: 12px; height: 12px; fill: currentColor; display: block; }
/* Inline tag icons (Phosphor SVGs, fill=currentColor) tinted to the tag color. */
.tag-icon { display: inline-flex; color: var(--tag-color, currentColor); }
.tag-icon svg { width: 1.15em; height: 1.15em; display: block; }
.c-fit { white-space: nowrap; color: var(--fg); }
.c-price, .c-sale, .c-cur { white-space: nowrap; text-align: right; }
.c-cur { text-align: center; cursor: default; }
.c-why { color: var(--muted); overflow: hidden; }
.why { display: flex; align-items: flex-start; gap: 0.4rem; cursor: pointer; }
.why:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.why-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.why.open .why-text { overflow: visible; white-space: normal; }
.why-icon {
  flex: 0 0 auto;
  margin-top: 0.35em;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  padding: 2.5px;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.why.open .why-icon { transform: rotate(-135deg); }

tr[hidden] { display: none; }

.empty { color: var(--muted); padding: 1.5rem 0; text-align: center; }

/* ===================================================================
   Designers Republic / WipEout control-panel details — black only.
   =================================================================== */

/* Inline coded micro-label (uppercase mono, tracked out). */
.code {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--fg);
  white-space: nowrap;
}
.code.bracket::before { content: "[ "; }
.code.bracket::after  { content: " ]"; }

/* Knockout label bar: solid black strip, white title + right-aligned code. */
.sysbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1ch;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.34rem 0.6rem;
}
.sysbar .sys-code { color: var(--bg); opacity: 0.85; letter-spacing: 0.16em; }

/* Diagonal slash-hatch divider strip. */
.hatch {
  height: 10px;
  background: repeating-linear-gradient(-60deg,
    var(--fg) 0 1px, transparent 1px 6px);
}

/* Labeled slash rule: a code label riding a hatched line. */
.sysrule {
  display: flex;
  align-items: center;
  gap: 0.7ch;
  margin: 0.6rem 0;
}
.sysrule::before,
.sysrule::after {
  content: "";
  flex: 1 1 auto;
  height: 8px;
  background: repeating-linear-gradient(-60deg,
    var(--fg) 0 1px, transparent 1px 6px);
}
.sysrule .code { flex: 0 0 auto; }

/* Fake barcode strip (irregular vertical bars). */
.barcode {
  height: 20px;
  width: 84px;
  background: repeating-linear-gradient(90deg,
    var(--fg) 0 1px, transparent 1px 2px,
    var(--fg) 2px 4px, transparent 4px 5px,
    var(--fg) 5px 6px, transparent 6px 9px,
    var(--fg) 9px 12px, transparent 12px 13px);
}

/* Module frame with overshooting corner "+" registration marks.
   ::before draws the two top marks, ::after the two bottom marks. */
.crop { position: relative; }
.crop::before,
.crop::after {
  content: "";
  position: absolute;
  left: -5px;
  right: -5px;
  height: 11px;
  pointer-events: none;
  background:
    linear-gradient(var(--fg), var(--fg)) left  center / 11px 1px no-repeat,
    linear-gradient(var(--fg), var(--fg)) left  center / 1px 11px no-repeat,
    linear-gradient(var(--fg), var(--fg)) right center / 11px 1px no-repeat,
    linear-gradient(var(--fg), var(--fg)) right center / 1px 11px no-repeat;
}
.crop::before { top: -6px; }
.crop::after  { bottom: -6px; }

/* Module layout */
.frame > .sysrule:first-child { margin-top: 0.2rem; }

.site-header { padding: 0.9rem 1rem 1rem; margin: 0 0 1.2rem; }
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.header-code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem 0.8rem;
}
.header-top + .hatch { margin: 0.7rem 0 0.9rem; }

/* Section bars sit just above their framed module. */
.sysbar { margin-top: 1.2rem; margin-bottom: 0.55rem; }
.filters.crop { padding: 0.9rem; }
.table-module.crop { padding: 0; }   /* table runs edge to edge inside its frame */
.filters { margin-bottom: 0; }

/* Bracket the search input like a data field: one border around [ input ],
   the input itself borderless so you type directly between the brackets. */
.search-row {
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.15rem;
  border: 1px solid var(--fg);
  padding: 0 0.55rem;
  background: #fff;
}
.search-row:focus-within { outline: 2px solid var(--fg); outline-offset: 2px; }
.search-row::before,
.search-row::after {
  content: "[";
  align-self: center;
  font-family: var(--font-body);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--fg);
}
.search-row::after { content: "]"; }

/* Office slider with a ruler tick strip beneath the track. */
.slider-wrap { display: inline-flex; flex-direction: column; flex: 0 1 220px; }
.slider-wrap input[type="range"] { flex: none; width: 100%; }
.slider-wrap .ticks {
  height: 5px;
  margin-top: 2px;
  /* 6 ticks: repeating gives 0/20/40/60/80%, second layer adds the 100% end tick. */
  background:
    repeating-linear-gradient(90deg, var(--fg) 0 1px, transparent 1px 20%),
    linear-gradient(90deg, var(--fg), var(--fg)) no-repeat right / 1px 100%;
}

/* ---- Responsive: progressively drop table columns, tighten padding ----
   Column order: 1 Store · 2 Type · 3 Style · 4 Min · 5 Max · 6 Cur · 7 Sale · 8 Desc
   Hidden by dropping both the <col> (reclaims width) and the th/td cells. */
@media (max-width: 920px) {          /* − currency & sale + tighten (scale) padding */
  .col-cur, .col-sale { display: none; }
  .shop-table th:nth-child(6), .shop-table td:nth-child(6),
  .shop-table th:nth-child(7), .shop-table td:nth-child(7) { display: none; }
  .shop-table th, .shop-table td { padding: 0.5rem 0.35rem; }
}
@media (max-width: 820px) {          /* − style; Type → barcode (thin bars, no icons) */
  .col-style { display: none; }
  .shop-table th:nth-child(3), .shop-table td:nth-child(3) { display: none; }
  .col-type { width: 48px; }
  .tsq { width: 4px; height: 16px; }
  .tsq svg { display: none; }
}
@media (max-width: 540px) {          /* − description; Store absorbs the slack */
  .col-desc { display: none; }
  .shop-table th:nth-child(8), .shop-table td:nth-child(8) { display: none; }
  .col-store { width: auto; }
  .shop-table th, .shop-table td { padding: 0.4rem 0.3rem; }
  /* Reclaim space so Store keeps names like "A.W.A.K.E. MODE" on one line. */
  .container { padding-left: 0.6rem; padding-right: 0.6rem; }
  .col-type { width: 40px; }
  .tsq { width: 3px; }
  .col-min { width: 56px; }
  .col-max { width: 64px; }
}

@media (max-width: 640px) {
  .slider-wrap { flex: 1 1 auto; }
}
