/* ==========================================================================
   BRO'S BOLTS MOTORS — design system
   Concept: "the page is the workshop floor" — signage paint, job cards, bays.
   Yellow is a MATERIAL (floor paint / number plate), never a decorative accent.
   ========================================================================== */

/* ---------- fonts (self-hosted, latin subsets) ---------- */
@font-face { font-family: 'Big Shoulders'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('/assets/fonts/big-shoulders-v4-latin-700.woff2') format('woff2'); }
@font-face { font-family: 'Big Shoulders'; font-weight: 900; font-style: normal; font-display: swap;
  src: url('/assets/fonts/big-shoulders-v4-latin-900.woff2') format('woff2'); }
@font-face { font-family: 'Work Sans'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('/assets/fonts/work-sans-v24-latin-regular.woff2') format('woff2'); }
@font-face { font-family: 'Work Sans'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('/assets/fonts/work-sans-v24-latin-500.woff2') format('woff2'); }
@font-face { font-family: 'Work Sans'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('/assets/fonts/work-sans-v24-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('/assets/fonts/space-mono-v17-latin-regular.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('/assets/fonts/space-mono-v17-latin-700.woff2') format('woff2'); }
/* metric-compatible fallbacks — kill layout shift while webfonts swap in */
@font-face { font-family: 'BS Fallback'; src: local('Arial Narrow'), local('Arial');
  size-adjust: 82%; ascent-override: 98%; descent-override: 24%; }
@font-face { font-family: 'WS Fallback'; src: local('Segoe UI'), local('Arial');
  size-adjust: 100%; ascent-override: 93%; descent-override: 23%; }

/* ---------- tokens ---------- */
:root {
  /* colour — warm oil-black scale + two working yellows */
  --ink-0: #12100D;
  --ink-1: #1A1712;
  --ink-2: #26211A;
  --line:  #37301F;
  --plate: #FFCE00;   /* UK rear number plate */
  --paint: #C89B00;   /* worn floor-signage paint */
  --bone:  #EFE9DB;
  --steel: #A39A82;
  --plate-ink: #12100D;

  /* type */
  --f-display: 'Big Shoulders', 'BS Fallback', 'Arial Narrow', sans-serif;
  --f-body: 'Work Sans', 'WS Fallback', system-ui, sans-serif;
  --f-mono: 'Space Mono', ui-monospace, monospace;

  /* rhythm */
  --wrap: 72rem;
  --gap: clamp(1rem, 2.5vw, 2rem);
  --sec-pad: clamp(4rem, 9vw, 7.5rem);

  /* z scale */
  --z-nav: 50; --z-lightbox: 60;
}

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink-0);
  color: var(--bone);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p, ul, figure, blockquote, address { margin: 0; }
ul[role="list"] { list-style: none; padding: 0; }
img, svg, canvas { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
em { font-style: italic; }
address { font-style: normal; }
:focus-visible { outline: 3px solid var(--plate); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.mono { font-family: var(--f-mono); font-size: 0.8125rem; letter-spacing: 0.02em; }

.skip-link {
  position: absolute; left: -200vw; top: 0; z-index: 100;
  background: var(--plate); color: var(--plate-ink);
  padding: 0.75rem 1.25rem; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.6rem 1.6rem;
  font-family: var(--f-display); font-weight: 700; font-size: 1.2rem;
  letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  border-radius: 3px; border: 2px solid transparent;
  cursor: pointer; transition: background-color 200ms, color 200ms, border-color 200ms;
}
.btn--plate { background: var(--plate); color: var(--plate-ink); }
.btn--plate:hover { background: var(--paint); }
.btn--ghost { background: transparent; color: var(--bone); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--paint); color: var(--plate); }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: color-mix(in srgb, var(--ink-0) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
/* hazard strip — painted, not decorative gradient-of-the-week */
.site-head::before {
  content: ""; display: block; height: 5px;
  background: repeating-linear-gradient(-45deg,
    var(--plate) 0 14px, var(--ink-0) 14px 28px);
}
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.wordmark { display: flex; align-items: baseline; gap: 0.45rem; text-decoration: none; padding-block: 0.35rem; min-height: 44px; box-sizing: border-box; }
.wordmark-line { font-family: var(--f-display); font-weight: 900; font-size: 1.5rem; letter-spacing: 0.04em; }
.wordmark-plate {
  font-family: var(--f-display); font-weight: 900; font-size: 1.15rem;
  background: var(--plate); color: var(--plate-ink);
  padding: 0.05rem 0.45rem; border-radius: 2px; letter-spacing: 0.08em;
}

.nav-list { display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.75rem); margin: 0; }
.nav-list a { text-decoration: none; font-weight: 500; font-size: 0.95rem; color: var(--steel); transition: color 200ms; }
.nav-list a:hover { color: var(--plate); }
.nav-list .nav-cta {
  color: var(--plate-ink); background: var(--plate); font-weight: 600;
  padding: 0.5rem 1rem; border-radius: 3px;
}
.nav-list .nav-cta:hover { color: var(--plate-ink); background: var(--paint); }
.nav-toggle { display: none; }

@media (max-width: 47.9rem) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: none; border: 1px solid var(--line); border-radius: 3px;
    color: var(--bone); font-family: var(--f-mono); font-size: 0.8rem;
    padding: 0.55rem 0.9rem; cursor: pointer; min-height: 44px;
  }
  .nav-toggle-bar { width: 16px; height: 2px; background: var(--plate);
    box-shadow: 0 5px 0 var(--plate), 0 -5px 0 var(--plate); }
  .nav-list {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink-1); border-bottom: 2px solid var(--plate); padding: 0.5rem 0;
  }
  .nav-list.open { display: flex; }
  .nav-list a { display: block; padding: 0.9rem 1.5rem; font-size: 1.05rem; }
  .nav-list .nav-cta { margin: 0.5rem 1.25rem; text-align: center; }
}

/* ---------- bay tags & section furniture ---------- */
.bay-tag {
  color: var(--paint); font-weight: 700; letter-spacing: 0.14em;
  margin-bottom: 0.9rem;
}
.bay-tag::before {
  content: ""; display: inline-block; width: 2rem; height: 2px;
  background: var(--paint); vertical-align: middle; margin-right: 0.7rem;
}
.section { padding-block: var(--sec-pad); }
.section--panel { background: var(--ink-1); border-block: 1px solid var(--line); }
.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-title {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2.4rem, 6vw, 4rem); line-height: 0.95; letter-spacing: 0.01em;
}
.section-lede { color: var(--steel); margin-top: 1rem; max-width: 40rem; }

/* ---------- BAY 00 · hero ---------- */
.hero { min-height: 280vh; }
.hero-sticky {
  position: sticky; top: 0; min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 5.5rem clamp(1.25rem, 4vw, 2.5rem) 1rem;
  max-width: var(--wrap); margin-inline: auto;
  overflow: clip;
}
.hero .bay-tag { margin-bottom: 0; }
.hero-stage {
  position: absolute; inset: 0; z-index: -1;
  display: grid; place-items: center;
}
.hero-canvas { width: 100%; height: 100%; }
.hero-fallback { display: grid; place-items: center; width: 100%; height: 100%; padding: 14vh 4vw 10vh; }
/* fixed box from first paint — the image must never reflow when it arrives */
.hero-fallback img { height: min(62vh, 620px); width: auto; aspect-ratio: 900 / 700; object-fit: contain; opacity: 0.9; }

.hero-callouts { position: absolute; inset: 0; pointer-events: none; }
.callout {
  position: absolute; left: 0; top: 0;
  color: var(--steel); line-height: 1.5;
  background: color-mix(in srgb, var(--ink-0) 78%, transparent);
  padding: 0.4rem 0.6rem; border-left: 2px solid var(--paint);
  opacity: 0; transition: opacity 400ms;
  max-width: 15rem; will-change: transform;
}
.callout.on { opacity: 1; }
.callout-dot {
  position: absolute; left: -0.35rem; top: 50%; width: 8px; height: 8px;
  background: var(--plate); border-radius: 50%; transform: translateY(-50%);
}

.hero-copy { align-self: center; max-width: 34rem; position: relative; }
.hero-title {
  font-family: var(--f-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(3rem, 9.5vw, 6.5rem); line-height: 0.92; letter-spacing: 0.01em;
}
.hero-title-row { display: block; }
.hero-title-row--plate {
  display: inline-block; background: var(--plate); color: var(--plate-ink);
  padding: 0.02em 0.14em 0.06em; border-radius: 4px; margin-top: 0.08em;
}
.hero-sub { color: var(--steel); margin-top: 1.4rem; font-size: 1.1rem; max-width: 30rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.8rem; }

.hero-datastrip {
  display: flex; flex-wrap: wrap; gap: 0.35rem 2rem;
  color: var(--steel); border-top: 1px solid var(--line); padding-top: 0.9rem;
}
.hero-scrollhint { color: var(--paint); margin-left: auto; }

@media (max-width: 63.9rem) {
  .hero { min-height: 240vh; }
  .hero-stage { position: absolute; opacity: 0.55; }
  .hero-copy { max-width: 100%; }
}

/* no 3D on this device: hero collapses to one screen, no strip-down hint */
.no3d .hero { min-height: 100svh; }
.no3d .hero-scrollhint { display: none; }

/* ---------- BAY 01 · job cards ---------- */
.job-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
}
@supports (grid-template-rows: subgrid) {
  .job-card { display: grid; grid-template-rows: subgrid; grid-row: span 4; }
  .job-grid { grid-auto-rows: auto; }
}
.job-card {
  background: var(--ink-1); border: 1px solid var(--line); border-radius: 4px;
  padding: 1.5rem 1.5rem 1.25rem; gap: 0.65rem;
  display: grid; align-content: start;
  transition: border-color 200ms, background-color 200ms;
}
.job-card:hover { border-color: var(--paint); background: var(--ink-2); }
.job-ref { color: var(--paint); letter-spacing: 0.12em; }
.job-title { font-family: var(--f-display); font-weight: 700; font-size: 1.9rem; text-transform: uppercase; line-height: 1; }
.job-desc { color: var(--steel); font-size: 0.98rem; }
.job-meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  border-top: 1px dashed var(--line); padding-top: 0.8rem; margin-top: 0.4rem;
  color: var(--steel);
}
.job-price { color: var(--plate); font-weight: 700; font-size: 1rem; }
.job-card--classic { border-style: dashed; border-color: var(--paint); }

/* ---------- BAY 02 · about ---------- */
.about-cols { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: 1fr; }
@media (min-width: 64rem) { .about-cols { grid-template-columns: 1.1fr 1fr; } }
.about-story p + p { margin-top: 1.1rem; }
.about-story { max-width: 36rem; }

.team-list { display: grid; gap: 1rem; }
.team-card {
  display: flex; gap: 1.1rem; align-items: flex-start;
  background: var(--ink-0); border: 1px solid var(--line); border-radius: 4px; padding: 1.1rem 1.25rem;
}
.team-initials {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 3.2rem; height: 3.2rem; border-radius: 3px;
  background: var(--plate); color: var(--plate-ink);
  font-family: var(--f-display); font-weight: 900; font-size: 1.3rem;
}
.team-name { font-family: var(--f-display); font-weight: 700; font-size: 1.4rem; text-transform: uppercase; }
.team-role { color: var(--paint); margin: 0.15rem 0 0.3rem; letter-spacing: 0.12em; }
.team-line { color: var(--steel); font-size: 0.95rem; }

.numbers-strip {
  display: flex; flex-wrap: wrap; gap: 0.8rem 2.5rem;
  margin-top: clamp(2rem, 5vw, 3.5rem); padding-top: 1.2rem;
  border-top: 1px solid var(--line); color: var(--steel);
}
.numbers-strip strong { color: var(--plate); font-weight: 700; font-size: 1.05rem; }

/* ---------- BAY 03 · manual ---------- */
.manual-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));
}
.plate-thumb {
  display: grid; gap: 0; width: 100%; padding: 0;
  background: var(--ink-1); border: 1px solid var(--line); border-radius: 4px;
  cursor: pointer; overflow: hidden; text-align: left;
  transition: border-color 200ms;
}
.plate-thumb:hover { border-color: var(--paint); }
.plate-thumb img { width: 100%; aspect-ratio: 9 / 7; object-fit: cover; }
.plate-label {
  color: var(--steel); padding: 0.7rem 0.9rem;
  border-top: 1px solid var(--line); letter-spacing: 0.1em;
}
.plate-thumb:hover .plate-label { color: var(--plate); }

/* ---------- lightbox ---------- */
.lightbox {
  border: 1px solid var(--line); border-radius: 6px; padding: 1rem;
  background: var(--ink-1); color: var(--bone);
  max-width: min(60rem, 92vw); width: auto;
}
.lightbox::backdrop { background: rgba(10, 9, 7, 0.85); }
.lightbox img { width: 100%; max-height: 75vh; object-fit: contain; }
.lightbox figcaption { color: var(--steel); padding-top: 0.8rem; }
.lightbox-close { margin-bottom: 0.8rem; }

/* ---------- BAY 04 · quotes ---------- */
.quote-row { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); }
.quote-card {
  background: var(--ink-0); border: 1px solid var(--line); border-left: 3px solid var(--plate);
  border-radius: 4px; padding: 1.4rem 1.5rem;
  display: grid; gap: 1rem; align-content: space-between;
}
.quote-card blockquote p { font-size: 1.02rem; }
.quote-who { color: var(--paint); letter-spacing: 0.1em; }

/* ---------- BAY 05 · booking ---------- */
.book-cols { display: grid; gap: clamp(2rem, 5vw, 3.5rem); grid-template-columns: 1fr; }
@media (min-width: 64rem) { .book-cols { grid-template-columns: 1.35fr 1fr; } }

.book-form { display: grid; gap: 1.1rem; }
.field-row { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .field-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 600; font-size: 0.92rem; }
.label-soft { color: var(--steel); font-weight: 400; }
.field input, .field select, .field textarea {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 3px;
  color: var(--bone); font: inherit; padding: 0.7rem 0.85rem; min-height: 3rem;
  width: 100%; transition: border-color 200ms;
}
.field textarea { min-height: auto; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--paint); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--plate); outline: none; }
.field select { appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--paint) 50%),
    linear-gradient(135deg, var(--paint) 50%, transparent 50%);
  background-position: calc(100% - 1.2rem) 55%, calc(100% - 0.85rem) 55%;
  background-size: 0.35rem 0.35rem; background-repeat: no-repeat;
}

/* number plate input — the one allowed echo of the signature */
.reg-input {
  background: var(--plate) !important; color: var(--plate-ink) !important;
  font-family: var(--f-mono); font-weight: 700; font-size: 1.25rem;
  text-transform: uppercase; letter-spacing: 0.12em; text-align: center;
  border: 2px solid #0f0d0a !important; border-left: 14px solid #003399 !important;
  border-radius: 5px;
}
.reg-input::placeholder { color: #6b5a00; }

/* error states — :has() with JS class fallback */
.field-err { color: var(--plate); }
.field:has(input:user-invalid) .field-err,
.field:has(select:user-invalid) .field-err,
.field.err .field-err { display: block; }
.field.err input, .field.err select,
.field:has(:user-invalid) input, .field:has(:user-invalid) select { border-color: var(--paint); }
.field-err[hidden] { display: none; }
.field.err .field-err[hidden] { display: block; }

.hp-field { position: absolute !important; left: -200vw !important; width: 1px; height: 1px; overflow: hidden; }

.form-note { padding: 0.9rem 1.1rem; border-radius: 3px; font-weight: 500; }
.form-note--ok { background: var(--plate); color: var(--plate-ink); }
.form-note--err { background: var(--ink-2); border: 1px solid var(--paint); }
.form-note--err a { color: var(--plate); }
.btn--submit { justify-self: start; }
.btn--submit[disabled] { opacity: 0.6; cursor: wait; }
.form-small { color: var(--steel); }

.book-aside { display: grid; gap: 1.4rem; align-content: start; }
.map-facade { position: relative; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.map-facade img { width: 100%; }
.map-facade iframe { width: 100%; height: 340px; border: 0; display: block; }
.map-load { position: absolute; inset: auto 0 1rem 0; margin-inline: auto; width: max-content;
  background: var(--ink-0); }
.visit { color: var(--steel); line-height: 2; }
.visit strong { color: var(--bone); }
.visit a { color: var(--plate); text-decoration: none; display: inline-block; padding-block: 0.35rem; }
.visit a:hover { text-decoration: underline; }
.hours { border-collapse: collapse; color: var(--steel); width: 100%; max-width: 22rem; }
.hours th, .hours td { text-align: left; padding: 0.5rem 0; border-bottom: 1px dashed var(--line); }
.hours th { color: var(--paint); font-weight: 400; padding-right: 2rem; }

/* ---------- footer ---------- */
.site-foot { margin-top: var(--sec-pad); }
.foot-chevrons {
  height: 10px;
  background: repeating-linear-gradient(-45deg, var(--plate) 0 22px, var(--ink-0) 22px 44px);
}
.foot-row { padding-block: 2.2rem; color: var(--steel); display: grid; gap: 0.4rem; }
.foot-motto { color: var(--plate); font-weight: 700; letter-spacing: 0.12em; }

/* ---------- reveals: CSS scroll-driven, JS fallback ---------- */
.section-head, .job-card, .team-card, .plate-thumb, .quote-card {
  --reveal-from: 24px;
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .section-head, .job-card, .team-card, .plate-thumb, .quote-card {
      animation: rise-in both;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }
  }
  @supports not (animation-timeline: view()) {
    .js .section-head, .js .job-card, .js .team-card, .js .plate-thumb, .js .quote-card {
      opacity: 0; transform: translateY(var(--reveal-from));
      transition: opacity 600ms ease-out, transform 600ms ease-out;
    }
    .js .in { opacity: 1; transform: none; }
  }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(var(--reveal-from)); }
  to { opacity: 1; transform: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .hero { min-height: 100svh; }
  .hero-scrollhint { display: none; }
}

/* ---------- small screens fine-tuning (design starts at 360px) ---------- */
@media (max-width: 25rem) {
  .hero-title { font-size: 2.9rem; }
  .btn { width: 100%; }
  .hero-ctas .btn { width: auto; flex: 1 1 auto; }
}
