/* ==========================================================================
   INM HOLDINGS — Core Stylesheet
   Design tokens live here AND are mirrored into the Tailwind config
   (see the inline <script> in each page's <head>) so both utility
   classes and hand-written CSS pull from the same palette/type scale.
   ========================================================================== */

:root {
  /* Colour tokens */
  --ink-black: #0b0d10;      /* page background */
  --surface-1: #14171c;      /* card / panel surface */
  --surface-2: #1b1f26;      /* raised surface */
  --surface-3: #22262e;      /* hover / active surface */
  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --off-white: #f5f6f7;      /* primary text on dark */
  --soft-grey: #9aa1ac;      /* secondary text */
  --metal-silver: #c9ced6;   /* metallic silver accents */
  --accent: #2f6fed;         /* electric blue */
  --accent-dark: #1e4fd6;
  --accent-soft: rgba(47, 111, 237, 0.14);

  /* Type */
  --font-display: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-eyebrow: "Manrope", ui-sans-serif, system-ui, sans-serif;

  /* Motion */
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--ink-black);
  color: var(--off-white);
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

::selection { background: var(--accent); color: #fff; }

/* Focus visibility — never remove without replacing */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.container-custom {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
@media (min-width: 768px) { .container-custom { padding-inline: 2rem; } }

/* ==========================================================================
   Header
   ========================================================================== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 16, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-premium), padding 0.3s var(--ease-premium);
}
#site-header .header-inner {
  padding-block: 1.25rem;
  transition: padding 0.3s var(--ease-premium);
}
#site-header.is-scrolled {
  border-bottom-color: var(--hairline);
}
#site-header.is-scrolled .header-inner {
  padding-block: 0.7rem;
}

.logo-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.nav-link {
  position: relative;
  color: var(--soft-grey);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width 0.25s var(--ease-premium);
}
.nav-link:hover { color: var(--off-white); }
.nav-link:hover::after, .nav-link.is-active::after { width: 100%; }
.nav-link.is-active { color: var(--off-white); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  padding: 0.75rem 1.4rem;
  transition: transform 0.2s var(--ease-premium), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(47, 111, 237, 0.55);
}
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 10px 30px -8px rgba(47, 111, 237, 0.7); }
.btn-secondary {
  background: transparent;
  color: var(--off-white);
  border: 1px solid var(--hairline-strong);
}
.btn-secondary:hover { border-color: var(--metal-silver); background: rgba(255,255,255,0.04); }
.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--off-white);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-lg { padding: 0.95rem 1.9rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* Mobile nav */
#mobile-nav {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-premium);
}
#mobile-nav.is-open { max-height: 420px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background: #0a0c10;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  animation: hero-drift 22s ease-in-out infinite alternate;
}
@keyframes hero-drift {
  from { transform: scale(1.06) translate(0, 0); }
  to   { transform: scale(1.12) translate(-1%, -1%); }
}
.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,12,16,0.55) 0%, rgba(10,12,16,0.55) 40%, rgba(10,12,16,0.96) 100%);
}

.search-panel {
  background: rgba(20, 23, 28, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--hairline-strong);
  border-radius: 20px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
}

.field-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--soft-grey);
  margin-bottom: 0.4rem;
  display: block;
}

.input, select.input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--hairline-strong);
  color: var(--off-white);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.92rem;
  transition: border-color 0.2s ease, background 0.2s ease;
  appearance: none;
}
.input::placeholder { color: #6b7280; }
.input:hover { border-color: rgba(255,255,255,0.28); }
.input:focus { border-color: var(--accent); background: rgba(255,255,255,0.06); outline: none; }

select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%239aa1ac' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
}

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease-premium), transform 0.7s var(--ease-premium);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Trust cards
   ========================================================================== */
.trust-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 1.75rem;
  transition: border-color 0.25s ease, transform 0.25s var(--ease-premium);
}
.trust-card:hover { border-color: var(--hairline-strong); transform: translateY(-3px); }
.trust-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1.1rem;
}

/* ==========================================================================
   Vehicle Card
   ========================================================================== */
.vehicle-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.35s var(--ease-premium), border-color 0.35s ease, box-shadow 0.35s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.vehicle-card:hover {
  transform: translateY(-6px);
  border-color: var(--hairline-strong);
  box-shadow: 0 24px 48px -24px rgba(0,0,0,0.55);
}
.vehicle-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
}
.vehicle-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-premium);
}
.vehicle-card:hover .vehicle-card__media img { transform: scale(1.06); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
}
.badge-featured { background: var(--accent); color: #fff; }
.badge-available {
  background: rgba(52, 211, 153, 0.14);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.favourite-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: rgba(11,13,16,0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.favourite-btn:hover { background: rgba(11,13,16,0.8); transform: scale(1.06); }
.favourite-btn.is-active { color: var(--accent); }
.favourite-btn.is-active svg { fill: currentColor; }

.spec-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  color: var(--soft-grey);
  font-size: 0.83rem;
}
.spec-row span { display: inline-flex; align-items: center; gap: 0.35rem; }

.price-tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--off-white);
  letter-spacing: -0.01em;
}
.price-monthly { color: var(--soft-grey); font-size: 0.78rem; }

/* ==========================================================================
   Odometer digit-roll — signature price/mileage animation.
   Each digit sits in a fixed-height window; a strip 0-9 is translated
   into view. JS sets --digit and toggles .is-armed to trigger the roll,
   giving every price and mileage figure a mechanical "clicking into
   place" feel, like a real odometer.
   ========================================================================== */
.odometer {
  display: inline-flex;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}
.odometer__digit {
  position: relative;
  height: 1em;
  width: 0.62em;
  overflow: hidden;
  display: inline-block;
}
.odometer__strip {
  position: absolute;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 0.9s var(--ease-premium);
}
.odometer__strip span {
  height: 1em;
  line-height: 1;
  display: flex;
  align-items: flex-start;
}
.odometer__digit.is-armed .odometer__strip {
  transform: translateY(calc(-1em * var(--digit, 0)));
}
.odometer__literal { display: inline-block; }

/* ==========================================================================
   Filters — sidebar (desktop) + bottom sheet (mobile)
   ========================================================================== */
.filter-panel {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 16px;
}
.filter-section {
  border-bottom: 1px solid var(--hairline);
  padding-block: 1.1rem;
}
.filter-section:last-child { border-bottom: none; }
.filter-section summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.filter-section summary::-webkit-details-marker { display: none; }
.filter-section summary .chev { transition: transform 0.25s var(--ease-premium); color: var(--soft-grey); }
.filter-section[open] summary .chev { transform: rotate(180deg); }
.filter-section .filter-body { padding-top: 0.9rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  color: var(--soft-grey);
  background: transparent;
  transition: all 0.2s ease;
}
.chip:hover { border-color: var(--metal-silver); color: var(--off-white); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.checkbox-row {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.88rem; color: var(--soft-grey);
  padding-block: 0.3rem;
  cursor: pointer;
}
.checkbox-row input { accent-color: var(--accent); width: 16px; height: 16px; }
.checkbox-row:hover { color: var(--off-white); }

#mobile-filter-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  visibility: hidden;
}
#mobile-filter-sheet .sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
}
#mobile-filter-sheet .sheet-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 86vh;
  background: var(--surface-1);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--hairline-strong);
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-premium);
  display: flex;
  flex-direction: column;
}
#mobile-filter-sheet.is-open { visibility: visible; }
#mobile-filter-sheet.is-open .sheet-backdrop { opacity: 1; }
#mobile-filter-sheet.is-open .sheet-panel { transform: translateY(0); }

/* ==========================================================================
   Skeleton loading
   ========================================================================== */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}
.skeleton::after {
  content: "";
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: skeleton-sheen 1.4s infinite;
}
@keyframes skeleton-sheen { to { transform: translateX(100%); } }

/* ==========================================================================
   Toast
   ========================================================================== */
#toast-region {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s var(--ease-premium);
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}
#toast-region.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--hairline-strong);
  border-left: 3px solid #34d399;
  border-radius: 10px;
  padding: 0.9rem 1.15rem;
  box-shadow: 0 20px 40px -16px rgba(0,0,0,0.6);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ==========================================================================
   Vehicle detail — gallery
   ========================================================================== */
.gallery-main {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}
.gallery-main img {
  width: 100%; height: auto; object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.gallery-main img.is-active { opacity: 1; }

.gallery-nav-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px;
  border-radius: 999px;
  background: rgba(11,13,16,0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.gallery-nav-btn:hover { background: rgba(11,13,16,0.85); }

.gallery-counter {
  position: absolute;
  bottom: 0.9rem; right: 0.9rem;
  background: rgba(11,13,16,0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.thumb {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color 0.2s ease;
}
.thumb.is-active { border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Subtle per-angle variation so a shared placeholder image reads
   as different photographs across gallery slots. */
.angle-0 { filter: none; }
.angle-1 { filter: saturate(0.9) brightness(0.97); transform: scaleX(-1); }
.angle-2 { filter: saturate(1.05) brightness(1.03) contrast(1.02); }

#lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(6,7,9,0.94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease;
}
#lightbox.is-open { opacity: 1; visibility: visible; }
#lightbox img { max-width: 90vw; max-height: 82vh; object-fit: contain; border-radius: 8px; }

/* ==========================================================================
   Accordion (specification)
   ========================================================================== */
.accordion-item { border-bottom: 1px solid var(--hairline); }
.accordion-item:first-child { border-top: 1px solid var(--hairline); }
.accordion-trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 1.1rem;
  font-weight: 600;
  text-align: left;
}
.accordion-trigger .chev { transition: transform 0.3s var(--ease-premium); color: var(--soft-grey); flex-shrink: 0; }
.accordion-trigger[aria-expanded="true"] .chev { transform: rotate(180deg); }
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-premium);
}
.accordion-panel .inner { padding-bottom: 1.2rem; }

/* ==========================================================================
   Sticky mobile CTA bar (vehicle detail page)
   ========================================================================== */
#mobile-cta-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: rgba(20,23,28,0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--hairline-strong);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(0);
  transition: transform 0.3s var(--ease-premium);
}
#mobile-cta-bar.is-hidden { transform: translateY(100%); }

/* ==========================================================================
   Misc
   ========================================================================== */
.hairline { border-color: var(--hairline); }
.bg-surface-1 { background: var(--surface-1); }
.bg-surface-2 { background: var(--surface-2); }
.text-soft { color: var(--soft-grey); }
.text-silver { color: var(--metal-silver); }
.text-accent { color: var(--accent); }

.social-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  color: var(--soft-grey);
  transition: all 0.2s ease;
}
.social-icon:hover { color: #fff; border-color: var(--metal-silver); transform: translateY(-2px); }

.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marquee 28s linear infinite;
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-black); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; }
