/* ============================================
   MANDELSON.CO — Main Stylesheet
   Foundation: Reset, Variables, Typography, Layout
   ============================================ */

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

html {
  scroll-behavior: auto; /* GSAP handles smooth scroll */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-light);
  overflow-x: clip;
  cursor: none;
}

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

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

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

ul, ol {
  list-style: none;
}

/* --- CSS Custom Properties --- */
:root {
  /* Colors — Light */
  --bg-light: #FAFAF8;
  --bg-light-alt: #F3F2EE;
  --bg-dark: #0A0F1C;
  --bg-dark-alt: #111827;

  /* Accent */
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-soft: #DBEAFE;

  /* Text */
  --text-primary: #111111;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  --text-on-dark: #F5F5F0;
  --text-on-dark-muted: #9CA3AF;

  /* Borders */
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --border-on-dark: rgba(255, 255, 255, 0.12);

  /* Warm tones */
  --sand: #E8E4DD;
  --cream: #F5F0E8;
  --warm-gray: #6B6560;

  /* Spacing scale */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
  --space-4xl: 6rem;     /* 96px */
  --space-5xl: 8rem;     /* 128px */
  --space-6xl: 12rem;    /* 192px */

  /* Layout */
  --container-max: 1400px;
  --container-pad: clamp(1.5rem, 5vw, 4rem);
  --grid-gap: clamp(1rem, 2vw, 2rem);

  /* Typography scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.35rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
  --text-3xl: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  --text-4xl: clamp(2.5rem, 1.8rem + 3.5vw, 5rem);
  --text-5xl: clamp(3rem, 2rem + 5vw, 7rem);
  --text-hero: clamp(3.5rem, 2rem + 7vw, 10rem);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Z-index layers */
  --z-cursor: 9999;
  --z-nav: 1000;
  --z-overlay: 900;
  --z-modal: 800;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.display-hero {
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.display-1 {
  font-size: var(--text-5xl);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.display-2 {
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.heading-1 {
  font-size: var(--text-3xl);
  line-height: 1.1;
}

.heading-2 {
  font-size: var(--text-2xl);
  line-height: 1.15;
}

.heading-3 {
  font-size: var(--text-xl);
  line-height: 1.2;
}

.body-large {
  font-size: var(--text-lg);
  line-height: 1.6;
}

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

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

.label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.container--wide {
  max-width: 1600px;
}

.container--narrow {
  max-width: 900px;
}

@media (max-width: 768px) {
  .container,
  .container--wide,
  .container--narrow {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* Grid */
.grid {
  display: grid;
  gap: var(--grid-gap);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--6 { grid-template-columns: repeat(6, 1fr); }

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

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

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

/* --- Sections --- */
section {
  position: relative;
}

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

.section-pad-lg {
  padding: var(--space-6xl) 0;
}

/* Dark section variant */
.section--dark {
  background-color: var(--bg-dark);
  color: var(--text-on-dark);
}

.section--dark .text-secondary {
  color: var(--text-on-dark-muted);
}

/* Alt light background */
.section--alt {
  background-color: var(--bg-light-alt);
}

/* --- Utility --- */
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
.text-right { text-align: right; }

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

.overflow-hidden { overflow: hidden; }

/* Selection */
::selection {
  background: var(--accent);
  color: white;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

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

.section--dark::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

/* --- Loading screen --- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader.is-done {
  pointer-events: none;
}

.loader__bar {
  width: clamp(120px, 20vw, 240px);
  height: 4px;
  background: var(--text-primary);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
}
