/* ═══════════════════════════════════════════════════════════
   RE-NOVA — Design System
   Premium Cinematic Automotive Identity
   ═══════════════════════════════════════════════════════════ */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ─── CSS Custom Properties ─── */
:root {
  /* Colors — Core */
  --color-white: #FAFAFA;
  --color-white-pure: #FFFFFF;
  --color-black: #0A0A0A;
  --color-black-soft: #141416;

  /* Colors — Bordeaux Signature */
  --color-bordeaux: #780B01;
  --color-bordeaux-light: #9E1002;
  --color-bordeaux-dark: #490500;
  --color-bordeaux-glow: rgba(120, 11, 1, 0.4);
  --color-bordeaux-subtle: rgba(120, 11, 1, 0.08);

  /* Colors — Neutrals */
  --color-graphite: #2A2A2E;
  --color-graphite-light: #3D3D42;
  --color-graphite-medium: #1E1E22;
  --color-silver: #B8B8BC;
  --color-silver-dark: #8A8A8E;
  --color-cream: #F5F0EB;
  --color-cream-dark: #E8E0D8;
  --color-grey-100: #F2F2F3;
  --color-grey-200: #E5E5E7;
  --color-grey-300: #D1D1D4;
  --color-grey-800: #333338;

  /* Typography — Families */
  --font-heading: 'Space Grotesk', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Typography — Scale */
  --text-xs: 0.75rem;
  /* 12px */
  --text-sm: 0.875rem;
  /* 14px */
  --text-base: 1rem;
  /* 16px */
  --text-md: 1.125rem;
  /* 18px */
  --text-lg: 1.25rem;
  /* 20px */
  --text-xl: 1.5rem;
  /* 24px */
  --text-2xl: 2rem;
  /* 32px */
  --text-3xl: 2.5rem;
  /* 40px */
  --text-4xl: 3rem;
  /* 48px */
  --text-5xl: 3.75rem;
  /* 60px */
  --text-6xl: 4.5rem;
  /* 72px */
  --text-hero: 6rem;
  /* 96px */

  /* Typography — Line Heights */
  --leading-tight: 0.8;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* Typography — Letter Spacing */
  --tracking-tighter: -0.03em;
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.05em;
  --tracking-wider: 0.1em;
  --tracking-widest: 0.2em;

  /* Spacing */
  --space-1: 0.25rem;
  /* 4px */
  --space-2: 0.5rem;
  /* 8px */
  --space-3: 0.75rem;
  /* 12px */
  --space-4: 1rem;
  /* 16px */
  --space-5: 1.25rem;
  /* 20px */
  --space-6: 1.5rem;
  /* 24px */
  --space-8: 2rem;
  /* 32px */
  --space-10: 2.5rem;
  /* 40px */
  --space-12: 3rem;
  /* 48px */
  --space-16: 4rem;
  /* 64px */
  --space-20: 5rem;
  /* 80px */
  --space-24: 6rem;
  /* 96px */
  --space-32: 8rem;
  /* 128px */
  --space-40: 10rem;
  /* 160px */

  /* Layout */
  --container-max: 1320px;
  --container-narrow: 960px;
  --container-text: 720px;
  --gutter: var(--space-6);

  /* Borders */
  --radius-none: 0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.14);
  --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.2);
  --shadow-bordeaux: 0 8px 32px rgba(107, 29, 42, 0.25);
  --shadow-inner: inset 0 2px 8px rgba(0, 0, 0, 0.06);

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 200ms;
  --duration-normal: 400ms;
  --duration-slow: 600ms;
  --duration-slower: 800ms;
  --duration-cinematic: 1200ms;

  /* Z-Index Scale */
  --z-behind: -1;
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-max: 9999;

  /* Glass Effect */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: 20px;

  --glass-bg-light: rgba(255, 255, 255, 0.7);
  --glass-border-light: rgba(255, 255, 255, 0.4);
}

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

html {
  font-size: 16px;
  scroll-behavior: auto;
  /* GSAP handles smooth scroll */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-black);
  background-color: var(--color-white);
  overflow-x: hidden;
  min-height: 100vh;
}

body.dark-page {
  background-color: var(--color-black);
  color: var(--color-white);
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out-quart);
}

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

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
}

input,
textarea,
select {
  font-family: var(--font-body);
}

::selection {
  background-color: var(--color-bordeaux);
  color: var(--color-white);
}

/* ─── Typography Classes ─── */
.heading-hero {
  font-family: var(--font-heading);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tighter);
}

.heading-1 {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.heading-2 {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 600;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

.heading-3 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: var(--leading-snug);
}

.heading-4 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: var(--leading-snug);
}

.heading-5 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: var(--leading-snug);
}

.text-body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

.text-body-lg {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}

.text-body-sm {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.text-caption {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-wide);
}

.text-label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.text-overline {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-bordeaux);
}

/* ─── FOUC Prevention for GSAP ─── */
.hero__title,
.hero__label,
.hero__subtitle,
.hero__ctas,
.hero__scroll,
.page-hero__title,
.page-hero__label,
.page-hero__subtitle {
  visibility: hidden;
  opacity: 0;
}

/* ─── Layout Utilities ─── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.container-text {
  max-width: var(--container-text);
}

.section {
  padding-top: var(--space-24);
  padding-bottom: var(--space-24);
}

.section-lg {
  padding-top: var(--space-32);
  padding-bottom: var(--space-32);
}

/* ─── Scroll Reveal Defaults ─── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
}

/* ─── Color Utilities ─── */
.text-bordeaux {
  color: var(--color-bordeaux);
}

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

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

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

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

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

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

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

/* ─── Page Transition Overlay ─── */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-bordeaux-dark);
  z-index: var(--z-max);
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
}

/* ─── Loading Screen ─── */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-black);
  z-index: var(--z-max);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-6);
}

.loader__logo {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: var(--tracking-wide);
}

.loader__logo span {
  color: var(--color-bordeaux);
}

.loader__bar {
  width: 120px;
  height: 2px;
  background-color: var(--color-graphite-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.loader__bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background-color: var(--color-bordeaux);
  border-radius: var(--radius-full);
}

/* ─── Custom Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-black);
}

::-webkit-scrollbar-thumb {
  background: var(--color-bordeaux);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-bordeaux-light);
}

/* ─── Responsive Typography ─── */
@media (max-width: 1024px) {
  :root {
    --text-hero: 4rem;
    --text-6xl: 3.5rem;
    --text-5xl: 3rem;
    --text-4xl: 2.5rem;
    --text-3xl: 2rem;
    --text-2xl: 1.75rem;
  }
}

@media (max-width: 768px) {
  :root {
    --text-hero: 2.75rem;
    --text-6xl: 2.5rem;
    --text-5xl: 2.25rem;
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
    --text-2xl: 1.5rem;
    --text-xl: 1.25rem;
    --gutter: var(--space-4);
  }

  .section {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
  }

  .section-lg {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }
}

@media (max-width: 480px) {
  :root {
    --text-hero: 2.25rem;
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
  }
}