/* ============================================================
   Roofer Rank AI — Design Tokens
   Source of truth for the editorial / premium consultancy system.
   Consumed by index.html (and later: report, sample-report, etc.)
   ============================================================ */

:root {
  /* ---------- Color ------------------------------------------- */
  --color-bg:        #FCFCFA;   /* warm off-white canvas */
  --color-bg-elev:   #FFFFFF;   /* cards, elevated surfaces */
  --color-bg-sunken: #F1EDE1;   /* sections that recede — deeper for visible banding */
  --color-bg-invert: #0F1419;   /* dark hero / footer */

  --color-ink:       #0F1419;   /* primary text */
  --color-ink-2:     #3D4754;   /* body copy */
  --color-ink-3:     #6B7785;   /* secondary, captions */
  --color-ink-4:     #A0A8B2;   /* tertiary, placeholders */
  --color-ink-inv:   #FCFCFA;   /* on dark surfaces */

  --color-rule:      #E8E6DF;   /* hairlines, dividers */
  --color-rule-2:    #D6D2C7;   /* stronger borders */

  --color-accent:    #D97706;   /* amber-700 — brand warm */
  --color-accent-2:  #B45309;   /* amber-800 — pressed */
  --color-accent-3:  #FBBF24;   /* amber-400 — highlights */
  --color-accent-bg: #FEF3C7;   /* amber-100 — wash */

  --color-anchor:    #1E293B;   /* slate-800 — heavy CTA */
  --color-anchor-2: #0F172A;    /* slate-900 — pressed */

  --color-success:   #15803D;   /* emerald-700 */
  --color-success-bg:#DCFCE7;   /* emerald-100 */
  --color-danger:    #B91C1C;   /* red-700 */
  --color-danger-bg: #FEE2E2;   /* red-100 */
  --color-info:      #1D4ED8;   /* blue-700 */
  --color-info-bg:   #DBEAFE;   /* blue-100 */

  --gradient-hero:   linear-gradient(135deg, #1E293B 0%, #D97706 100%);
  --gradient-glow:   radial-gradient(60% 60% at 50% 0%, rgba(217,119,6,.12), transparent 70%);

  /* ---------- Typography -------------------------------------- */
  /* Fraunces: opsz axis softens the serif at display sizes (warm, editorial).
     Hanken Grotesk: humanist grotesque with more character than Inter — sheds the
     generic-SaaS body feel while staying highly readable. Both Google Fonts. */
  --font-display:    'Fraunces', 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans:       'Hanken Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:       'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Type scale — fluid clamp() for mobile-first */
  --fs-xs:    clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);  /* 12 → 13 */
  --fs-sm:    clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem); /* 14 → 15 */
  --fs-base:  clamp(1rem, 0.98rem + 0.15vw, 1.0625rem);     /* 16 → 17 */
  --fs-lg:    clamp(1.125rem, 1.08rem + 0.25vw, 1.25rem);   /* 18 → 20 */
  --fs-xl:    clamp(1.25rem, 1.18rem + 0.4vw, 1.5rem);      /* 20 → 24 */
  --fs-2xl:   clamp(1.5rem, 1.35rem + 0.75vw, 2rem);        /* 24 → 32 */
  --fs-3xl:   clamp(2rem, 1.7rem + 1.5vw, 3rem);            /* 32 → 48 */
  --fs-4xl:   clamp(2.5rem, 1.95rem + 2.75vw, 4.25rem);     /* 40 → 68 — hero */
  --fs-5xl:   clamp(3rem, 2.15rem + 4.25vw, 5.5rem);        /* 48 → 88 — display */

  --lh-tight:  1.05;
  --lh-snug:   1.2;
  --lh-normal: 1.5;
  --lh-loose:  1.65;

  --ls-tight:  -0.02em;
  --ls-display:-0.035em;  /* for serif display */
  --ls-normal: 0;
  --ls-wide:   0.06em;    /* eyebrows / labels */

  /* ---------- Spacing (4-base) -------------------------------- */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   20px;
  --space-6:   24px;
  --space-8:   32px;
  --space-10:  40px;
  --space-12:  48px;
  --space-16:  64px;
  --space-20:  80px;
  --space-24:  96px;
  --space-32:  128px;

  /* Section vertical rhythm — fluid */
  --section-pad-y: clamp(4rem, 3rem + 5vw, 7rem);  /* 64 → 112 */
  --content-max:   1120px;  /* main content container */
  --prose-max:     680px;   /* body copy width — readability */

  /* ---------- Radii ------------------------------------------- */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* ---------- Shadows ----------------------------------------- */
  --shadow-0: 0 0 0 1px rgba(15,20,25,.06);
  --shadow-1: 0 1px 2px rgba(15,20,25,.04), 0 0 0 1px rgba(15,20,25,.06);
  --shadow-2: 0 8px 24px -8px rgba(15,20,25,.12), 0 0 0 1px rgba(15,20,25,.06);
  --shadow-3: 0 20px 48px -16px rgba(15,20,25,.18), 0 0 0 1px rgba(15,20,25,.08);
  --shadow-focus: 0 0 0 3px rgba(217,119,6,.28);

  /* ---------- Motion ------------------------------------------ */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);   /* "expo out" — editorial */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* gentle overshoot */

  --dur-instant: 80ms;
  --dur-fast:    180ms;
  --dur-mid:     360ms;
  --dur-slow:    720ms;
  --dur-extra:   1200ms;

  /* ---------- Z-index ----------------------------------------- */
  --z-base:     0;
  --z-raised:   10;
  --z-sticky:   100;
  --z-overlay:  500;
  --z-modal:    900;
  --z-toast:    1000;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
