/* ==========================================================================
   Jolly Auto India: UK trade redesign (homepage).
   Direction: a workshop parts book. Brunswick green and brass on cool paper,
   rules and rows instead of stacks of cards, and a vehicle finder up front.
   ========================================================================== */

:root {
  --brunswick: #1f4033;
  --field: #2f5d46;
  --brass: #b8892f;
  --ink: #16201b;
  --ink-2: #1f2d26;
  --steel: #43514a;
  --slate: #66736b;
  --rule: #d3d9d1;
  --stone: #e8ebe5;
  --paper: #f5f6f2;
  --white: #ffffff;

  /* chat widget reads these names, so it picks up the new palette */
  --red: var(--field);
  --red-dark: var(--brunswick);
  --red-tint: #e4eee8;
  --line: var(--rule);
  --radius: 3px;
  --shadow-md: 0 6px 22px rgba(22, 32, 27, 0.14);
  --shadow-lg: 0 18px 44px rgba(22, 32, 27, 0.2);

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --gutter: 20px;
}
@media (min-width: 768px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--field); }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -999px; top: 0; z-index: 300; padding: 0.7rem 1rem; background: var(--ink); color: #fff; }
.skip:focus { left: 8px; top: 8px; }

:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.55rem 1.25rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: 700 1rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn--primary { background: var(--field); color: #fff; border-color: var(--field); }
.btn--primary:hover { background: var(--brunswick); border-color: var(--brunswick); }
.btn--line { background: transparent; color: var(--brunswick); border-color: var(--brunswick); }
.btn--line:hover { background: var(--brunswick); color: #fff; }
.btn--light { background: #fff; color: var(--brunswick); border-color: #fff; }
.btn--light:hover { background: transparent; color: #fff; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------------------------------------------------------- top strip -- */

.strip { background: var(--brunswick); color: #d5e0d9; font-size: 0.9rem; }
.strip__inner { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; justify-content: space-between; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.strip a { color: #fff; text-decoration: none; }
.strip a:hover { text-decoration: underline; }
.strip__contact { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
@media (max-width: 720px) { .strip__inner > span:first-child { display: none; } }

/* ------------------------------------------------------------- header -- */

.head { background: var(--white); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 80; transition: box-shadow 0.2s ease; }
.head.is-scrolled { box-shadow: 0 4px 16px rgba(22, 32, 27, 0.1); }
.head__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 92px; flex-wrap: wrap; }
.head__logo img { width: 220px; }
@media (max-width: 480px) { .head__logo img { width: 190px; } }
.head__toggle {
  display: none;
  min-height: 44px; padding: 0 1rem;
  background: transparent; color: var(--brunswick);
  border: 2px solid var(--brunswick); border-radius: var(--radius);
  font: 700 1rem var(--font-body); cursor: pointer;
}
.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav ul { display: flex; gap: 1.5rem; }
.nav a:not(.btn) { color: var(--ink); font-weight: 600; text-decoration: none; padding: 0.4rem 0; border-bottom: 2px solid transparent; }
.nav a:not(.btn):hover { border-bottom-color: var(--brass); }

@media (max-width: 900px) {
  .head__toggle { display: inline-flex; align-items: center; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.5rem 0 1.25rem; }
  .nav.is-open { display: flex; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav ul a { display: block; padding: 0.85rem 0 !important; border-bottom: 1px solid var(--rule) !important; }
}

/* --------------------------------------------------------------- hero -- */

.hero { padding: clamp(2rem, 5vw, 4rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero__grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 960px) { .hero__grid { grid-template-columns: 1.05fr 0.95fr; gap: 3.5rem; } }

.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.7rem); max-width: 15ch; color: var(--brunswick); }
.hero__lead { margin: 1.25rem 0 1.75rem; max-width: 34em; font-size: 1.2rem; color: var(--steel); }

.hero__visual { position: relative; background: #000; border-radius: 4px; overflow: hidden; }
.hero__visual > img,
.hero__visual > video {
  width: 100%; aspect-ratio: 4 / 3; border-radius: 0; background: #000;
}
.hero__video { position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s ease; object-fit: cover; object-position: 62% center; }
.hero__video.is-ready { opacity: 1; }
.hero__fallback { position: relative; object-fit: contain; }

.btn--play { display: inline-flex; align-items: center; gap: 0.5rem; }
.btn--play svg { flex: none; }

/* ------------------------------------------------------- factory tour -- */

.tour { width: min(900px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 4px; background: var(--ink); box-shadow: var(--shadow-lg); }
.tour::backdrop { background: rgba(10, 15, 12, 0.75); }
.tour__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0.85rem 0.85rem 1.1rem; border-bottom: 3px solid var(--brass); }
.tour__head h2 { font-size: 1.2rem; color: #fff; }
.tour__close { display: grid; place-items: center; width: 40px; height: 40px; background: transparent; color: #fff; border: 0; border-radius: var(--radius); cursor: pointer; }
.tour__close:hover { background: rgba(255, 255, 255, 0.12); }
.tour__body { line-height: 0; }
.tour__body video { display: block; width: 100%; max-height: 72vh; background: #000; }

.finder {
  position: relative;
  margin: -3.5rem 1rem 0;
  padding: 1.25rem 1.25rem 1.1rem;
  background: var(--white);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--brass);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.finder h2 { margin-bottom: 0.9rem; font-size: 1.35rem; color: var(--brunswick); }
.finder__field { margin-bottom: 0.8rem; }
.finder label { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; font-weight: 600; color: var(--steel); }
.finder select {
  width: 100%; min-height: 46px; padding: 0.5rem 0.65rem;
  background: #fff; color: var(--ink);
  border: 1px solid #aab3ab; border-radius: var(--radius);
  font: 400 16px/1.3 var(--font-body);
}
.finder select:disabled { background: var(--paper); color: var(--slate); }
.finder__err { min-height: 0; margin: 0 0 0.6rem; font-size: 0.9rem; font-weight: 600; color: #9c2a1c; }
.finder__err:empty { display: none; }
.finder__alt { margin: 0.8rem 0 0; font-size: 0.95rem; color: var(--steel); }

/* -------------------------------------------------------------- facts -- */

.facts { background: var(--stone); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts ul { display: flex; flex-wrap: wrap; }
.facts li { flex: 1 1 200px; padding: 1.2rem 1.25rem; border-left: 1px solid #c3cbc1; }
.facts li:first-child { border-left: 0; padding-left: 0; }
.facts strong { display: block; font: 700 1.7rem/1.15 var(--font-display); color: var(--brunswick); font-variant-numeric: tabular-nums; }
.facts .counter { display: inline-block; min-width: 1.6ch; }
.facts span:not(.counter) { display: block; margin-top: 0.2rem; font-size: 0.92rem; color: var(--steel); }
@media (max-width: 720px) {
  .facts li { flex-basis: 100%; border-left: 0; padding: 0.85rem 0; border-top: 1px solid #c3cbc1; }
  .facts li:first-child { border-top: 0; }
}

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

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--stone { background: var(--stone); }
.section__head { display: grid; gap: 1rem; margin-bottom: 2.25rem; }
.section__head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); color: var(--brunswick); }
.section__head p { max-width: 38em; margin: 0; color: var(--steel); }
@media (min-width: 960px) {
  .section__head { grid-template-columns: 1fr 1.3fr; gap: 3rem; align-items: end; }
}

/* vehicle tabs + compact rows */
.vtabs__list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.vtabs__tab {
  min-height: 44px; padding: 0.45rem 1.15rem;
  background: transparent; color: var(--brunswick);
  border: 2px solid var(--brunswick); border-radius: var(--radius);
  font: 700 1rem/1.2 var(--font-body); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.vtabs__tab:hover { background: var(--red-tint); }
.vtabs__tab[aria-selected="true"] { background: var(--brunswick); color: #fff; }
.vtabs__heading { margin: 0 0 0.6rem; font-size: 1.15rem; color: var(--brunswick); }
/* Without JavaScript every make is shown in turn; with it, one tab at a time. */
.js-tabs .vtabs__list { display: flex; }
.vtabs:not(.js-tabs) .vtabs__list { display: none; }
.js-tabs .vtabs__heading { display: none; }
.vtabs:not(.js-tabs) .vtabs__panel { margin-bottom: 1.75rem; }
.vtabs__panel[hidden] { display: none; }

.rows { border-top: 3px solid var(--brunswick); }
.row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.row > div { flex: 1 1 auto; min-width: 0; }
.row .btn { flex: none; }
.row__name { font: 700 1.1rem/1.25 var(--font-display); color: var(--ink); }
.row__years { margin-left: 0.5rem; font-size: 0.95rem; color: var(--slate); }
.row .btn { min-height: 38px; min-width: 96px; padding: 0.3rem 1rem; font-size: 0.95rem; }
@media (max-width: 600px) {
  .row__years { display: block; margin-left: 0; font-size: 0.9rem; }
}

/* product plates */
.plates { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1.75rem 1.25rem; }
.plates a { display: block; color: var(--ink); text-decoration: none; }
.plates a > span:first-child { display: block; overflow: hidden; border-radius: var(--radius); background: #fff; border: 1px solid var(--rule); }
/* Whole product photo visible (zoomed out, nothing cropped). */
.plates img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; transition: transform 0.35s ease; }
.plates a:hover img, .plates a:focus-visible img { transform: scale(1.03); }
.plates span.plates__label { display: block; margin-top: 0.6rem; padding-top: 0.5rem; border-top: 2px solid var(--brass); font-weight: 700; line-height: 1.3; }
.plates a:hover span.plates__label { color: var(--field); text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .plates img { transition: none; } }

/* -------------------------------------------------------- scroll reveal -- */

.reveal, .reveal-group > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible, .reveal-group.is-visible > * { opacity: 1; transform: none; }
.reveal-group.is-visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-group.is-visible > *:nth-child(2) { transition-delay: 0.05s; }
.reveal-group.is-visible > *:nth-child(3) { transition-delay: 0.1s; }
.reveal-group.is-visible > *:nth-child(4) { transition-delay: 0.15s; }
.reveal-group.is-visible > *:nth-child(5) { transition-delay: 0.2s; }
.reveal-group.is-visible > *:nth-child(6) { transition-delay: 0.25s; }
.reveal-group.is-visible > *:nth-child(n+7) { transition-delay: 0.3s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-group > * { opacity: 1; transform: none; transition: none; }
}

/* quality */
.section--dark { background: var(--brunswick); color: #dbe6df; }
.made { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 960px) { .made { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.made__img img { width: 100%; border-radius: 4px; }
.made h2 { margin-bottom: 1rem; font-size: clamp(1.8rem, 3.6vw, 2.6rem); color: #fff; max-width: 16ch; }
.ticks { margin: 1.25rem 0 1.75rem; }
.ticks li { position: relative; padding: 0.55rem 0 0.55rem 1.7rem; border-top: 1px solid rgba(255, 255, 255, 0.18); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 1.05rem;
  width: 0.9rem; height: 0.5rem;
  border-left: 3px solid var(--brass); border-bottom: 3px solid var(--brass);
  transform: rotate(-45deg);
}

/* closing enquiry band */
.quote { border-top: 1px solid var(--rule); }
.quote__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.quote h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--brunswick); }
.quote p { margin: 0.5rem 0 0; color: var(--steel); }

/* ------------------------------------------------------------- footer -- */

.foot { background: var(--ink); color: #b9c5be; font-size: 0.98rem; }
.foot a { color: #fff; }
.foot__grid { display: grid; gap: 2rem; padding-top: 3rem; padding-bottom: 2.5rem; }
@media (min-width: 720px) { .foot__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 1.5rem; } }
.foot__logo { width: 162px; margin-bottom: 1rem; }
.foot__small { max-width: 28em; margin: 0; font-size: 0.92rem; }
.foot h2 { margin-bottom: 0.75rem; font-size: 1.1rem; color: #fff; }
.foot address { font-style: normal; }
.foot li { padding: 0.15rem 0; }
.foot__base { border-top: 1px solid rgba(255, 255, 255, 0.14); }
.foot__base-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem; font-size: 0.9rem; }
.foot__base p { margin: 0; }

/* the chat widget takes the brass accent from the brand palette */
.jae-head { border-bottom-color: var(--brass); }
.jae-chat .jae-avatar { background: var(--brass); color: var(--ink); }
