/* ============================================================================
   IsaMunoz Design System — Colors & Type
   ----------------------------------------------------------------------------
   Brand: IsaMunoz — personal blog on AI, CRM and automations.
   Two-color identity: signal blue + deep navy, on white. Editorial + technical.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* --------------------------------------------------------------------------
     COLORS — primitives
     The two values sampled directly from the logo are sacred. Everything else
     is derived (tints/shades or oklch-harmonized neutrals).
     ------------------------------------------------------------------------ */

  /* Brand */
  --im-blue:        #005BC2;   /* signal blue — sampled from logo "i" */
  --im-blue-600:   #0049a0;
  --im-blue-700:   #003a82;
  --im-blue-400:   #2f7ed8;
  --im-blue-200:   #b8d4f0;
  --im-blue-100:   #e6f0fa;
  --im-blue-050:   #f3f8fd;

  --im-navy:        #00123A;   /* deep navy — sampled from logo "M" */
  --im-navy-900:   #000a22;
  --im-navy-700:   #0a1d4d;
  --im-navy-500:   #1c2f5e;
  --im-navy-300:   #4a5778;
  --im-navy-100:   #d4d8e2;

  /* Neutrals (cool, biased slightly toward navy) */
  --im-white:       #ffffff;
  --im-paper:       #fbfbfd;   /* page background, very faint cool tint */
  --im-bone:        #f4f5f8;   /* surface 2 */
  --im-fog:         #e6e8ee;   /* dividers / borders */
  --im-mist:        #c9cdd6;   /* mid neutral */
  --im-slate:       #6b7286;   /* secondary text */
  --im-graphite:    #2c3142;   /* primary text alt */
  --im-ink:         #0d1428;   /* primary text */

  /* Semantic accents — used sparingly */
  --im-success:     #1f8f5b;
  --im-warning:     #c2811a;
  --im-danger:      #c0392b;
  --im-info:        var(--im-blue);

  /* --------------------------------------------------------------------------
     COLORS — semantic tokens
     Use these in components, NOT the primitives.
     ------------------------------------------------------------------------ */

  /* Backgrounds */
  --bg-page:        var(--im-paper);
  --bg-surface:     var(--im-white);
  --bg-surface-2:   var(--im-bone);
  --bg-inverse:     var(--im-navy);
  --bg-accent:      var(--im-blue);
  --bg-accent-soft: var(--im-blue-050);

  /* Foregrounds */
  --fg-1:           var(--im-ink);          /* headlines, primary text */
  --fg-2:           var(--im-graphite);     /* body */
  --fg-3:           var(--im-slate);        /* meta, captions */
  --fg-4:           var(--im-mist);         /* placeholder, disabled */
  --fg-on-accent:   var(--im-white);
  --fg-on-inverse:  var(--im-white);
  --fg-link:        var(--im-blue);
  --fg-link-hover:  var(--im-blue-700);

  /* Borders */
  --border-1:       var(--im-fog);
  --border-2:       var(--im-mist);
  --border-strong:  var(--im-ink);
  --border-accent:  var(--im-blue);

  /* --------------------------------------------------------------------------
     TYPOGRAPHY — families
     Display/UI:   Space Grotesk — geometric sans, echoes the logo's geometry
     Reading:      Source Serif 4 — editorial serif for long-form posts
     Code:         JetBrains Mono — for inline code, snippets, automations UI
     ------------------------------------------------------------------------ */

  --font-sans:    'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif:   'Source Serif 4', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --font-display: var(--font-sans);
  --font-body:    var(--font-serif);
  --font-ui:      var(--font-sans);

  /* Type scale (modular, ratio ~1.2 for UI, larger jumps for display) */
  --fs-12: 0.75rem;     /* 12px  — micro/meta */
  --fs-14: 0.875rem;    /* 14px  — small UI */
  --fs-16: 1rem;        /* 16px  — base */
  --fs-18: 1.125rem;    /* 18px  — body lg */
  --fs-20: 1.25rem;     /* 20px  — body xl / lead */
  --fs-24: 1.5rem;      /* 24px  — h4 */
  --fs-30: 1.875rem;    /* 30px  — h3 */
  --fs-36: 2.25rem;     /* 36px  — h2 */
  --fs-48: 3rem;        /* 48px  — h1 */
  --fs-64: 4rem;        /* 64px  — display */
  --fs-80: 5rem;        /* 80px  — hero */

  --lh-tight:   1.1;
  --lh-snug:    1.25;
  --lh-normal:  1.5;
  --lh-relaxed: 1.65;
  --lh-loose:   1.8;

  --ls-tight:   -0.02em;
  --ls-snug:    -0.01em;
  --ls-normal:  0;
  --ls-wide:     0.04em;
  --ls-wider:    0.12em;       /* eyebrows, kickers */

  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold: 600;
  --fw-bold:    700;

  /* --------------------------------------------------------------------------
     SPACING + RADII + SHADOWS
     ------------------------------------------------------------------------ */
  --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-10: 4rem;      /* 64 */
  --space-12: 6rem;      /* 96 */
  --space-16: 8rem;      /*128 */

  --radius-none: 0;
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  20px;
  --radius-pill: 999px;

  /* Shadows are subtle; the brand reads sharp + flat. Use shadow only for
     elevation that genuinely floats (menus, modals, hovered cards). */
  --shadow-xs: 0 1px 2px rgba(0, 18, 58, 0.05);
  --shadow-sm: 0 2px 6px rgba(0, 18, 58, 0.06), 0 1px 2px rgba(0,18,58,0.04);
  --shadow-md: 0 8px 24px -8px rgba(0, 18, 58, 0.12), 0 2px 6px rgba(0,18,58,0.05);
  --shadow-lg: 0 20px 40px -12px rgba(0, 18, 58, 0.18), 0 4px 12px rgba(0,18,58,0.06);
  --shadow-focus: 0 0 0 3px rgba(0, 91, 194, 0.25);

  /* Motion */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:       cubic-bezier(0.4, 0, 1, 1);
  --dur-fast:   120ms;
  --dur-base:   180ms;
  --dur-slow:   320ms;
}

/* ============================================================================
   SEMANTIC TYPE STYLES
   Apply directly via class, or use the element selectors as defaults.
   ========================================================================== */

html { font-size: 16px; }

body, .im-body {
  font-family: var(--font-body);
  font-size: var(--fs-18);
  line-height: var(--lh-relaxed);
  color: var(--fg-2);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Display + headings — sans, tight, ink */
.im-display, h1.display {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: clamp(2.5rem, 6vw, var(--fs-80));
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--fg-1);
}

h1, .im-h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-48);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--fg-1);
}

h2, .im-h2 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-36);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
  color: var(--fg-1);
}

h3, .im-h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-24);
  line-height: var(--lh-snug);
  color: var(--fg-1);
}

h4, .im-h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  font-size: var(--fs-20);
  line-height: var(--lh-snug);
  color: var(--fg-1);
}

/* Eyebrow / kicker — uppercase, wide, blue */
.im-eyebrow {
  font-family: var(--font-ui);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-12);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--im-blue);
}

/* Lead paragraph — first paragraph after a heading, slightly larger serif */
.im-lead {
  font-family: var(--font-body);
  font-size: var(--fs-20);
  line-height: var(--lh-relaxed);
  color: var(--fg-1);
  font-weight: var(--fw-regular);
}

/* Body */
p, .im-p {
  font-family: var(--font-body);
  font-size: var(--fs-18);
  line-height: var(--lh-relaxed);
  color: var(--fg-2);
}

.im-small {
  font-family: var(--font-ui);
  font-size: var(--fs-14);
  line-height: var(--lh-normal);
  color: var(--fg-3);
}

.im-meta {
  font-family: var(--font-ui);
  font-size: var(--fs-12);
  line-height: var(--lh-normal);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--fg-3);
}

/* Code */
code, .im-code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

code:not(pre code) {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-1);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--im-navy-700);
  font-weight: var(--fw-medium);
}

pre {
  background: var(--im-navy);
  color: var(--im-white);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: var(--lh-snug);
  font-size: var(--fs-14);
}

pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

/* Links */
a, .im-link {
  color: var(--fg-link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in oklch, var(--im-blue) 40%, transparent);
  transition: color var(--dur-fast) var(--ease-standard),
              text-decoration-color var(--dur-fast) var(--ease-standard);
}
a:hover {
  color: var(--fg-link-hover);
  text-decoration-color: currentColor;
}

/* Quotes — editorial pull-quote */
blockquote, .im-quote {
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--fs-24);
  line-height: var(--lh-snug);
  color: var(--fg-1);
  border-left: 3px solid var(--im-blue);
  padding-left: var(--space-5);
  margin: var(--space-6) 0;
}

/* Selection */
::selection { background: var(--im-blue); color: var(--im-white); }

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--im-blue);
  outline-offset: 2px;
  border-radius: 2px;
}
