/* =====================================================================
   Luppy Design System — colors_and_type.css
   Single source of truth for color + type tokens.
   Mirrors src/app/globals.css + src/css/theme/default-colors.css from
   the Luppy product (Tailwind v4 + Radix UI).
   ===================================================================== */

/* -------- Font face -------- */
/* Manrope is the product font (loaded via next/font in production).
   We pull it from Google Fonts here so HTML mocks render correctly. */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap");

:root {
  /* ----- Brand seeds (from src/css/theme/default-colors.css) ----- */
  --color-primary: #3b82f6;       /* Luppy blue — buttons, links, brand */
  --color-secondary: #14b8a6;     /* Teal — secondary actions, charts */
  --color-primary-hint: #5d87ff;  /* Top-loader & PWA theme-color */

  /* ----- Semantic colors (status / feedback) ----- */
  --color-info:    #46caeb;
  --color-success: #2ea95c;
  --color-warning: #f8c20a;
  --color-error:   #ff6692;

  /* ----- Neutrals ----- */
  --color-white:        #ffffff;
  --color-dark:         #2a3a52;  /* deep navy — page text on light */
  --color-darkgray:     #1a2537;  /* dark surface */
  --color-darkinfo:     #223662;
  --color-link:         #2a3547;  /* foreground / heading */
  --color-sky:          #0a2540;
  --color-bodytext:     #98a4ae;  /* paragraph copy */
  --color-lightmuted:   #98a4ae;
  --color-lightgray:    #f4f7fb;  /* page wash */
  --color-bgmuted:      #eff4fa;
  --color-lighthover:   #f5f7fb;
  --color-light-emphasis: #dfe5ef;
  --color-border:       #e5e5e5;
  --color-darkborder:   #333f55;

  /* ----- Tints (12% mix toward transparent) -----
     Used everywhere as "soft" status backgrounds and the famous
     `lightprimary` hover wash on icon buttons & sidebar items. */
  --color-lightprimary:   color-mix(in oklab, var(--color-primary)   12%, transparent);
  --color-lightsecondary: color-mix(in oklab, var(--color-secondary) 12%, transparent);
  --color-lightsuccess:   color-mix(in oklab, var(--color-success)   12%, transparent);
  --color-lightinfo:      color-mix(in oklab, var(--color-info)      12%, transparent);
  --color-lightwarning:   color-mix(in oklab, var(--color-warning)   12%, transparent);
  --color-lighterror:     color-mix(in oklab, var(--color-error)     12%, transparent);

  /* ----- Emphasis (20% darker) — hover states for solid buttons ----- */
  --color-primary-emphasis:   color-mix(in oklab, var(--color-primary)   80%, black);
  --color-secondary-emphasis: color-mix(in oklab, var(--color-secondary) 80%, black);
  --color-success-emphasis:   color-mix(in oklab, var(--color-success)   80%, black);
  --color-info-emphasis:      color-mix(in oklab, var(--color-info)      80%, black);
  --color-warning-emphasis:   color-mix(in oklab, var(--color-warning)   80%, black);
  --color-error-emphasis:     color-mix(in oklab, var(--color-error)     80%, black);

  /* ----- Surface roles ----- */
  --background:  #ffffff;
  --foreground:  var(--color-link);
  --card:        var(--color-white);
  --card-foreground: var(--color-link);
  --popover:     var(--color-white);
  --muted:       #f5f5f5;
  --muted-foreground: #737373;
  --accent:      var(--color-lightprimary);
  --accent-foreground: var(--color-primary);
  --ring:        var(--color-lightprimary);

  /* ----- Type tokens ----- */
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Type scale — Tailwind defaults + a few custom rungs from globals.css */
  --text-xs:    12px;
  --text-sm:    14px;
  --text-base:  16px;
  --text-lg:    18px;
  --text-xl:    20px;
  --text-2xl:   24px;
  --text-fs_13: 13px;
  --text-fs_21: 21px;
  --text-fs_28: 28px;
  --text-40:    40px;
  --text-44:    44px;
  --text-56:    56px;

  --leading-tight:  1.2;
  --leading-normal: 1.5;
  --leading-21:     21px;

  --font-normal:   400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;

  /* ----- Radius scale ----- */
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-tw: 12px;   /* "tailwind" — pill icon buttons in sidebar */
  --radius-bb: 20px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* ----- Spacing (Tailwind 4 default, 4-pt grid) ----- */
  --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;

  /* ----- Shadows -----
     `shadow-sm` is the workhorse card shadow in the product. */
  --shadow-sm: 0 6px 24.2px -10px rgba(41, 52, 61, 0.22);
  --shadow-md: 0px 2px 4px -1px rgba(175, 182, 201, 0.2);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  --shadow-dark-md:
    rgba(145, 158, 171, 0.3) 0px 0px 2px 0px,
    rgba(145, 158, 171, 0.02) 0px 12px 24px -4px;
  --shadow-btn: rgba(0, 0, 0, 0.05) 0 9px 17.5px;
}

/* ----- Dark mode (apply by adding class="dark" to <html>) ----- */
.dark {
  --background:  #1c2536;
  --foreground:  var(--color-white);
  --card:        var(--color-darkgray);
  --card-foreground: var(--color-white);
  --popover:     var(--color-dark);
  --muted:       #2a3851;
  --muted-foreground: #98a4ae;
  --color-link:  #98a4ae;        /* body text is muted on dark */
  --color-border: #333f55;
}

/* =====================================================================
   Semantic helpers — apply globally so plain HTML inherits Luppy type
   ===================================================================== */
html, body {
  font-family: var(--font-sans);
  color: var(--color-link);
  background: var(--background);
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

body {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-bodytext);     /* body copy is muted by default */
}

/* Headings — see globals.css. Always tight leading, never margin-top. */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-link);
  line-height: var(--leading-tight);
  margin: 0 0 8px 0;
}
h1 { font-size: var(--text-2xl); font-weight: var(--font-bold); }
h2 { font-size: var(--text-xl);  font-weight: var(--font-bold); }
h3 { font-size: var(--text-lg);  font-weight: var(--font-semibold); }
h4 { font-size: var(--text-base);font-weight: var(--font-semibold); }
h5 { font-size: var(--text-sm);  font-weight: var(--font-semibold); }
h6 { font-size: var(--text-xs);  font-weight: var(--font-medium); }

p { font-size: var(--text-sm); color: var(--color-bodytext); }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, kbd, samp {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
}
