/* M.R Autos - style.css
   Built to dettogni-production-polish v19. Tokens and decisions: BUILD.md Section 3. */

/* 0. Fonts (self-hosted, latin subset) */
@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo Black';
  src: url('/fonts/archivo-black-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo Fallback';
  src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('Roboto');
  size-adjust: 98.7%;
  ascent-override: 89%;
  descent-override: 21%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Archivo Black Fallback';
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Liberation Sans Bold'), local('Roboto Bold');
  size-adjust: 115%;
  ascent-override: 76%;
  descent-override: 18%;
  line-gap-override: 0%;
}

/* 1. Tokens */
:root {
  /* Colour: from the shopfront */
  --navy: #0E2D62;          /* header, footer, dark sections */
  --blue: #1A4A9B;          /* brand blue, links, focus on light */
  --red: #C0272D;           /* primary action fill, stripes */
  --red-dark: #A01F24;      /* primary hover */
  --red-rim: #E87A7F;       /* button edge on dark sections (4.79:1 on navy) */
  --ink: #0F0F0F;
  --text: #2A2A2A;
  --muted: #5A5A5A;         /* 6.38:1 on --paper-alt */
  --line: #E8ECF0;
  --paper: #FFFFFF;
  --paper-alt: #F5F6F8;
  --on-dark: #FFFFFF;
  --on-dark-muted: rgba(255, 255, 255, 0.78); /* 8.4:1 on navy */
  --focus: var(--blue);

  /* Type */
  --body: 'Archivo', 'Archivo Fallback', Arial, sans-serif;
  --display: 'Archivo Black', 'Archivo Black Fallback', 'Arial Black', Arial, sans-serif;
  --fs-small: 0.875rem;     /* labels, fine print only */
  --fs-secondary: 1rem;     /* cards, steps */
  --fs-body: 1.0625rem;     /* running text, 17px */
  --fs-lead: 1.1875rem;
  --fs-h3: 1.25rem;
  --fs-h2: clamp(1.75rem, 1.25rem + 2.2vw, 2.75rem);
  --fs-h1: clamp(2.25rem, 1.5rem + 3.4vw, 3.75rem);
  --measure: 54ch;

  /* Space */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-5: 3rem;
  --s-6: 4rem;
  --s-7: 6rem;

  /* Layout */
  --container: 1200px;
  --gutter: clamp(1rem, 0.6rem + 1.6vw, 1.5rem);
  --header-h: 80px;
  --radius: 4px;

  /* Button */
  --btn-h: 48px;
  --btn-pad-x: 24px;

  /* Motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-press: 140ms;
  --dur-fast: 180ms;
  --dur-overlay: 280ms;
}

/* 2. Reset and base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
  overflow-x: clip;
}

body {
  font-family: var(--body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.skip-link {
  position: absolute;
  top: 0;
  left: 1rem;
  z-index: 1000;
  padding: 0.6rem 1.2rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transform: translateY(-110%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: none; outline: 2px solid var(--red-rim); outline-offset: 2px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--s-7); }
.section--alt { background: var(--paper-alt); }

/* 3. Typography */
h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  color: var(--ink);
  overflow-wrap: break-word;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.015em; margin-bottom: var(--s-3); }
h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.25; color: var(--ink); }
h1 em, h2 em, h3 em { font-style: normal; }

p + p { margin-top: var(--s-2); }
main :is(p, li, dd) { max-width: var(--measure); }

.lead { font-size: var(--fs-lead); color: var(--muted); }
.kicker { font-weight: 700; color: var(--red); margin-bottom: var(--s-2); }
.nowrap { white-space: nowrap; }

/* 4. Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--btn-h);
  padding: 0 var(--btn-pad-x);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  background: var(--red);
  color: var(--paper);
  font: 700 1.0625rem/1.2 var(--body);
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.btn--secondary {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}

.on-dark { --focus: var(--on-dark); }
.on-dark .btn { border-color: var(--red-rim); }
.on-dark .btn--secondary { color: var(--on-dark); border-color: var(--on-dark); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--red-dark); }
  .btn--secondary:hover { background: var(--blue); color: var(--paper); }
  .on-dark .btn--secondary:hover { background: var(--on-dark); color: var(--navy); }
}

/* 5. Header and navigation */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  background: var(--paper);
  border-bottom: 3px solid var(--red);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  height: 100%;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  min-height: 44px;
  margin-right: auto;
  text-decoration: none;
}
.logo img { height: 64px; width: auto; }

.main-nav ul { display: flex; gap: var(--s-1); }
.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.main-nav a.is-active { color: var(--navy); border-bottom-color: var(--red); }
@media (hover: hover) and (pointer: fine) {
  .main-nav a:hover { color: var(--blue); }
}

.header-call { min-height: 44px; padding-inline: 16px; font-size: 1rem; }
.header-call .call-short { display: none; }

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--navy);
}
.hamburger-lines { position: relative; width: 26px; height: 18px; }
.hamburger-lines span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) ease;
}
.hamburger-lines span:nth-child(1) { top: 0; }
.hamburger-lines span:nth-child(2) { top: 8px; }
.hamburger-lines span:nth-child(3) { top: 16px; }
.hamburger[aria-expanded="true"] .hamburger-lines span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger[aria-expanded="true"] .hamburger-lines span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] .hamburger-lines span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-overlay {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--paper);
  z-index: 99;
  padding: var(--s-4) var(--gutter);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity var(--dur-overlay) var(--ease-out),
    transform var(--dur-overlay) var(--ease-out),
    display var(--dur-overlay) allow-discrete;
}
.mobile-overlay.is-hidden {
  display: none;
  opacity: 0;
  transform: translateY(-8px);
  transition-duration: var(--dur-fast);
}
@starting-style {
  .mobile-overlay { opacity: 0; transform: translateY(-8px); }
}
.mobile-overlay ul { display: grid; gap: var(--s-1); }
.mobile-overlay a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: 52px;
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--navy);
  text-decoration: none;
}
.mobile-overlay .btn { margin-top: var(--s-3); width: 100%; }

/* 6. Hero */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 88vh;
  min-height: 88svh;
  padding-top: var(--header-h);
  background: var(--navy);
  color: var(--on-dark);
  overflow: hidden;
}
.hero-photo { position: absolute; inset: 0; z-index: 0; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg, rgba(14, 45, 98, 0.94) 0%, rgba(14, 45, 98, 0.86) 55%, rgba(14, 45, 98, 0.55) 100%);
}
.hero-content { position: relative; z-index: 2; padding-block: var(--s-6); }
.hero-content > * { max-width: 40rem; }
.hero .kicker { color: var(--red-rim); }
.hero h1 { color: var(--on-dark); margin-bottom: var(--s-3); }
.hero-sub { font-size: var(--fs-lead); color: var(--on-dark); margin-bottom: var(--s-4); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-5); }

.badges { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--on-dark);
}

/* 7. Service strip (the site's one tracked-uppercase role) */
.service-strip { background: var(--blue); border-top: 4px solid var(--red); }
.strip-list {
  display: flex;
  flex-wrap: wrap;
  padding-block: var(--s-2);
}
.strip-list li {
  position: relative;
  padding: 0.4rem 1.1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--on-dark);
  max-width: none;
}
.strip-list li:first-child { padding-left: 0; }
.strip-list li + li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.35);
}

/* 8. Photo slots */
.photo-slot { position: relative; overflow: hidden; background: var(--line); }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 12rem;
  padding: var(--s-2);
  border: 2px dashed #9AA8B5;
  background: repeating-linear-gradient(135deg, var(--line) 0 12px, #DFE5EB 12px 24px);
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 700;
  text-align: center;
}
.hero .photo-placeholder { display: none; }

/* 9. Services */
.section-head { margin-bottom: var(--s-5); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.service-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.service-card .photo-slot { aspect-ratio: 16 / 9; }
.service-card-body { padding: var(--s-3); }
.service-card-body h3 { margin-bottom: var(--s-1); }
.service-card-body p { font-size: var(--fs-secondary); color: var(--muted); }

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}
.cta-band p { font-size: var(--fs-lead); color: var(--text); }

/* 10. Why us */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-6);
  align-items: start;
}
.why-grid .photo-slot { aspect-ratio: 4 / 5; border-radius: var(--radius); max-width: 34rem; }
.why-copy > p { color: var(--muted); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--s-2);
  margin-block: var(--s-4);
}
.fact {
  padding: var(--s-2);
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
}
.fact-value {
  display: block;
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.25rem;
}
.fact-label { display: block; font-size: var(--fs-small); color: var(--muted); line-height: 1.4; }
.source-note { font-size: var(--fs-small); color: var(--muted); }

.accreditations { margin-top: var(--s-5); }
.accreditations h3 { margin-bottom: var(--s-2); }
.accred-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-2);
}
.accred {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: var(--s-2);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: none;
}
.accred img { height: 48px; width: auto; margin-bottom: 0.25rem; }
.accred-name { font-weight: 700; color: var(--ink); line-height: 1.3; }
.accred-note { font-size: var(--fs-small); color: var(--muted); line-height: 1.4; }

/* 11. Specialisms */
.makes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-2);
  margin-block: var(--s-4);
}
.make {
  position: relative;
  padding: var(--s-3);
  background: var(--navy);
  border-radius: var(--radius);
  text-align: center;
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--on-dark);
  overflow: hidden;
  max-width: none;
}
.make::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--red);
}
.specialisms .photo-slot { aspect-ratio: 21 / 9; border-radius: var(--radius); margin-bottom: var(--s-4); }

/* 12. How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
}
.step { display: flex; gap: var(--s-2); max-width: none; }
.step-number {
  flex-shrink: 0;
  width: 2.5rem;
  font-family: var(--display);
  font-size: 2.5rem;
  line-height: 1;
  color: var(--blue);
}
.step h3 { margin-bottom: var(--s-1); }
.step p { font-size: var(--fs-secondary); color: var(--muted); }

/* 13. Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-6);
  align-items: start;
}
.contact-details { display: grid; gap: var(--s-3); margin-block: var(--s-4); }
.contact-details dt {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 0.15rem;
}
.contact-details dd { color: var(--text); }
.contact-details .tel { font-size: 1.375rem; font-weight: 700; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.contact-side { display: grid; gap: var(--s-3); }
.contact-photo { aspect-ratio: 4 / 3; border-radius: var(--radius); }
.hours-card {
  padding: var(--s-4);
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: var(--radius);
}
.hours-card h3 { margin-bottom: var(--s-2); }
.hours { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hours th, .hours td { padding: 0.6rem 0; text-align: left; border-bottom: 1px solid var(--line); font-size: var(--fs-secondary); }
.hours th { font-weight: 700; color: var(--ink); }
.hours td { color: var(--text); text-align: right; }

/* 14. Footer */
.site-footer {
  background: var(--navy);
  border-top: 4px solid var(--red);
  color: var(--on-dark-muted);
  padding-block: var(--s-6) var(--s-4);
  font-size: var(--fs-secondary);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--s-4);
  margin-bottom: var(--s-4);
}
.footer-brand .logo { min-height: 0; margin-bottom: var(--s-2); }
.footer-brand .logo img { height: 80px; }
.notfound .logo { margin-inline: auto; }
.notfound .logo img { height: 100px; }
.site-footer a { color: var(--on-dark); text-underline-offset: 3px; }
.site-footer p + p { margin-top: 0.4rem; }
.footer-links { display: grid; gap: 0.25rem; }
.footer-links a { display: inline-flex; align-items: center; min-height: 32px; }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: var(--fs-small);
}
.footer-base p { margin: 0; }

/* 15. Privacy page and 404 */
.page-top { padding-top: calc(var(--header-h) + var(--s-6)); }
.prose h1 { margin-bottom: var(--s-3); }
.prose h2 { font-size: 1.5rem; margin-top: var(--s-5); margin-bottom: var(--s-2); }
.prose ul { list-style: disc; padding-left: 1.25rem; }
.prose li + li { margin-top: 0.4rem; }
.prose .updated { color: var(--muted); font-size: var(--fs-small); }

.notfound { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: var(--s-4) var(--gutter); background: var(--navy); color: var(--on-dark); }
.notfound h1 { color: var(--on-dark); margin-block: var(--s-3); }
.notfound p { margin-inline: auto; margin-bottom: var(--s-4); }

/* 16. Responsive */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .why-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
  .why-grid .photo-slot { aspect-ratio: 4 / 3; max-width: none; }
  .why-grid .photo-slot img { object-position: center 35%; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .main-nav { display: none; }
  .hamburger { display: inline-flex; }
  .header-inner { gap: var(--s-1); }
  .header-call .call-long { display: none; }
  .header-call .call-short { display: inline; }
}

@media (max-width: 768px) {
  :root { --s-7: 4rem; --s-6: 3rem; }
  .hero-overlay { background: rgba(14, 45, 98, 0.88); }
  .strip-list { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
  .strip-list li { white-space: nowrap; flex-shrink: 0; scroll-snap-align: start; }
  .services-grid, .steps, .makes, .accred-list, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .steps { gap: var(--s-3); }
  .make { padding: var(--s-2); }
}

@media (max-width: 480px) {
  .hero-actions .btn, .contact-actions .btn, .cta-band .btn { width: 100%; }
}

@media (max-width: 359px) {
  .logo img { height: 52px; }
}

/* 17. Reduced motion (after the rules it overrides) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .skip-link { transition-property: background-color, border-color; }
  .btn:active { transform: none; }
  .mobile-overlay, .mobile-overlay.is-hidden { transform: none; }
  .mobile-overlay { transition-duration: 200ms; }
  @starting-style {
    .mobile-overlay { transform: none; }
  }
  .hamburger-lines span { transition: none; }
}
