:root {
  --bg: #0c0c0f;
  --surface: #121217;
  --elevated: #171922;
  --border: #242633;
  --text: #e6e7eb;
  --muted: #a6a8b2;
  --accent: #c0c0c0; /* silver */
  --accent-strong: #d8d8d8;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: radial-gradient(1200px 800px at 70% -10%, rgba(192,192,192,0.06), transparent 60%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(800px 400px at 70% 10%, #000, transparent 70%);
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in lab, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-logo { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; display: block; }

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 6px;
}

.brand-name { font-weight: 700; letter-spacing: 0.3px; }

.nav { display: flex; gap: 22px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease;
}
.nav a:hover { color: var(--text); }
.nav .cta-link { color: var(--accent); }

/* Mobile nav */
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 200ms ease, opacity 200ms ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-mobile { position: fixed; top: 64px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); display: grid; padding: 10px 16px; gap: 8px; z-index: 70; }
.nav-mobile[hidden] { display: none !important; }
.nav-mobile a { padding: 8px 6px; color: var(--text); text-decoration: none; border-radius: 8px; }
.nav-mobile a:hover { background: rgba(255,255,255,0.04); }

.section { padding: 72px 0; }
.section-head { max-width: 720px; }
.section h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: 0.2px; }
.section p { margin: 0; color: var(--muted); }

.hero {
  padding: 96px 0 48px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1;
}
.hero p { color: var(--muted); }
.hero-cta { margin-top: 20px; display: flex; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn-primary { background: linear-gradient(180deg, var(--accent-strong), var(--accent)); color: #0d0f13; border-color: transparent; }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.38) 50%, transparent 70%); transform: translateX(-100%); transition: transform 600ms ease; }
.btn-primary:hover { filter: brightness(1.04); transform: translateY(-1.5px); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.btn-primary:hover::after { transform: translateX(100%); }
.btn-ghost { background: transparent; }

.hero-stats { margin: 18px 0 0; display: flex; gap: 18px; padding: 0; list-style: none; }
.hero-stats .stat { display: block; font-size: 18px; font-weight: 700; }
.hero-stats .label { display: block; color: var(--muted); font-size: 13px; }

.hero-art { display: grid; place-items: center; }
.rover-card {
  position: relative;
  width: min(520px, 90%);
  aspect-ratio: 4/3;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rover-card::before { content: ""; position: absolute; inset: -1px; border-radius: 16px; padding: 1px; background: conic-gradient(from 0deg, rgba(192,192,192,0.06), rgba(192,192,192,0.18), rgba(192,192,192,0.06)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 12s linear infinite; pointer-events: none; }
.rover-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02)); opacity: 0.95; transform: scale(2.2); transform-origin: center; }
.rover-outline {
  position: absolute; inset: 0;
  background: radial-gradient(200px 140px at 60% 50%, rgba(192,192,192,0.18), transparent 60%), linear-gradient(transparent 60%, rgba(255,255,255,0.04));
  mask-image: radial-gradient(280px 220px at 55% 50%, #000 40%, transparent 70%);
}
.arm-segment { position: absolute; height: 4px; background: var(--accent); border-radius: 2px; }
.arm-segment.s1 { width: 160px; left: 30%; top: 48%; transform-origin: left center; transform: rotate(10deg); }
.arm-segment.s2 { width: 120px; left: calc(30% + 150px); top: 48%; transform-origin: left center; transform: rotate(22deg); }
.arm-segment.s3 { width: 80px; left: calc(30% + 260px); top: 48%; transform-origin: left center; transform: rotate(10deg); }
.glow { position: absolute; width: 160px; height: 160px; right: -20px; bottom: -20px; background: radial-gradient(circle, rgba(192,192,192,0.35), transparent 60%); filter: blur(14px); }
@keyframes spin { to { transform: rotate(360deg); } }

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.card {
  background: linear-gradient(180deg, var(--surface), var(--elevated));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in lab, var(--accent), var(--border)); box-shadow: 0 8px 24px rgba(0,0,0,0.25); filter: saturate(1.02); }

.card .badge {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.3px;
  color: #0c0e12;
  background: var(--accent);
  padding: 4px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); }

.specs-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.spec { display: flex; align-items: center; justify-content: space-between; }
.spec .k { color: var(--muted); }
.spec .v { font-weight: 600; }

.demo { padding: 0; overflow: hidden; }
.video-skeleton { aspect-ratio: 16/9; background: repeating-linear-gradient( -45deg, rgba(255,255,255,0.06) 0 10px, rgba(255,255,255,0.02) 10px 20px ); display: grid; place-items: center; }
.video-skeleton .play { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #0d0f13; font-weight: 700; box-shadow: var(--shadow); }
.demo-meta { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); background: var(--surface); }
.chip { font-size: 12px; color: var(--text); border: 1px solid var(--border); padding: 6px 10px; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); }

.contact { display: flex; align-items: center; justify-content: space-between; gap: 18px; }

.site-footer { border-top: 1px solid var(--border); padding: 20px 0 36px; margin-top: 24px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.brand-mini { font-weight: 700; }
.muted { color: var(--muted); }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(8px); }
.reveal.in-view { opacity: 1; transform: none; transition: opacity 500ms ease, transform 500ms ease; }

/* Tilt effect */
.tilt { transform-style: preserve-3d; will-change: transform; }
.tilt:hover { transition: transform 200ms ease; }

/* Preloader */
#preloader { position: fixed; inset: 0; display: grid; place-items: center; background: color-mix(in lab, var(--bg) 88%, #000 12%); z-index: 9999; transition: opacity 300ms ease, visibility 300ms ease; }
#preloader.hidden { opacity: 0; visibility: hidden; }
.spinner { width: 56px; height: 56px; position: relative; }
.spinner > div { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--accent); border-right-color: var(--accent); animation: spin 900ms linear infinite; }
.spinner > div:nth-child(2) { inset: 8px; border-top-color: var(--accent-strong); border-right-color: var(--accent-strong); animation-direction: reverse; }

/* Responsive */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .specs-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .section { padding: 56px 0; }
  .card-grid { grid-template-columns: 1fr; }
  .specs-grid { grid-template-columns: 1fr; }
  .contact { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 561px) {
  .nav-toggle { display: none !important; }
  .nav-mobile { display: none !important; }
}

@media (max-width: 560px) {
  .rover-photo { transform: scale(2.0); }
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Catalog */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.product { display: grid; grid-template-rows: 440px auto; padding: 0; overflow: hidden; }
.product-media { height: 440px; background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08)); border-bottom: 1px solid var(--border); overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; transform: scale(1.08); transform-origin: center; transition: transform 240ms ease; }
.product:hover .product-media img { transform: scale(1.16); }
.product-body { padding: 16px; display: grid; gap: 10px; }
.product-body h3 { margin: 0; font-size: 18px; }
.product-meta { display: flex; align-items: center; justify-content: space-between; }
.product-actions { display: flex; gap: 8px; }

/* Inputs */
.input, .select { height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.input::placeholder { color: var(--muted); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) calc(1em + 2px), calc(100% - 11px) calc(1em + 2px); background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

@media (max-width: 900px) {
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .product { grid-template-rows: 260px auto; }
  .product-media { height: 260px; }
  .catalog-toolbar { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
  .catalog-toolbar .input, .catalog-toolbar .select { width: 100%; }
}


