/* ==========================================================================
   THE FINAL RENDER - FIBONACCI DESIGN SYSTEM & GOLDEN RATIO TOKENS
   Strict Anti-Overlap, Ultra-Responsive, Luxurious Dark & Gold Paradigm
   ========================================================================== */

:root {
  /* Fibonacci Spatial Scale (px progression: 5, 8, 13, 21, 34, 55, 89, 144, 233) */
  --fib-1: 5px;
  --fib-2: 8px;
  --fib-3: 13px;
  --fib-4: 21px;
  --fib-5: 34px;
  --fib-6: 55px;
  --fib-7: 89px;
  --fib-8: 144px;
  --fib-9: 233px;

  /* Golden Ratio Constants (phi = 1.61803398875) */
  --phi: 1.618;
  --phi-minor: 38.1966%;
  --phi-major: 61.8034%;

  /* Fluid Fibonacci Typography Scale (Clamped for 100% Mobile & Ultra-wide Safety) */
  --font-xs: clamp(11px, 0.72rem, 12px);
  --font-sm: clamp(13px, 0.84rem, 14px);
  --font-base: clamp(15px, 0.98rem, 16px);
  --font-md: clamp(18px, 1.22rem, 21px);
  --font-lg: clamp(22px, 1.62rem, 28px);
  --font-xl: clamp(28px, 2.15rem, 34px);
  --font-2xl: clamp(34px, 3.4rem, 55px);
  --font-3xl: clamp(42px, 4.8rem, 89px);

  /* Typography Line Heights */
  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-relaxed: 1.618;

  /* Luxury Dark Obsidian & Cinematic 24K Gold Palette */
  --color-canvas: #060608;
  --color-surface-1: #0d0d11;
  --color-surface-2: #14141a;
  --color-surface-3: #1c1c24;
  --color-surface-glass: rgba(13, 13, 17, 0.78);
  --color-glass-border: rgba(255, 255, 255, 0.08);

  /* Cinematic Gold Gradient & Accents */
  --gold-primary: #d4af37;
  --gold-light: #f6e6b4;
  --gold-warm: #e5b94c;
  --gold-burnished: #9e7d23;
  --gold-gradient: linear-gradient(135deg, #f6e6b4 0%, #d4af37 48%, #aa801e 100%);
  --gold-gradient-glow: linear-gradient(135deg, rgba(246, 230, 180, 0.2) 0%, rgba(212, 175, 55, 0.1) 100%);
  --gold-border: rgba(212, 175, 55, 0.32);
  --gold-border-bright: rgba(212, 175, 55, 0.75);
  --gold-glow: 0 0 34px rgba(212, 175, 55, 0.24);

  /* Contrast Accents */
  --accent-amber: #ff8c38;
  --accent-cyan: #38bdf8;
  --color-success: #10b981;

  /* Text Colors */
  --text-primary: #fcfcfd;
  --text-secondary: #a3a3af;
  --text-muted: #6b6b7b;
  --text-inverse: #060608;

  /* Radius (Fibonacci Rounded) */
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 13px;
  --radius-xl: 21px;
  --radius-2xl: 34px;
  --radius-full: 9999px;

  /* Strict Layering Z-Index Hierarchy (Prevent Overlapping) */
  --z-base: 1;
  --z-card: 10;
  --z-sticky: 100;
  --z-header: 1000;
  --z-drawer: 1500;
  --z-modal: 2000;
  --z-toast: 3000;

  /* Fluid Container Max Width */
  --container-max: 1360px;
  --container-padding: clamp(var(--fib-4), 4vw, var(--fib-6));
}

/* ==========================================================================
   RESET & STRICT ANTI-OVERLAP RULES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--color-canvas);
  color: var(--text-primary);
  font-size: 16px;
  line-height: var(--lh-relaxed);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

body {
  background-color: var(--color-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  width: 100%;
}

/* Prevent Media Overflow and Unwanted Stretches */
img, video, iframe, svg {
  display: block;
  max-width: 100%;
  height: auto;
  border: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* Fibonacci Layout Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
  position: relative;
  min-width: 0;
}

.container-narrow {
  width: 100%;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
  min-width: 0;
}

/* Golden Ratio Grid Splits */
.phi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--fib-5);
  align-items: center;
  min-width: 0;
}

@media (min-width: 992px) {
  .phi-grid-major-left {
    grid-template-columns: var(--phi-major) 1fr;
    gap: var(--fib-6);
  }
  .phi-grid-major-right {
    grid-template-columns: 1fr var(--phi-major);
    gap: var(--fib-6);
  }
  .phi-grid-even {
    grid-template-columns: 1fr 1fr;
    gap: var(--fib-6);
  }
  .phi-grid-tri {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--fib-5);
  }
  .phi-grid-quad {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--fib-5);
  }
}

/* Strict Flexbox Helpers with Wrap & Zero Collision */
.flex-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--fib-4);
  flex-wrap: wrap;
  min-width: 0;
}

.flex-col {
  display: flex;
  flex-direction: column;
  gap: var(--fib-4);
  min-width: 0;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--fib-3);
  min-width: 0;
}

/* Fibonacci Section Spacing (Optimized - Tight, cinematic rhythm without unnecessary dead space) */
.section-gap {
  padding-top: clamp(22px, 3.2vw, 44px);
  padding-bottom: clamp(22px, 3.2vw, 44px);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.section-gap-sm {
  padding-top: clamp(14px, 2.2vw, 28px);
  padding-bottom: clamp(14px, 2.2vw, 28px);
  position: relative;
  width: 100%;
}
