/* FILE:     ezfit.css
   PATH:     site/ezfit.css
   PURPOSE:  The whole site's styling. One file, cached at the edge, no imports,
             no webfonts.
   VERSION:  0.3.0
   DATE:     2026-08-16
   CHANGELOG
   0.1.0  2026-08-16  Extracted from the single-page build.
   0.2.0  2026-08-16  Multi-page: nav, home, part pages, footer.
   0.3.0  2026-08-16  New identity. The previous palette - cool neutrals, one
                      teal-blue accent, mono labels - read as a cousin of the
                      other projects, which cluster on near-black grounds with a
                      single bright accent (mint, lime, yellow, amber) or warm
                      cream with tan. Nothing in the estate used red as a
                      PRIMARY, and nothing used a printed look.

                      So: a parts catalogue. Paper ground, oxide red masthead,
                      part numbers set as black stamps, flat square chips, heavy
                      rules. Red carries the engine side, cobalt the body side -
                      a two-colour print, which is what an interchange manual
                      actually was. No gradients, no glow, no rounded cards. */

:root {
  --paper:       #FBFAF7;
  --surface:     #FFFFFF;
  --surface-alt: #F1EEE8;
  --sunk:        #F6F4EF;
  --ink:         #16130F;
  --ink-soft:    #574F46;
  --ink-faint:   #8B8175;
  --rule:        #E3DED4;
  --rule-strong: #C4BBAC;

  --red:      #C1281A;   /* 5.3:1 on white - safe for body text */
  --red-deep: #961F14;
  --red-soft: #FBE6E2;
  --blue:      #1E4B8F;
  --blue-soft: #E5EBF6;

  /* The masthead and the part-number stamp get their own tokens rather than
     reusing ink/paper, because a straight inversion turns the red bar into
     salmon and drops white nav text below contrast. Dark mode instead keeps a
     dark bar and lets red do the work as a rule and an accent. */
  --bar-bg:     #C1281A;
  --bar-fg:     #FFFFFF;
  --bar-fg-alt: #16130F;
  --bar-nav:    rgba(255,255,255,0.84);
  --bar-edge:   #16130F;
  --stamp-bg:   #16130F;
  --stamp-fg:   #FBFAF7;

  --display: ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif;
  --data: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14110D; --surface: #1D1913; --surface-alt: #262119; --sunk: #100D0A;
    --ink: #F3EFE8; --ink-soft: #B3A899; --ink-faint: #857B6D;
    --rule: #2E281F; --rule-strong: #453D31;
    --red: #FF7259; --red-deep: #FF8E79; --red-soft: #37190F;
    --blue: #8FB2F0; --blue-soft: #16203A;
    --bar-bg: #1D1913; --bar-fg: #F3EFE8; --bar-fg-alt: #FF7259;
    --bar-nav: #B3A899; --bar-edge: #FF7259;
    --stamp-bg: #F3EFE8; --stamp-fg: #14110D;
  }
}
:root[data-theme="dark"] {
  --paper: #14110D; --surface: #1D1913; --surface-alt: #262119; --sunk: #100D0A;
  --ink: #F3EFE8; --ink-soft: #B3A899; --ink-faint: #857B6D;
  --rule: #2E281F; --rule-strong: #453D31;
  --red: #FF7259; --red-deep: #FF8E79; --red-soft: #37190F;
  --blue: #8FB2F0; --blue-soft: #16203A;
  --bar-bg: #1D1913; --bar-fg: #F3EFE8; --bar-fg-alt: #FF7259;
  --bar-nav: #B3A899; --bar-edge: #FF7259;
  --stamp-bg: #F3EFE8; --stamp-fg: #14110D;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--display); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red-deep); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
img { max-width: 100%; }

/* ---- masthead: a solid block of colour, like a catalogue cover ---------- */
header.top {
  background: var(--bar-bg); color: var(--bar-fg);
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  display: flex; align-items: center; gap: 0.75rem 1.75rem; flex-wrap: wrap;
  border-bottom: 4px solid var(--bar-edge);
}
.brand {
  font-weight: 900; letter-spacing: -0.05em; font-size: 1.5rem; margin: 0;
  text-decoration: none; color: var(--bar-fg); line-height: 1;
}
.brand span { color: var(--bar-fg-alt); }
nav.main { display: flex; gap: 1.25rem; flex-wrap: wrap; }
nav.main a {
  font-family: var(--data); font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; text-decoration: none;
  color: var(--bar-nav); padding-bottom: 2px;
}
nav.main a:hover { color: var(--bar-fg); }
nav.main a[aria-current="page"] { color: var(--bar-fg); box-shadow: 0 2px 0 var(--bar-edge); }

.wrap { max-width: 60rem; margin: 0 auto; padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1rem, 4vw, 2.5rem) 4rem; }
.wrap.wide { max-width: 76rem; }

.crumbs {
  font-family: var(--data); font-size: 0.7rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 1.1rem;
}
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--red); }

h1 {
  font-size: clamp(1.9rem, 5.5vw, 3rem); font-weight: 900;
  letter-spacing: -0.045em; line-height: 1.02; margin: 0 0 0.5rem; text-wrap: balance;
}
h2 {
  font-size: 0.75rem; font-family: var(--data); letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink);
  margin: 2.75rem 0 1rem; padding-bottom: 0.4rem;
  border-bottom: 3px solid var(--red);
}
h3 { font-size: 1.02rem; font-weight: 800; letter-spacing: -0.015em; margin: 1.75rem 0 0.5rem; }
p { margin: 0 0 1rem; max-width: 68ch; }
.lede { color: var(--ink-soft); font-size: 0.95rem; }

.specs {
  margin: 0 0 1.75rem; padding-bottom: 1rem; border-bottom: 4px solid var(--ink);
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem;
  font-family: var(--data); font-size: 0.75rem; color: var(--ink-soft);
}
.specs div { display: flex; gap: 0.4rem; }
.specs dt { color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.09em; }
.specs dd { margin: 0; color: var(--ink); }

/* ---- part blocks -------------------------------------------------------- */
.parts { display: grid; gap: 0; border: 2px solid var(--ink); background: var(--ink); }
.part {
  background: var(--surface); padding: 1.1rem 1.15rem;
  border-bottom: 2px solid var(--ink);
}
.part:last-child { border-bottom: 0; }
.part-top { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

/* category = which side of the car. Two-colour print: red engine, blue body. */
.cat {
  font-family: var(--data); font-size: 0.64rem; letter-spacing: 0.13em;
  text-transform: uppercase; padding: 0.24rem 0.5rem; flex: none;
  color: #fff; background: var(--ink);
}
.cat.engine { background: var(--red); }
.cat.body   { background: var(--blue); }

/* the part number is the product: set it like a stamped catalogue entry */
.pn {
  font-family: var(--data); font-size: 1.15rem; font-weight: 700;
  letter-spacing: 0.01em; background: var(--stamp-bg); color: var(--stamp-fg);
  padding: 0.22rem 0.55rem; text-decoration: none; display: inline-block;
}
a.pn:hover { background: var(--red); color: #fff; }
.brand-of { font-size: 0.8rem; color: var(--ink-soft); font-family: var(--data); }
.part-top .spacer { flex: 1; }
.srclink { font-family: var(--data); font-size: 0.68rem; color: var(--ink-faint); }
.srclink:hover { color: var(--red); }

button.copy {
  font: inherit; font-family: var(--data); font-size: 0.66rem; letter-spacing: 0.1em;
  text-transform: uppercase; cursor: pointer; padding: 0.28rem 0.55rem;
  background: transparent; color: var(--ink-soft);
  border: 2px solid var(--rule-strong);
}
button.copy:hover { color: var(--ink); border-color: var(--ink); }
button.copy.done { background: var(--red); color: #fff; border-color: var(--red); }

.fits { margin-top: 0.9rem; }
.fits-label {
  font-family: var(--data); font-size: 0.66rem; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.45rem;
}
.vchips { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.vchips a {
  display: inline-block; font-size: 0.82rem; text-decoration: none;
  background: var(--surface); color: var(--ink); border: 2px solid var(--ink);
  padding: 0.18rem 0.5rem; font-weight: 600;
}
.vchips a:hover { background: var(--ink); color: var(--paper); }
.vchips a:hover .yr { color: var(--rule-strong); }
.vchips .yr { color: var(--ink-faint); font-family: var(--data); font-size: 0.68rem; font-weight: 400; }

.findrow {
  margin-top: 0.9rem; padding-top: 0.8rem; border-top: 2px dotted var(--rule-strong);
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
}
.findrow .lbl {
  font-family: var(--data); font-size: 0.66rem; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--ink-faint); margin-right: 0.25rem;
}
a.find {
  font-family: var(--data); font-size: 0.73rem; text-decoration: none;
  padding: 0.25rem 0.55rem; border: 2px solid var(--rule-strong);
  color: var(--ink-soft); font-weight: 600;
}
a.find:hover { border-color: var(--red); color: var(--red); }

.gap {
  margin-top: 0.85rem; font-size: 0.8rem; color: var(--ink-faint);
  border-left: 4px solid var(--rule-strong); padding-left: 0.7rem; max-width: 68ch;
}

/* ---- vehicle index ------------------------------------------------------ */
.filter { margin: 0 0 1.25rem; }
.filter input {
  width: 100%; max-width: 26rem; padding: 0.65rem 0.8rem; font: inherit; font-size: 0.95rem;
  background: var(--sunk); color: var(--ink); border: 2px solid var(--ink);
}
.filter input::placeholder { color: var(--ink-faint); }
ul.vlist {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0; border: 2px solid var(--ink);
}
ul.vlist li { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
ul.vlist a { display: block; padding: 0.7rem 0.85rem; text-decoration: none; color: inherit; background: var(--surface); }
ul.vlist a:hover { background: var(--red); color: #fff; }
ul.vlist a:hover small { color: rgba(255,255,255,0.85); }
ul.vlist b { display: block; font-weight: 700; }
ul.vlist small { color: var(--ink-soft); font-family: var(--data); font-size: 0.7rem; }

/* ---- notices ------------------------------------------------------------ */
.slot {
  border: 2px dashed var(--rule-strong); padding: 1rem 1.15rem;
  color: var(--ink-soft); font-size: 0.88rem; max-width: 68ch; margin: 0 0 1rem;
  background: var(--sunk);
}
.slot b {
  display: block; color: var(--ink); font-family: var(--data); font-size: 0.7rem;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.45rem;
}
.caution {
  border: 2px solid var(--ink); border-left: 10px solid var(--red);
  background: var(--surface); padding: 1rem 1.15rem; font-size: 0.87rem;
  color: var(--ink-soft); max-width: 68ch; margin-top: 2rem;
}
.caution b { color: var(--ink); }

footer.site {
  border-top: 4px solid var(--red); background: var(--ink); color: var(--rule-strong);
  padding: 1.4rem clamp(1rem, 4vw, 2.5rem);
  font-family: var(--data); font-size: 0.71rem; letter-spacing: 0.04em;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem;
}
footer.site a { color: #fff; text-decoration: none; }
footer.site a:hover { color: var(--red); }

@media (prefers-reduced-motion: no-preference) {
  .vchips a, ul.vlist a, a.pn, button.copy, a.find { transition: background-color .12s, color .12s, border-color .12s; }
}
