:root {
  --bg: #0e1620;
  --bg-elevated: #1a2530;
  --border: #1f2937;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --accent: #facc15;
  --accent-hover: #fbbf24;
  --blue: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
  --max-width: 1100px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

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

header {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(14, 22, 32, 0.92);
  backdrop-filter: blur(10px);
  z-index: 10;
}

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

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  height: 36px;
  width: auto;
  display: block;
}

@media (max-width: 768px) {
  .logo img {
    height: 28px;
  }
}

nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
}

nav a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}

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

main {
  flex: 1;
}

.hero {
  position: relative;
  min-height: 560px;
  padding: 100px 0 140px;
  overflow: hidden;
  isolation: isolate;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(14, 22, 32, 0.96) 0%, rgba(14, 22, 32, 0.78) 30%, rgba(14, 22, 32, 0.35) 55%, rgba(14, 22, 32, 0) 75%),
    linear-gradient(to bottom, rgba(14, 22, 32, 0.25) 0%, rgba(14, 22, 32, 0) 30%, rgba(14, 22, 32, 0) 65%, rgba(14, 22, 32, 0.55) 100%);
  z-index: 6;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 7;
}

.hero-text {
  max-width: 560px;
}

.hero-text h1 {
  font-size: 56px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.hero-text h1 .accent {
  color: var(--accent);
}

.hero-text p {
  font-size: 20px;
  color: var(--text);
  margin-bottom: 32px;
  max-width: 480px;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.app-store-badge {
  display: inline-flex;
  align-items: center;
  height: 52px;
  border-radius: 8.5px;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
}

.app-store-badge svg {
  height: 100%;
  width: auto;
  display: block;
}

.app-store-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--bg);
  transform: translateY(-1px);
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 4px 16px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 6px 20px rgba(0, 0, 0, 0.25);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.badge-icon {
  width: 14px;
  height: 14px;
}

.track-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(to bottom, #a3dcf5 0%, #cae7f5 55%, #d6e8f1 80%, #b7d8eb 100%);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  z-index: 1;
}

@keyframes scroll-x {
  to { background-position-x: calc(var(--w) * -1); }
}

.layer-city {
  --w: 526px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 200px;
  height: 70px;
  background-image: url('/assets/city.png');
  background-image: image-set(url('/assets/city.webp') type('image/webp'), url('/assets/city.png') type('image/png'));
  background-size: var(--w) 70px;
  background-repeat: repeat-x;
  animation: scroll-x 30s linear infinite;
  opacity: 0.95;
  z-index: 1;
}

.layer-trees {
  --w: 712px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 200px;
  height: 55px;
  background-image: url('/assets/trees.png');
  background-image: image-set(url('/assets/trees.webp') type('image/webp'), url('/assets/trees.png') type('image/png'));
  background-size: var(--w) 55px;
  background-repeat: repeat-x;
  animation: scroll-x 7s linear infinite;
  z-index: 2;
}

.layer-road {
  --w: 660px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 200px;
  background-image: url('/assets/track.png');
  background-image: image-set(url('/assets/track.webp') type('image/webp'), url('/assets/track.png') type('image/png'));
  background-size: var(--w) 200px;
  background-repeat: repeat-x;
  animation: scroll-x 2.4s linear infinite;
  z-index: 3;
}

.layer-shoulder {
  --w: 668px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20px;
  background-image: url('/assets/shoulder.png');
  background-image: image-set(url('/assets/shoulder.webp') type('image/webp'), url('/assets/shoulder.png') type('image/png'));
  background-size: var(--w) 20px;
  background-repeat: repeat-x;
  animation: scroll-x 3s linear infinite;
  z-index: 4;
}

.kart {
  position: absolute;
  bottom: 50px;
  left: 72%;
  width: 220px;
  height: 110px;
  transform: translateX(-50%);
  z-index: 5;
  animation: kart-wobble 0.4s ease-in-out infinite alternate;
}

.kart-body {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  z-index: 2;
}

.kart-driver {
  position: absolute;
  left: 17%;
  bottom: 30%;
  width: 55%;
  height: auto;
  z-index: 3;
}

.wheel {
  position: absolute;
  width: 73px;
  height: 73px;
  bottom: 2%;
  background-image: url('/assets/kart_wheel.png');
  background-image: image-set(url('/assets/kart_wheel.webp') type('image/webp'), url('/assets/kart_wheel.png') type('image/png'));
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: wheel-frames 0.16s steps(2, jump-none) infinite;
  z-index: 4;
}

.wheel-rear {
  left: 5%;
}

.wheel-front {
  right: 21%;
  bottom: 1%;
}

@keyframes wheel-frames {
  from { background-position-x: 0%; }
  to { background-position-x: 100%; }
}

@keyframes kart-wobble {
  0% { transform: translateX(-50%) translateY(0) rotate(-0.6deg); }
  100% { transform: translateX(-50%) translateY(-2px) rotate(0.6deg); }
}

section {
  padding: 80px 0;
}

section h2 {
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 16px;
  text-align: center;
}

section .subhead {
  font-size: 17px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 48px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.features {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.feature {
  background: var(--bg);
  padding: 28px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(250, 204, 21, 0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 16px;
}

.feature-icon svg {
  width: 26px;
  height: 26px;
}

.feature h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.feature p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
}

.modes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.mode {
  background: var(--bg-elevated);
  padding: 32px 24px;
  border-radius: 14px;
  border: 1px solid var(--border);
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

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

.mode-rounds {
  font-size: 56px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.mode-rounds-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.mode-name {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.mode-desc {
  font-size: 14px;
  color: var(--text-muted);
}

#faq {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-list details {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.faq-list details:hover {
  border-color: rgba(250, 204, 21, 0.35);
}

.faq-list details[open] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.2), 0 8px 24px rgba(0, 0, 0, 0.25);
}

.faq-list summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 56px 20px 24px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  position: relative;
  user-select: none;
  transition: color 0.15s;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary:hover {
  color: var(--accent);
}

.faq-list summary::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.25s ease;
}

.faq-list details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.faq-list details[open] summary {
  color: var(--accent);
}

.faq-list details > p {
  padding: 0 24px 22px 24px;
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.65;
  border-top: 1px solid var(--border);
  margin-top: 0;
  padding-top: 18px;
}

@media (prefers-reduced-motion: reduce) {
  .faq-list details,
  .faq-list summary::after {
    transition: none;
  }
}

.cta-section {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.08), rgba(59, 130, 246, 0.05));
  text-align: center;
}

.cta-section h2 {
  font-size: 40px;
  margin-bottom: 12px;
}

.cta-section p {
  color: var(--text-muted);
  font-size: 18px;
  margin-bottom: 32px;
}

.cta-section .beta-cta {
  justify-content: center;
  margin-bottom: 28px;
}

.beta-note {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 16px !important;
}

.subscribe-form {
  display: flex;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.subscribe-form input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.subscribe-form input[type="email"]:focus {
  border-color: var(--accent);
}

.subscribe-form input[type="email"]::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.subscribe-form button {
  flex: 0 0 auto;
}

.subscribe-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.subscribe-status {
  min-height: 1.4em;
  margin-top: 14px !important;
  margin-bottom: 0 !important;
  font-size: 15px;
  text-align: center;
}

.subscribe-status.is-success {
  color: var(--accent);
}

.subscribe-status.is-error {
  color: #ef4444;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

footer {
  padding: 40px 0 60px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

footer .footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

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

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

.legal-page main {
  padding: 60px 0 80px;
}

.error-page main {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 220px);
  padding: 60px 0 80px;
}

.error-box {
  text-align: center;
  max-width: 640px;
}

.error-code {
  font-size: clamp(96px, 18vw, 180px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent), #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.error-page h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 900;
  margin: 0 0 12px;
}

.error-lede {
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.55;
  margin: 0 auto 32px;
  max-width: 480px;
}

.legal-page h1 {
  font-size: 40px;
  font-weight: 900;
  margin-bottom: 8px;
}

.legal-page .last-updated {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 40px;
}

.legal-page h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 32px 0 12px;
  text-align: left;
}

.legal-page p,
.legal-page ul {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal-page ul {
  padding-left: 24px;
}

.legal-page strong {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 768px) {
  .hero {
    min-height: 480px;
    padding: 60px 0 100px;
  }
  .hero-overlay {
    background:
      linear-gradient(to bottom, rgba(14, 22, 32, 0.55) 0%, rgba(14, 22, 32, 0.35) 30%, rgba(14, 22, 32, 0.45) 70%, rgba(14, 22, 32, 0.85) 100%);
  }
  .hero-text h1 {
    font-size: 38px;
  }
  .hero-text p {
    font-size: 17px;
  }
  .layer-city {
    --w: 376px;
    bottom: 140px;
    height: 50px;
    background-size: var(--w) 50px;
  }
  .layer-trees {
    --w: 504px;
    bottom: 150px;
    height: 39px;
    background-size: var(--w) 39px;
  }
  .layer-road {
    --w: 495px;
    height: 150px;
    background-size: var(--w) 150px;
  }
  .layer-shoulder {
    --w: 535px;
    height: 16px;
    background-size: var(--w) 16px;
  }
  .kart {
    width: 150px;
    height: 75px;
    bottom: 30px;
    left: 65%;
  }
  .wheel {
    width: 50px;
    height: 50px;
  }
  section {
    padding: 60px 0;
  }
  section h2 {
    font-size: 28px;
  }
  .features-grid,
  .modes-grid {
    grid-template-columns: 1fr;
  }
  nav ul {
    gap: 16px;
  }
  nav a {
    font-size: 13px;
  }
  .faq-list summary {
    font-size: 15.5px;
    padding: 16px 48px 16px 18px;
  }
  .faq-list summary::after {
    right: 18px;
    width: 10px;
    height: 10px;
  }
  .faq-list details > p {
    padding: 14px 18px 18px;
    font-size: 14.5px;
  }
}
