/* gear.charlessieg.com, "Gear and Goods": the design system (docs/design.md is the contract). This file holds the tokens,
   the base, the masthead, the shelf strip, the phone's tab bar, the footer, and the parts every page shares (buttons,
   chips, plates, item cards, callouts). Page-type rules are in pages.css. Tokens live on :root for light, and twice for
   dark: under the media query (a visitor with no saved choice) and under [data-theme="dark"] (the toggle). The
   filter dialog is styled only with these tokens, in its own file. Hairlines take the place of shadows; corners are 0.25rem. */
:root {
  --paper: #F8F6F0;
  --paper-raised: #F3EFE6;
  --paper-sunk: #ECE7DC;
  --plate: #FFFFFF;
  --ink: #1A1918;
  --ink-2: #5A574F;
  --ink-3: #6A665C;
  --accent: #C85A32;
  --accent-text: #A23E18;
  --rule: #E2DED4;
  --rule-strong: #D5CEBF;
  --ok: #2E5A44;
  --warn: #A34828;
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 0.25rem;
  --max: 1280px;
  --margin: 1.25rem;
  --tabbar-h: 3.9rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131312;
    --paper-raised: #1C1C1A;
    --paper-sunk: #0E0E0D;
    --plate: #1C1C1A;
    --ink: #EDEAE2;
    --ink-2: #A8A398;
    --ink-3: #8E897E;
    --accent: #E59048;
    --accent-text: #E59048;
    --rule: #2A2927;
    --rule-strong: #3A3938;
    --ok: #8FBF9F;
    --warn: #EE8F6A;
  }
}

:root[data-theme="dark"] {
  --paper: #131312;
  --paper-raised: #1C1C1A;
  --paper-sunk: #0E0E0D;
  --plate: #1C1C1A;
  --ink: #EDEAE2;
  --ink-2: #A8A398;
  --ink-3: #8E897E;
  --accent: #E59048;
  --accent-text: #E59048;
  --rule: #2A2927;
  --rule-strong: #3A3938;
  --ok: #8FBF9F;
  --warn: #EE8F6A;
}

@media (min-width: 720px) { :root { --margin: 2rem; } }
@media (min-width: 1024px) { :root { --margin: 3.5rem; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; scroll-padding-bottom: calc(var(--tabbar-h) + 1px + env(safe-area-inset-bottom, 0px) + 0.75rem); }
@media (min-width: 720px) { html { scroll-padding-bottom: 1rem; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  overflow-wrap: break-word;
  padding-bottom: calc(var(--tabbar-h) + 1px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 720px) { body { padding-bottom: 0; } }
img, picture, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-text); text-decoration-color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; }
p, ul, ol, dl, figure, table { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; color: var(--ink); }
h1 { font-size: 2.75rem; line-height: 3rem; font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: 1.75rem; line-height: 2.25rem; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; line-height: 1.6rem; letter-spacing: -0.01em; }
@media (min-width: 720px) { h1 { font-size: 4rem; line-height: 4.25rem; letter-spacing: -0.04em; } }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--margin); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 0.5rem; top: -4rem; z-index: 30; padding: 0.5rem 0.9rem; background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: 0.8125rem; border-radius: var(--radius); }
.skip:focus { top: 0.5rem; }
.icon { width: 1.125rem; height: 1.125rem; flex: none; }

/* --- Labels: the mono voice (catalog numbers, eyebrows, captions) ------------------------------------------------ */
.eyebrow { font-family: var(--font-mono); font-size: 0.7rem; line-height: 0.95rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); }
.label { font-family: var(--font-mono); font-size: 0.7rem; line-height: 0.95rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.catno { font-family: var(--font-mono); font-size: 0.75rem; line-height: 1rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.lead { font-size: 1.25rem; line-height: 1.85rem; color: var(--ink-2); }
.ticks, .prose blockquote {
  --tick: var(--ink-3);
  --tick-size: 0.75rem;
  background-image: linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick));
  background-repeat: no-repeat;
  background-size: var(--tick-size) 1px, 1px var(--tick-size), var(--tick-size) 1px, 1px var(--tick-size), var(--tick-size) 1px, 1px var(--tick-size), var(--tick-size) 1px, 1px var(--tick-size);
  background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%;
}

/* --- Masthead, navigation, shelf strip ---------------------------------------------------------------------------- */
.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); }
.masthead__inner { display: flex; align-items: center; gap: 0.75rem 1.5rem; padding-block: 0.75rem; }
.brand { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.75rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.1; letter-spacing: -0.02em; text-transform: uppercase; }
.brand__by { display: none; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.nav { display: none; }
.nav ul { display: flex; gap: 0.25rem; }
.nav a { display: inline-block; padding: 0.5rem 0.75rem; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); border-radius: var(--radius); }
.nav a:hover { color: var(--ink); background: var(--paper-sunk); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; }
.masthead__tools { display: flex; align-items: center; gap: 0.5rem; }
.filter-open { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; padding: 0.4rem 0.7rem; border: 1px solid var(--ink-3); border-radius: var(--radius); background: var(--paper-raised); color: var(--ink-2); font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }
.filter-open:hover { border-color: var(--ink); color: var(--ink); }
.filter-open kbd { display: none; font: inherit; color: var(--ink-3); }
.theme { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; background: var(--paper-raised); color: var(--ink); border: 1px solid var(--ink-3); border-radius: var(--radius); cursor: pointer; }
.theme:hover { border-color: var(--ink); }
html:not(.js) .theme { display: none; }
html:not(.js) .filter-open kbd { display: none; }
.theme svg { width: 1.25rem; height: 1.25rem; }
.theme__sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme__sun { display: block; } :root:not([data-theme="light"]) .theme__moon { display: none; } }
:root[data-theme="dark"] .theme__sun { display: block; }
:root[data-theme="dark"] .theme__moon { display: none; }
@media (min-width: 720px) {
  .masthead__inner { display: grid; grid-template-columns: 1fr auto 1fr; padding-block: 1rem; }
  .brand__name { font-size: 1.5rem; }
  .brand__by { display: inline; }
  .nav { display: block; }
  .masthead__tools { justify-content: flex-end; }
  .filter-open kbd { display: inline; }
}
.rail { background: var(--paper-sunk); border-bottom: 1px solid var(--rule); }
.rail__row { display: flex; align-items: center; gap: 0.75rem; }
.rail__label { flex: none; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.rail__list { display: flex; flex: 1 1 auto; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.rail__list li + li::before { content: "/"; margin-inline: 0.15rem; color: var(--ink-3); font-family: var(--font-mono); font-size: 0.7rem; }
.rail__list li { display: flex; align-items: center; flex: none; }
.rail a { display: inline-block; white-space: nowrap; padding: 0.7rem 0.5rem; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); }
.rail a:hover { color: var(--ink); }
.rail a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.rail__num { font-weight: 600; color: var(--ink); }

/* The phone's four-tab bar: fixed, inside the safe-area inset; the body keeps room for it (see body). */
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 20; background: var(--paper-raised); border-top: 1px solid var(--rule-strong); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar ul { display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem; min-height: var(--tabbar-h); padding: 0.4rem 0.25rem; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); border-top: 2px solid transparent; }
.tabbar a:hover { color: var(--ink); }
.tabbar a[aria-current="page"] { color: var(--accent-text); border-top-color: var(--accent-text); }
.tabbar .icon { width: 1.4rem; height: 1.4rem; }
@media (min-width: 720px) { .tabbar { display: none; } }

/* --- Buttons, chips, links ---------------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.7rem 1.1rem; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; line-height: 1.2; text-transform: uppercase; text-decoration: none; border: 1px solid var(--ink); border-radius: var(--radius); transition: background-color 120ms linear, color 120ms linear, border-color 120ms linear; }
.btn--maker { background: var(--ink); color: var(--paper); }
.btn--maker:hover { background: var(--accent-text); border-color: var(--accent-text); color: var(--paper); }
.btn--amazon { background: transparent; color: var(--ink); }
.btn--amazon:hover { background: var(--ink); color: var(--paper); }
.arrow, .arrow-svg { display: inline-block; width: 0.95rem; height: 0.95rem; flex: none; }
.paid { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em; color: var(--ink-2); white-space: nowrap; }
.chip { display: inline-block; padding: 0.15rem 0.45rem; background: var(--paper-sunk); color: var(--ink-2); font-family: var(--font-mono); font-size: 0.68rem; line-height: 1rem; letter-spacing: 0.05em; text-transform: uppercase; border: 1px solid transparent; border-radius: var(--radius); white-space: nowrap; }
.chip--status { background: transparent; border-color: currentColor; font-weight: 500; }
.chip--ok { color: var(--ok); }
.chip--warn { color: var(--warn); }
.chip--link { color: var(--ink); text-decoration: none; background: var(--paper-raised); border-color: var(--ink-3); padding: 0.3rem 0.6rem; }
.chip--link:hover { border-color: var(--ink); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.more-link { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--ink); }
.more-link:hover { color: var(--accent-text); }

/* --- Plates: an illustration set on its field with right-angle corner ticks, and the caption that says what it is --- */
.plate { position: relative; }
.plate__frame { padding: 0.75rem; background-color: var(--plate); border: 1px solid var(--rule); border-radius: var(--radius); }
.plate__frame img, .plate__frame picture { width: 100%; }
.plate__caption { padding-top: 0.5rem; font-family: var(--font-mono); font-size: 0.6875rem; line-height: 0.95rem; letter-spacing: 0.02em; color: var(--ink-3); }
.photo-missing { display: grid; place-items: center; width: 100%; background: var(--paper-sunk); border: 1px dashed var(--rule-strong); color: var(--ink-2); font-family: var(--font-mono); font-size: 0.75rem; }
.photo-missing::after { content: "Illustration to come"; }

/* --- Item cards: plate, catalog number, status, name, maker, the one line, the tag, and the way in -------------------- */
.cards { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: flex; }
.card[hidden] { display: none; }
.card__link { display: flex; flex-direction: column; flex: 1; gap: 0.35rem; padding: 0.75rem; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.card__link:hover { border-color: var(--ink); color: var(--ink); }
.card__link:hover .card__name { color: var(--accent-text); }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin-top: 0.4rem; }
.card__shelf { margin-left: auto; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.card__name { font-size: 1.125rem; line-height: 1.4rem; font-weight: 600; letter-spacing: 0; }
.card__maker { font-style: italic; font-size: 0.85rem; line-height: 1.35rem; color: var(--ink-2); }
.card__line { font-size: 0.95rem; line-height: 1.55rem; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; padding-top: 0.75rem; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; }
.card__tag { color: var(--ink-3); }
.card__go { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: auto; font-weight: 600; color: var(--ink); }

/* --- Callouts and the section pattern ----------------------------------------------------------------------------- */
.callout { padding: 1.25rem 1.5rem; background-color: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--radius); }
.section { margin-block: 4rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0.5rem 1.5rem; margin-bottom: 1.5rem; }
.section-head h2 { margin-top: 0.25rem; }
.section-head__note { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.empty { padding: 1.75rem; border: 1px dashed var(--rule-strong); border-radius: var(--radius); font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink-2); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.15rem 0.5rem; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; }
.crumbs a { color: var(--ink-2); }
/* A column is never narrower than its own number, so a date takes the room it needs and the counts share the rest. */
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(min-content, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 0.2rem; padding: 0.75rem 0.7rem; background: var(--paper-raised); }
@media (min-width: 420px) { .stat { padding: 0.9rem 1rem; } }
.stat__n { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 2.25rem; line-height: 2.25rem; letter-spacing: -0.02em; color: var(--accent); }
.stat__n--date { font-size: 1.15rem; line-height: 2.25rem; letter-spacing: -0.01em; color: var(--accent-text); white-space: nowrap; }
@media (min-width: 420px) { .stat__n--date { font-size: 1.4rem; } }
.stat__l { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }

/* --- Footer ------------------------------------------------------------------------------------------------------- */
.colophon { margin-top: 5rem; background: var(--paper-raised); border-top: 1px solid var(--rule-strong); }
.colophon__grid { display: grid; gap: 2rem; padding-block: 3rem 2rem; }
@media (min-width: 640px) { .colophon__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .colophon__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.colophon__name { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.02em; text-transform: uppercase; }
.colophon__dek { margin-top: 0.6rem; max-width: 32ch; font-size: 0.95rem; line-height: 1.55rem; color: var(--ink-2); }
.colophon h2 { margin-bottom: 0.75rem; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; line-height: 1rem; letter-spacing: 0.1em; text-transform: uppercase; }
.colophon li { padding-block: 0.15rem; font-size: 0.95rem; }
.colophon__spec li { font-family: var(--font-mono); font-size: 0.7rem; line-height: 1.1rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.colophon__fine { display: grid; gap: 0.4rem; padding-block: 1.25rem 2rem; border-top: 1px solid var(--rule); }
.colophon__fine p { max-width: 72ch; font-family: var(--font-mono); font-size: 0.6875rem; line-height: 1.1rem; letter-spacing: 0.02em; color: var(--ink-3); }

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