:root {
  --paper: #eef1f3;
  --card: #ffffff;
  --ink: #10243b;
  --steel: #56687a;
  --rule: #cbd3da;
  --face: #1a3350;
  --face-2: #142a44;
  --amber: #f0a202;
  --amber-ink: #3a2700;
  --led: #2fb36b;
  --led-off: #2c4562;
  --warn: #a4400f;
  --focus: #f0a202;
  --w: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c1826; --card: #12233a; --ink: #e8eef4; --steel: #9fb0c1; --rule: #253c57;
    --face: #1b3654; --face-2: #15304c; --led-off: #2a4562; --warn: #f08a4b; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0c1826; --card: #12233a; --ink: #e8eef4; --steel: #9fb0c1; --rule: #253c57;
  --face: #1b3654; --face-2: #15304c; --led-off: #2a4562; --warn: #f08a4b; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif; font-variation-settings: "wdth" 100;
  font-size: 17px; line-height: 1.55;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

.pn { font-variation-settings: "wdth" 82; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.money { font-variant-numeric: tabular-nums; font-weight: 700; }

/* Header */
.top { background: var(--face-2); color: #fff; }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; font-variation-settings: "wdth" 120; font-weight: 800; font-size: 20px; letter-spacing: -.01em; white-space: nowrap; }
.brand small { font-variation-settings: "wdth" 90; font-weight: 500; font-size: 13px; color: #a9bccf; letter-spacing: 0; }
.top nav { margin-left: auto; display: flex; gap: 18px; align-items: center; font-size: 15px; }
.top nav a { text-decoration: none; color: #d8e3ee; }
.top nav a:hover { color: #fff; text-decoration: underline; }
.cartlink { display: inline-flex; align-items: center; gap: 8px; background: var(--amber); color: var(--amber-ink) !important; font-weight: 700; padding: 7px 14px; border-radius: 3px; }
.cartlink b { font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .top nav .hide-sm { display: none; } .brand small { display: none; } }

/* Hero: the part-number search */
.hero { padding: 56px 0 40px; }
.hero h1 {
  margin: 0 0 18px; font-variation-settings: "wdth" 118; font-weight: 800; letter-spacing: -.02em;
  font-size: clamp(34px, 5.4vw, 64px); line-height: 1.02; max-width: 15ch;
}
.hero p { margin: 0 0 28px; color: var(--steel); max-width: 60ch; font-size: 18px; }
.finder { position: relative; max-width: 860px; }
.finder label { display: block; font-weight: 650; margin-bottom: 8px; }
.finder input {
  width: 100%; font: inherit; font-size: clamp(20px, 2.6vw, 28px); font-variation-settings: "wdth" 86; font-weight: 600;
  padding: 18px 20px; border: 3px solid var(--ink); border-radius: 4px; background: var(--card); color: var(--ink);
}
.finder input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 30%, transparent); }
.tries { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--steel); align-items: center; }
.tries button { font: inherit; font-variation-settings: "wdth" 84; font-weight: 600; background: none; border: 1px solid var(--rule); color: var(--ink); padding: 4px 10px; border-radius: 3px; cursor: pointer; }
.tries button:hover { border-color: var(--ink); }
.results { margin-top: 18px; }
.results:empty { display: none; }

/* The rack: one faceplate per category, one port per listing */
.rack { margin: 24px 0 64px; background: var(--face-2); padding: 10px; border-radius: 6px; }
.unit {
  display: grid; grid-template-columns: 18px minmax(160px, 260px) 1fr auto 18px; align-items: center; gap: 16px;
  background: var(--face); color: #fff; text-decoration: none; min-height: 52px; padding: 0 10px;
  border-top: 1px solid #2a4a6c; border-bottom: 1px solid #0b1b2d;
}
.unit + .unit { margin-top: 4px; }
.unit .ear { width: 10px; height: 14px; border-radius: 5px; background: var(--face-2); box-shadow: inset 0 1px 2px #0008; justify-self: center; }
.unit .name { font-variation-settings: "wdth" 110; font-weight: 700; font-size: 17px; }
.unit .ports { display: flex; flex-wrap: wrap; gap: 3px; padding: 8px 0; }
.unit .ports i { width: 9px; height: 7px; background: var(--led-off); border-radius: 1px; }
.unit .ports i.on { background: var(--led); box-shadow: 0 0 4px color-mix(in srgb, var(--led) 70%, transparent); }
.unit .count { font-variant-numeric: tabular-nums; color: #c5d4e3; font-size: 14px; white-space: nowrap; }
.unit:hover { background: #21405f; }
.unit:hover .name { text-decoration: underline; }
@media (max-width: 640px) {
  .unit { grid-template-columns: 1fr auto; padding: 8px 14px; }
  .unit .ear { display: none; }
  .unit .ports { grid-column: 1 / -1; order: 3; padding-top: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .rack.boot .ports i.on { animation: blink .9s steps(2, jump-none) 1; animation-delay: calc(var(--d, 0) * 1ms); }
  @keyframes blink { 0% { background: var(--led-off); box-shadow: none; } 100% { background: var(--led); } }
}

/* Sections */
.band { padding: 56px 0; border-top: 1px solid var(--rule); }
.band h2 { font-variation-settings: "wdth" 112; font-weight: 800; font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.015em; margin: 0 0 12px; line-height: 1.1; }
.band .lede { color: var(--steel); max-width: 62ch; margin: 0 0 28px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 3px solid var(--ink); }
.steps li { padding: 18px 20px 0 0; }
.steps li strong { display: block; font-variation-settings: "wdth" 110; font-size: 19px; margin-bottom: 6px; }
.steps li span.n { font-variation-settings: "wdth" 82; font-weight: 700; color: var(--steel); display: block; margin-bottom: 4px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } .steps li { padding-bottom: 14px; border-bottom: 1px solid var(--rule); } }

.quote { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: start; }
@media (max-width: 860px) { .quote { grid-template-columns: 1fr; gap: 20px; } }
form.req { display: grid; gap: 14px; }
form.req label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
form.req input, form.req textarea { font: inherit; padding: 12px 14px; border: 1.5px solid var(--rule); border-radius: 4px; background: var(--card); color: var(--ink); }
form.req input:focus, form.req textarea:focus { border-color: var(--ink); outline: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; padding: 13px 22px; border-radius: 4px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--face); border-color: var(--face); color: #fff; }
.btn.buy { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.btn.buy:hover { background: #ffb31a; border-color: #ffb31a; color: var(--amber-ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Listing rows */
.list { border-top: 3px solid var(--ink); }
.row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.row .thumb { width: 76px; height: 76px; background: #fff; border-radius: 3px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--rule); }
.row .thumb img { max-height: 70px; object-fit: contain; }
.row .pn { font-size: 18px; text-decoration: none; }
.row .pn:hover { text-decoration: underline; }
.row .t { color: var(--steel); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .price { text-align: right; font-size: 19px; }
.row .price small { display: block; font-weight: 500; font-size: 13px; color: var(--steel); }
.cond { display: inline-block; font-size: 12.5px; font-weight: 650; padding: 1px 7px; border-radius: 2px; margin-left: 8px; vertical-align: 2px; border: 1px solid currentColor; }
.cond.refurbished { color: var(--steel); }
.cond.new { color: #15804a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cond.new { color: var(--led); } }
@media (max-width: 640px) {
  .row { grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; }
  .row .thumb { width: 64px; height: 64px; grid-row: span 2; }
  .row .price { text-align: left; }
  .row .add { grid-column: 2; justify-self: start; }
}
.add { padding: 9px 16px; font-size: 15px; }

.crumbs { font-size: 14px; color: var(--steel); padding: 22px 0 6px; }
.crumbs a { color: var(--steel); }
h1.page { font-variation-settings: "wdth" 116; font-weight: 800; font-size: clamp(30px, 4.4vw, 48px); letter-spacing: -.02em; margin: 6px 0 8px; line-height: 1.05; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 18px 0 14px; }
.toolbar input, .toolbar select { font: inherit; padding: 10px 12px; border: 1.5px solid var(--rule); border-radius: 4px; background: var(--card); color: var(--ink); }
.toolbar input { flex: 1 1 260px; }

/* Product */
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; padding: 18px 0 56px; }
@media (max-width: 860px) { .product { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.photo { background: #fff; border: 1px solid var(--rule); border-radius: 4px; aspect-ratio: 1; display: grid; place-items: center; padding: 24px; }
.photo img { max-height: 100%; object-fit: contain; }
.product .pn.big { font-size: clamp(30px, 4vw, 46px); line-height: 1.05; display: block; margin: 0 0 8px; }
.product h1 { font-size: 19px; font-weight: 500; color: var(--steel); margin: 0 0 22px; line-height: 1.4; }
.pricebox { border-top: 3px solid var(--ink); border-bottom: 1px solid var(--rule); padding: 18px 0; margin-bottom: 22px; }
.pricebox .money { font-size: 40px; line-height: 1; }
.pricebox s { color: var(--steel); margin-left: 10px; font-size: 16px; }
.pricebox p { margin: 10px 0 0; font-size: 15px; color: var(--steel); }
.buyrow { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.qty { display: inline-flex; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; }
.qty button { width: 42px; font: inherit; font-size: 20px; background: var(--card); color: var(--ink); border: 0; cursor: pointer; }
.qty input { width: 56px; text-align: center; border: 0; font: inherit; font-weight: 700; background: var(--card); color: var(--ink); }
.facts { margin: 22px 0 0; padding: 0; list-style: none; font-size: 15px; }
.facts li { padding: 8px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 14px; }
.facts li b { font-weight: 600; }
.specs { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 8px; }
.specs th, .specs td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.specs th { width: 42%; font-weight: 600; padding-right: 16px; }
.added { margin-top: 12px; font-weight: 600; min-height: 1.5em; }

/* Cart */
.cart .row { grid-template-columns: 76px minmax(0, 1fr) auto auto auto; }
.totals { margin-left: auto; max-width: 380px; padding: 18px 0; }
.totals div { display: flex; justify-content: space-between; padding: 6px 0; }
.totals .grand { border-top: 3px solid var(--ink); margin-top: 8px; padding-top: 12px; font-size: 22px; font-weight: 800; }
.note { color: var(--steel); font-size: 15px; }
.err { color: var(--warn); font-weight: 600; }
.remove { background: none; border: 0; color: var(--steel); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }

/* Footer */
footer { background: var(--face-2); color: #c5d4e3; padding: 40px 0; margin-top: 40px; font-size: 15px; }
footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
footer a { color: #fff; }
footer strong { color: #fff; display: block; margin-bottom: 6px; font-variation-settings: "wdth" 110; }
@media (max-width: 760px) { footer .wrap { grid-template-columns: 1fr; } }
.facts li span { min-width: 0; overflow-wrap: anywhere; }
.buyrow .btn.ghost { flex: 1 1 auto; }
