/* ==========================================================================
   NEXA Palakkad — custom layer
   Tailwind (Play CDN) handles layout/utilities. This file holds the things
   utilities can't express: the palette, motion, and a few composed parts.
   ========================================================================== */

:root {
  --ink:        #06070A;
  --ink-2:      #0B0D12;
  --ink-3:      #11141B;
  --ink-4:      #191D26;
  --line:       rgba(255, 255, 255, 0.08);
  --line-soft:  rgba(255, 255, 255, 0.045);
  --platinum:   #EEF0F6;
  --muted:      #98A0B2;
  --muted-2:    #6B7386;
  --accent:     #2E6BFF;
  --accent-2:   #6EA8FF;
  --accent-ev:  #35D9C4;
  --gold:       #C9A96A;
  --stage:      #F3F5F9;

  --shell: min(1280px, 100% - 2.5rem);
  --header-h: 76px;
}

/* --------------------------------------------------------------- base ---- */

* { -webkit-tap-highlight-color: transparent; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  background: var(--ink);
  color: var(--platinum);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, .font-display {
  font-family: Sora, Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.025em;
}

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

/* Scrollbar — quiet, matches the dark shell. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb {
  background: #232936;
  border-radius: 999px;
  border: 2px solid var(--ink);
}
::-webkit-scrollbar-thumb:hover { background: #313949; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell { width: var(--shell); margin-inline: auto; }

/* ------------------------------------------------------------ surfaces ---- */

.surface {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.hairline { border-color: var(--line); }

.glass {
  background: rgba(10, 12, 17, 0.72);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

/* Faint engineering grid — reads as blueprint, not wallpaper. */
.grid-veil::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  pointer-events: none;
}

.glow-blue {
  background: radial-gradient(circle, rgba(46, 107, 255, 0.28) 0%, transparent 68%);
  filter: blur(46px);
}

.text-gradient {
  background: linear-gradient(100deg, #FFFFFF 8%, #B9C6E6 46%, #6EA8FF 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-2);
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1400ms ease, transform 9000ms linear;
  will-change: opacity, transform;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--ink) 2%, rgba(6, 7, 10, 0.55) 42%, rgba(6, 7, 10, 0.72) 100%),
    linear-gradient(to right, rgba(6, 7, 10, 0.92) 0%, rgba(6, 7, 10, 0.35) 58%, transparent 100%);
}

.hero-dot {
  width: 30px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  transition: background 400ms ease, width 400ms ease;
}

.hero-dot.is-active { background: var(--accent-2); width: 52px; }

@keyframes scroll-cue {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50%      { transform: translateY(7px); opacity: 1; }
}

.scroll-cue { animation: scroll-cue 2.1s ease-in-out infinite; }

/* ------------------------------------------------------------- marquee ---- */

.marquee { display: flex; overflow: hidden; user-select: none; gap: 0; }

.marquee__track {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 3rem;
  min-width: 100%;
  padding-right: 3rem;
  animation: marquee 38s linear infinite;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

.marquee:hover .marquee__track { animation-play-state: paused; }

/* ---------------------------------------------------------- car cards ---- */

.car-card {
  position: relative;
  isolation: isolate;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(165deg, #12151C 0%, #0A0C11 100%);
  border: 1px solid var(--line);
  transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 400ms ease,
              box-shadow 520ms ease;
}

.car-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(110, 168, 255, 0.55), transparent 42%, transparent 62%, rgba(46, 107, 255, 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 420ms ease;
  pointer-events: none;
}

.car-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 34px 70px -28px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(110, 168, 255, 0.08);
}

.car-card:hover::after { opacity: 1; }

/* The photo stage. NEXA's press shots are black-studio, so the plate is dark
   and the image just melts into the card — no plate edge, no white box.
   --focus shifts the crop toward the car, which sits right of centre in the
   source frames. */
.car-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 62% 55%, rgba(46, 107, 255, 0.12), transparent 72%),
    linear-gradient(180deg, #10131A 0%, #07080C 100%);
}

.car-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 66% 50%);
  transition: transform 780ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.car-card:hover .car-stage img { transform: scale(1.06); }

/* Fade the photo's lower edge into the card body. */
.car-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #0A0C11 1%, rgba(10, 12, 17, 0.45) 16%, transparent 42%);
  pointer-events: none;
}

/* The modal banner is wider than the 16:9 source, so `cover` trims only the
   empty sky and floor — the car itself is never cropped. */
.car-stage--banner {
  aspect-ratio: 2.4 / 1;
}

.car-stage--banner img { object-position: center; }

@media (max-width: 640px) {
  .car-stage--banner { aspect-ratio: 16 / 10; }
  .car-stage--banner img { object-position: 66% 50%; }
}

/* A light-background photo needs the opposite treatment — a light plate and a
   multiply blend, so a white studio shot doesn't sit in a bright rectangle. */
.car-stage--light {
  background:
    radial-gradient(ellipse 68% 52% at 50% 88%, rgba(46, 107, 255, 0.14), transparent 70%),
    linear-gradient(180deg, #FFFFFF 0%, var(--stage) 60%, #E2E7F0 100%);
}

.car-stage--light img {
  object-fit: contain;
  object-position: center;
  padding: 7% 6% 10%;
  mix-blend-mode: multiply;
}

.car-stage--light::after {
  background: linear-gradient(to top, rgba(10, 12, 17, 0.55) 0%, transparent 26%);
}

.spec-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.625rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line-soft);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.badge--ev   { background: rgba(53, 217, 196, 0.16); color: #6FE9D8; border: 1px solid rgba(53, 217, 196, 0.3); }
.badge--new  { background: rgba(46, 107, 255, 0.18); color: #8FBAFF; border: 1px solid rgba(46, 107, 255, 0.34); }
.badge--hyb  { background: rgba(201, 169, 106, 0.15); color: #E0C793; border: 1px solid rgba(201, 169, 106, 0.3); }
.badge--dark { background: rgba(10, 12, 17, 0.7);   color: #D6DCEA; border: 1px solid rgba(255, 255, 255, 0.14); }

/* --------------------------------------------------------------- pills ---- */

.filter-pill {
  position: relative;
  padding: 0.5625rem 1.125rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  transition: color 260ms ease, border-color 260ms ease, background 260ms ease;
  white-space: nowrap;
}

.filter-pill:hover { color: var(--platinum); border-color: rgba(255, 255, 255, 0.18); }

.filter-pill[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #1F4FD8);
  border-color: transparent;
  box-shadow: 0 8px 24px -10px rgba(46, 107, 255, 0.85);
}

/* -------------------------------------------------------------- button ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 11px;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  padding: 0.8125rem 1.375rem;
  transition: transform 220ms ease, box-shadow 320ms ease, background 260ms ease, border-color 260ms ease, color 260ms ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px) scale(0.99); }

.btn--primary {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #3B78FF 0%, #1E4FD9 100%);
  box-shadow: 0 12px 30px -12px rgba(46, 107, 255, 0.9);
}

.btn--primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transition: left 720ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn--primary:hover::before { left: 130%; }
.btn--primary:hover { box-shadow: 0 18px 40px -14px rgba(46, 107, 255, 1); }

.btn--ghost {
  color: var(--platinum);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.26);
}

.btn--wa {
  color: #fff;
  background: linear-gradient(135deg, #2CD46A 0%, #14A94C 100%);
  box-shadow: 0 12px 28px -14px rgba(37, 211, 102, 0.9);
}

.btn--wa:hover { box-shadow: 0 16px 36px -14px rgba(37, 211, 102, 1); }

.btn--light { color: var(--ink); background: var(--platinum); }
.btn--light:hover { background: #fff; }

/* ----------------------------------------------------------------- map ---- */

/* Google's embed has no dark theme, so invert it and spin the hue back —
   roads and labels end up light-on-dark instead of a white slab. */
.map-dark {
  filter: invert(0.91) hue-rotate(180deg) saturate(0.55) contrast(0.92) brightness(0.98);
  pointer-events: none;   /* keeps the overlay pin honest, and stops mobile scroll-trapping */
}

/* Our own marker, dead centre — the embed's stock pin is unreadable once the
   frame is inverted, and a fixed frame means centre is always the address. */
.map-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -100%;
  pointer-events: none;
}

.map-pin__dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(140deg, #3B78FF, #1E4FD9);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65), 0 0 0 3px rgba(255, 255, 255, 0.14);
}

.map-pin__pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  translate: -50% -50%;
  border-radius: 50%;
  background: rgba(46, 107, 255, 0.55);
  animation: fab-ping 2.8s cubic-bezier(0, 0, 0.2, 1) infinite;
  z-index: -1;
}

/* ---------------------------------------------------------- link arrow ---- */

.link-arrow { display: inline-flex; align-items: center; gap: 0.375rem; }
.link-arrow svg { transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ------------------------------------------------------------- reveals ---- */

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 820ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 820ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible { opacity: 1; transform: none; }

/* --------------------------------------------------------------- range ---- */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: #232936;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--accent);
  cursor: grab;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
  transition: transform 180ms ease;
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; }

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--accent);
  cursor: grab;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
}

input[type="range"]::-moz-range-track { height: 5px; border-radius: 999px; background: #232936; }

/* --------------------------------------------------------------- forms ---- */

.field {
  width: 100%;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  padding: 0.8125rem 0.9375rem;
  font-size: 0.875rem;
  color: var(--platinum);
  transition: border-color 240ms ease, background 240ms ease, box-shadow 240ms ease;
}

.field::placeholder { color: var(--muted-2); }

.field:focus {
  outline: none;
  border-color: rgba(110, 168, 255, 0.55);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 3px rgba(46, 107, 255, 0.14);
}

select.field {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2398A0B2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
}

select.field option { background: var(--ink-3); color: var(--platinum); }

/* Native date pickers render a dark-on-dark icon; invert it. */
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.68); cursor: pointer; }

/* ----------------------------------------------------------- accordion ---- */

.acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 460ms cubic-bezier(0.16, 1, 0.3, 1);
}

.acc-item.is-open .acc-panel { grid-template-rows: 1fr; }
.acc-panel > div { overflow: hidden; }
.acc-item.is-open .acc-icon { transform: rotate(45deg); }
.acc-icon { transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1); }

/* --------------------------------------------------------------- modal ---- */

.modal { opacity: 0; pointer-events: none; transition: opacity 320ms ease; }
.modal.is-open { opacity: 1; pointer-events: auto; }

.modal__panel {
  transform: translateY(28px) scale(0.985);
  opacity: 0;
  transition: transform 460ms cubic-bezier(0.16, 1, 0.3, 1), opacity 380ms ease;
}

.modal.is-open .modal__panel { transform: none; opacity: 1; }

/* ------------------------------------------------------------ floaties ---- */

.fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.7);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 280ms ease;
}

.fab:hover { transform: scale(1.09) translateY(-2px); }

.fab--wa   { background: linear-gradient(140deg, #2CD46A, #12A048); }
.fab--call { background: linear-gradient(140deg, #3B78FF, #1E4FD9); }

/* Ping ring — one slow pulse, not a strobe. */
.fab-ping::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  opacity: 0.6;
  animation: fab-ping 2.6s cubic-bezier(0, 0, 0.2, 1) infinite;
  z-index: -1;
}

@keyframes fab-ping {
  0%   { transform: scale(1);    opacity: 0.55; }
  70%  { transform: scale(1.75); opacity: 0; }
  100% { transform: scale(1.75); opacity: 0; }
}

.fab-label {
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 260ms ease, transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.fab-wrap:hover .fab-label { opacity: 1; transform: none; }

/* ---------------------------------------------------------- utilities ---- */

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Phones: the fixed call/WhatsApp bar would otherwise cover the footer. */
@media (max-width: 1023px) {
  body { padding-bottom: 104px; }
}

/* Phones: shorten the cards so more of the range fits on one screen, and keep
   the two contact buttons within thumb reach of the model name. */
@media (max-width: 639px) {
  .car-stage:not(.car-stage--banner) { aspect-ratio: 16 / 10; }
  .car-card { border-radius: 18px; }
  .car-card .p-6 { padding: 1.125rem 1.125rem 1.25rem; }
  .spec-chip { padding: 0.25rem 0.5rem; font-size: 0.6875rem; }
}

.tabular { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero-slide.is-active { transform: none; }
}

@media print {
  .no-print, .fab-wrap, #siteHeader, #carModal { display: none !important; }
  body { background: #fff; color: #000; }
}
