/* ==========================================================================
   V-TWIN SPECIALISTS UK — "Workshop spec-plate" design system
   World: night workshop. Warm charcoal surfaces, hot-rod orange action,
   lume-cream verified stamps, mono service-book data. Directory rendered
   as spec-sheet rows, not cards.
   Inspiration lineage: evidencecanvas.co.uk (instrument darks, orange/lume,
   Antonio+Hanken+RedHatMono) × kamasze.com (inner-lit surfaces) —
   derived, not copied. Independent identity per MASTER_RUNBOOK A1.5.
   ========================================================================== */

:root {
  /* surfaces — warm charcoal, workshop at night */
  --bg: #0d0e10;
  --surface: #131518;
  --raised: #1a1d21;
  --well: #0a0b0d;
  /* hairlines */
  --rule: #26292e;
  --rule-strong: #34383f;
  /* ink ramp */
  --ink: #d8dcdf;
  --ink-2: #a6adb4;
  --ink-3: #818890;
  /* action + stamps */
  --rev: #ff5b1f;            /* hot-rod orange: actions, live links */
  --rev-hi: #ff7a45;
  --rev-ink: #180700;        /* text on orange */
  --lume: #ece4c4;           /* verified stamp cream */
  --lume-ink: #171307;
  --ok: #8fd3a6;
  --warn: #f2b84b;
  --err: #ff7a6b;

  /* type */
  --display: "Antonio", "Arial Narrow", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "Red Hat Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* geometry */
  --radius: 12px;
  --radius-sm: 6px;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --max: 1240px;
  --measure: 68ch;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --shadow: 0 1px 2px rgba(0,0,0,.45), 0 16px 36px -20px rgba(0,0,0,.75);
  --shadow-plate: 0 2px 3px rgba(0,0,0,.5), 0 26px 60px -34px rgba(0,0,0,.9);
}

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--rev); color: var(--rev-ink); }
img, svg { display: block; max-width: 100%; }
a { color: var(--rev); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--rev-hi); }

/* browser surfaces carry the design */
:focus-visible { outline: 2px solid var(--rev); outline-offset: 3px; border-radius: 2px; }
html { scrollbar-color: var(--rule-strong) var(--well); }
input, textarea, button, select { font: inherit; color: inherit; caret-color: var(--rev); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--rev); color: var(--rev-ink);
  padding: .75rem 1.25rem; border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- primitives ---------- */
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.04; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.9rem, 7.5vw, 5.4rem); text-transform: uppercase; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1.15; }
p { max-width: var(--measure); margin: 0 0 1em; }
.lead { font-size: clamp(1.15rem, 2vw, 1.35rem); color: var(--ink-2); }

.mono { font-family: var(--mono); font-size: .82rem; letter-spacing: .02em; }

/* spec-plate: the signature surface — a bordered plate like a bike's ID plate */
.plate {
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-plate);
}
.plate-pad { padding: clamp(1.25rem, 3vw, 2rem); }

/* verified stamp: lume rectangle, slight rotation like a punch stamp */
.stamp {
  display: inline-block;
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--lume);
  border: 1px solid color-mix(in srgb, var(--lume) 55%, transparent);
  border-radius: var(--radius-sm);
  padding: .3rem .55rem;
  transform: rotate(-1.2deg);
  white-space: nowrap;
}
.stamp::before { content: ""; display: inline-block; width: .5em; height: .5em; border-radius: 50%;
  background: var(--ok); margin-right: .5em; vertical-align: .04em; }

.tag {
  display: inline-block;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .04em;
  color: var(--ink-2);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  padding: .28rem .55rem;
  white-space: nowrap;
}

/* buttons — 44px+ targets, tactile press */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  min-height: 47px; padding: .7rem 1.35rem;
  background: var(--rev); color: var(--rev-ink);
  font-weight: 700; text-decoration: none;
  border: 0; border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .1s var(--ease), background .15s var(--ease);
}
.btn:hover { background: var(--rev-hi); color: var(--rev-ink); }
.btn:active { transform: scale(.97); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--rule-strong);
}
.btn-ghost:hover { background: var(--raised); color: var(--ink); border-color: var(--ink-3); }

/* ---------- header / nav ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.top-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 64px; }
.brand {
  font-family: var(--display); font-weight: 700; font-size: 1.28rem;
  letter-spacing: .015em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand em { font-style: normal; color: var(--rev); }
.top nav { margin-left: auto; display: flex; gap: .25rem; flex-wrap: wrap; }
.top nav a {
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: .65rem .8rem; border-radius: var(--radius-sm);
  transition: color .15s var(--ease), background .15s var(--ease);
}
.top nav a:hover { color: var(--ink); background: var(--raised); }

/* ---------- hero ---------- */
.hero { padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4.5rem); position: relative; }
.hero h1 { max-width: 12ch; margin-bottom: .35em; }
.hero h1 .rev { color: var(--rev); }
.hero .lead { max-width: 54ch; margin-bottom: 1.6rem; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: 2.2rem; }

/* the authored moment: a tach-style sweep under the hero heading */
.hero-rule {
  position: relative; height: 3px; max-width: 420px; overflow: hidden;
  background: var(--rule); border-radius: 2px; margin: 0 0 1.8rem;
}
.hero-rule::after {
  content: ""; position: absolute; inset: 0;
  background: var(--rev); transform-origin: left;
  animation: sweep 1.1s var(--ease) .2s both;
}
@keyframes sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- directory: spec-sheet rows (not cards) ---------- */
.dir-bar {
  display: flex; gap: .6rem; flex-wrap: wrap; align-items: center;
  padding: 1rem 0; border-top: 1px solid var(--rule);
}
.dir-bar input[type="search"], .dir-bar select {
  min-height: 47px; padding: .55rem .9rem;
  background: var(--well); border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm); color: var(--ink);
}
.dir-bar input[type="search"] { flex: 1 1 240px; }
.dir-bar input::placeholder { color: var(--ink-3); }

.dir-count { font-family: var(--mono); font-size: .8rem; color: var(--ink-3); margin-left: auto; }

.sheet { border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); margin: 1.25rem 0 2.5rem; }
.row {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.6fr) auto;
  gap: .4rem 1.4rem; align-items: baseline;
  padding: 1.05rem clamp(.9rem, 2.5vw, 1.5rem);
  border-bottom: 1px solid var(--rule);
  transition: background .15s var(--ease);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--raised); }
.row-name { font-family: var(--display); font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; }
.row-name a { color: var(--ink); text-decoration: none; }
.row-name a:hover { color: var(--rev); }
.row-name .cat-dot { display: inline-block; width: .55em; height: .55em; border-radius: 50%; margin-right: .5rem; vertical-align: .06em; }
.row-where { color: var(--ink-2); font-size: .95rem; }
.row-meta { display: flex; align-items: center; gap: .6rem; justify-self: end; }
.row-meta .mono { color: var(--ink-3); }

.cat-dot.independent { background: var(--rev); }
.cat-dot.custom { background: var(--lume); }
.cat-dot.parts { background: var(--warn); }
.cat-dot.hire { background: var(--ok); }
.cat-dot.authorised { background: var(--ink-3); }

.empty-note { padding: 2rem 1.4rem; color: var(--ink-2); display: none; }
.sheet.is-empty .empty-note { display: block; }

/* ---------- sections ---------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--rule); }
.section > .wrap > h2 { max-width: 20ch; }

.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.guide-list { list-style: none; margin: 0; padding: 0; }
.guide-list li { border-bottom: 1px solid var(--rule); }
.guide-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1rem .25rem; color: var(--ink); text-decoration: none;
  transition: color .15s var(--ease), padding-left .15s var(--ease);
}
.guide-list a:hover { color: var(--rev); padding-left: .7rem; }
.guide-list .mono { color: var(--ink-3); flex-shrink: 0; }

/* footer */
footer.site { border-top: 1px solid var(--rule); padding: 2.5rem 0 3.5rem; color: var(--ink-3); }
footer.site .fine { font-size: .85rem; max-width: 78ch; }
footer.site nav { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: 1rem 0; }
footer.site nav a { color: var(--ink-2); }

/* ---------- content pages (guides, entity, about) ---------- */
.page { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.page h2 { margin-top: 1.8em; }
.page ul, .page ol { max-width: var(--measure); padding-left: 1.3rem; }
.page li { margin-bottom: .5rem; }
.callout {
  border: 1px solid var(--rule-strong); border-left-width: 1px;
  border-radius: var(--radius-sm); background: var(--raised);
  padding: 1rem 1.25rem; margin: 1.4rem 0; max-width: var(--measure);
}
.callout.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--rule-strong)); }
.callout .mono { color: var(--warn); display: block; margin-bottom: .35rem; }

.crumbs { font-family: var(--mono); font-size: .78rem; color: var(--ink-3); margin-bottom: 2rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--rev); }

/* profile header on entity pages */
.profile-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: 1.2rem 0 1.8rem; }
.chips { display: flex; gap: .45rem; flex-wrap: wrap; }

/* fact list on entity pages */
.facts { border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; margin: 1.5rem 0; }
.facts div { display: grid; grid-template-columns: 180px 1fr; gap: 1rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--rule); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-family: var(--mono); font-size: .78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding-top: .15rem; }
.facts dd { margin: 0; color: var(--ink); }
@media (max-width: 560px) { .facts div { grid-template-columns: 1fr; gap: .15rem; } }

/* related mesh */
.related { border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 1.6rem; }
.related ul { columns: 2; column-gap: 2.5rem; max-width: none; list-style: none; padding: 0; }
.related li { break-inside: avoid; }
@media (max-width: 680px) { .related ul { columns: 1; } }

/* ---------- tools ---------- */
.tool-out {
  font-family: var(--mono); font-size: .88rem; white-space: pre-wrap;
  background: var(--well); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; margin: 1.25rem 0; min-height: 3rem; color: var(--ink);
}
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.tool-grid label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
.tool-grid input, .tool-grid select {
  width: 100%; min-height: 47px; padding: .55rem .8rem;
  background: var(--well); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm);
}
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .35rem 1.5rem; margin: 1rem 0; }
.checks label { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem .25rem; cursor: pointer; border-radius: var(--radius-sm); }
.checks label:hover { background: var(--raised); }
.checks input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--rev); margin-top: .2rem; flex-shrink: 0; }
.score-big { font-family: var(--display); font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 700; line-height: 1; }

/* motion safety */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* responsive directory rows */
@media (max-width: 760px) {
  .row { grid-template-columns: 1fr; }
  .row-meta { justify-self: start; }
}

/* small screens: nav collapses to essential links */
@media (max-width: 560px) {
  .top nav a { padding: .65rem .55rem; font-size: .88rem; }
  .top-inner { gap: .6rem; }
}
