/* ═══════════════════════════════════════════════════════════════
   VEIL SUPPLY CO. — Design System v2.0
   ═══════════════════════════════════════════════════════════════
   Dark technical outerwear brand.
   Built for the worst day.
   ═══════════════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════════════
   1. DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* ── Brand Colors ── */
  --black:           #0a0a0a;
  --charcoal:        #141414;
  --dark-gray:       #1a1a1a;
  --stone:           #8a8a8a;
  --light-gray:      #b0b0b0;
  --off-white:       #f5f5f0;
  --white:           #fafafa;
  --burnt-orange:    #c4652a;
  --orange-hover:    #d4752f;
  --orange-subtle:   rgba(196,101,42,0.08);

  /* Semantic mapping */
  --primary:         #c4652a;
  --primary-light:   #d4752f;
  --primary-dark:    #a8542a;
  --secondary:       #8a8a8a;
  --accent:          #c4652a;

  --primary-rgb:     196, 101, 42;
  --secondary-rgb:   138, 138, 138;

  /* ── Backgrounds ── */
  --bg:              #0a0a0a;
  --bg-alt:          #111111;
  --surface:         #141414;
  --surface-2:       #1a1a1a;
  --surface-3:       #222222;
  --surface-hover:   #1e1e1e;
  --card-bg:         #141414;
  --card-bg-hover:   #1a1a1a;
  --elevated:        #1a1a1a;

  /* ── Text (4-tier hierarchy) ── */
  --text:            #f5f5f0;
  --text-dim:        #b0b0b0;
  --text-muted:      #8a8a8a;
  --text-faint:      #5a5a5a;

  /* ── Borders ── */
  --border:          rgba(255,255,255,0.06);
  --border-hover:    rgba(255,255,255,0.12);
  --border-active:   rgba(255,255,255,0.2);
  --border-accent:   #c4652a;

  /* ── Utility ── */
  --success:         #2d8a4e;
  --warning:         #c4652a;
  --error:           #c43a2a;
  --info:            #4a7ab5;

  /* ── Gradients ── */
  --gradient-brand:       linear-gradient(135deg, #c4652a, #a8542a);
  --gradient-hero:        linear-gradient(180deg, transparent 0%, rgba(10,10,10,0.85) 100%);
  --gradient-glow:        radial-gradient(circle at center, rgba(196,101,42,0.15), transparent 70%);
  --gradient-surface:     linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);

  /* ── Typography ── */
  --font-display:  'Space Grotesk', system-ui, sans-serif;
  --font-body:     'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;

  /* Fluid type scale */
  --text-xs:    clamp(0.6875rem, 0.65rem + 0.2vw, 0.75rem);
  --text-sm:    clamp(0.8125rem, 0.78rem + 0.2vw, 0.875rem);
  --text-base:  clamp(0.9375rem, 0.90rem + 0.2vw, 1rem);
  --text-lg:    clamp(1.0625rem, 1.00rem + 0.3vw, 1.125rem);
  --text-xl:    clamp(1.1875rem, 1.10rem + 0.4vw, 1.25rem);
  --text-2xl:   clamp(1.375rem, 1.25rem + 0.6vw, 1.5rem);
  --text-3xl:   clamp(1.625rem, 1.40rem + 1.1vw, 2rem);
  --text-4xl:   clamp(2rem, 1.70rem + 1.5vw, 2.75rem);
  --text-5xl:   clamp(2.5rem, 2.00rem + 2.5vw, 4rem);
  --text-hero:  clamp(3rem, 2.50rem + 4vw, 6rem);

  /* ── Spacing (4px base) ── */
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-6:   1.5rem;
  --space-8:   2rem;
  --space-10:  2.5rem;
  --space-12:  3rem;
  --space-16:  4rem;
  --space-20:  5rem;
  --space-24:  6rem;
  --space-section: clamp(100px, 14vh, 160px);

  /* ── Layout ── */
  --max-width:    1280px;
  --max-width-sm: 720px;
  --max-width-lg: 1440px;
  --nav-height:   72px;
  --content-pad:  clamp(16px, 4vw, 48px);

  /* ── Border Radius ── */
  --radius-xs:   2px;
  --radius-sm:   4px;
  --radius-md:   4px;
  --radius:      4px;
  --radius-lg:   8px;
  --radius-xl:   8px;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.5);
  --shadow-xl:      0 16px 64px rgba(0,0,0,0.5);
  --shadow-glow:    0 0 40px rgba(196,101,42,0.15);
  --shadow-glow-lg: 0 0 80px rgba(196,101,42,0.2);
  --shadow-card:    0 1px 0 rgba(255,255,255,0.04);

  /* ── Easing ── */
  --ease:        cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);

  /* ── Durations ── */
  --dur-fast:      150ms;
  --dur-normal:    300ms;
  --dur-slow:      600ms;
  --dur-reveal:    1000ms;
  --dur-dramatic:  1500ms;

  /* ── Z-Index Scale ── */
  --z-base:     0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-nav:      1000;
  --z-modal:    3000;
  --z-overlay:  9000;
  --z-top:      9999;

  /* ── Studio Variable Aliases ── */
  --studio-primary:      var(--primary);
  --studio-secondary:    var(--secondary);
  --studio-accent:       var(--accent);
  --studio-bg:           var(--bg);
  --studio-surface:      var(--surface);
  --studio-text:         var(--text);
  --studio-text-dim:     var(--text-dim);
  --studio-text-muted:   var(--text-muted);
  --studio-border:       var(--border);
  --studio-heading-font: var(--font-display);
  --studio-body-font:    var(--font-body);
}

/* ═══════════════════════════════════════════════════════════════
   2. CSS RESET
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
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: var(--font-display); line-height: 1.1; letter-spacing: -0.02em; }
input, textarea, select { font: inherit; }

/* ═══════════════════════════════════════════════════════════════
   3. UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--content-pad); }
.container--wide { max-width: var(--max-width-lg); margin: 0 auto; padding: 0 var(--content-pad); }
.container--sm { max-width: var(--max-width-sm); margin: 0 auto; padding: 0 var(--content-pad); }
.section { padding: var(--space-section) 0; }
.section--dark { background: var(--surface); }
.section--darker { background: var(--bg); }
.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.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;
}

/* ── Section Headers ── */
.section-overline {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--burnt-orange);
  margin-bottom: var(--space-4);
}
.section-title {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--off-white);
  margin-bottom: var(--space-4);
}
.section-sub {
  font-size: var(--text-lg);
  color: var(--text-dim);
  max-width: 600px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   4. NAVIGATION
   ═══════════════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 var(--content-pad);
  background: transparent;
  transition: background var(--dur-slow) var(--ease), backdrop-filter var(--dur-slow) var(--ease);
}
.nav.scrolled {
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--max-width-lg);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--off-white);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.nav__link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  transition: color var(--dur-fast);
  position: relative;
}
.nav__link:hover { color: var(--off-white); }
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--burnt-orange);
  transition: width var(--dur-normal) var(--ease);
}
.nav__link:hover::after { width: 100%; }
.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav__cart {
  position: relative;
  color: var(--text-dim);
  transition: color var(--dur-fast);
}
.nav__cart:hover { color: var(--off-white); }
.nav__cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--burnt-orange);
  color: var(--white);
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}
.nav__hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--off-white);
  transition: transform var(--dur-normal) var(--ease);
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }
}

/* ═══════════════════════════════════════════════════════════════
   5. BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-xs);
  transition: all var(--dur-normal) var(--ease);
  cursor: pointer;
}
.btn--primary {
  background: var(--burnt-orange);
  color: var(--white);
  border: 1px solid var(--burnt-orange);
}
.btn--primary:hover {
  background: var(--orange-hover);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--off-white);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn--ghost:hover {
  border-color: var(--off-white);
  background: rgba(255,255,255,0.04);
}
.btn--lg {
  padding: 16px 36px;
  font-size: 0.875rem;
}
.btn--sm {
  padding: 10px 20px;
  font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════
   6. CARDS
   ═══════════════════════════════════════════════════════════════ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-8);
  transition: border-color var(--dur-normal) var(--ease), transform var(--dur-normal) var(--ease);
}
.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════
   7. SCROLL REVEAL
   ═══════════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }
.reveal-delay-5 { transition-delay: 400ms; }
.reveal-delay-6 { transition-delay: 480ms; }

/* ═══════════════════════════════════════════════════════════════
   8. RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --space-section: clamp(60px, 10vh, 100px);
  }
}

/* ═══════════════════════════════════════════════════════════════
   9. REDUCED MOTION
   ═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
