/* AS Mobile Mechanic and Diagnostics — tokens from ../../DESIGN.md */

:root {
  --navy-900: #0F172A;
  --navy-800: #1E293B;
  --navy-700: #334155;
  --amber-500: #F59E0B;
  --amber-400: #FBBF24;
  --amber-700: #B45309;  /* icons/stars on light grounds — 4.6:1 on white */

  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --muted: #E9EDF1;
  --border: #E2E8F0;
  --text: #0F172A;
  --text-dim: #576375;
  --on-dark: #FFFFFF;
  --on-dark-dim: #CBD5E1;
  --danger: #B91C1C;
  --whatsapp: #25D366;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.875rem;
  --fs-3xl: 2.25rem;
  --fs-display: clamp(2.125rem, 8vw, 4rem);

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px; --sp-24: 96px;

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .06);
  --shadow-md: 0 4px 16px rgb(15 23 42 / .08);

  --font-head: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --header-h: 60px;
  --callbar-h: 72px;
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-base)/1.55 var(--font-body);
  overflow-x: hidden;
  /* clears the fixed mobile call bar */
  padding-bottom: calc(var(--callbar-h) + env(safe-area-inset-bottom, 0px));
}

img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; margin: 0; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: var(--navy-800); text-underline-offset: 3px; }
a:hover { color: var(--navy-700); }

:focus-visible {
  outline: 3px solid var(--amber-500);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.ico { width: 24px; height: 24px; flex: none; }
.ico--wa { color: var(--whatsapp); }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--sp-5); }
/* same gutters as every other section; measure is capped on the content */
.wrap--text > * { max-width: 62ch; }
.wrap--text .form { max-width: 34rem; }

/* ---------- preview banner ---------- */

.banner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 14px;
  background: var(--navy-900);
  color: var(--on-dark-dim);
  font-size: var(--fs-xs);
}
.banner[hidden] { display: none; }
.banner p { margin: 0; flex: 1; }
.banner__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -10px -10px -10px 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--on-dark-dim);
  cursor: pointer;
}
.banner__close:hover { color: var(--on-dark); }
.banner__close .ico { width: 18px; height: 18px; }

/* ---------- 1. header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--navy-800);
  box-shadow: var(--shadow-sm);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  max-width: 1120px;
  margin-inline: auto;
  min-height: var(--header-h);
  padding: var(--sp-2) 20px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .3em;              /* flex collapses the space between "AS" and the rest */
  min-height: 44px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: -0.01em;
  color: var(--on-dark);
  text-decoration: none;
}
.wordmark span { color: var(--amber-500); font-weight: 700; }
.header__cta-short { display: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: var(--r-pill);
  font: 600 var(--fs-base)/1.2 var(--font-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease-out, transform .18s ease-out, border-color .18s ease-out;
}
.btn--sm { min-height: 44px; padding: 10px 18px; font-size: var(--fs-sm); }
.btn--lg { min-height: 56px; padding: 16px 28px; font-size: var(--fs-lg); font-weight: 700; }
.btn--block { width: 100%; }

.btn--primary { background: var(--amber-500); color: var(--navy-900); }
.btn--primary:hover { background: var(--amber-400); color: var(--navy-900); transform: translateY(-1px); }
.btn--primary:active { transform: scale(.98); }

.btn--ghost {
  background: transparent;
  color: var(--on-dark);
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .55);
}
.btn--ghost:hover { background: rgb(255 255 255 / .1); color: var(--on-dark); transform: translateY(-1px); }

.btn--outline {
  background: var(--surface);
  color: var(--navy-800);
  box-shadow: inset 0 0 0 1px var(--border);
}
.btn--outline:hover { background: var(--muted); color: var(--navy-800); }

/* ---------- 2. hero ---------- */

.hero {
  /* gradient sits over the texture so headline contrast never depends on the image */
  background:
    linear-gradient(170deg, rgb(30 41 59 / .92) 0%, rgb(15 23 42 / .97) 100%),
    url("../images/hero-texture.webp") center / cover no-repeat,
    var(--navy-900);
  color: var(--on-dark);
}
.hero__inner { padding-block: var(--sp-8) var(--sp-12); }

.rating {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--on-dark-dim);
}
.rating__stars { display: inline-flex; gap: 2px; color: var(--amber-500); }
.rating__stars .ico { width: 18px; height: 18px; }
.rating strong { color: var(--on-dark); font-size: var(--fs-base); }

.hero h1 {
  font-size: var(--fs-display);
  letter-spacing: -0.03em;
  max-width: 18ch;
  margin-bottom: var(--sp-4);
}
.hero__sub {
  font-size: var(--fs-lg);
  color: var(--on-dark-dim);
  max-width: 42ch;
  margin-bottom: var(--sp-6);
}
.actions { display: flex; flex-direction: column; gap: var(--sp-3); }
.hero__note {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
  font-size: var(--fs-sm);
  color: var(--on-dark-dim);
}
.hero__note .ico { width: 18px; height: 18px; }

/* ---------- sections ---------- */

.section { padding-block: var(--sp-16); }
.section--alt { background: var(--surface); border-block: 1px solid var(--border); }
.section h2 { font-size: var(--fs-2xl); margin-bottom: var(--sp-4); max-width: 24ch; }
.section .rating { color: var(--text-dim); margin-bottom: var(--sp-3); }
.section .rating__stars { color: var(--amber-700); }
.section .rating strong { color: var(--text); }

.lede { font-size: var(--fs-lg); color: var(--text-dim); max-width: 60ch; }
.section h2 + .lede { margin-bottom: var(--sp-8); }

.section__cta { margin-top: var(--sp-8); font-size: var(--fs-base); color: var(--text-dim); }
.section__cta a { color: var(--navy-800); font-weight: 600; }
.section__cta--btn a { color: var(--navy-900); }

/* ---------- 3. services ---------- */

.cards { display: grid; gap: var(--sp-4); margin-top: var(--sp-8); }
.card {
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.section--alt .card { background: var(--bg); }
.card__ico { width: 28px; height: 28px; color: var(--amber-700); margin-bottom: var(--sp-3); }
.card h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.card p { color: var(--text-dim); font-size: var(--fs-sm); }

/* ---------- image band ---------- */

.band { background: var(--navy-900); }
.band__item { margin: 0; }
.band__item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  max-height: 420px;
  object-fit: cover;
}

/* honesty label — these are stock photos, not Anas's own work */
.photo-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--on-dark-dim);
}
.band .photo-label { padding: var(--sp-2) var(--sp-5) var(--sp-3); }

.hero__media { display: none; }

/* ---------- 4. reviews ---------- */

.reviews { display: grid; gap: var(--sp-4); margin-top: var(--sp-8); }
.review {
  margin: 0;
  padding: var(--sp-6);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.review blockquote { margin: 0; }
.review p { color: var(--text); }
.review figcaption {
  margin-top: var(--sp-4);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-dim);
}

/* ---------- 5. why ---------- */

.whys { display: grid; gap: var(--sp-5); }
.whys li { display: flex; align-items: flex-start; gap: var(--sp-3); }
.whys .ico { width: 22px; height: 22px; color: var(--amber-700); margin-top: 3px; }
.whys strong { display: block; font-family: var(--font-head); font-weight: 600; }
.whys span { color: var(--text-dim); font-size: var(--fs-sm); }

/* ---------- 6. areas ---------- */

.areas__ico { width: 32px; height: 32px; color: var(--amber-700); margin-bottom: var(--sp-3); }

/* ---------- 7. form ---------- */

.form { margin-top: var(--sp-8); }
.field { margin-bottom: var(--sp-5); }
.field label {
  display: block;
  margin-bottom: var(--sp-2);
  font-weight: 600;
  font-size: var(--fs-sm);
}
.field__opt { font-weight: 400; color: var(--text-dim); }
.field input, .field textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid #B6C0CE;
  border-radius: var(--r-md);
  color: var(--text);
  font: 400 var(--fs-base)/1.5 var(--font-body);
}
.field textarea { resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--navy-800); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); }
.field__hint { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--text-dim); }
.field__err {
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--danger);
}
.field__err[hidden] { display: none; }
.form__note { margin-top: var(--sp-4); font-size: var(--fs-sm); color: var(--text-dim); }

/* ---------- 8. footer ---------- */

.footer {
  padding-block: var(--sp-12) var(--sp-8);
  background: var(--navy-800);
  color: var(--on-dark-dim);
  font-size: var(--fs-sm);
}
.footer__inner { display: grid; gap: var(--sp-8); }
.footer__name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--fs-lg);
  color: var(--on-dark);
  margin-bottom: var(--sp-2);
}
.footer__meta { margin: 0; }
.footer__meta dt {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.footer__meta dt .ico { width: 16px; height: 16px; }
.footer__meta dd { margin: 0 0 var(--sp-4); color: var(--on-dark); }
.footer__meta dd a { display: inline-flex; align-items: center; min-height: 44px; color: var(--on-dark); font-weight: 600; }
.footer__meta dd a:hover { color: var(--amber-400); }
.footer__legal {
  max-width: 1120px;
  margin: var(--sp-8) auto 0;
  padding: var(--sp-6) 20px 0;
  border-top: 1px solid var(--navy-700);
  font-size: var(--fs-xs);
}

/* ---------- 9. sticky call bar (mobile) ---------- */

.callbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) 16px calc(var(--sp-3) + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.callbar__call { flex: 1 1 auto; }
.callbar__wa { flex: 0 0 auto; padding-inline: 18px; background: var(--muted); }

/* ---------- breakpoints ---------- */

@media (min-width: 420px) {
  .actions { flex-direction: row; flex-wrap: wrap; }
  .actions .btn { flex: 1 1 auto; }
}

@media (min-width: 640px) {
  .hero__inner { padding-block: var(--sp-16) var(--sp-24); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .reviews { grid-template-columns: repeat(2, 1fr); }
  .band__item img { aspect-ratio: 16 / 7; }
  .footer__inner { grid-template-columns: 1.4fr 1fr; }
  .section h2 { font-size: var(--fs-3xl); }
}

@media (min-width: 900px) {
  :root { --callbar-h: 0px; }
  body { padding-bottom: 0; }
  .callbar { display: none; }
  .section { padding-block: var(--sp-24); }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { max-width: 16ch; }

  /* hero becomes two columns — text left, example photo filling the empty right */
  .hero__inner {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: var(--sp-12);
    align-items: center;
  }
  .hero__media { display: block; margin: 0; }
  .hero__media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--r-lg);
  }
  .hero__media .photo-label { margin-top: var(--sp-2); }
}

@media (max-width: 639px) {
  .header__cta-full { display: none; }
  .header__cta-short { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .btn:hover, .btn:active { transform: none; }
}
