@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(/assets/fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(/assets/fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(/assets/fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(/assets/fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }

:root {
  /* Self-healing cutting mat */
  --mat: #1E5A4C;
  --mat-deep: #174A3E;
  --mat-line: rgba(255, 255, 255, .07);
  --mat-major: rgba(255, 255, 255, .15);
  --mat-ink: #F4F7F5;
  --mat-soft: #B9D3CA;
  /* Page: grey primer, white panels */
  --primer: #E9ECE8;
  --panel: #FFFFFF;
  --ink: #18201D;
  --muted: #56625D;
  --rule: #CDD3CE;
  /* Price label and status */
  --label: #F2C230;
  --label-ink: #2B2206;
  --in: #1C7C45;
  --pre: #2D5FB8;
  --coming: #9A6408;
  --out: #7C8580;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--primer); color: var(--ink); font: 400 1.0625rem/1.55 var(--body); }
a { color: var(--mat); text-underline-offset: .15em; }
a:hover { color: var(--mat-deep); }
:focus-visible { outline: 3px solid var(--label); outline-offset: 2px; border-radius: 2px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 2rem, 68rem); margin-inline: auto; }

/* The mat: minor grid every 12px, major every 60px */
.mat {
  background-color: var(--mat);
  background-image:
    linear-gradient(var(--mat-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-major) 1px, transparent 1px),
    linear-gradient(var(--mat-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line) 1px, transparent 1px);
  background-size: 60px 60px, 60px 60px, 12px 12px, 12px 12px;
  background-position: -1px -1px;
  color: var(--mat-ink);
}
header.mat + main > .mat { background-position: -1px -1px; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; }
.brand { font: 700 1.5rem/1 var(--cond); letter-spacing: .01em; color: var(--mat-ink); text-decoration: none; }
.brand:hover { color: #fff; }
.mini-search input {
  width: min(16rem, 46vw); padding: .45rem .7rem; border: 0; border-radius: 4px;
  font: 400 1rem var(--body); background: rgba(255, 255, 255, .92); color: var(--ink);
}

/* Home hero */
.hero { padding: 2.5rem 0 3rem; }
.hero h1 { font: 700 clamp(3rem, 9vw, 5.75rem)/.9 var(--cond); margin: 0 0 1.25rem; letter-spacing: -.01em; }
.search input {
  width: 100%; max-width: 40rem; padding: 1rem 1.1rem 1.35rem; border: 0; border-radius: 4px 4px 2px 2px;
  font: 600 1.35rem/1.2 var(--body); color: var(--ink);
  /* steel-rule edge: ticks every 6px, longer every 30px */
  background-color: #FFFFFF;
  background-image: linear-gradient(90deg, #8E9893 1px, transparent 1px), linear-gradient(90deg, #BCC3BF 1px, transparent 1px);
  background-size: 30px 10px, 6px 5px;
  background-position: 1rem 100%, 1rem 100%;
  background-repeat: repeat-x;
  box-shadow: 0 2px 0 var(--mat-deep);
}
.search input::placeholder { color: #8A948F; font-weight: 400; }
.sub { max-width: 40rem; margin: 1rem 0 0; color: var(--mat-soft); font-size: 1rem; }
.results { max-width: 40rem; margin: .5rem 0 0; background: var(--panel); color: var(--ink); border-radius: 4px; }
.results:empty { display: none; }
.results .none { padding: .9rem 1rem; color: var(--muted); }

/* Panels and kit lists */
.cols { display: grid; gap: 1.25rem; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); padding: 1.75rem 0 2.5rem; }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 1.1rem 1.25rem 1.25rem; }
.panel h2 { font: 700 1.6rem/1.1 var(--cond); margin: 0 0 .5rem; }
.kits { list-style: none; margin: 0; padding: 0; }
.kits li + li { border-top: 1px solid var(--rule); }
.kits a {
  display: grid; grid-template-columns: 1fr auto; column-gap: 1rem; padding: .6rem 0;
  color: var(--ink); text-decoration: none;
}
.results.kits a { padding: .6rem 1rem; }
.kits a:hover .t { text-decoration: underline; }
.kits .t { font-weight: 600; line-height: 1.3; }
.kits .p { font: 700 1.25rem/1.2 var(--cond); font-variant-numeric: tabular-nums; text-align: right; }
.kits .w { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; }
.quiet { color: var(--muted); }
.small { font-size: .9rem; }

/* Kit page */
.kit-head { padding: 1.5rem 0 1.75rem; }
.kit-head h1 { font: 700 clamp(2rem, 6vw, 3.5rem)/1 var(--cond); margin: 0; max-width: 22ch; }
.kit-head .meta { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin: .6rem 0 0; color: var(--mat-soft); }
.kit { padding: 1.5rem 0 2.5rem; }
.lead { font-size: 1.2rem; margin: 0 0 1rem; max-width: 60ch; }
.lead strong { font: 700 1.45rem var(--cond); }
.table-wrap { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.offers { width: 100%; border-collapse: collapse; }
.offers th, .offers td { padding: .8rem 1rem; text-align: left; vertical-align: middle; }
.offers thead th { font: 600 .9rem var(--body); color: var(--muted); border-bottom: 1px solid var(--rule); }
.offers tbody tr + tr { border-top: 1px solid var(--rule); }
.offers tbody th { font-weight: 600; }
.offers .num { text-align: right; }
.offers .price { font: 700 1.6rem/1 var(--cond); font-variant-numeric: tabular-nums; white-space: nowrap; }
.offers .save { color: var(--muted); font-size: .95rem; }
.offers .act { text-align: right; }
.offers tr.best { background: #FFF9E3; }
.offers tr.dim .price { color: var(--muted); }
.tag {
  display: inline-block; margin-left: .6rem; padding: .1rem .55rem .1rem .9rem; vertical-align: .1em;
  background: var(--label); color: var(--label-ink); font: 700 .85rem/1.4 var(--cond); letter-spacing: .02em;
  clip-path: polygon(.45rem 0, 100% 0, 100% 100%, .45rem 100%, 0 50%);
}
.go {
  display: inline-block; padding: .5rem .9rem; border-radius: 4px; white-space: nowrap;
  background: var(--mat); color: #fff; font-weight: 600; text-decoration: none;
}
.go:hover { background: var(--mat-deep); color: #fff; }
tr.dim .go { background: transparent; color: var(--mat); box-shadow: inset 0 0 0 1px var(--rule); }

.st { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; white-space: nowrap; }
.st::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; }
.st-in_stock { color: var(--in); }
.st-preorder { color: var(--pre); }
.st-stock_coming { color: var(--coming); }
.st-out_of_stock { color: var(--out); }
.st-out_of_stock::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }

.kit .panel { margin-top: 1.5rem; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .rrp { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .ax { fill: var(--muted); font: 400 12px var(--body); }
.chart .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.chart .line.off { stroke-dasharray: 3 5; stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; list-style: none; padding: 0; margin: .5rem 0 0; font-size: .95rem; }
.sw { display: inline-block; width: 1rem; height: .25rem; margin-right: .4rem; vertical-align: middle; border-radius: 2px; }
.sw-off { background: repeating-linear-gradient(90deg, var(--muted) 0 3px, transparent 3px 7px); }

.prose { padding: 1.5rem 0 2.5rem; max-width: 42rem; }
.prose h2 { font: 700 1.6rem/1.1 var(--cond); margin: 1.75rem 0 .4rem; }

.foot { border-top: 1px solid var(--rule); padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: .9rem; }
.foot p { max-width: 70ch; margin: 0 0 .6rem; }

/* Phones: offers table becomes stacked rows */
@media (max-width: 640px) {
  .offers thead { display: none; }
  .offers, .offers tbody, .offers tr { display: block; }
  .offers tr { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .85rem 1rem; }
  .offers th, .offers td { padding: 0; }
  .offers tbody th { grid-column: 1; }
  .offers .price { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .offers .save { grid-column: 1; }
  .offers td:nth-child(4) { grid-column: 1; }
  .offers .act { grid-column: 1 / -1; text-align: left; margin-top: .4rem; }
  .offers .act .go { display: block; text-align: center; }
  .tag { margin-left: .4rem; }
  .mini-search input { width: 40vw; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
