/* Al Rabhi Servicing — landing page
   Palette: chaux (lime-washed concrete), ink, navy (logo), plate yellow (Algerian plates), sand */
:root {
  --chaux: #eef0ec;
  --paper: #ffffff;
  --ink: #10151f;
  --ink-soft: #4a5263;
  --navy: #1f3a8a;
  --navy-deep: #14265c;
  --plate: #f2c230;
  --sand: #d9c7a5;
  --line: #d3d7d0;

  --f-display: "Archivo", "Arial Narrow", sans-serif;
  --f-body: "Hanken Grotesk", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;
  --f-ar: "Noto Kufi Arabic", sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1280px;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--chaux);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--plate);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 {
  font-family: var(--f-display);
  font-variation-settings: "wdth" 125;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--plate);
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Plate: the recurring label device ---------- */
.plate {
  display: inline-block;
  margin: 0;
  padding: 6px 12px 5px;
  background: var(--plate);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 4px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.2;
  box-shadow: inset 0 0 0 2px var(--plate), inset 0 0 0 3px rgba(16, 21, 31, 0.35);
}
.plate--sm { font-size: 0.72rem; padding: 4px 9px 3px; }
.plate--onnavy { border-color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  background: var(--plate);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 0.95rem; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px var(--gutter);
  background: rgba(238, 240, 236, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand img { width: 150px; height: auto; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a {
  text-decoration: none;
  font-weight: 500;
  color: var(--ink-soft);
}
.nav a:hover { color: var(--navy); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(88vh, 860px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
  background: var(--navy-deep);
}
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 60%;
  animation: settle 1.6s ease-out both;
}
.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(10, 16, 34, 0.92) 0%, rgba(10, 16, 34, 0.55) 38%, rgba(10, 16, 34, 0) 70%),
    linear-gradient(to right, rgba(10, 16, 34, 0.55), rgba(10, 16, 34, 0) 60%);
}
.hero__content {
  position: relative;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px var(--gutter) clamp(40px, 7vh, 80px);
}
.hero__title {
  margin-top: 20px;
  max-width: 15ch;
  font-size: clamp(2.3rem, 6.4vw, 5.6rem);
  text-wrap: balance;
}
.hero__title span { display: block; color: var(--plate); }
.hero__lede {
  max-width: 46ch;
  margin: 22px 0 0;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: rgba(255, 255, 255, 0.88);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__ar {
  position: absolute;
  top: 28px;
  right: var(--gutter);
  margin: 0;
  font-family: var(--f-ar);
  font-weight: 800;
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 18px rgba(10, 16, 34, 0.5);
}

@keyframes settle {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}

/* ---------- References ---------- */
.refs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 40px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--gutter);
  border-bottom: 1px solid var(--line);
}
.refs__title {
  font-family: var(--f-mono);
  font-variation-settings: normal;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.refs__list {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ref {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 92px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.ref img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 60px;
  object-fit: contain;
}
.ref img.ref__img--tall { max-height: 76px; }
.ref--text {
  flex-direction: column;
  gap: 2px;
  text-align: center;
  font-family: var(--f-display);
  font-variation-settings: "wdth" 100;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--ink-soft);
}
.ref--text [lang="ar"] {
  font-family: var(--f-ar);
  font-size: 1rem;
  color: var(--navy);
}

/* ---------- Section shared ---------- */
.activites,
.parc,
.chantiers {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 120px) var(--gutter) 0;
}
.section-head { margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 {
  margin-top: 16px;
  max-width: 22ch;
  font-size: clamp(1.75rem, 3.6vw, 3rem);
  text-wrap: balance;
}
.section-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

/* ---------- Activities ---------- */
.act-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.act {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.act img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.act__body { padding: 22px 24px 26px; }
.act h3 {
  margin: 14px 0 8px;
  font-size: 1.55rem;
  color: var(--navy);
}
.act p { margin: 0; color: var(--ink-soft); }
.act ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.act li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

/* ---------- Fleet yard (signature) ---------- */
.parc__ctrl { display: flex; gap: 10px; flex-shrink: 0; }
.round {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.round:hover { background: var(--plate); }

.yard {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(250px, 30vw, 360px);
  gap: 18px;
  margin: 0 calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 28px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--navy) transparent;
}
.unit {
  position: relative;
  scroll-snap-align: start;
}
.unit img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--sand);
}
.plate--unit {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 1.05rem;
  padding: 7px 14px 6px;
  box-shadow: inset 0 0 0 2px var(--plate), inset 0 0 0 3px rgba(16, 21, 31, 0.35), 0 6px 18px rgba(0, 0, 0, 0.25);
}
.unit h3 {
  margin-top: 14px;
  font-size: 1.2rem;
  font-variation-settings: "wdth" 112;
}
.unit__model {
  margin: 4px 0 0;
  font-family: var(--f-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ---------- Fleet filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  min-height: 40px;
  padding: 0 16px;
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.chip:hover { background: rgba(242, 194, 48, 0.4); }
.chip[aria-pressed="true"] { background: var(--plate); }
.unit[hidden] { display: none; }

/* ---------- Projects mosaic ---------- */
.mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  grid-auto-flow: dense;
  gap: 12px;
}
.m {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--sand);
}
.m--wide { grid-column: span 2; }
.m--tall { grid-row: span 2; }
.m img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.m:hover img { transform: scale(1.04); }
.m figcaption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 10px;
  background: rgba(16, 21, 31, 0.82);
  color: #fff;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ---------- Quote form ---------- */
.devis {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 120px) var(--gutter) 0;
}
.devis__form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  padding: clamp(20px, 3vw, 36px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.field label span { font-weight: 500; color: var(--ink-soft); text-transform: none; letter-spacing: 0; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  background: var(--chaux);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}
.field textarea { resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px var(--plate); }
.field input:user-invalid,
.field select:user-invalid { border-color: #b3261e; }
.devis__error { grid-column: 1 / -1; margin: 0; color: #b3261e; font-weight: 600; }
.devis__send { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
.devis__how { margin: 0 6px 0 0; font-family: var(--f-mono); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; }
.btn--wa { background: #25d366; }
.devis__send .btn { cursor: pointer; }

/* ---------- Floating WhatsApp ---------- */
.wa-float {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  background: #25d366;
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
  will-change: transform;
  touch-action: manipulation;
}
@media (hover: hover) {
  .wa-float:hover { transform: translateY(-3px); }
}

/* ---------- Lightbox ---------- */
.m { cursor: zoom-in; }
.lightbox {
  width: min(96vw, 1100px);
  max-height: 94vh;
  padding: 0;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(10, 16, 34, 0.86); }
.lightbox img { width: 100%; max-height: 80vh; object-fit: contain; background: #000; }
.lightbox__cap { margin: 0; padding: 12px 16px 14px; font-weight: 500; }
.lightbox__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  background: var(--plate);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__nav {
  position: absolute;
  top: 40%;
  width: 48px;
  height: 48px;
  background: var(--plate);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
}
.lightbox__nav--prev { left: 10px; }
.lightbox__nav--next { right: 10px; }
.lightbox img { touch-action: pan-y; }

/* ---------- Contact ---------- */
.contact {
  margin-top: clamp(64px, 10vw, 120px);
  background: var(--navy);
  color: #fff;
}
.contact__inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 110px) var(--gutter);
}
.contact h2 {
  margin-top: 18px;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  text-wrap: balance;
}
.contact__lede {
  max-width: 44ch;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.82);
}

.bigplate {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 20px 14px;
  background: var(--plate);
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 10px;
  box-shadow: inset 0 0 0 4px var(--plate), inset 0 0 0 6px rgba(16, 21, 31, 0.4), 0 18px 40px rgba(0, 0, 0, 0.3);
}
.bigplate__num {
  color: inherit;
  text-decoration: none;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: clamp(1.35rem, 3.4vw, 2.6rem);
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.15s ease;
}
.bigplate__row { display: flex; align-items: center; gap: 12px; }
.bigplate__row + .bigplate__row { margin-top: 10px; }
.copy {
  min-height: 32px;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 4px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.copy:hover { background: rgba(16, 21, 31, 0.1); }
.bigplate__num:hover { transform: translateY(-2px); }
.bigplate__tag {
  margin-top: 10px;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.bigplate__mail {
  align-self: stretch;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid var(--ink);
  color: inherit;
  text-align: center;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.bigplate__mail:hover { text-decoration: underline; text-underline-offset: 4px; }

.contact__list { margin: 28px 0 0; }
.contact__list > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}
.contact__list dt {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  padding-top: 3px;
}
.contact__list dd { margin: 0; overflow-wrap: anywhere; }
.contact__list a { color: #fff; text-underline-offset: 3px; }
.contact__list a:hover { color: var(--plate); }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  padding: 28px var(--gutter);
  background: var(--paper);
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.footer img { width: 110px; height: auto; }
.footer p { margin: 0; }
.footer p:last-child { margin-left: auto; }
.footer [lang="ar"] { font-family: var(--f-ar); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .refs__list { flex-basis: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .act-grid { grid-template-columns: 1fr; }
  .act { flex-direction: row; }
  .act img { width: 42%; aspect-ratio: auto; }
  .mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
  .contact__inner { grid-template-columns: 1fr; }
  .devis__form { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .topbar { justify-content: space-between; }
  .brand img { width: 120px; }
  .hero { min-height: 92vh; }
  .hero__ar { top: 18px; }
  .ref { height: 76px; padding: 10px; }
  .ref img { max-height: 48px; }
  .ref img.ref__img--tall { max-height: 56px; }
  .act { flex-direction: column; }
  .act img { width: 100%; aspect-ratio: 16 / 10; }
  .section-head--row { align-items: flex-start; flex-direction: column; }
  .parc__ctrl { display: none; }
  .yard { grid-auto-columns: 78%; }
  .mosaic { grid-auto-rows: 150px; gap: 8px; }
  .m--wide { grid-column: span 2; }
  .footer p:last-child { margin-left: 0; }
  .footer { padding-bottom: 92px; }
  .wa-float { width: 52px; height: 52px; }
  .wa-float svg { width: 26px; height: 26px; }
  .devis__send .btn { flex: 1 1 140px; }
  .lightbox__nav { top: auto; bottom: 64px; }
}

@media (max-width: 380px) {
  .bigplate { padding-inline: 12px; }
  .bigplate__row { gap: 8px; }
  .bigplate__num { font-size: 1.15rem; letter-spacing: 0.02em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
