:root {
  --bg: #f3efe6;
  --surface: #fbf9f4;
  --ink: #1d2118;
  --muted: #5d6253;
  --line: #d9d3c4;
  --olive: #4a5a2b;
  --olive-dark: #36431e;
  --signal: #d4612a;
  --tile: #e4dfd1;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(29, 33, 24, .14);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151812;
    --surface: #1d2119;
    --ink: #ece8dc;
    --muted: #a3a693;
    --line: #333829;
    --olive: #8fa65a;
    --olive-dark: #a8bf72;
    --signal: #e8784a;
    --tile: #262b20;
    --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 "Archivo", system-ui, sans-serif;
}
a { color: var(--olive); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--signal); }

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  font: 500 .75rem "JetBrains Mono", monospace; letter-spacing: .08em;
  background: var(--olive); color: var(--bg);
  padding: 6px 7px; border-radius: 6px;
}
.brand-name { font-size: 1.05rem; }
.brand-name b { font-weight: 800; }
.cart-btn {
  font: 600 .95rem "Archivo", sans-serif; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.cart-count {
  background: var(--signal); color: #fff; border-radius: 999px;
  min-width: 22px; height: 22px; display: inline-grid; place-items: center;
  font-size: .8rem; padding: 0 6px;
}

/* Logo */
.brand-logo { width: 36px; height: 36px; border-radius: 9px; display: block; }

/* Hero: copy on the left, product photos on the right, signal rings behind */
.hero {
  position: relative; overflow: hidden;
  max-width: 1100px; margin: 0 auto;
  padding: clamp(40px, 7vw, 90px) clamp(16px, 4vw, 40px) clamp(32px, 5vw, 56px);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center;
}
.hero-rings { position: absolute; width: min(900px, 120vw); right: -22%; top: 50%; transform: translateY(-50%); color: var(--signal); z-index: 0; pointer-events: none; }
.hero-copy, .hero-media { position: relative; z-index: 1; min-width: 0; }
.eyebrow { font: 500 .8rem "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .14em; color: var(--signal); margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); font-weight: 800; max-width: 16ch; letter-spacing: -.02em; text-wrap: balance; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 52ch; margin: 0 0 24px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-cta .btn-ghost { padding: 12px 20px; font-size: 1rem; }
.bands { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 26px 0 0; }
.bands li {
  font: 500 .78rem "JetBrains Mono", monospace; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line); border-left: 3px solid var(--signal); border-radius: 4px;
  padding: 4px 10px; color: var(--ink); background: var(--surface);
}
.hero-media { display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: auto auto; gap: 12px; }
.hm { margin: 0; border-radius: 12px; overflow: hidden; background: var(--tile); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-main { grid-row: 1 / 3; aspect-ratio: 3 / 4; }
.hm-a, .hm-b { aspect-ratio: 4 / 3; }
.freq-tag {
  position: absolute; left: -14px; bottom: 22px;
  display: flex; flex-direction: column; gap: 1px;
  background: #0f1b2d; color: #f3efe6; border-radius: 8px; padding: 8px 12px;
  box-shadow: var(--shadow); border-left: 3px solid #f26a21;
}
.freq-tag span { font: 500 .66rem "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .12em; color: #f6a26e; }
.freq-tag b { font: 500 1.25rem "JetBrains Mono", monospace; letter-spacing: .04em; }
.freq-tag b::after { content: " MHz"; font-size: .7rem; color: #b9c0cc; }

/* Why-us strip */
.field-strip {
  max-width: 1100px; margin: 0 auto; padding: 22px clamp(16px, 4vw, 40px);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.fs-item { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.fs-item svg { flex: 0 0 34px; width: 34px; height: 34px; fill: none; stroke: var(--signal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fs-item h3 { font-size: .98rem; margin: 0 0 3px; }
.fs-item p { margin: 0; font-size: .88rem; color: var(--muted); }

/* Category photo tiles */
.cats { max-width: 1100px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 4px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cat {
  position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); padding: 0; cursor: pointer; background: var(--tile); font: inherit; text-align: left;
}
.cat img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.cat:hover img, .cat:focus-visible img { transform: scale(1.04); }
.cat span {
  position: absolute; inset: auto 0 0 0; padding: 36px 16px 14px; color: #f6f3ec;
  background: linear-gradient(to top, rgba(12, 16, 10, .88), rgba(12, 16, 10, 0));
  display: flex; flex-direction: column; gap: 2px;
}
.cat b { font-size: 1.15rem; font-weight: 800; }
.cat small { font-size: .85rem; color: #d7d6cc; }
.cat:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-rings { right: -40%; top: 72%; }
  .field-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .field-strip, .cats { grid-template-columns: 1fr; }
  .cat { aspect-ratio: 16 / 8; }
  .freq-tag { left: 8px; bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .cat img { transition: none; } }

/* Buttons */
.btn {
  display: inline-block; font: 600 1rem "Archivo", sans-serif; text-decoration: none;
  border-radius: 8px; padding: 12px 20px; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--olive); color: var(--bg); }
.btn-primary:hover { background: var(--olive-dark); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; font-size: 1.1rem; color: var(--muted); cursor: pointer; padding: 6px; }

/* Shop */
.shop { max-width: 1100px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 60px; }
.shop-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.shop-head h2 { font-size: 1.6rem; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 500 .85rem "Archivo", sans-serif; color: var(--ink);
  border: 1px solid var(--line); background: var(--surface);
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.chip[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
  transition: transform .15s, box-shadow .15s; text-align: left; padding: 0; font: inherit; color: inherit;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-img { aspect-ratio: 4 / 3; background: var(--tile); position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--signal); color: #fff; font: 500 .72rem "JetBrains Mono", monospace;
  padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .06em;
}
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-body h3 { font-size: 1.02rem; margin: 0; }
.card-body p { margin: 0; color: var(--muted); font-size: .9rem; }
.price { font: 500 1rem "JetBrains Mono", monospace; margin-top: auto; padding-top: 8px; }

/* Placeholder art */
.ph { width: 100%; height: 100%; display: grid; place-items: center; }
.ph span { font: 500 clamp(1.4rem, 4vw, 2rem) "JetBrains Mono", monospace; color: var(--olive); opacity: .7; letter-spacing: .05em; }

/* Info */
.info {
  max-width: 1100px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 40px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px;
  border-top: 1px solid var(--line);
}
.info h3 { font-size: 1rem; }
.info p { margin: 0; color: var(--muted); }
.footer { text-align: center; padding: 28px 16px 40px; color: var(--muted); font-size: .85rem; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.footer p { margin: 0; }
.footer-logo { width: 44px; height: 44px; border-radius: 11px; }
.footer .signoff { font: 500 .8rem "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .14em; color: var(--signal); }

/* Dialog */
.dialog {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  border: 1px solid var(--line); border-radius: 14px; padding: 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(10, 12, 8, .55); }
.dialog-close-row { display: flex; justify-content: flex-end; padding: 6px 6px 0; position: absolute; right: 0; top: 0; z-index: 1; }
.pd { display: grid; grid-template-columns: 1fr 1fr; }
.pd-img { background: var(--tile); min-height: 280px; }
.pd-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-info { padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.pd-info h2 { font-size: 1.4rem; margin: 0; padding-right: 24px; }
.pd-info p { margin: 0; color: var(--muted); }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 4px; }
.field select, .qty input {
  width: 100%; font: inherit; padding: 9px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
@media (max-width: 640px) { .pd { grid-template-columns: 1fr; } .pd-img { min-height: 200px; } }

/* Drawer */
.scrim { position: fixed; inset: 0; background: rgba(10, 12, 8, .5); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 21;
  width: min(420px, 100vw); background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.2rem; }
.drawer-items { flex: 1; overflow-y: auto; padding: 8px 20px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line h4 { margin: 0; font-size: .95rem; }
.line .opts { color: var(--muted); font-size: .82rem; }
.line .lp { font-family: "JetBrains Mono", monospace; text-align: right; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { background: var(--bg); color: var(--ink); border: 0; width: 30px; height: 30px; cursor: pointer; font-size: 1rem; }
.stepper span { min-width: 30px; text-align: center; font-family: "JetBrains Mono", monospace; }
.remove { background: none; border: 0; color: var(--muted); font-size: .8rem; cursor: pointer; text-decoration: underline; justify-self: end; }
.drawer-foot { padding: 18px 20px 22px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.drawer-foot .row { display: flex; justify-content: space-between; font-size: 1.05rem; }
.drawer-foot p { margin: 0; }

/* Success page */
.center-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 40px 16px; }
.center-page h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }

/* Product gallery */
.pd-media { display: flex; flex-direction: column; background: var(--tile); }
.pd-media .pd-img { aspect-ratio: 1 / 1; min-height: 0; }
.thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; }
.thumb { flex: 0 0 56px; height: 56px; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: pointer; background: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-desc { white-space: pre-line; max-height: 220px; overflow-y: auto; }

/* Live shipping rates in the cart */
.ship-box { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ship-box label { font-weight: 600; font-size: .85rem; }
.ship-zip { display: flex; gap: 8px; }
.ship-zip input { flex: 1; min-width: 0; font: inherit; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.btn-ghost { background: var(--bg); color: var(--ink); border-color: var(--line); padding: 9px 14px; font-size: .9rem; }
.btn-ghost:disabled { opacity: .5; cursor: wait; }
#shipRates { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.rate { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: .88rem; }
.rate:has(input:checked) { border-color: var(--olive); background: color-mix(in srgb, var(--olive) 10%, transparent); }
.rate .svc small { display: block; color: var(--muted); font-size: .78rem; }
.rate .amt { font-family: "JetBrains Mono", monospace; }
.drawer-foot .row.small { font-size: .9rem; color: var(--muted); }

/* Embedded checkout page */
.checkout-page { max-width: 1000px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 60px; }
.checkout-page h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.checkout-page > p { margin: 0 0 20px; }
#checkout { background: #fff; border-radius: 12px; overflow: hidden; }

/* Header actions + email sign-up */
.top-actions { display: flex; gap: 8px; align-items: center; }
.signup { max-width: 1100px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px); display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; border-top: 1px solid var(--line); }
.signup h3 { margin: 0 0 4px; }
.signup p { margin: 0; }
.signup-form { display: flex; flex-wrap: wrap; gap: 8px; }
.signup-form input { flex: 1; min-width: 200px; font: inherit; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.signup-form p { flex-basis: 100%; }
@media (max-width: 720px) { .signup { grid-template-columns: 1fr; } }

/* Shop by radio: sidebar on wide screens, a dropdown on phones */
.shop-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.radio-side { position: sticky; top: 76px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px; }
.radio-side h3 { font-size: .95rem; margin: 0 6px 8px; }
.radio-list { display: flex; flex-direction: column; gap: 2px; }
.radio-brand { font: 500 .7rem "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .12em; color: var(--signal); margin: 10px 6px 2px; }
.radio-pick {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; border-radius: 6px; padding: 7px 8px; cursor: pointer;
  font: 500 .9rem "Archivo", sans-serif; color: var(--ink); text-align: left;
}
.radio-pick small { font: 500 .75rem "JetBrains Mono", monospace; color: var(--muted); }
.radio-pick:hover { background: var(--tile); }
.radio-pick[aria-pressed="true"] { background: var(--olive); color: var(--bg); }
.radio-pick[aria-pressed="true"] small { color: var(--bg); }
.radio-pick:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }
.radio-select-wrap { display: none; margin-bottom: 14px; }
.radio-note { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }
.linklike { background: none; border: 0; padding: 0; color: var(--olive); text-decoration: underline; cursor: pointer; font: inherit; }
.fits-any { align-self: flex-start; font: 500 .7rem "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
@media (max-width: 760px) {
  .shop-body { grid-template-columns: 1fr; }
  .radio-side { display: none; }
  .radio-select-wrap { display: block; }
}

/* Items that ship separately (e.g. the kit battery from Amazon) */
.ships-sep { margin: 0; padding: 10px 12px; border-radius: 8px; border-left: 4px solid var(--signal); background: color-mix(in srgb, var(--signal) 12%, transparent); font-size: .9rem; color: var(--ink); }
.ships-sep-line { color: var(--signal); }

/* Product page (/p/<id>) */
.pp { max-width: 1100px; margin: 0 auto; padding: 20px clamp(16px, 4vw, 40px) 60px; }
.pp-crumbs { color: var(--muted); margin: 0 0 16px; }
.pp-crumbs a { color: var(--muted); }
.pp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: start; }
.pp-main { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--tile); display: block; }
.pp-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 8px; }
.pp-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.pp-info h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.pp-price { font: 500 1.4rem "JetBrains Mono", monospace; margin: 0 0 10px; }
.pp-facts { padding-left: 18px; margin: 18px 0; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.pp-facts b { color: var(--ink); }
.pp-desc { color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.pp-related { margin-top: 40px; }
.pp-related h2 { font-size: 1.3rem; }
@media (max-width: 760px) { .pp-grid { grid-template-columns: 1fr; } }
