/* Cambridge Auto Brokers — "showroom at dusk"
   Deep charcoal, warm amber, Archivo Expanded display. Built by SaneLot. */
:root {
  --ink: #0e1013;
  --ink-2: #15181d;
  --ink-3: #1d2129;
  --line: #262b35;
  --mist: #98a0ad;
  --paper: #f2f3f5;
  --white: #ffffff;
  --amber: #f0a52a;
  --amber-deep: #d98d12;
  --green: #34d276;
  --font-display: "Archivo", -apple-system, sans-serif;
  --font-body: "Instrument Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); background: var(--ink); color: var(--paper); line-height: 1.5; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.display { font-family: var(--font-display); font-variation-settings: "wdth" 125, "wght" 880; letter-spacing: -0.5px; }

/* ---- Top bar ---- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: linear-gradient(rgba(14, 16, 19, 0.92), rgba(14, 16, 19, 0.75) 70%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-display); font-variation-settings: "wdth" 125, "wght" 900; font-size: 17px; color: var(--white); letter-spacing: 0.5px; }
.brand-sub { font-size: 10px; letter-spacing: 3.5px; color: var(--amber); font-weight: 700; text-transform: uppercase; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); font-size: 14px; font-weight: 600; }
.topnav a { color: var(--mist); transition: color 0.2s; }
.topnav a:hover { color: var(--white); }
.topnav .call {
  color: var(--ink); background: var(--amber); padding: 9px 16px; border-radius: 10px;
  font-weight: 700; transition: background 0.2s;
}
.topnav .call:hover { background: var(--amber-deep); color: var(--ink); }
@media (max-width: 560px) { .topnav a:not(.call) { display: none; } }

/* ---- Hero ---- */
.hero { position: relative; min-height: 92svh; display: grid; place-items: end start; overflow: hidden; }
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.08);
  transition: opacity 1.6s ease;
}
.hero-slide.is-on { opacity: 1; animation: kenburns 9s linear forwards; }
@keyframes kenburns { from { transform: scale(1.08) translateX(0); } to { transform: scale(1.16) translateX(-2%); } }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--ink) 4%, rgba(14,16,19,0.55) 40%, rgba(14,16,19,0.25) 70%, rgba(14,16,19,0.6));
}
.hero-inner { position: relative; z-index: 2; padding: 0 clamp(16px, 5vw, 56px) clamp(40px, 8vh, 84px); max-width: 1200px; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--amber);
  margin-bottom: 18px;
}
.hero-kicker::before { content: ""; width: 26px; height: 2px; background: var(--amber); }
.hero-title {
  font-size: clamp(38px, 8.5vw, 92px); line-height: 0.98; color: var(--white);
  text-transform: uppercase; max-width: 11ch;
}
.hero-title em { font-style: normal; color: var(--amber); }
.hero-sub { margin-top: 18px; font-size: clamp(15px, 2.2vw, 19px); color: var(--mist); max-width: 46ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px; border-radius: 12px; font-weight: 700; font-size: 15px;
  border: none; cursor: pointer; transition: transform 0.15s, background 0.2s, border-color 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-amber { background: var(--amber); color: var(--ink); }
.btn-amber:hover { background: var(--amber-deep); }
.btn-line { background: rgba(255,255,255,0.06); color: var(--white); border: 1px solid rgba(255,255,255,0.25); backdrop-filter: blur(6px); }
.btn-line:hover { border-color: var(--white); }

/* ---- Ticker ---- */
.ticker { border-block: 1px solid var(--line); background: var(--ink-2); overflow: hidden; white-space: nowrap; }
.ticker-track { display: inline-flex; gap: 44px; padding: 13px 0; animation: tick 50s linear infinite; will-change: transform; }
@keyframes tick { to { transform: translateX(-50%); } }
.ticker-item { font-size: 13px; color: var(--mist); font-weight: 600; }
.ticker-item b { color: var(--amber); font-family: var(--font-mono); font-weight: 700; }

/* ---- Sections ---- */
.section { padding: clamp(48px, 9vw, 96px) clamp(16px, 5vw, 56px); max-width: 1280px; margin: 0 auto; }
.section-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 34px; flex-wrap: wrap; }
.section-title { font-size: clamp(26px, 4.5vw, 44px); color: var(--white); text-transform: uppercase; }
.section-link { margin-left: auto; color: var(--amber); font-weight: 700; font-size: 14px; }
.section-link:hover { text-decoration: underline; }

/* ---- Car cards ---- */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.car-card {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.25s, box-shadow 0.25s;
  position: relative;
}
.car-card:hover { transform: translateY(-4px); border-color: #3a4252; box-shadow: 0 18px 44px rgba(0,0,0,0.45); }
.car-photo { aspect-ratio: 4/3; overflow: hidden; background: var(--ink-3); position: relative; }
.car-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.car-card:hover .car-photo img { transform: scale(1.05); }
.badge-new {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--amber); color: var(--ink); font-size: 11px; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase; padding: 6px 10px; border-radius: 8px;
}
.car-body { padding: 16px 18px 18px; }
.car-name { font-family: var(--font-display); font-variation-settings: "wdth" 120, "wght" 800; font-size: 18px; color: var(--white); line-height: 1.15; }
.car-trim { font-size: 13px; color: var(--mist); margin-top: 3px; min-height: 1.2em; }
.car-row { display: flex; align-items: baseline; margin-top: 12px; }
.car-price { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--amber); }
.car-price small { font-size: 12px; color: var(--mist); font-weight: 500; }
.car-miles { margin-left: auto; font-size: 13px; color: var(--mist); }
.car-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.car-chip { font-size: 11px; font-weight: 600; color: var(--mist); background: var(--ink-3); border: 1px solid var(--line); padding: 4px 9px; border-radius: 7px; }

/* ---- Filters (inventory page) ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.filter {
  background: var(--ink-2); border: 1px solid var(--line); color: var(--mist);
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.filter:hover { border-color: var(--amber); color: var(--white); }
.filter.is-on { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.search {
  width: 100%; max-width: 380px; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; color: var(--white); font-family: var(--font-body);
  font-size: 15px; outline: none; margin-bottom: 18px;
}
.search:focus { border-color: var(--amber); }

/* ---- Pillars ---- */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 18px; }
.pillar { background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.pillar-num { font-family: var(--font-mono); color: var(--amber); font-size: 13px; font-weight: 700; }
.pillar h3 { font-family: var(--font-display); font-variation-settings: "wdth" 120, "wght" 800; color: var(--white); font-size: 19px; margin: 10px 0 8px; }
.pillar p { color: var(--mist); font-size: 14px; }

/* ---- Visit ---- */
.visit { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 760px) { .visit { grid-template-columns: 1fr; } }
.visit-phone { font-family: var(--font-display); font-variation-settings: "wdth" 120, "wght" 850; font-size: clamp(28px, 5vw, 44px); color: var(--white); }
.visit-phone a:hover { color: var(--amber); }
.visit-addr { color: var(--mist); margin: 12px 0 20px; font-size: 16px; }
.hours-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hours-table td { padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--mist); }
.hours-table td:last-child { text-align: right; color: var(--paper); font-family: var(--font-mono); font-size: 13px; }
.hours-table tr.today td { color: var(--amber); font-weight: 700; }

/* ---- Detail page ---- */
.detail { padding-top: 86px; }
.detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; max-width: 1280px; margin: 0 auto; padding: 20px clamp(16px, 5vw, 56px) 80px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.gallery-main {
  aspect-ratio: 4/3; border-radius: 18px; overflow: hidden; background: var(--ink-3);
  border: 1px solid var(--line);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 10px; }
.gallery-thumbs button {
  aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; border: 2px solid transparent;
  background: var(--ink-3); cursor: pointer; padding: 0;
}
.gallery-thumbs button.is-on { border-color: var(--amber); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail-name { font-size: clamp(26px, 4vw, 40px); color: var(--white); line-height: 1.05; text-transform: uppercase; }
.detail-trim { color: var(--mist); margin-top: 6px; font-size: 15px; }
.detail-price { font-family: var(--font-mono); font-size: clamp(30px, 4.5vw, 42px); font-weight: 700; color: var(--amber); margin: 16px 0 4px; }
.detail-miles { color: var(--mist); font-size: 14px; margin-bottom: 20px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 18px 0 24px; }
.spec-table td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.spec-table td:first-child { color: var(--mist); width: 42%; }
.spec-table td:last-child { color: var(--paper); font-weight: 600; }
.detail-desc { color: var(--mist); font-size: 15px; line-height: 1.7; margin: 18px 0; white-space: pre-line; }
.listed-by {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 16px;
  font-size: 12px; color: var(--mist); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}
.listed-by b { color: #5fa8d3; }

/* ---- Footer ---- */
footer { border-top: 1px solid var(--line); background: var(--ink-2); }
.footer-inner {
  max-width: 1280px; margin: 0 auto; padding: 34px clamp(16px, 5vw, 56px);
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 13px; color: var(--mist);
}
.footer-inner .spacer { flex: 1; }
.footer-sane { color: var(--mist); }
.footer-sane b { color: #5fa8d3; }

/* ---- Reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-slide.is-on { animation: none; }
  .ticker-track { animation: none; }
}
