/* ========================================
 * Raceboard - Clean Stylesheet
 * ======================================== */

/* ========================================
 * CSS Custom Properties (Design Tokens)
 * ======================================== */
:root {
  /* Colors */
  --color-bg: #0d0d0d;
  --color-bg-secondary: #161616;
  --color-bg-card: #161616;
  --color-border: #262626;
  --color-border-light: #3d3d3d;
  --color-text: #ffffff;
  --color-text-muted: #7a7a7a;
  --color-text-subtle: rgba(255, 255, 255, 0.62);
  --color-accent: #bef221;
  --color-accent-dark: #a7ca25;

  /* Typography */
  --font-body: 'Clash Display', system-ui, -apple-system, sans-serif;
  --font-display: 'Clash Display', system-ui, -apple-system, sans-serif;

  /* Font sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.5rem;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;

  /* Container */
  --container-max: 1280px;
  --container-padding: 1.5rem;
}

/* ========================================
 * Font Face Declarations
 * ======================================== */
@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ========================================
 * Reset & Base Styles
 * ======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul,
ol {
  list-style: none;
}

/* ========================================
 * Typography
 * ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
}

h2 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

h3 {
  font-size: var(--text-xl);
}

p {
  color: var(--color-text-subtle);
}

/* ========================================
 * Layout Utilities
 * ======================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: var(--space-3xl) 0;
}

/* ========================================
 * Navbar
 * ======================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.navbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--container-padding);
  max-width: var(--container-max);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-icon {
  width: 40px;
  height: 40px;
}

.logo-text {
  height: 20px;
  width: auto;
}

/* ========================================
 * Buttons
 * ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-sm);
  line-height: 1.3;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-primary {
  background-color: #1c1c1c;
  color: var(--color-text);
  border: 1px solid var(--color-border-light);
}

.btn-primary:hover {
  background-color: #2a2a2a;
}

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

.btn-accent:hover {
  background-color: var(--color-accent-dark);
}

/* ========================================
 * Hero Section
 * ======================================== */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  overflow: hidden;
  padding-top: var(--space-2xl);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

.hero-pattern {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-pattern img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.5;
}

.hero-content {
  max-width: 800px;
  padding: var(--space-2xl) var(--container-padding);
  z-index: 1;
}

.hero h1 {
  background: linear-gradient(180deg, #fff 9%, rgba(255, 255, 255, 0.63) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-subtle);
  margin-bottom: var(--space-xl);
}

.store-buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.store-buttons a {
  transition: transform var(--transition), opacity var(--transition);
}

.store-buttons a:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.store-buttons img {
  height: 52px;
  width: auto;
}

.hero-phones {
  width: 100%;
  max-width: 1200px;
  margin-top: var(--space-xl);
  z-index: 1;
}

.hero-phones img {
  width: 100%;
  height: auto;
}

/* ========================================
 * Feature Sections
 * ======================================== */
.feature {
  background-color: var(--color-bg);
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

@media (min-width: 1024px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
  }
}

@media (min-width: 1024px) {
  .feature-reverse .feature-content {
    order: 2;
  }

  .feature-reverse .feature-visual {
    order: 1;
  }
}

.feature-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.feature-label {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.feature-content h2 {
  margin: 0;
}

.feature-content p {
  max-width: 500px;
}

.feature-visual {
  display: flex;
  justify-content: center;
}

.phone-frame {
  position: relative;
  max-width: 400px;
  border: 1px solid var(--color-border);
  border-radius: 40px;
  overflow: hidden;
  background: linear-gradient(180deg, #1e1e1e 0%, #141414 100%);
  padding: 12px;
}

.phone-frame img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center top;
  border-radius: 28px;
}

/* ========================================
 * Section Header
 * ======================================== */
.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background-color: rgba(190, 242, 33, 0.1);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: 500;
}

/* ========================================
 * Reviews Section
 * ======================================== */
.reviews {
  background-color: var(--color-bg);
  overflow: hidden;
}

.reviews h2 {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.reviews-carousel {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-behavior: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: var(--space-sm) 0;
  margin: 0 calc(-1 * var(--container-padding));
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
  -webkit-mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 1) 12.5%,
    rgba(0, 0, 0, 1) 87.5%,
    rgba(0, 0, 0, 0.55) 100%
  );
  mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 1) 12.5%,
    rgba(0, 0, 0, 1) 87.5%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

.reviews-carousel::-webkit-scrollbar {
  display: none;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}

.review-card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  flex-shrink: 0;
  width: 380px;
  min-width: 320px;
  scroll-snap-align: start;
}

.review-stars {
  width: 116px;
  height: 19px;
}

.review-stars-dynamic {
  display: flex;
  gap: 4px;
  height: 19px;
}

.review-stars-dynamic .star-icon {
  flex-shrink: 0;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
}

.review-date {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.review-title {
  color: var(--color-text);
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}

.review-quote {
  color: var(--color-text);
  font-size: var(--text-base);
  line-height: 1.6;
  flex-grow: 1;
}

.review-author {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.review-name {
  color: var(--color-text);
  font-weight: 500;
}

.review-source {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.reviews-fallback {
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-2xl);
  width: 100%;
}

/* ========================================
 * FAQ Section
 * ======================================== */
.faq {
  background-color: var(--color-bg);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  color: var(--color-text);
  width: 100%;
  text-align: left;
  background: none;
  border: none;
}

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

.faq-icon {
  width: 24px;
  height: 24px;
  transition: transform var(--transition);
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-answer p {
  padding-bottom: var(--space-md);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.faq-answer a {
  color: var(--color-accent);
}

.faq-answer a:hover {
  text-decoration: underline;
}

.faq-contact {
  text-align: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.faq-contact h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.contact-email {
  display: inline-block;
  font-size: var(--text-lg);
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity var(--transition);
}

.contact-email:hover {
  opacity: 0.8;
}

/* ========================================
 * CTA Section
 * ======================================== */
.cta {
  position: relative;
  text-align: center;
  padding: var(--space-3xl) 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin: 0 var(--container-padding);
}

.cta-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cta-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cta .container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

.cta-content {
  max-width: 600px;
}

.cta-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-base);
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.cta h2 {
  margin-bottom: var(--space-xl);
}

.cta-phone {
  max-width: 600px;
}

.cta-phone img {
  width: 100%;
  height: auto;
}

/* ========================================
 * Footer
 * ======================================== */
.footer {
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: var(--space-2xl) 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  text-align: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.footer-logo {
  width: 21px;
  height: 17px;
}

.footer-tagline {
  max-width: 400px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  opacity: 0.5;
}

.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
  transition: background-color var(--transition);
}

.footer-social:hover {
  background-color: var(--color-border);
}

.footer-divider {
  width: 100%;
  max-width: 300px;
  height: 1px;
  background-color: #333;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md) var(--space-lg);
}

.footer-links a {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition);
}

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

.footer-copyright {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-text);
  opacity: 0.5;
}

/* ========================================
 * Responsive Styles
 * ======================================== */
@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
  }

  .navbar-inner {
    padding: var(--space-sm) var(--container-padding);
  }

  .logo-text {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-bottom: 0;
  }

  .store-buttons {
    flex-direction: column;
    align-items: center;
  }

  .feature-grid {
    text-align: center;
  }

  .feature-content {
    align-items: center;
  }

  .feature-content p {
    max-width: 100%;
  }

  .phone-frame {
    max-width: 280px;
  }

  .reviews-carousel .review-card {
    width: 300px;
    min-width: 280px;
  }

  .footer-inner {
    text-align: center;
  }
}

/* ========================================
 * Utility Classes
 * ======================================== */
.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;
}

.text-center {
  text-align: center;
}

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