:root {
  --bg: #14161a;
  --surface: #1d2026;
  --border: #2e333c;
  --text: #e8eaee;
  --muted: #9aa1ad;
  --accent: #ff7a1a;
  --mango: linear-gradient(135deg, #ffc233, #ff6a1a);
  --radius: 12px;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes drift {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

main {
  animation: page-in 0.5s ease-out;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, "Segoe UI", Roboto, sans-serif;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  margin-bottom: 16px;
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Slanted mango stripe in front of every section heading */
h2::before {
  content: "";
  width: 22px;
  height: 10px;
  background: var(--mango);
  transform: skewX(-24deg);
  border-radius: 2px;
}

main,
.site-header,
footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  padding-bottom: 12px;
  /* Sticks to the top; the shadow extends the background to the full window width. */
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  box-shadow: 0 0 0 100vmax var(--bg);
  clip-path: inset(0 -100vmax -1px);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.2s;
}

.brand:hover {
  color: var(--accent);
}

nav a {
  display: inline-block;
  padding: 10px 0 10px 12px;
  color: var(--muted);
  text-decoration: none;
}

nav a:hover {
  color: var(--text);
}

/* Hero: text over a slideshow of the cars */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(70vh, 560px);
  margin-bottom: 56px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0f1114;
}

.hero-slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero-slides img.active {
  opacity: 1;
  animation: drift 7s ease-out forwards;
}

/* Darkens the left and bottom so the text stays readable on any photo */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 17, 20, 0.92) 0%, rgba(15, 17, 20, 0.62) 42%, rgba(15, 17, 20, 0) 72%),
    linear-gradient(0deg, rgba(15, 17, 20, 0.75) 0%, rgba(15, 17, 20, 0) 45%);
}

.hero-text {
  position: relative;
  z-index: 1;
  max-width: 640px;
  padding: 36px 36px 44px;
}

.hero h1 {
  font-size: clamp(2rem, 5.4vw, 3.4rem);
  margin-bottom: 14px;
}

.hero p,
.lead {
  color: #c3c8d0;
  font-size: 1.1rem;
  margin: 0;
}

.hero-caption {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 16px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 17, 20, 0.7);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.hero-caption:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  .hero-text {
    padding: 24px 20px 56px;
  }

  .hero::after {
    background: linear-gradient(0deg, rgba(15, 17, 20, 0.95) 10%, rgba(15, 17, 20, 0.55) 60%, rgba(15, 17, 20, 0.15) 100%);
  }
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* Icons are black SVGs: inverted to white, except on the orange first button. */
.link-icon {
  width: 16px;
  height: 16px;
  filter: invert(1);
}

.links a:first-child .link-icon {
  filter: none;
}

.footer-links .link-icon {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.links a,
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.links a {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
  background: rgba(29, 32, 38, 0.7);
  transition: transform 0.15s, border-color 0.15s;
}

.links a:first-child {
  background: var(--mango);
  border-color: transparent;
  color: #14161a;
  font-weight: 700;
}

.links a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.footer-links a {
  padding: 8px 0;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.video {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

[hidden] {
  display: none !important;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

/* Cards start lowered and transparent; main.js adds .in when they scroll into view. */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.2s, box-shadow 0.2s;
}

.card.in {
  opacity: 1;
  transform: none;
}

.card.in:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  transition-delay: 0s !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

/* Mango line that sweeps across the bottom of a card on hover */
.card::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--mango);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.card:hover::after {
  transform: scaleX(1);
}

.card-photo {
  overflow: hidden;
  background: #0f1114;
}

.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.card-body {
  padding: 14px 16px 16px;
}

.card-title,
.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-body p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.badge {
  flex: none;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.back {
  display: inline-block;
  margin: 10px 0 24px;
  color: var(--muted);
  text-decoration: none;
}

.back:hover {
  color: var(--text);
}

.title-row {
  justify-content: flex-start;
}

.title-row h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 28px;
  margin-top: 36px;
}

/* Photos come in different shapes (16:9, 4:3, square): show them uncropped. */
.photo-main {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  transition: opacity 0.13s ease;
}

.photo-main.fading {
  opacity: 0;
}

.photo-frame {
  position: relative;
}

/* Previous / next arrows over the main photo */
.photo-nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  padding: 0 0 4px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(15, 17, 20, 0.65);
  color: var(--text);
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.photo-nav.prev {
  left: 12px;
}

.photo-nav.next {
  right: 12px;
}

.photo-nav:hover {
  background: var(--mango);
  border-color: transparent;
  color: #14161a;
  transform: scale(1.08);
}

.thumbs button {
  transition: border-color 0.15s, transform 0.15s;
}

.thumbs button:hover {
  transform: translateY(-2px);
}

/* Touch screens have no hover: stop cards looking "stuck" after a tap. */
@media (hover: none) {
  .card.in:hover {
    border-color: var(--border);
    transform: none;
    box-shadow: none;
  }

  .card:hover::after {
    transform: scaleX(0);
  }

  .card:hover img {
    transform: none;
  }

  .photo-nav:hover {
    background: rgba(15, 17, 20, 0.65);
    border-color: var(--border);
    color: var(--text);
    transform: none;
  }
}

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

  .card {
    opacity: 1;
    transform: none;
  }
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.thumbs button {
  width: 72px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: none;
  cursor: pointer;
}

.thumbs button.active {
  border-color: var(--accent);
}

.thumbs img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.specs {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.specs dt,
.specs dd {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.specs dt {
  color: var(--muted);
}

.specs dt:last-of-type,
.specs dd:last-of-type {
  border-bottom: 0;
}

.button {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 18px;
  background: var(--accent);
  color: #14161a;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
}

.button[hidden] {
  display: none;
}

.notice {
  padding: 60px 0;
  color: var(--muted);
}

footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 70px;
  padding-top: 24px;
  padding-bottom: 32px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
