/* ============================================
   CROWN & FADE — Premium Design System (Light Theme)
   Inspired by Apple & Tesla aesthetics
   ============================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Primary palette — warm gold */
  --color-primary: #B8860B;
  --color-primary-light: #D4A017;
  --color-primary-dark: #8B6508;
  --color-primary-rgb: 184, 134, 11;

  /* Light neutral palette */
  --color-white:        #FFFFFF;
  --color-off-white:    #F8F7F5;
  --color-light:        #F2F0ED;
  --color-light-mid:    #E8E5E0;
  --color-border:       #E0DDD8;
  --color-border-light: #EEEAE4;

  /* Text colours */
  --color-text:         #111111;
  --color-text-mid:     #444444;
  --color-text-light:   #777777;
  --color-text-muted:   #AAAAAA;

  /* Dark accents (for contrast elements) */
  --color-black:        #111111;
  --color-dark:         #1A1A1A;
  --color-charcoal:     #2D2D2D;

  /* Status */
  --color-success: #2E7D32;
  --color-error:   #C62828;
  --color-warning: #E65100;

  /* Web4Budget brand */
  --color-w4b: #E63329;

  /* Typography */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Font sizes — fluid scale */
  --text-xs:   clamp(0.7rem,  0.65rem + 0.25vw, 0.8rem);
  --text-sm:   clamp(0.8rem,  0.75rem + 0.25vw, 0.9rem);
  --text-base: clamp(0.95rem, 0.9rem  + 0.25vw, 1.05rem);
  --text-lg:   clamp(1.1rem,  1rem    + 0.5vw,  1.25rem);
  --text-xl:   clamp(1.3rem,  1.1rem  + 1vw,    1.75rem);
  --text-2xl:  clamp(1.75rem, 1.4rem  + 1.75vw, 2.75rem);
  --text-3xl:  clamp(2.25rem, 1.75rem + 2.5vw,  3.75rem);
  --text-4xl:  clamp(2.75rem, 2rem    + 3.75vw, 5rem);

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Layout */
  --max-width:        1200px;
  --max-width-narrow: 800px;
  --max-width-xs:     560px;
  --border-radius:    12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 20px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows — light theme */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.08);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-glow: 0 0 30px rgba(184, 134, 11, 0.15);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-white);
  overflow-x: hidden;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-mid);
}

::selection {
  background: var(--color-primary);
  color: var(--color-white);
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

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

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

.section--light {
  background-color: var(--color-off-white);
}

.section--lighter {
  background-color: var(--color-light);
}

.section--white {
  background-color: var(--color-white);
}

.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-primary { color: var(--color-primary); }
.text-muted   { color: var(--color-text-light); }

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

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.section-title {
  margin-bottom: var(--space-lg);
  color: var(--color-text);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-light);
  max-width: 600px;
  margin: 0 auto;
  font-weight: 400;
}

/* --- Divider --- */
.divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  margin: var(--space-lg) auto;
  border: none;
}

/* --- Fade-in Animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }
