/* Signal -- the design system for the Electric Martini product archive.
 *
 * One hand-written stylesheet, no framework. It replaces Pure.css plus three
 * legacy sheets, so a page now loads a single blocking stylesheet instead of
 * four.
 *
 * The system is named for what defines it: a near-neutral slate UI where one
 * saturated orange is worn only by the Amazon call to action. That is the
 * isolation effect -- an element is noticed because nothing else on the page
 * looks like it -- and it is the reliable driver of click-through, not any
 * particular hue. Price movement indicators are deliberately neutral rather
 * than red and green, both so they do not leak chroma away from the button and
 * because the plus and minus signs already carry the meaning without relying
 * on colour.
 *
 * Every colour pair used for text clears WCAG AA (4.5:1) in both schemes.
 */

/* -------------------------------------------------------------- tokens -- */

:root {
    --bg: #f6f7f8;
    --card: #ffffff;
    --ink: #14171a;
    --dim: #5a626b;
    --rule: #e1e5e9;
    --accent: #3d5a7a;
    --cta: #c2410c;
    --ctaInk: #ffffff;
    --tint: #eaeff4;
    --up: #6b6259;
    --dn: #59645c;
    --shadow: 20, 23, 26;
    --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    --r: 14px;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1013;
        --card: #161a1e;
        --ink: #e8ecf0;
        --dim: #98a1aa;
        --rule: #252b31;
        --accent: #8fb4dc;
        --cta: #f97316;
        --ctaInk: #14171a;
        --tint: #1b222a;
        --up: #b8ab9c;
        --dn: #a3b3a8;
        --shadow: 0, 0, 0;
    }
}

/* --------------------------------------------------------------- reset -- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16.5px;
    line-height: 1.6;
    letter-spacing: -.003em;
    font-variant-numeric: tabular-nums;
}

img,
svg {
    max-width: 100%;
}

a {
    color: inherit;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

button,
input {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 10px 16px;
    background: var(--ink);
    color: var(--bg);
}

.skip:focus {
    left: 0;
}

.wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 22px;
}

/* -------------------------------------------------------------- header -- */

header.site {
    padding: 18px 0;
}

.bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.mark {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.02em;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 9px;
}

.dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent);
    flex: none;
}

form.find {
    position: relative;
    flex: 1 1 240px;
    display: flex;
    max-width: 420px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 4px 4px 4px 16px;
}

form.find input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font-family: var(--mono);
    font-size: .84rem;
    padding: 8px 0;
}

form.find input:focus {
    outline: none;
}

form.find button {
    padding: 9px 18px;
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg);
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}

.hnav {
    display: flex;
    gap: 20px;
    font-size: .85rem;
    font-weight: 500;
}

.hnav a {
    color: var(--dim);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.hnav a:hover {
    color: var(--ink);
}

/* Search results are injected by search.js as a bare <ul><li><a>…</a>
   <span class="sku">…</span></li></ul>; the markup contract lives there. The
   box is a child of the form, so it anchors to the input on every page. */
.results {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 260px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--r);
    box-shadow: 0 12px 32px -12px rgba(var(--shadow), .26);
}

.results li {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: .9rem;
}

.results li+li {
    border-top: 1px solid var(--rule);
}

.results a {
    display: block;
    padding: 12px 0;
    min-height: 44px;
    text-decoration: none;
    font-weight: 600;
}

.results a:hover {
    color: var(--accent);
}

.results .sku {
    font-family: var(--mono);
    font-size: .74rem;
    color: var(--dim);
    flex: none;
}

/* ---------------------------------------------------------- breadcrumb -- */

nav.crumb {
    font-size: .8rem;
    color: var(--dim);
    padding: 8px 0 0;
}

nav.crumb a {
    color: var(--dim);
    text-decoration: none;
}

nav.crumb a:hover {
    color: var(--ink);
}

nav.crumb li {
    display: inline;
}

nav.crumb li+li::before {
    content: "\2192";
    margin: 0 .5em;
    opacity: .5;
}

/* -------------------------------------------------------- product page -- */

/* Mobile is the DOM order: title, buy box, record, description, history, ad,
   related. Desktop rearranges with named grid areas, which is what keeps the
   call to action directly under the title on a phone without pushing the ad
   up next to it on a wide screen. */
.grid {
    display: grid;
    gap: 26px;
    padding: 18px 0 56px;
}

@media (min-width: 940px) {
    .grid {
        grid-template-columns: minmax(0, 1fr) 350px;
        align-items: start;
        column-gap: 44px;
        grid-template-areas:
            "head rec"
            "buy  rec"
            "body rec"
            "hist rec"
            "ad   ad"
            "rel  rel";
    }

    .rec {
        grid-area: rec;
        position: sticky;
        top: 24px;
    }

    .head {
        grid-area: head;
    }

    .buy {
        grid-area: buy;
    }

    .body {
        grid-area: body;
    }

    .hist {
        grid-area: hist;
    }

    .adwrap {
        grid-area: ad;
    }

    .rel {
        grid-area: rel;
    }
}

.kicker {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 22px 0 12px;
}

h1 {
    font-size: clamp(2rem, 6vw, 3.3rem);
    line-height: 1.04;
    letter-spacing: -.033em;
    font-weight: 700;
    max-width: 16ch;
}

.idrow {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    margin-top: 18px;
    font-size: .8rem;
}

.pn {
    font-family: var(--mono);
    font-weight: 600;
    font-size: .84rem;
    border: 1px solid var(--rule);
    background: var(--card);
    padding: 6px 12px;
    border-radius: 999px;
}

.pill {
    padding: 6px 13px;
    border-radius: 999px;
    background: var(--tint);
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.pillq {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--rule);
    color: var(--dim);
}

/* ------------------------------------------------------------- buy box -- */

/* The price sits beside the button rather than in the sidebar: it anchors the
   click instead of being stranded away from it. */
.buy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 30px;
    justify-content: space-between;
    padding: 20px 22px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--r);
    box-shadow: 0 1px 2px rgba(var(--shadow), .04),
        0 8px 24px -12px rgba(var(--shadow), .14);
}

.buyFig {
    flex: 1 1 190px;
}

.buyFig b {
    display: block;
    font-size: 2.3rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.035em;
}

.buyFig span {
    display: block;
    font-size: .78rem;
    color: var(--dim);
    margin-top: 6px;
}

.buyGo {
    flex: 1 1 250px;
    max-width: 330px;
}

.cta {
    display: block;
    padding: 16px;
    min-height: 52px;
    background: var(--cta);
    color: var(--ctaInk);
    font-size: 1.02rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border-radius: 999px;
}

.cta:hover {
    opacity: .87;
}

.cta span {
    display: block;
    font-size: .72rem;
    font-weight: 500;
    opacity: .78;
    margin-top: 3px;
}

.paid {
    font-size: .68rem;
    color: var(--dim);
    text-align: center;
    margin-top: 9px;
}

/* ------------------------------------------------------- archive record -- */

.rec {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--r);
    padding: 24px;
    box-shadow: 0 1px 2px rgba(var(--shadow), .04),
        0 8px 24px -12px rgba(var(--shadow), .14);
}

.recHd {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--dim);
}

/* Inline SVG with an explicit viewBox and a fixed CSS height: no request, and
   no layout shift, because the box is reserved before paint. */
figure.chart {
    margin: 18px 0 6px;
    background: var(--tint);
    border-radius: 10px;
    padding: 14px 12px 10px;
}

.spark {
    display: block;
    width: 100%;
    height: 66px;
    overflow: visible;
}

.sparkLine {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.sparkFill {
    fill: var(--accent);
    opacity: .13;
    stroke: none;
}

.sparkDot {
    fill: var(--accent);
}

figcaption {
    display: flex;
    justify-content: space-between;
    font-size: .68rem;
    color: var(--dim);
    margin-top: 8px;
    font-family: var(--mono);
}

dl.facts {
    margin-top: 20px;
    font-size: .84rem;
}

dl.facts div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border-top: 1px solid var(--rule);
}

dl.facts dt {
    color: var(--dim);
}

dl.facts dd {
    font-weight: 600;
    text-align: right;
}

dl.facts .m {
    font-family: var(--mono);
    font-size: .8rem;
}

/* --------------------------------------------------------- description -- */

h2 {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 16px;
}

.body p {
    max-width: 66ch;
    margin-bottom: 1.1em;
}

.body p:first-of-type {
    font-size: 1.2rem;
    line-height: 1.5;
    letter-spacing: -.012em;
}

ul.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
    font-size: .8rem;
}

ul.tags a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    text-decoration: none;
    color: var(--dim);
}

ul.tags a:hover {
    color: var(--ink);
    border-color: var(--ink);
}

/* ------------------------------------------------------- price history -- */

table {
    width: 100%;
    max-width: 520px;
    border-collapse: collapse;
    font-size: .88rem;
}

th {
    text-align: left;
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--dim);
    padding: 0 0 9px;
    font-weight: 700;
}

td {
    padding: 11px 0;
    border-top: 1px solid var(--rule);
}

td.n {
    text-align: right;
    font-family: var(--mono);
    font-size: .84rem;
}

td.d {
    color: var(--dim);
}

.up {
    color: var(--up);
    font-weight: 600;
}

.dn {
    color: var(--dn);
    font-weight: 600;
}

.histNote {
    font-size: .8rem;
    color: var(--dim);
    margin-top: 12px;
    max-width: 520px;
}

/* -------------------------------------------------------- record cards -- */

/* Used by related products, category listings, browse and tag pages. Each card
   carries the title, the original part number and the last catalog price,
   which is what makes a listing scannable for someone matching a part. */
.cards {
    display: grid;
    gap: 14px;
}

@media (min-width: 560px) {
    .cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 900px) {
    .cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

.cards a {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    height: 100%;
    min-height: 118px;
    padding: 18px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--r);
    text-decoration: none;
}

.cards a:hover {
    border-color: var(--ink);
}

.cards .t {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.32;
    letter-spacing: -.01em;
}

.cards .meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-family: var(--mono);
    font-size: .72rem;
    color: var(--dim);
}

.cards .p {
    font-weight: 600;
    color: var(--ink);
}

/* A plainer stacked list, for directories of categories, letters and tags
   where there is no part number or price to show. */
.links {
    display: grid;
    gap: 10px;
}

@media (min-width: 640px) {
    .links {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 940px) {
    .links {
        grid-template-columns: repeat(3, 1fr);
    }
}

.links a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 14px 16px;
    min-height: 44px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 11px;
    text-decoration: none;
    font-size: .92rem;
    font-weight: 600;
}

.links a:hover {
    border-color: var(--ink);
}

.links .count {
    font-family: var(--mono);
    font-size: .74rem;
    font-weight: 500;
    color: var(--dim);
}

/* -------------------------------------------------------------- pager -- */

nav.pager {
    margin-top: 34px;
}

nav.pager ol {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

nav.pager a,
nav.pager strong {
    display: grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    text-decoration: none;
    font-size: .86rem;
    font-weight: 600;
    background: var(--card);
}

nav.pager a:hover {
    border-color: var(--ink);
}

nav.pager strong {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

/* ------------------------------------------------------- listing, home -- */

.lead {
    max-width: 62ch;
    color: var(--dim);
    font-size: 1.1rem;
    margin: 18px 0 30px;
}

.page {
    padding: 18px 0 56px;
}

.sect {
    margin-top: 46px;
}

.sect h2 {
    margin-bottom: 16px;
}

.hero {
    padding: 26px 0 10px;
}

.hero h1 {
    max-width: 20ch;
}

.hero .lead {
    margin-bottom: 24px;
}

.hero form.find {
    max-width: 520px;
    padding: 6px 6px 6px 20px;
}

.hero form.find input {
    font-size: .95rem;
    padding: 11px 0;
}

.heroNote {
    font-size: .8rem;
    color: var(--dim);
    margin-top: 12px;
}

.more {
    display: inline-block;
    margin-top: 18px;
    padding: 12px 20px;
    min-height: 44px;
    border: 1px solid var(--rule);
    background: var(--card);
    border-radius: 999px;
    text-decoration: none;
    font-size: .86rem;
    font-weight: 600;
}

.more:hover {
    border-color: var(--ink);
}

/* ---------------------------------------------------------- prose page -- */

/* Long-form text, for the privacy policy. It needs its own block because two
   global decisions that are right everywhere else are wrong here: the reset
   strips list markers from every ul, and h2 is styled as an all-caps micro
   label for the product page's section headers. A legal document needs real
   bullets and real headings. */
.prose {
    max-width: 68ch;
}

.prose h2 {
    margin: 38px 0 10px;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -.016em;
    text-transform: none;
    color: var(--ink);
}

.prose p {
    margin-bottom: 1.05em;
}

.prose ul {
    list-style: disc;
    padding-left: 1.3em;
    margin-bottom: 1.05em;
}

.prose li {
    margin-bottom: .5em;
}

.prose a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
}

.prose a:hover {
    color: var(--ink);
}

.prose .updated {
    margin: 14px 0 26px;
    color: var(--dim);
    font-size: .85rem;
}

/* ----------------------------------------------------------- ad slots -- */

/* min-height reserves the box before the ad script resolves, so a late-loading
   unit cannot shift the article underneath it. */
.ad {
    margin: 34px 0;
    min-height: 280px;
    display: grid;
    place-items: center;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--r);
    overflow: hidden;
}

.ad ins {
    display: block;
    width: 100%;
}

/* -------------------------------------------------------------- footer -- */

footer.site {
    border-top: 1px solid var(--rule);
    padding: 34px 0 48px;
    font-size: .82rem;
    color: var(--dim);
}

footer.site p {
    max-width: 70ch;
    margin-bottom: 10px;
}

footer.site nav {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 16px;
}

footer.site a {
    color: var(--ink);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

footer.site a:hover {
    text-decoration: underline;
}
