/* ============================================================
   THE LEDE ADVISORY — Foundations
   colors + typography + spacing + elevation tokens
   ============================================================ */

/* ---- Fonts (Google Fonts — substitutions flagged in README) ---- */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ============================================================
     COLOR — Bold modern editorial palette
     ============================================================ */

  /* Core neutrals — bright modern surface, warm undertone preserved in alt + hairlines */
  --paper:       #FFFFFF;   /* primary surface — near-pure white */
  --bone:        #FAF6EC;   /* warm off-white alt surface — cards on paper */
  --hairline:    #E6E1D2;   /* rules + dividers (warm, subtle on white) */
  --hairline-2:  #D2CBB8;   /* slightly stronger hairline */

  /* Ink scale */
  --ink:         #111111;   /* primary text */
  --ink-2:       #2E2E30;   /* secondary text */
  --graphite:    #5A5A60;   /* tertiary / meta */
  --mute:        #8A8A8E;   /* placeholder / disabled */

  /* Inverted surfaces (for slide section breaks, dark hero) */
  --noir:        #141312;   /* near-black with warm undertone */
  --noir-2:      #1F1D1B;
  --paper-inv:   #F1ECE0;   /* paper used on noir */

  /* Signal — single accent, used sparingly like an editor's pen */
  --lede:        #7C2BFF;   /* primary accent — electric violet */
  --lede-deep:   #5F14D9;   /* press / hover */
  --lede-tint:   #E9DEFC;   /* tint for callout strips */

  /* Semantic foreground/background aliases */
  --fg-1:        var(--ink);
  --fg-2:        var(--ink-2);
  --fg-3:        var(--graphite);
  --fg-mute:     var(--mute);
  --bg-1:        var(--paper);
  --bg-2:        var(--bone);
  --bg-inv:      var(--noir);
  --border:      var(--hairline);
  --border-strong: var(--hairline-2);
  --accent:      var(--lede);

  /* ============================================================
     TYPE — Instrument Serif (display) + Geist (sans) + JetBrains Mono
     ============================================================ */
  --font-display: 'Instrument Serif', 'Times New Roman', Georgia, serif;
  --font-sans:    'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Type scale — bold modern editorial. Display sizes punch hard. */
  --t-display-xl:  clamp(64px, 9vw, 144px);    /* @kind font */ /* hero — front-page lede */
  --t-display-lg:  clamp(48px, 6vw, 96px);     /* @kind font */ /* section opener */
  --t-display-md:  clamp(36px, 4.5vw, 64px);   /* @kind font */ /* large heading */
  --t-h1:          40px;
  --t-h2:          28px;
  --t-h3:          22px;
  --t-h4:          18px;
  --t-body-lg:     19px;
  --t-body:        16px;
  --t-body-sm:     14px;
  --t-caption:     13px;
  --t-meta:        11px;   /* mono dateline / tags — tracked out */

  --lh-tight:   1.04;   /* @kind other */
  --lh-snug:    1.18;   /* @kind other */
  --lh-normal:  1.45;   /* @kind other */
  --lh-loose:   1.6;    /* @kind other */

  --tr-tight:   -0.02em;   /* @kind other */
  --tr-normal:  0;         /* @kind other */
  --tr-meta:    0.14em;    /* @kind other */ /* mono small-caps tracking */

  /* ============================================================
     SPACING — 4px base, generous editorial scale
     ============================================================ */
  --s-0:  0px;
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-7:  32px;
  --s-8:  40px;
  --s-9:  56px;
  --s-10: 72px;
  --s-11: 96px;
  --s-12: 128px;

  /* ============================================================
     RADIUS — sharp by default. Cards have 0–2px max.
     ============================================================ */
  --r-0: 0px;
  --r-1: 2px;
  --r-2: 4px;
  --r-pill: 999px;

  /* ============================================================
     ELEVATION — flat. Use rules and contrast, not shadow.
     A single subtle shadow is allowed for tooltips / menus only.
     ============================================================ */
  --shadow-flat: none;
  --shadow-menu: 0 8px 24px -12px rgba(17, 17, 17, 0.18);
  --shadow-modal: 0 24px 48px -16px rgba(17, 17, 17, 0.24);

  /* ============================================================
     MOTION
     ============================================================ */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);      /* @kind other */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);   /* @kind other */
  --dur-1: 120ms;   /* @kind other */
  --dur-2: 200ms;   /* @kind other */
  --dur-3: 360ms;   /* @kind other */
}

/* ============================================================
   SEMANTIC ELEMENT STYLES
   Use these directly on bare h1/h2/p/etc. or via .ld-* classes.
   ============================================================ */

html { background: var(--paper); color: var(--ink); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-normal);
  color: var(--fg-1);
  background: var(--bg-1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Headings — display serif. Tight leading, mild negative tracking. */
.display-xl, h1.display, .ld-display-xl {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-display-xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-tight);
  color: var(--fg-1);
}
.display-lg, .ld-display-lg {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-display-lg);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-tight);
}
.display-md, .ld-display-md {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-display-md);
  line-height: 1.08;
  letter-spacing: var(--tr-tight);
}
h1, .ld-h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-h1);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-tight);
  margin: 0;
}
h2, .ld-h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-h2);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}
h3, .ld-h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--t-h3);
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 0;
}
h4, .ld-h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--t-h4);
  line-height: 1.3;
  margin: 0;
}

/* Body */
.body-lg, .ld-body-lg {
  font-size: var(--t-body-lg);
  line-height: var(--lh-loose);
  color: var(--fg-2);
}
.body, p {
  font-size: var(--t-body);
  line-height: var(--lh-normal);
  color: var(--fg-2);
  margin: 0;
}
.body-sm, .ld-body-sm {
  font-size: var(--t-body-sm);
  line-height: 1.5;
  color: var(--fg-3);
}
.caption, .ld-caption {
  font-size: var(--t-caption);
  line-height: 1.4;
  color: var(--fg-3);
}

/* Meta — the signature editorial detail.
   Mono, small caps look, tracked out. Use for datelines, tags, eyebrows. */
.meta, .ld-meta, .eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  font-weight: 500;
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--fg-3);
}
.meta--accent, .eyebrow--accent {
  color: var(--accent);
}

/* Editorial italic — Instrument Serif italic is distinctive */
em.editorial, .ld-italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
}

/* Drop-cap — opening of an essay / case study */
.ld-dropcap::first-letter {
  font-family: var(--font-display);
  font-weight: 400;
  float: left;
  font-size: 4.2em;
  line-height: 0.85;
  padding: 0.08em 0.12em 0 0;
  color: var(--ink);
}

/* Links */
a, .ld-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--hairline-2);
  transition: text-decoration-color var(--dur-2) var(--ease-out);
}
a:hover, .ld-link:hover {
  text-decoration-color: var(--accent);
}

/* Hairline rule — the spine of the editorial system */
.rule, hr.ld-rule {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 0;
}
.rule--strong { border-top-color: var(--hairline-2); }
.rule--ink    { border-top-color: var(--ink); }
.rule--double { border-top: 3px double var(--ink); }

/* Inline tag pill — sparse, used for taxonomy */
.tag, .ld-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--hairline-2);
  color: var(--ink);
  background: transparent;
  border-radius: var(--r-0);
}
.tag--accent {
  color: var(--lede);
  border-color: var(--lede);
}
.tag--solid {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Section opener — "01 — APPROACH" pattern */
.section-opener, .ld-section-opener {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}
.section-opener .num {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  letter-spacing: var(--tr-meta);
  color: var(--accent);
}
.section-opener .label {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--ink);
}

/* Inverted surface — dark editorial slabs (cover slides, callouts) */
.ld-noir {
  background: var(--noir);
  color: var(--paper-inv);
}
.ld-noir h1, .ld-noir h2, .ld-noir .ld-display-xl, .ld-noir .ld-display-lg, .ld-noir .ld-display-md {
  color: var(--paper-inv);
}
.ld-noir .meta, .ld-noir .eyebrow { color: rgba(241, 236, 224, 0.6); }
.ld-noir .rule { border-top-color: rgba(241, 236, 224, 0.2); }

/* Focus ring — sharp, never rounded */
:focus-visible {
  outline: 2px solid var(--lede);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--lede);
  color: var(--paper);
}

/* ============================================================
   COMPONENT PRIMITIVES — buttons, fields, cards
   ============================================================ */

/* Buttons */
.ld-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  border-radius: var(--r-0);
  transition: background var(--dur-1) var(--ease-out),
              color var(--dur-1) var(--ease-out),
              transform var(--dur-1) var(--ease-out);
  text-decoration: none;
}
.ld-btn:hover  { background: var(--lede); border-color: var(--lede); }
.ld-btn:active { transform: translateY(1px); }

.ld-btn--secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.ld-btn--secondary:hover { background: var(--ink); color: var(--paper); }

.ld-btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}
.ld-btn--ghost:hover { color: var(--lede); background: transparent; }

.ld-btn--accent {
  background: var(--lede);
  border-color: var(--lede);
  color: var(--paper);
}
.ld-btn--accent:hover { background: var(--lede-deep); border-color: var(--lede-deep); }

/* Fields */
.ld-field {
  display: block;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline-2);
  padding: 10px 0;
  outline: none;
  transition: border-color var(--dur-2) var(--ease-out);
}
.ld-field::placeholder { color: var(--mute); }
.ld-field:focus { border-bottom-color: var(--ink); }

.ld-label {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--graphite);
  display: block;
  margin-bottom: 6px;
}

/* Card — sharp corners, hairline border, optional accent rule.
   White surface — separates from the page by border only. */
.ld-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-0);
  padding: 24px;
}
.ld-card--accent {
  border-top: 3px solid var(--lede);
}

/* Blockquote — editorial pull-quote */
.ld-pullquote {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: var(--t-display-md);
  line-height: 1.1;
  color: var(--ink);
  border-left: none;
  margin: 0;
  padding: 0;
}
.ld-pullquote .attrib {
  display: block;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--t-meta);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--graphite);
}
