/* ─── Reset & Variables ────────────────────────────────────────────── */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-card: #111111;
  --text: #ffffff;
  --text-muted: #999999;
  --accent: #e8750a;
  --accent-gold: #d4a017;
  --border: #333333;
  --nav-height: 72px;
  --container: 1120px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-gold);
}

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

/* ─── Utility ─────────────────────────────────────────────────────── */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Navigation ──────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}

.nav--scrolled {
  background: rgba(10, 10, 10, 0.95);
  border-bottom-color: var(--border);
}

.nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav__logo img {
  height: 32px;
  width: auto;
}

.nav__links {
  display: flex;
  list-style: none;
  gap: 32px;
  align-items: center;
}

.nav__links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

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

.nav__cta {
  color: var(--accent) !important;
  font-weight: 600 !important;
}

.nav__cta:hover {
  color: var(--accent-gold) !important;
}

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

.nav__toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Hero ────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-primary);
}

.hero__checker {
  position: absolute;
  inset: 0;
  background:
    repeating-conic-gradient(
      rgba(255, 255, 255, 0.02) 0% 25%,
      transparent 0% 50%
    )
    0 0 / 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 70%);
}

.hero__content {
  position: relative;
  text-align: center;
  padding: 0 24px;
}

.hero__logo {
  max-width: 480px;
  width: 100%;
  margin: 0 auto 32px;
}

.hero__tagline {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.hero__accent {
  width: 64px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-gold));
  margin: 32px auto 0;
  border-radius: 2px;
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-8px); }
  60% { transform: translateX(-50%) translateY(-4px); }
}

/* ─── Sections ────────────────────────────────────────────────────── */

.section {
  padding: 100px 0;
}

.section--alt {
  background: var(--bg-secondary);
}

.section__title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.section__divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-gold));
  margin: 16px 0 48px;
  border-radius: 2px;
}

/* ─── Fade-in Animation ───────────────────────────────────────────── */

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── About ───────────────────────────────────────────────────────── */

.about__content {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about__content p {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ─── Services ────────────────────────────────────────────────────── */

.services__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(232, 117, 10, 0.08);
}

.card__icon {
  color: var(--accent);
  margin-bottom: 20px;
}

.card__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.card__text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ─── RaceTrace ───────────────────────────────────────────────────── */

.racetrace {
  background: #0b0b18;
  position: relative;
  overflow: hidden;
}

.racetrace__hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 72px;
}

.racetrace__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #748ffc;
  border: 1px solid rgba(116, 143, 252, 0.3);
  border-radius: 100px;
  padding: 4px 16px;
  margin-bottom: 24px;
}

.racetrace__logo-link {
  display: block;
  text-decoration: none;
  margin-bottom: 16px;
}

.racetrace__wordmark {
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #5c7cfa, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.racetrace__headline {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  color: #e0e0e8;
  margin-bottom: 16px;
  line-height: 1.3;
}

.racetrace__gradient-text {
  background: linear-gradient(135deg, #748ffc, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.racetrace__desc {
  font-size: 16px;
  color: #6b6b88;
  line-height: 1.7;
  margin-bottom: 28px;
}

.racetrace__cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn--racetrace {
  background: linear-gradient(135deg, #4c6ef5, #3b5bdb);
  color: #fff;
}

.btn--racetrace:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(76, 110, 245, 0.35);
  color: #fff;
}

/* Chart visualization */
.racetrace__hero-chart {
  background: #12122a;
  border: 1px solid #1e1e38;
  border-radius: 12px;
  padding: 20px 12px 12px;
  position: relative;
}

.racetrace__chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* SVG trace draw animation */
.racetrace__trace {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

.racetrace__hero.visible .racetrace__trace {
  animation: drawTrace 2s ease-out forwards;
  animation-delay: var(--trace-delay, 0s);
}

@keyframes drawTrace {
  to {
    stroke-dashoffset: 0;
  }
}

/* Feature cards */
.racetrace__features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.racetrace__feature {
  background: #12122a;
  border: 1px solid #1e1e38;
  border-radius: 12px;
  padding: 28px 24px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.racetrace__feature:hover {
  transform: translateY(-4px);
  border-color: #4c6ef5;
  box-shadow: 0 8px 32px rgba(76, 110, 245, 0.1);
}

.racetrace__feature-icon {
  color: #748ffc;
  margin-bottom: 16px;
}

.racetrace__feature-title {
  font-size: 15px;
  font-weight: 700;
  color: #e0e0e8;
  margin-bottom: 8px;
}

.racetrace__feature-text {
  font-size: 14px;
  color: #6b6b88;
  line-height: 1.6;
}

/* ─── Buttons ─────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  text-decoration: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-gold));
  color: #000;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(232, 117, 10, 0.3);
  color: #000;
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--full {
  width: 100%;
  justify-content: center;
}

/* ─── Motorsports Carousel ────────────────────────────────────────── */

.carousel {
  position: relative;
}

.carousel__viewport {
  overflow: hidden;
  border-radius: 12px;
}

.carousel__track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel__slide {
  flex: 0 0 100%;
  min-width: 0;
}

.motorsports__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.motorsports__photo {
  border-radius: 12px;
  overflow: hidden;
}

.motorsports__photo img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
  aspect-ratio: 16 / 10;
}

.motorsports__placeholder {
  aspect-ratio: 16 / 10;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.motorsports__placeholder--apple {
  background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
}

.motorsports__placeholder-sub {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
}

.motorsports__subtitle {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  line-height: 1.3;
}

.motorsports__class {
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 20px;
}

.motorsports__info p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 28px;
  line-height: 1.7;
}

/* Carousel arrows */
.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
  z-index: 10;
}

.carousel__arrow:hover {
  border-color: var(--accent);
  background: rgba(26, 26, 26, 0.95);
}

.carousel__arrow--prev {
  left: -22px;
}

.carousel__arrow--next {
  right: -22px;
}

/* Carousel dots */
.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}

.carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
  padding: 0;
}

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

.carousel__dot.active {
  background: var(--accent);
  border-color: var(--accent);
}

/* ─── Contact ─────────────────────────────────────────────────────── */

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact__info {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 8px;
}

.contact__item {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 16px;
}

.contact__item svg {
  color: var(--accent);
  flex-shrink: 0;
}

.contact__item a {
  color: var(--text-muted);
}

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

.form__group {
  margin-bottom: 16px;
}

.form__input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.2s;
  outline: none;
}

.form__input::placeholder {
  color: #666;
}

.form__input:focus {
  border-color: var(--accent);
}

.form__textarea {
  resize: vertical;
  min-height: 120px;
}

/* ─── Footer ──────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__logo {
  height: 24px;
  width: auto;
  opacity: 0.5;
}

.footer__copy {
  font-size: 13px;
  color: #555;
}

/* ─── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.98);
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }

  .nav__links.open {
    opacity: 1;
    pointer-events: auto;
  }

  .nav__links a {
    font-size: 20px;
  }

  .section {
    padding: 72px 0;
  }

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

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

  .carousel__arrow--prev {
    left: 8px;
  }

  .carousel__arrow--next {
    right: 8px;
  }

  .carousel__arrow {
    width: 36px;
    height: 36px;
  }

  .contact__grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .racetrace__hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 32px;
    margin-bottom: 48px;
  }

  .racetrace__cta-row {
    justify-content: center;
  }

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

  .footer__inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero__logo {
    max-width: 280px;
  }

  .card {
    padding: 28px 24px;
  }

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