/* ============================================================
   Sanjay Strategic Advisors — Design System Tokens
   Colors, typography, spacing, motion. Import this in every page.
   ============================================================ */

/* --- Webfonts (Google Fonts; swap to local @font-face for prod) --- */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300..700;1,8..60,300..700&family=Newsreader:ital,opsz,wght@0,6..72,300..700;1,6..72,300..700&family=Inter+Tight:wght@400;500;600&display=swap');

:root {
  /* ---------- COLOR ---------- */
  /* Paper / ink — cool neutral foundation, McKinsey-adjacent */
  --paper:        #FFFFFF;
  --paper-2:      #F4F6F9;
  --paper-3:      #E8ECF2;
  --hairline:     #D5DBE3;

  --ink:          #0A1F3D;        /* deep navy ink */
  --ink-2:        #3A4A63;
  --ink-3:        #7B8699;

  /* Accent — McKinsey blue, used sparingly */
  --accent:       #0A6CB6;
  --accent-2:     #074F85;   /* hover/active */
  --accent-soft:  #D6E6F4;   /* tinted wash */

  /* Dark surfaces */
  --deep:         #051C36;
  --deep-2:       #0A2745;
  --deep-3:       #143A5C;
  --deep-paper:   #FFFFFF;   /* fg on deep */

  /* Semantic */
  --bg:           var(--paper);
  --bg-elevated:  var(--paper-2);
  --fg:           var(--ink);
  --fg-muted:     var(--ink-2);
  --fg-subtle:    var(--ink-3);
  --border:       var(--hairline);
  --link:         var(--ink);
  --link-accent:  var(--accent);

  /* Functional (kept neutral; this brand avoids loud success/error chips) */
  --positive:     #1F9D55;
  --negative:     #C0382B;

  /* ---------- TYPOGRAPHY ---------- */
  --font-display: 'Source Serif 4', 'Tiempos Headline', 'GT Sectra', Georgia, serif;
  --font-body:    'Newsreader', 'Source Serif 4', Georgia, serif;
  --font-ui:      'Inter Tight', 'Söhne', 'Helvetica Neue', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  /* Type scale — 1.250 (major third), anchored at 17px */
  --text-xs:      0.75rem;    /* 12px — tracked labels */
  --text-sm:      0.8125rem;  /* 13px — UI labels */
  --text-base:    1.0625rem;  /* 17px — body */
  --text-md:      1.25rem;    /* 20px — lead */
  --text-lg:      1.5rem;     /* 24px — h4 */
  --text-xl:      1.875rem;   /* 30px — h3 */
  --text-2xl:     2.5rem;     /* 40px — h2 */
  --text-3xl:     3.5rem;     /* 56px — h1 */
  --text-display: clamp(3rem, 7vw, 6rem); /* 48–96px — hero */

  --leading-tight:  1.05;
  --leading-snug:   1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  --tracking-tight: -0.02em;
  --tracking-snug:  -0.01em;
  --tracking-wide:  0.12em;
  --tracking-wider: 0.18em;

  /* ---------- SPACING ---------- */
  --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;
  --space-11: 160px;

  /* ---------- LAYOUT ---------- */
  --content-max:  1320px;
  --content-pad:  clamp(20px, 4vw, 64px);
  --measure:      66ch;
  --nav-h:        64px;

  /* ---------- RADIUS ---------- */
  --radius-0:   0;
  --radius-1:   2px;   /* inputs */
  --radius-2:   4px;   /* buttons, badges */
  --radius-3:   8px;   /* image containers, modals */

  /* ---------- ELEVATION ---------- */
  --shadow-sm:  0 1px 0 rgba(26,24,21,0.04);
  --shadow-lg:  0 24px 48px -16px rgba(26,24,21,0.16);

  /* ---------- MOTION ---------- */
  --ease:       cubic-bezier(0.2, 0, 0, 1);
  --ease-in:    cubic-bezier(0.5, 0, 1, 1);
  --duration-1: 120ms;
  --duration-2: 240ms;
  --duration-3: 400ms;
}

/* ============================================================
   BASE RESET + DEFAULTS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Subtle paper texture — barely perceptible */
body.textured::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' /></filter><rect width='100%25' height='100%25' filter='url(%23n)' /></svg>");
}

/* ============================================================
   SEMANTIC TYPE STYLES
   ============================================================ */

/* Headings — display serif */
h1, .h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-5) 0;
  color: var(--ink);
}

h2, .h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-5) 0;
  color: var(--ink);
}

h3, .h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-snug);
  margin: 0 0 var(--space-4) 0;
  color: var(--ink);
}

h4, .h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  margin: 0 0 var(--space-3) 0;
  color: var(--ink);
}

/* Hero / display */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-display);
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--ink);
}

.lede {
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--ink-2);
  font-weight: 300;
  max-width: var(--measure);
}

/* Eyebrows / kickers */
.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--ink-3);
}

/* Body */
p {
  margin: 0 0 var(--space-4) 0;
  max-width: var(--measure);
}

/* Italic — reserved; brand prefers roman for emphasis (color shift instead) */
.italic-display {
  font-family: var(--font-display);
  font-weight: 500;
}

/* Numerals — large editorial chapter numbers (roman, not italic) */
.chapter-num {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 4rem;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.01em;
  font-feature-settings: 'lnum' 1;
}

/* UI labels */
.ui-label {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0;
}

/* Tabular figures — data, metrics */
.tabular {
  font-family: var(--font-ui);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

/* Links */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-underline-offset var(--duration-1) var(--ease),
              text-decoration-thickness var(--duration-1) var(--ease);
}
a:hover {
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.12em;
}

/* Selection */
::selection { background: var(--accent-soft); color: var(--ink); }

/* Brand has no italic — use accent color for emphasis instead */
em, i, cite { font-style: normal; color: var(--accent); }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* --- Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 22px;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--radius-2);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--duration-1) var(--ease),
              border-color var(--duration-1) var(--ease),
              transform var(--duration-1) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.99); }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: #000; }

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

.btn-ghost {
  background: transparent;
  color: var(--ink);
  padding: 8px 0;
}
.btn-ghost:hover { color: var(--accent); }

/* --- Input --- */
.input {
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-1);
  color: var(--ink);
  width: 100%;
  transition: border-color var(--duration-1) var(--ease);
}
.input:focus {
  outline: none;
  border-color: var(--ink);
}
.input::placeholder { color: var(--ink-3); }

/* --- Tag / pill --- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-2);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--ink-2);
}
.tag-accent {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-2);
}

/* --- Card (editorial) --- */
.card {
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-0);
  padding: var(--space-6);
  transition: background var(--duration-2) var(--ease);
}
.card:hover { background: var(--paper-3); }

/* --- Hairline rule --- */
.rule { height: 1px; background: var(--hairline); border: 0; margin: 0; }

/* --- Container --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--content-pad);
  padding-right: var(--content-pad);
}

/* --- Section --- */
.section {
  padding-top: var(--space-9);
  padding-bottom: var(--space-9);
}
.section-lg { padding-top: var(--space-11); padding-bottom: var(--space-11); }
