/* ============================================================
   Behind the Craft — Design Tokens
   Peter Yang's Newsletter (creatoreconomy.so)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Pirata+One&display=swap');

/* ============================================================
   BASE COLOR PALETTE
   ============================================================ */
:root {
  /* Neutrals */
  --color-black:        #111111;
  --color-gray-900:     #222222;
  --color-gray-800:     #333333;
  --color-gray-700:     #555555;
  --color-gray-600:     #777777;
  --color-gray-500:     #888888;
  --color-gray-400:     #AAAAAA;
  --color-gray-300:     #CCCCCC;
  --color-gray-200:     #E5E5E5;
  --color-gray-100:     #F5F4F1;
  --color-gray-50:      #FAFAF8;
  --color-white:        #FFFFFF;

  /* Brand — Warm Amber-Orange */
  --color-brand-600:    #C46A00;
  --color-brand-500:    #E8820C;
  --color-brand-400:    #F59A38;
  --color-brand-100:    #FFF1DC;
  --color-brand-50:     #FFF8F0;

  /* ============================================================
     SEMANTIC COLOR TOKENS
     ============================================================ */

  /* Foreground */
  --fg-primary:         var(--color-black);
  --fg-secondary:       var(--color-gray-700);
  --fg-tertiary:        var(--color-gray-500);
  --fg-disabled:        var(--color-gray-400);
  --fg-inverse:         var(--color-white);
  --fg-accent:          var(--color-brand-500);
  --fg-accent-hover:    var(--color-brand-600);

  /* Background */
  --bg-page:            var(--color-white);
  --bg-subtle:          var(--color-gray-50);
  --bg-muted:           var(--color-gray-100);
  --bg-accent:          var(--color-brand-50);
  --bg-accent-strong:   var(--color-brand-100);
  --bg-inverse:         var(--color-black);

  /* Border */
  --border-default:     var(--color-gray-200);
  --border-strong:      var(--color-gray-300);
  --border-accent:      var(--color-brand-500);

  /* Shadow */
  --shadow-card:        0 1px 3px rgba(0,0,0,0.08);
  --shadow-elevated:    0 4px 16px rgba(0,0,0,0.10);
  --shadow-focus:       0 0 0 3px rgba(232,130,12,0.20);

  /* ============================================================
     TYPOGRAPHY
     Note: Lora (serif) and Inter (sans) from Google Fonts.
     JetBrains Mono for code. These are substitutions —
     see README.md for details.
     ============================================================ */

  /* Font families */
  --font-serif:         'Lora', Georgia, 'Times New Roman', serif;
  --font-sans:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:          'JetBrains Mono', 'Courier New', monospace;
  --font-display:       'Pirata One', 'Lora', Georgia, serif;

  /* Font sizes */
  --text-xs:            11px;
  --text-sm:            13px;
  --text-base:          16px;
  --text-md:            18px;
  --text-lg:            20px;
  --text-xl:            24px;
  --text-2xl:           30px;
  --text-3xl:           38px;
  --text-4xl:           48px;

  /* Font weights */
  --weight-regular:     400;
  --weight-medium:      500;
  --weight-semibold:    600;
  --weight-bold:        700;

  /* Line heights */
  --leading-tight:      1.25;
  --leading-snug:       1.4;
  --leading-normal:     1.6;
  --leading-relaxed:    1.75;

  /* Letter spacing */
  --tracking-tight:     -0.02em;
  --tracking-normal:    0;
  --tracking-wide:      0.04em;
  --tracking-wider:     0.08em;
  --tracking-widest:    0.12em;

  /* ============================================================
     SPACING SCALE
     ============================================================ */
  --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;

  /* ============================================================
     BORDER RADIUS
     ============================================================ */
  --radius-sm:    4px;
  --radius-md:    6px;
  --radius-lg:    8px;
  --radius-xl:    12px;
  --radius-full:  9999px;

  /* ============================================================
     LAYOUT
     ============================================================ */
  --max-width-article:  640px;
  --max-width-page:     1200px;
  --sidebar-width:      280px;
}

/* ============================================================
   SEMANTIC ELEMENT STYLES
   ============================================================ */

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--fg-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Article headings — serif */
h1, .h1 {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--fg-primary);
}

h2, .h2 {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--fg-primary);
}

h3, .h3 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--fg-primary);
}

h4, .h4 {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-normal);
  color: var(--fg-primary);
}

/* Body / prose */
p, .body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--fg-primary);
}

.lead {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--fg-secondary);
  font-style: italic;
}

/* Meta / labels */
.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--fg-tertiary);
}

.caption {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--fg-tertiary);
}

/* Code */
code, .code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-accent);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  color: var(--color-brand-600);
}

pre, .pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-muted);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: var(--leading-relaxed);
}

/* Links */
a, .link {
  color: var(--fg-accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}
a:hover, .link:hover {
  color: var(--fg-accent-hover);
  text-decoration-color: var(--fg-accent-hover);
}

/* Blockquote */
blockquote {
  border-left: 3px solid var(--border-accent);
  padding-left: var(--space-5);
  margin: var(--space-6) 0;
  color: var(--fg-secondary);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}

/* Divider */
hr {
  border: none;
  border-top: 1px solid var(--border-default);
  margin: var(--space-8) 0;
}
