/* ---------- Base styles ---------- */
:root {
  --background: #0b0d10;
  --surface: #15191f;
  --surface-light: #20262e;
  --text: #f7f9fb;
  --muted: #aab2bd;
  --accent: #f8b400;
  --accent-dark: #ca8f00;
  --border: #303842;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(248, 180, 0, 0.12), transparent 25rem),
    var(--background);
  line-height: 1.6;
}

a {
  color: inherit;
}

button,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto;
  padding: 1rem 0;
  background: rgba(11, 13, 16, 0.88);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: var(--accent);
}

.nav-list {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  color: var(--muted);
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--text);
}

.cart-button,
.primary-button,
.add-button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #15110a;
  font-weight: 800;
  cursor: pointer;
}

.cart-button {
  padding: 0.7rem 1rem;
}

.cart-button span {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  min-height: 1.45rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  background: #15110a;
  color: var(--accent);
}

/* ---------- Main layout ---------- */
main,
footer {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  min-height: 72vh;
  gap: 3rem;
  padding: 4rem 0 5rem;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 11ch;
  margin-bottom: 1.25rem;
  font-size: clamp(2.8rem, 7vw, 5.7rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-content > p:not(.eyebrow) {
  max-width: 55ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.primary-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.9rem 1.3rem;
  text-decoration: none;
}

.primary-button:hover,
.cart-button:hover,
.add-button:hover {
  background: var(--accent-dark);
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 25rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 2rem;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0)),
    var(--surface);
}

.hero-visual::before {
  content: "";
  position: absolute;
  width: 18rem;
  height: 18rem;
  border: 1px dashed rgba(248, 180, 0, 0.38);
  border-radius: 50%;
}

.track-line {
  position: absolute;
  bottom: 5rem;
  width: 140%;
  height: 0.35rem;
  transform: rotate(-8deg);
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0 3rem,
    transparent 3rem 5rem
  );
}

.car {
  position: relative;
  width: min(78%, 24rem);
  height: 7.5rem;
  transform: rotate(-7deg);
  border-radius: 3.5rem 5rem 1.4rem 1.4rem;
  background: linear-gradient(135deg, #f8b400, #d94a1e);
  box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.38);
}

.car::before {
  content: "";
  position: absolute;
  top: -2.8rem;
  left: 5.7rem;
  width: 9.5rem;
  height: 4rem;
  border-radius: 4rem 5rem 0 0;
  background: linear-gradient(135deg, #d94a1e, #f8b400);
}

.car-window {
  position: absolute;
  top: -2.15rem;
  left: 7rem;
  width: 6.8rem;
  height: 2.5rem;
  border-radius: 2.5rem 3rem 0.5rem 0.5rem;
  background: #2c3947;
}

.wheel {
  position: absolute;
  bottom: -1.6rem;
  width: 3.5rem;
  height: 3.5rem;
  border: 0.7rem solid #08090b;
  border-radius: 50%;
  background: #68717d;
}

.wheel-left {
  left: 3rem;
}

.wheel-right {
  right: 3rem;
}

/* ---------- Products ---------- */
.products-section,
.about-section {
  padding: 5rem 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.filter-label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

select {
  min-width: 11rem;
  padding: 0.75rem 2.3rem 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  color: var(--text);
  background: var(--surface);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  background: var(--surface);
}

.product-image {
  display: grid;
  place-items: center;
  min-height: 13rem;
  font-size: 5rem;
  background:
    linear-gradient(135deg, rgba(248, 180, 0, 0.16), transparent),
    var(--surface-light);
}

.product-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.25rem;
}

.product-category {
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-content h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.product-description {
  flex: 1;
  color: var(--muted);
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.2rem;
}

.price {
  font-weight: 850;
  font-size: 1.2rem;
}

.add-button {
  padding: 0.7rem 1rem;
}

/* ---------- About and footer ---------- */
.about-section {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 3rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-grid article {
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
}

.feature-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.8rem;
  background: var(--text);
  color: var(--background);
  font-weight: 700;
  opacity: 0;
  transform: translateY(1rem);
  transition: 180ms ease;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* ---------- Responsive styles ---------- */
@media (max-width: 850px) {
  .hero,
  .about-section {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 2rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .site-header {
    flex-wrap: wrap;
  }

  nav {
    order: 3;
    width: 100%;
  }

  .nav-list {
    justify-content: center;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 20rem;
  }
}
