/* ============================================================
   METROPOLIS CRUISE — UNIFIED DESIGN TOKENS
   root.css · v6.0 (improved)
   
   STRUCTURE:
   1. Core Brand Colors (with RGB variants)
   2. Grayscale
   3. Semantic / Status Colors
   4. Backgrounds
   5. Text Colors (improved contrast)
   6. Borders
   7. Gradients (using variables)
   8. Typography
   9. Spacing
   10. Layout & Containers
   11. Border Radius
   12. Shadows (using RGB colors)
   13. Transitions & Animations
   14. Z-Index
   15. Effects
   16. Hero Variables
   17. Aliases (backward compatibility)
   
   RULES:
   · One source of truth – aliases point to base tokens.
   · Media queries only for responsive typography and spacing.
   · Dark mode via separate block at the end.
   ============================================================ */

:root {

  /* ==========================================
     1. CORE BRAND COLORS
     Primary palette: Navy + Gold + Coral
     ========================================== */

  /* --- Navy (Primary) ---
     900 = darkest background, 100 = lightest tint */
  --color-primary-900: #010a1a;
  --color-primary-800: #01142e;
  --color-primary-700: #0A1929;      /* cruise-deep */
  --color-primary-600: #0A2F4A;
  --color-primary-500: #0A4D68;      /* main brand navy */
  --color-primary-400: #1A6D8A;
  --color-primary-300: #1A7B9E;
  --color-primary-200: #8fd3ff;
  --color-primary-100: #b8e9f2;

  /* RGB variants for shadows / overlays */
  --color-primary-500-rgb: 10, 77, 104;
  --color-primary-700-rgb: 10, 25, 41;

  /* --- Gold (Accent / Luxury) ---
     500 = pure gold, 200 = creamy champagne */
  --color-gold-600: #B8941F;          /* dark gold, hover */
  --color-gold-500: #C7A34A;          /* muted gold */
  --color-gold-400: #D4AF37;          /* *** MAIN GOLD *** */
  --color-gold-300: #E4C981;          /* medium gold */
  --color-gold-200: #F4E4BC;          /* champagne */
  --color-gold-100: #fdf7e8;          /* light tint */

  --color-gold-400-rgb: 212, 175, 55;

  /* --- Coral (Warm Accent) ---
     For sales, urgency badges */
  --color-coral-500: #FF6B6B;
  --color-coral-400: #ff8b7b;
  --color-coral-300: #fcb69f;


  /* ==========================================
     2. GRAYSCALE
     Neutral scale based on gray-500 = #6b7280
     ========================================== */
  --white: #ffffff;
  --black: #000000;

  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;


  /* ==========================================
     3. SEMANTIC / STATUS COLORS
     Single source: --color-* used everywhere
     ========================================== */
  --color-success: #10B981;   /* Emerald */
  --color-warning: #F59E0B;   /* Amber */
  --color-danger:  #EF4444;   /* Red */
  --color-info:    #3B82F6;   /* Blue */

  /* RGB variants for shadows */
  --color-success-rgb: 16, 185, 129;
  --color-warning-rgb: 245, 158, 11;
  --color-danger-rgb:  239, 68, 68;
  --color-info-rgb:    59, 130, 246;


  /* ==========================================
     4. BACKGROUNDS
     ========================================== */

  /* Light backgrounds */
  --bg-primary:   #ffffff;
  --bg-secondary: #f9fafb;    /* gray-50 */
  --bg-tertiary:  #f3f4f6;    /* gray-100 */
  --bg-card:      #fbfcfe;
  --bg-muted:     #f5f7fa;
  --bg-glass:     rgba(255, 255, 255, 0.6);

  /* Dark backgrounds */
  --bg-dark:         #0b1f33;
  --bg-dark-deep:    #010a1a;          /* --color-primary-900 */
  --bg-dark-card:    rgba(255, 255, 255, 0.05);


  /* ==========================================
     5. TEXT COLORS (improved contrast)
     ========================================== */
  --text:           #1f2937;   /* gray-800 – primary text */
  --text-primary:   #1f2937;   /* alias for main text */
  --text-secondary: #374151;   /* gray-700 – secondary text */
  --text-muted:     #4b5563;   /* gray-600 – increased contrast */
  --text-light:     #6b7280;   /* gray-500 – for placeholders */
  --text-inverse:   #ffffff;

  /* Dark sections text */
  --text-on-dark:       #ffffff;
  --text-on-dark-muted: rgba(255, 255, 255, 0.8); /* lighter for better readability */


  /* ==========================================
     6. BORDERS
     ========================================== */
  --border:        #e5e7eb;   /* gray-200 */
  --border-light:  #f3f4f6;   /* gray-100 */
  --border-medium: #d1d5db;   /* gray-300 */
  --border-dark:   #2a3f55;


  /* ==========================================
     7. GRADIENTS (using variables)
     ========================================== */
  --gradient-luxury:       linear-gradient(135deg, var(--color-gold-400) 0%, var(--color-gold-200) 50%, var(--color-gold-400) 100%);
  --gradient-luxury-rev:   linear-gradient(135deg, var(--color-gold-600) 0%, var(--color-gold-400) 100%);
  --gradient-ocean:        linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-300) 100%);
  --gradient-navy-dark:    linear-gradient(135deg, var(--color-primary-900) 0%, var(--color-primary-700) 100%);
  --gradient-sunset:       linear-gradient(135deg, var(--color-coral-500) 0%, #FFB347 100%);
  --gradient-glass:        linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  --gradient-sky:          linear-gradient(90deg, #00d2ff 0%, #3a7bd5 100%);
  --gradient-warm:         linear-gradient(90deg, #ffecd2 0%, #fcb69f 100%);
  --gradient-hero-overlay: linear-gradient(to right, rgba(var(--color-primary-700-rgb), 0.85) 0%, rgba(var(--color-primary-700-rgb), 0.45) 55%, transparent 100%);


  /* ==========================================
     8. TYPOGRAPHY SYSTEM
     ========================================== */

  /* Font families */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'Fira Code', 'Courier New', Consolas, monospace;

  /* Font sizes – Desktop (base 16px) */
  --fs-hero:    4.5rem;    /* 72px */
  --fs-display: 3.75rem;   /* 60px */
  --fs-h1:      3.5rem;    /* 56px */
  --fs-h2:      3rem;      /* 48px */
  --fs-h3:      2.25rem;   /* 36px */
  --fs-h4:      1.75rem;   /* 28px */
  --fs-h5:      1.5rem;    /* 24px */
  --fs-h6:      1.25rem;   /* 20px */

  --fs-body-xl: 1.25rem;   /* 20px */
  --fs-body-lg: 1.125rem;  /* 18px */
  --fs-body:    1rem;      /* 16px */
  --fs-body-sm: 0.875rem;  /* 14px */
  --fs-body-xs: 0.75rem;   /* 12px */
  --fs-caption: 0.6875rem; /* 11px */

  /* Aliases for compatibility */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;

  /* Font weights */
  --fw-light:     300;
  --fw-regular:   400;
  --fw-medium:    500;
  --fw-semibold:  600;
  --fw-bold:      700;
  --fw-extrabold: 800;
  --fw-black:     900;

  --font-light:    300;
  --font-normal:   400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;
  --font-black:    900;

  /* Line heights */
  --lh-tight:   1.1;
  --lh-snug:    1.2;
  --lh-normal:  1.5;
  --lh-relaxed: 1.6;
  --lh-loose:   1.8;

  /* Letter spacing */
  --ls-tight:   -0.02em;
  --ls-normal:  0;
  --ls-wide:    0.02em;
  --ls-wider:   0.05em;
  --ls-widest:  0.1em;


  /* ==========================================
     9. SPACING SYSTEM (base 8px)
     ========================================== */

  --space-0:  0;
  --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 */

  /* Semantic spacing */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   0.75rem;
  --space-base: 1rem;
  --space-lg:   1.25rem;
  --space-xl:   1.5rem;
  --space-2xl:  2rem;
  --space-3xl:  2.5rem;
  --space-4xl:  3rem;
  --space-5xl:  4rem;
  --space-6xl:  5rem;
  --space-7xl:  6rem;
  --space-8xl:  8rem;

  /* Section Spacing – Desktop */
  --section-padding-xs:  2rem;    /* 32px  */
  --section-padding-sm:  2.5rem;  /* 40px  */
  --section-padding-md:  3.75rem; /* 60px  */
  --section-padding-lg:  5rem;    /* 80px  */
  --section-padding-xl:  7.5rem;  /* 120px */
  --section-padding-2xl: 10rem;   /* 160px */

  --space-section: var(--section-padding-lg);

  /* Grid gaps */
  --gap-xs:  0.5rem;
  --gap-sm:  0.75rem;
  --gap-md:  1rem;
  --gap-lg:  1.5rem;
  --gap-xl:  2rem;
  --gap-2xl: 3rem;


  /* ==========================================
     10. LAYOUT & CONTAINERS
     ========================================== */
  --container-xs:   40rem;   /* 640px  */
  --container-sm:   48rem;   /* 768px  */
  --container-md:   64rem;   /* 1024px */
  --container-lg:   75rem;   /* 1200px */
  --container-xl:   80rem;   /* 1280px */
  --container-2xl:  90rem;   /* 1440px */
  --container-full: 100%;

  --header-height: 5rem;     /* 80px */

  --content-narrow: 40rem;   /* 640px */
  --content-medium: 48rem;   /* 768px */
  --content-wide:   56rem;   /* 896px */


  /* ==========================================
     11. BORDER RADIUS
     ========================================== */
  --radius-none: 0;
  --radius-sm:   0.375rem;  /* 6px  */
  --radius-md:   0.5rem;    /* 8px  */
  --radius-lg:   0.75rem;   /* 12px */
  --radius-xl:   1rem;      /* 16px */
  --radius-2xl:  1.5rem;    /* 24px */
  --radius-3xl:  2rem;      /* 32px */
  --radius-card: 1.25rem;   /* 20px */
  --radius-full: 9999px;


  /* ==========================================
     12. SHADOWS (using RGB variables)
     ========================================== */
  --shadow-xs:  0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm:  0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg:  0 8px 32px rgba(0, 0, 0, 0.16);
  --shadow-xl:  0 16px 48px rgba(0, 0, 0, 0.20);
  --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.24);

  --shadow-gold:  0 8px 32px rgba(var(--color-gold-400-rgb), 0.35);
  --shadow-ocean: 0 8px 32px rgba(var(--color-primary-500-rgb), 0.35);
  --shadow-coral: 0 8px 32px rgba(var(--color-coral-500), 0.25); /* direct color if RGB not defined */
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.06);


  /* ==========================================
     13. TRANSITIONS & ANIMATIONS
     ========================================== */

  /* Duration */
  --duration-fast:   150ms;
  --duration-normal: 300ms;
  --duration-slow:   500ms;
  --duration-slower: 700ms;

  /* Easing */
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce:  cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth:  cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Combined */
  --transition-fast:   var(--duration-fast) var(--ease-default);
  --transition-normal: var(--duration-normal) var(--ease-default);
  --transition-slow:   var(--duration-slow) var(--ease-default);
  --transition-base:   var(--duration-normal) var(--ease-default);

  --transition-colors:   color var(--duration-normal) var(--ease-default),
                         background-color var(--duration-normal) var(--ease-default),
                         border-color var(--duration-normal) var(--ease-default);
  --transition-transform: transform var(--duration-normal) var(--ease-default);
  --transition-opacity:   opacity var(--duration-normal) var(--ease-default);


  /* ==========================================
     14. Z-INDEX SCALE
     ========================================== */
  --z-base:         0;
  --z-dropdown:     100;
  --z-sticky:       200;
  --z-fixed:        300;
  --z-overlay:      400;
  --z-modal:        500;
  --z-popover:      600;
  --z-tooltip:      700;
  --z-header:       800;
  --z-notification: 900;
  --z-max:          9999;


  /* ==========================================
     15. EFFECTS & FILTERS
     ========================================== */
  --blur-sm: 4px;
  --blur-md: 8px;
  --blur-lg: 16px;
  --blur-xl: 24px;

  --backdrop-blur:    blur(10px);
  --backdrop-blur-sm: blur(4px);
  --backdrop-blur-md: blur(12px);
  --backdrop-blur-lg: blur(16px);


  /* ==========================================
     16. HERO VARIABLES
     References tokens above – no duplication.
     ========================================== */
  --hero-padding-x: clamp(1rem, 5vw, 4rem);
  --hero-padding-y: clamp(2rem, 8vh, 6rem);

  --hero-content-max:        900px;
  --hero-content-center-max: 1000px;

  /* Hero colors – aliases of tokens */
  --hero-text:          var(--text-on-dark);
  --hero-text-muted:    var(--text-on-dark-muted);
  --hero-accent:        var(--color-gold-400);
  --hero-accent-light:  var(--color-gold-200);
  --hero-overlay-dark:  rgba(0, 0, 0, 0.55);


  /* ==========================================
     17. ALIASES – BACKWARD COMPATIBILITY
     All old names → new tokens.
     ========================================== */

  /* Brand shortcuts */
  --primary:      var(--color-primary-500);
  --primary-dark: var(--color-primary-600);
  --navy:         var(--color-primary-700);
  --navy-light:   var(--color-primary-400);
  --cruise-deep:  var(--color-primary-700);
  --luxury-gold:  var(--color-gold-400);
  --luxury-champagne: var(--color-gold-200);

  /* Gold shortcuts */
  --gold:       var(--color-gold-400);
  --gold-dark:  var(--color-gold-600);
  --gold-light: var(--color-gold-200);
  --accent:     var(--color-gold-400);
  --accent-light: var(--color-gold-200);   /* fixed: now champagne, not bright yellow */

  /* Status shortcuts */
  --success: var(--color-success);
  --warning: var(--color-warning);
  --danger:  var(--color-danger);

  /* Background shortcuts */
  --light-bg: var(--bg-secondary);
  --color-bg-dark:  var(--bg-dark-deep);
  --color-bg-card:  var(--bg-dark-card);
  --color-text-main: var(--text-on-dark);

  /* Rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}


/* ==========================================
   ADAPTIVE TYPOGRAPHY — TABLET (≤ 1024px)
   Only font sizes and section paddings.
   ========================================== */
@media (max-width: 1024px) {
  :root {
    --fs-hero:    3.5rem;    /* 56px */
    --fs-display: 3rem;      /* 48px */
    --fs-h1:      3rem;      /* 48px */
    --fs-h2:      2.5rem;    /* 40px */
    --fs-h3:      2rem;      /* 32px */
    --fs-h4:      1.5rem;    /* 24px */
    --fs-h5:      1.25rem;   /* 20px */
    --fs-h6:      1.125rem;  /* 18px */

    --fs-body-xl: 1.125rem;
    --fs-body-lg: 1.0625rem;
    --fs-body:    1rem;
    --fs-body-sm: 0.875rem;

    --section-padding-xs:  1.5rem;
    --section-padding-sm:  2rem;
    --section-padding-md:  3rem;
    --section-padding-lg:  4rem;
    --section-padding-xl:  5rem;
    --section-padding-2xl: 6rem;

    --header-height: 4.5rem;
  }
}


/* ==========================================
   ADAPTIVE TYPOGRAPHY — MOBILE (≤ 768px)
   ========================================== */
@media (max-width: 768px) {
  :root {
    --fs-hero:    2.5rem;    /* 40px */
    --fs-display: 2.25rem;   /* 36px */
    --fs-h1:      2rem;      /* 32px */
    --fs-h2:      1.75rem;   /* 28px */
    --fs-h3:      1.5rem;    /* 24px */
    --fs-h4:      1.25rem;   /* 20px */
    --fs-h5:      1.125rem;  /* 18px */
    --fs-h6:      1rem;      /* 16px */

    --fs-body-xl: 1.0625rem;
    --fs-body-lg: 1rem;
    --fs-body:    0.9375rem;
    --fs-body-sm: 0.875rem;
    --fs-body-xs: 0.75rem;

    --section-padding-xs:  1rem;
    --section-padding-sm:  1.5rem;
    --section-padding-md:  2rem;
    --section-padding-lg:  3rem;
    --section-padding-xl:  4rem;
    --section-padding-2xl: 5rem;

    --space-3xl: 2rem;
    --space-4xl: 2.5rem;
    --space-5xl: 3rem;
    --space-6xl: 3.5rem;
    --space-7xl: 4rem;
    --space-8xl: 5rem;

    --gap-lg:  1rem;
    --gap-xl:  1.5rem;
    --gap-2xl: 2rem;

    --header-height: 3.75rem;
  }
}


/* ==========================================
   DARK MODE
   ========================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary:   #0b1f33;
    --bg-secondary: #1a2f45;
    --bg-tertiary:  #243b53;
    --bg-card:      #162435;
    --bg-muted:     #0f2438;

    --text-primary:   #f0f4f8;
    --text-secondary: #d9e2ec;
    --text-muted:     #9fb3c8;        /* lighter for dark bg */
    --text-light:     #627d98;
    --text:           #e0e7ef;

    --border:        #334e68;
    --border-light:  #243b53;
    --border-medium: #486581;

    --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 48px rgba(0, 0, 0, 0.6);
  }
}


/* ==========================================
   REDUCED MOTION
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast:   0.01ms;
    --duration-normal: 0.01ms;
    --duration-slow:   0.01ms;
    --duration-slower: 0.01ms;

    --transition-fast:      none;
    --transition-normal:    none;
    --transition-slow:      none;
    --transition-base:      none;
    --transition-colors:    none;
    --transition-transform: none;
    --transition-opacity:   none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ==========================================
   HIGH CONTRAST
   ========================================== */
@media (prefers-contrast: high) {
  :root {
    --border:        #000000;
    --border-medium: #000000;
    --text-muted:    #000000;
  }
}


/* ==========================================
   PRINT
   ========================================== */
@media print {
  :root {
    --shadow-xs:  none;
    --shadow-sm:  none;
    --shadow-md:  none;
    --shadow-lg:  none;
    --shadow-xl:  none;
    --shadow-2xl: none;

    --bg-glass:     #ffffff;
    --backdrop-blur: none;
  }
}