/* ============================================
   Modern Blinds — Primitive Design Tokens (Tier 1)
   ============================================
   Raw scales. No semantics — just values.
   Naming: DTCG-aligned [category]-[property]-[variant].
   Loaded FIRST via base.html + base_lp.html.
   Downstream: tokens-semantic.css references these.

   Also declares the @layer order for the whole app and holds
   the global reset + .container utility in @layer base.
   ============================================ */

@layer tokens, base, components, pages, overrides;

@layer tokens {
  :root {
    /* ---------- COLOR — Gray scale (10 steps) ---------- */
    --gray-50:  #faf9f7;
    --gray-100: #f5f5f5;
    --gray-200: #e5e7eb;  /* was undefined; appears 3× hardcoded in style.css — Tailwind gray-200 */
    --gray-300: #cccccc;
    --gray-400: #9ca3af;  /* was undefined; Tailwind gray-400 */
    --gray-500: #888888;
    --gray-600: #4b5563;  /* was undefined; appears 3× hardcoded in style.css — Tailwind gray-600 */
    --gray-650: #666666;  /* legacy muted text, fills scale gap between 500 and 700 */
    --gray-700: #555555;
    --gray-800: #2c2c2c;  /* LP footer background, was hardcoded 10× */
    --gray-900: #18181b;

    /* ---------- COLOR — Neutrals ---------- */
    --color-white: #ffffff;
    --color-black: #1a1a1a;

    /* ---------- COLOR — Brand ---------- */
    --color-brand-primary:       #1f2937;
    --color-brand-primary-dark:  #111827;
    --color-brand-primary-light: #f3f4f6;
    --color-brand-accent:        #d97706;
    --color-brand-accent-dark:   #b45309;  /* hover state, was hardcoded in lp.css */
    --color-brand-accent-deep:   #c2410c;  /* deeper hover, was hardcoded 7× in lp.css */
    --color-brand-accent-strong: #ea580c;  /* medium-deep hover variant, 3× */
    --color-brand-accent-light:  #fef3c7;
    --color-brand-beige:         #f0ece6;  /* brand beige accent (warranty card borders etc.), 4× */

    /* ---------- COLOR — State ---------- */
    --color-state-success:       #22c55e;
    --color-state-success-dark:  #16a34a;

    /* ---------- SPACING — 4px modular scale ---------- */
    --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 */

    /* ---------- TYPOGRAPHY — Font family ---------- */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* ---------- TYPOGRAPHY — Size scale (1.125 modular ratio) ---------- */
    --text-xs:   0.75rem;   /* 12px */
    --text-sm:   0.875rem;  /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg:   1.125rem;  /* 18px */
    --text-xl:   1.25rem;   /* 20px */
    --text-2xl:  1.5rem;    /* 24px */
    --text-3xl:  1.875rem;  /* 30px */
    --text-4xl:  2.25rem;   /* 36px */
    --text-5xl:  3rem;      /* 48px */

    /* ---------- TYPOGRAPHY — Line height ---------- */
    --leading-none:    1;
    --leading-tight:   1.2;
    --leading-snug:    1.4;
    --leading-normal:  1.6;
    --leading-relaxed: 1.7;
    --leading-loose:   1.8;

    /* ---------- TYPOGRAPHY — Font weight ---------- */
    --font-weight-normal:   400;
    --font-weight-medium:   500;
    --font-weight-semibold: 600;
    --font-weight-bold:     700;

    /* ---------- RADIUS ---------- */
    --radius-xs:   2px;
    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   16px;
    --radius-full: 9999px;

    /* ---------- SHADOW — Elevation scale ---------- */
    --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.08);
    --shadow-md: 0 4px 12px rgb(0 0 0 / 0.10);
    --shadow-lg: 0 8px 30px rgb(0 0 0 / 0.12);
    --shadow-xl: 0 20px 48px rgb(0 0 0 / 0.16);

    /* ---------- Z-INDEX — Stacking contexts ---------- */
    --z-base:     0;
    --z-sticky:   100;
    --z-dropdown: 200;
    --z-overlay:  900;
    --z-modal:    1000;
    --z-toast:    1100;

    /* ---------- MOTION — Duration ---------- */
    --duration-fast:   150ms;
    --duration-normal: 300ms;
    --duration-slow:   500ms;

    /* ---------- LAYOUT ---------- */
    --layout-max-width: 1280px;
    --layout-gutter:    var(--space-6);
  }
}

/* ============================================
   Global reset + page wrapper — inside @layer base
   Keeps these rules lower-priority than components/pages so
   they can be overridden without !important.
   ============================================ */
@layer base {
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    font-family: var(--font-body);
    color: var(--gray-700);
    line-height: var(--leading-relaxed);
    background: var(--color-white);
  }

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

  a {
    text-decoration: none;
    color: inherit;
    transition: color var(--duration-normal);
  }
}

@layer components {
  .container {
    max-width: var(--layout-max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
  }
}
