:root {
  --green-700: #0d5c73;
  --green-600: #12798f;
  --green-500: #199bb2;
  --green-50:  #e6f4f7;
  --green-100: #cbe8ee;

  --ink-900: #0e1712;
  --ink-800: #1a2520;
  --ink-700: #2d3934;
  --ink-500: #6b7770;
  --ink-400: #8a938d;
  --ink-300: #b6bcb8;
  --ink-200: #e4e8e5;
  --ink-100: #f0f3f1;
  --ink-50:  #f7f9f7;
  --white:   #ffffff;

  --amber-600: #c77b14;
  --amber-50:  #fdf3e3;
  --blue-600:  #2b6cb0;
  --blue-50:   #e6f0fa;
  --red-600:   #c7361c;

  --shadow-sm: 0 1px 2px rgba(14, 23, 18, 0.04), 0 1px 1px rgba(14, 23, 18, 0.03);
  --shadow-md: 0 4px 14px rgba(14, 23, 18, 0.06), 0 1px 2px rgba(14, 23, 18, 0.04);
  --shadow-lg: 0 12px 32px rgba(14, 23, 18, 0.08), 0 2px 4px rgba(14, 23, 18, 0.04);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink-900);
  background: var(--ink-50);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* Topbar */
.topbar { background: var(--ink-900); border-bottom: 1px solid #1a2520; position: sticky; top: 0; z-index: 40; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 16px; }

/* yournxtcar wordmark */
.ync-logo { display: flex; align-items: center; gap: 10px; }
.ync-mark { flex-shrink: 0; }
.ync-word {
  font-size: 19px; font-weight: 700; letter-spacing: -0.03em;
  color: #ffffff; line-height: 1; white-space: nowrap;
}
.ync-word .nxt { color: var(--green-500); }
.ync-word .tld { color: #6b7770; font-weight: 500; }

.page { max-width: 1280px; margin: 0 auto; padding: 24px 24px 80px; }

/* Header */
.car-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 20px;
}
.car-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.car-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.car-title .green { color: var(--green-700); }
.car-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center;
}
.meta-line {
  font-size: 13px; color: var(--ink-500);
}
.meta-line strong { color: var(--ink-800); font-weight: 500; }

/* Layout */
.grid { display: block; }

.card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--ink-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card { margin-top: 18px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--ink-200);
}
.card-head h2 {
  margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
}
.card-head .counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-500);
  margin-left: 6px;
}
.card-body { padding: 20px 22px; }

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 180px 180px;
  gap: 6px;
  padding: 6px;
}
.gallery-cell {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ink-100);
  cursor: pointer;
}
.gallery-cell:nth-child(1) { grid-row: 1 / 3; }
.gallery-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.gallery-cell:hover img { transform: scale(1.03); }
.gallery-more {
  position: absolute; inset: 0;
  background: rgba(14,23,18,0.55); backdrop-filter: blur(2px);
  color: white;
  display: grid; place-items: center;
  font-weight: 600; font-size: 16px; gap: 4px;
}
.gallery-more span { font-size: 12px; font-weight: 400; opacity: 0.85; }

/* Specs */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
}
.spec { background: var(--white); box-shadow: 0 0 0 1px var(--ink-200); padding: 16px 16px 14px; display: flex; align-items: flex-start; gap: 12px; }
.spec-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--green-50); color: var(--green-700); display: grid; place-items: center; flex-shrink: 0; }
.spec-label { font-size: 11px; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; margin-bottom: 3px; }
.spec-value { font-size: 14px; color: var(--ink-900); font-weight: 600; line-height: 1.35; }

/* Equipment */
.equip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  background: var(--ink-100);
  border-radius: 12px;
  padding: 8px;
}
.equip-item {
  background: var(--white);
  border-radius: 8px;
  padding: 14px 10px 12px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px;
  transition: transform 0.12s, box-shadow 0.12s;
}
.equip-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.equip-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--green-50); color: var(--green-700);
  display: grid; place-items: center;
  overflow: hidden;
}
.equip-icon img { width: 20px; height: 20px; object-fit: contain; }
.equip-item span { font-size: 12px; font-weight: 500; color: var(--ink-800); line-height: 1.3; }

.equip-toggle { margin-top: 14px; border-top: 1px solid var(--ink-200); }
.equip-toggle summary {
  list-style: none; cursor: pointer;
  padding: 14px 4px 4px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--green-700); font-weight: 600;
}
.equip-toggle summary::-webkit-details-marker { display: none; }
.equip-toggle-count { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-500); font-weight: 400; }
.equip-toggle-chevron { transition: transform 0.18s; }
.equip-toggle[open] .equip-toggle-chevron { transform: rotate(180deg); }
.equip-full { padding: 14px 4px 4px; }
.equip-full ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 28px; }
.equip-full li { font-size: 13px; color: var(--ink-800); padding-left: 20px; position: relative; }
.equip-full li::before {
  content: ''; position: absolute; left: 0; top: 6px;
  width: 12px; height: 12px;
  background: var(--green-50); border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d5c73' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 8px; background-repeat: no-repeat; background-position: center;
}

/* Dealer contact card */
.dealer-card {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 20px 22px 20px;
  margin-top: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}
.dealer-card .head { display: flex; align-items: center; gap: 12px; }
.dealer-card .contact-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #cbe8ee, #12798f);
  color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; flex-shrink: 0;
}
.dealer-card .eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-500); margin-bottom: 3px;
}
.dealer-card .name { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.dealer-card .org { font-size: 12.5px; color: var(--ink-500); margin-top: 1px; }
.dealer-card .reach { display: flex; gap: 8px; flex-wrap: wrap; justify-self: end; }
.reach-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 13px;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  color: var(--ink-900);
  transition: all 0.12s;
}
.reach-item:hover { background: var(--ink-50); border-color: var(--ink-300); text-decoration: none; }
.reach-item svg { color: var(--green-700); flex-shrink: 0; }
@media (max-width: 720px) {
  .dealer-card { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .dealer-card .reach { justify-self: stretch; flex-direction: column; }
  .reach-item { justify-content: center; }
}

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(14,23,18,0.92); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox-img { max-width: 100%; max-height: 80vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.lightbox-close, .lightbox-nav { color: white; border-radius: 50%; background: rgba(255,255,255,0.1); display: grid; place-items: center; position: absolute; }
.lightbox-close { top: 16px; right: 16px; width: 40px; height: 40px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: white; font-family: 'JetBrains Mono', monospace; font-size: 13px; background: rgba(0,0,0,0.4); padding: 6px 14px; border-radius: 999px; }

/* State panels (loading / error / message) */
.state-panel {
  max-width: 480px;
  margin: 80px auto;
  text-align: center;
  padding: 20px;
}
.state-panel h1 { font-size: 19px; font-weight: 700; margin: 16px 0 8px; letter-spacing: -0.01em; }
.state-panel p { color: var(--ink-500); font-size: 14px; margin: 0; }
.state-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--ink-100); color: var(--ink-500);
  display: grid; place-items: center; margin: 0 auto;
}
.state-panel .dealer-card { margin-top: 24px; text-align: left; }
.spinner {
  width: 32px; height: 32px; margin: 0 auto 16px;
  border: 3px solid var(--ink-200);
  border-top-color: var(--green-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 980px) {
  .grid { grid-template-columns: 1fr; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .equip-grid { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
}
@media (max-width: 720px) {
  .page { padding: 14px 14px 40px; }
  .topbar-inner { padding: 10px 14px; }
  .car-title { font-size: 22px; }
  .car-header { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 200px 110px; }
  .gallery-cell:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
  .gallery-cell:nth-child(4), .gallery-cell:nth-child(5) { display: none; }
}
@media (max-width: 460px) {
  .spec-grid { grid-template-columns: 1fr; }
  .equip-grid { grid-template-columns: repeat(3, 1fr); }
}
