/* =========================================================================
   CADOne Design System — Color & Type Tokens
   Sampled from: assets/cadone-logo.png
   Fonts:        Sora (display), Inter (body), JetBrains Mono (mono)
                 — substitutions, see README.md
   ========================================================================= */

/* ---------- 1. Web fonts ------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Sora:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---------- 2. Tokens ---------------------------------------------------- */
:root {
  /* ----- Brand: Blue scale (sampled from logo wordmark "CAD") --------- */
  --blue-50:  #EAF1FB;
  --blue-100: #D2E0F4;
  --blue-200: #A7C2EA;
  --blue-300: #7AA1DD;
  --blue-400: #4F80CE;
  --blue-500: #2A63BD;
  --blue-600: #0050B0;   /* mid logo blue */
  --blue-700: #004090;   /* core brand blue */
  --blue-800: #003275;
  --blue-900: #0B1F4A;   /* deep ink, hero backgrounds */

  /* ----- Brand: Orange scale (sampled from logo wordmark "ONE") ------- */
  --orange-50:  #FFF4E0;
  --orange-100: #FFE4B3;
  --orange-200: #FFCE80;
  --orange-300: #FFB94D;
  --orange-400: #F0A000;   /* amber */
  --orange-500: #F08000;   /* mid (primary accent) */
  --orange-600: #F06000;   /* deep */
  --orange-700: #C24A00;
  --orange-800: #8F3500;

  /* ----- Brand gradient (the wordmark transition) -------------------- */
  --grad-wordmark: linear-gradient(90deg, var(--blue-700) 0%, var(--blue-600) 35%, var(--orange-500) 70%, var(--orange-600) 100%);
  --grad-swoosh:   linear-gradient(90deg, var(--orange-400) 0%, var(--orange-600) 100%);
  --grad-hero:     radial-gradient(ellipse at 20% 0%, var(--blue-700) 0%, var(--blue-900) 70%);

  /* ----- Neutrals ----------------------------------------------------- */
  --white:    #FFFFFF;
  --gray-25:  #FBFCFD;
  --gray-50:  #F6F8FB;
  --gray-100: #EEF2F7;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  --ink:      #0B1424;   /* near-black with blue cast */

  /* ----- Semantic foreground / background ---------------------------- */
  --bg:        var(--white);
  --bg-subtle: var(--gray-50);
  --bg-muted:  var(--gray-100);
  --bg-inverse: var(--blue-900);

  --fg-1:      var(--ink);          /* primary text */
  --fg-2:      var(--gray-700);     /* secondary text */
  --fg-3:      var(--gray-500);     /* tertiary / meta */
  --fg-4:      var(--gray-400);     /* disabled / placeholder */
  --fg-on-dark:    var(--white);
  --fg-on-accent:  var(--white);

  /* ----- Semantic state colors --------------------------------------- */
  --success-bg:  #E6F7EE;
  --success-fg:  #0E8A4F;
  --success-bd:  #9FE0BC;

  --warning-bg:  #FFF4E0;
  --warning-fg:  #B86E00;
  --warning-bd:  #FFCE80;

  --danger-bg:   #FDECEC;
  --danger-fg:   #B42318;
  --danger-bd:   #F5B5B0;

  --info-bg:     var(--blue-50);
  --info-fg:     var(--blue-700);
  --info-bd:     var(--blue-200);

  /* ----- Borders ------------------------------------------------------ */
  --border-1: var(--gray-200);   /* default */
  --border-2: var(--gray-300);   /* emphatic */
  --border-strong: var(--blue-300);
  --focus-ring: 0 0 0 2px var(--white), 0 0 0 4px var(--orange-500);

  /* ----- Shadows (tinted with brand blue, never pure black) ---------- */
  --shadow-sm: 0 1px 2px rgba(11, 31, 74, 0.06);
  --shadow-md: 0 4px 12px rgba(11, 31, 74, 0.08);
  --shadow-lg: 0 12px 32px rgba(11, 31, 74, 0.12);
  --shadow-xl: 0 24px 56px rgba(11, 31, 74, 0.16);
  --shadow-inset-input: inset 0 1px 2px rgba(11, 31, 74, 0.04);

  /* ----- Radii -------------------------------------------------------- */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

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

  /* ----- Motion ------------------------------------------------------- */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-std:    cubic-bezier(0.40, 0, 0.20, 1);
  --dur-fast:    180ms;
  --dur-base:    320ms;
  --dur-slow:    480ms;

  /* ----- Type families ------------------------------------------------ */
  --font-display: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* ----- Type scale (px) --------------------------------------------- */
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-md:   18px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  32px;
  --text-3xl:  40px;
  --text-4xl:  56px;
  --text-5xl:  72px;

  /* ----- Line heights ------------------------------------------------- */
  --lh-tight:   1.1;
  --lh-snug:    1.25;
  --lh-normal:  1.5;
  --lh-relaxed: 1.65;

  /* ----- Layout ------------------------------------------------------- */
  --container-max: 1280px;
  --gutter-mobile: 24px;
  --gutter-tablet: 48px;
  --gutter-desktop: 96px;
  --nav-height-desktop: 72px;
  --nav-height-mobile:  56px;
}

/* ---------- 3. Base resets ---------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- 4. Semantic typography classes ------------------------------ */
.h-display, h1.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 6vw, var(--text-5xl));
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--fg-1);
}
h1, .h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-4xl);
  line-height: var(--lh-tight);
  letter-spacing: -0.015em;
  color: inherit;
  margin: 0;
}
h2, .h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-3xl);
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
  color: inherit;
  margin: 0;
}
h3, .h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-2xl);
  line-height: var(--lh-snug);
  letter-spacing: -0.005em;
  color: inherit;
  margin: 0;
}
h4, .h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: var(--lh-snug);
  color: inherit;
  margin: 0;
}
h5, .h5 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-lg);
  line-height: var(--lh-snug);
  color: inherit;
  margin: 0;
}

p, .p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  color: var(--fg-2);
  text-wrap: pretty;
  margin: 0;
}
.lead {
  font-size: var(--text-md);
  line-height: var(--lh-relaxed);
  color: var(--fg-2);
}
.small, small {
  font-size: var(--text-sm);
  color: var(--fg-3);
}
.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--orange-600);
}
.kicker {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--blue-700);
}

code, .code, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--gray-100);
  color: var(--blue-800);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
}
pre {
  font-family: var(--font-mono);
  background: var(--gray-50);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
}

/* ---------- 5. Wordmark gradient utility -------------------------------- */
.brand-gradient-text {
  background: var(--grad-wordmark);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 6. Focus ring ----------------------------------------------- */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

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