/* ============================================================
   acrepair.nyc — Design tokens
   Mobile-first. All colour / spacing / typography lives here.
   Do not hardcode hex values in base.css or styles.css.
   ============================================================ */

:root {
  color-scheme: light dark;

  /* ---- Brand palette --------------------------------------
     Professional HVAC direction: deep cool slate-blue (trust,
     technical) + warm copper accent (heat / call-to-action).
     No neon green anywhere (legacy cricket palette retired).  */
  --color-primary:        #12395c;
  --color-primary-strong: #0c2740;
  --color-primary-soft:   #e8eff5;
  --color-accent:         #b8541f;
  --color-accent-strong:  #93410f;
  --color-accent-soft:    #fbeee5;

  /* ---- Neutral surfaces ---- */
  --color-bg:             #fbfaf8;
  --color-surface:        #ffffff;
  --color-surface-alt:    #f2f0ec;
  --color-border:         #ddd8d1;
  --color-border-strong:  #b9b2a8;

  /* ---- Text (all AA on their surfaces) ---- */
  --color-text:           #1b1a17;
  --color-text-muted:     #55524c;
  --color-text-invert:    #f8f7f4;

  /* ---- Status ---- */
  --color-success:        #1c6b45;
  --color-warning:        #8a5a00;
  --color-danger:         #a32020;

  /* ---- Typography: system stack, no webfont round-trip.
     Keeps LCP low; no render-blocking font CSS. ---- */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Base 16px mobile → 17px desktop (see media query below) */
  --text-xs:   0.8125rem;  /* 13 */
  --text-sm:   0.9375rem;  /* 15 */
  --text-base: 1rem;       /* 16 */
  --text-lg:   1.125rem;   /* 18 */
  --text-xl:   1.375rem;   /* 22 */
  --text-2xl:  1.625rem;   /* 26 */
  --text-3xl:  2rem;       /* 32 */
  --text-4xl:  2.375rem;   /* 38 */

  --leading-tight: 1.18;
  --leading-snug:  1.35;
  --leading-body:  1.62;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semi:   600;
  --weight-bold:   700;

  /* ---- Spacing: strict 8pt grid (half-steps allowed) ---- */
  --space-1: 0.25rem;  /*  4 */
  --space-2: 0.5rem;   /*  8 */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-5: 1.5rem;   /* 24 */
  --space-6: 2rem;     /* 32 */
  --space-7: 2.5rem;   /* 40 */
  --space-8: 3rem;     /* 48 */
  --space-9: 4rem;     /* 64 */
  --space-10: 5rem;    /* 80 */

  /* ---- Radius: 6–8px house style ---- */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 999px;

  /* ---- Elevation ---- */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 2px 8px rgba(16, 24, 40, 0.09);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.12);

  /* ---- Layout ---- */
  --container-max: 1160px;
  --container-narrow: 680px;
  --header-height: 60px;
  --mobile-cta-height: 64px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur: 200ms;
}

/* Desktop: nudge base type up to 17px for comfortable reading */
@media (min-width: 768px) {
  :root {
    --text-base: 1.0625rem; /* 17 */
    --text-lg:   1.1875rem; /* 19 */
    --text-xl:   1.5rem;    /* 24 */
    --text-2xl:  1.875rem;  /* 30 */
    --text-3xl:  2.375rem;  /* 38 */
    --text-4xl:  3rem;      /* 48 */
    --header-height: 72px;
  }
}

/* ---- Dark mode: OS preference ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary:        #7fb2da;
    --color-primary-strong: #a8cbe9;
    --color-primary-soft:   #17262f;
    --color-accent:         #e8905c;
    --color-accent-strong:  #f2ab7e;
    --color-accent-soft:    #2b1c13;

    --color-bg:             #14130f;
    --color-surface:        #1c1b17;
    --color-surface-alt:    #24221d;
    --color-border:         #3a372f;
    --color-border-strong:  #565247;

    --color-text:           #f3f1ec;
    --color-text-muted:     #b6b1a6;
    --color-text-invert:    #14130f;

    --color-success:        #6fce9f;
    --color-warning:        #e8bd63;
    --color-danger:         #f08d8d;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  }
}

/* ---- Dark mode: explicit user toggle (data-theme="dark") ---- */
:root[data-theme="dark"] {
  --color-primary:        #7fb2da;
  --color-primary-strong: #a8cbe9;
  --color-primary-soft:   #17262f;
  --color-accent:         #e8905c;
  --color-accent-strong:  #f2ab7e;
  --color-accent-soft:    #2b1c13;

  --color-bg:             #14130f;
  --color-surface:        #1c1b17;
  --color-surface-alt:    #24221d;
  --color-border:         #3a372f;
  --color-border-strong:  #565247;

  --color-text:           #f3f1ec;
  --color-text-muted:     #b6b1a6;
  --color-text-invert:    #14130f;

  --color-success:        #6fce9f;
  --color-warning:        #e8bd63;
  --color-danger:         #f08d8d;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
}
