/* ═══════════════════════════════════════════════════════════════
   R5WF DESIGN SYSTEM
   Inspired by Volvo Cars — clean, premium, harmonious
   Mobile-first · CSS Custom Properties · Zero frameworks
   ═══════════════════════════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-black);
  background-color: var(--c-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-family: 'Barlow', sans-serif; line-height: 1.15; }
input, textarea, select { font: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ── CSS CUSTOM PROPERTIES (TOKENS) ────────────────────────── */
:root {
  /* Colors */
  --c-white:       #FFFFFF;
  --c-black:       #0A0A0A;
  --c-gray-50:     #FAFAFA;
  --c-gray-100:    #F5F5F5;
  --c-gray-200:    #E8E8E8;
  --c-gray-300:    #D4D4D4;
  --c-gray-400:    #A3A3A3;
  --c-gray-500:    #737373;
  --c-gray-600:    #6B6B6B;
  --c-gray-700:    #404040;
  --c-gray-800:    #262626;
  --c-gray-900:    #171717;
  --c-red:         #c21d20;
  --c-red-dark:    #a01719;
  --c-red-light:   #E31E25;

  /* Line accent colors */
  --c-select-gold:    #C9922F;
  --c-diamond-plus:   #6B4FBB;
  --c-diamond-hd:     #E31E25;
  --c-vision-clear:   #4A4A4A;
  --c-nri:            #1A3A6B;
  --c-nr:             #2D7A3A;

  /* Typography scale (mobile-first, fluid) */
  --fs-xs:    0.75rem;    /* 12px */
  --fs-sm:    0.875rem;   /* 14px */
  --fs-base:  1rem;       /* 16px */
  --fs-md:    1.125rem;   /* 18px */
  --fs-lg:    1.25rem;    /* 20px */
  --fs-xl:    1.5rem;     /* 24px */
  --fs-2xl:   clamp(1.75rem, 3vw, 2.25rem);    /* 28-36px */
  --fs-3xl:   clamp(2rem, 4vw, 3rem);           /* 32-48px */
  --fs-4xl:   clamp(2.5rem, 6vw, 4.5rem);       /* 40-72px */
  --fs-giant: clamp(3.5rem, 8vw, 7rem);          /* 56-112px */

  /* Spacing */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;
  --sp-3xl: 64px;
  --sp-4xl: 96px;
  --sp-5xl: 128px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:   0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 30px rgba(0,0,0,0.12);
  --shadow-xl:   0 16px 48px rgba(0,0,0,0.16);
  --shadow-up:   0 -4px 20px rgba(0,0,0,0.1);

  /* Borders */
  --radius-sm: 15px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --border-light: 1px solid var(--c-gray-200);

  /* Transitions */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --nav-height: 64px;
  --container-max: 1200px;
  --container-wide: 1400px;
  --mobile-cta-height: 60px;
}

/* ── TYPOGRAPHY ─────────────────────────────────────────────── */
.t-display {
  font-family: 'Barlow', sans-serif;
  font-size: var(--fs-4xl);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.t-h1 {
  font-family: 'Barlow', sans-serif;
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.t-h2 {
  font-family: 'Barlow', sans-serif;
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.15;
}

.t-h3 {
  font-family: 'Barlow', sans-serif;
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.2;
}

.t-h4 {
  font-family: 'Barlow', sans-serif;
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.25;
}

.t-body {
  font-size: var(--fs-base);
  line-height: 1.6;
}

.t-body-lg {
  font-size: var(--fs-md);
  line-height: 1.6;
}

.t-small {
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.t-label {
  font-family: 'Barlow', sans-serif;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── LAYOUT ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--sp-md);
}

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

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

.section--lg {
  padding: var(--sp-4xl) 0;
}

/* ── GRID ───────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: var(--sp-lg);
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .container { padding: 0 var(--sp-xl); }
}

/* ── UTILITY CLASSES ────────────────────────────────────────── */

/* Backgrounds */
.bg-white  { background-color: var(--c-white); }
.bg-black  { background-color: var(--c-black); }
.bg-gray   { background-color: var(--c-gray-100); }

/* Text colors */
.text-white { color: var(--c-white); }
.text-black { color: var(--c-black); }
.text-muted { color: var(--c-gray-600); }
.text-red   { color: var(--c-red); }

/* Alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }

/* Flex utilities */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.items-center   { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }
.gap-lg { gap: var(--sp-lg); }
.gap-xl { gap: var(--sp-xl); }

/* Spacing */
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mt-xl { margin-top: var(--sp-xl); }
.mt-2xl { margin-top: var(--sp-2xl); }
.mb-sm { margin-bottom: var(--sp-sm); }
.mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); }
.mb-xl { margin-bottom: var(--sp-xl); }

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

/* ── SCROLL ANIMATIONS ──────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

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

/* Stagger children */
.stagger > .fade-up:nth-child(1) { transition-delay: 0ms; }
.stagger > .fade-up:nth-child(2) { transition-delay: 80ms; }
.stagger > .fade-up:nth-child(3) { transition-delay: 160ms; }
.stagger > .fade-up:nth-child(4) { transition-delay: 240ms; }
.stagger > .fade-up:nth-child(5) { transition-delay: 320ms; }
.stagger > .fade-up:nth-child(6) { transition-delay: 400ms; }

/* No-JS fallback: show everything */
.no-js .fade-up {
  opacity: 1;
  transform: none;
}

/* ── SECTION DECORATORS ─────────────────────────────────────── */
.section-label {
  font-family: 'Barlow', sans-serif;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-red);
  margin-bottom: var(--sp-md);
}

.section-title {
  font-family: 'Barlow', sans-serif;
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--sp-md);
}

.section-subtitle {
  font-size: var(--fs-md);
  color: var(--c-gray-600);
  max-width: 600px;
  line-height: 1.6;
}

.section-subtitle.centered {
  margin: 0 auto;
}

/* ── RESPONSIVE HELPERS ─────────────────────────────────────── */
.hide-mobile { display: none; }
.hide-desktop { display: block; }

@media (min-width: 768px) {
  .hide-mobile { display: block; }
  .hide-desktop { display: none; }

  .section { padding: var(--sp-4xl) 0; }
  .section--lg { padding: var(--sp-5xl) 0; }
}
