// Get Closure — design system tokens.
// Single source of truth for palette, typography, spacing, and the headline copy
// set. Load this file FIRST, before any component files that consume window.GC_*.

// ── Config ─────────────────────────────────────────────────────────────────
// Loops API key lives in the LOOPS_API_KEY Vercel environment variable —
// NOT here. It's used server-side by api/subscribe.js to avoid CORS issues.
window.GC_CONFIG = {
  posthog: {
    apiKey: 'phc_rh2cgVzw7YBejs4qccj2EGUkeBBw2D5vk5XXhcSqMDYx',
    host: 'https://eu.i.posthog.com',
  },
};

window.GC_P = {
  // ── Surfaces ──────────────────────────────────────────────────────────
  bg:        '#fbe8d3',                                                 // base peach
  bgGrad:    'linear-gradient(180deg, #fbe8d3 0%, #fcd5b2 100%)',       // hero gradient
  paper:     '#fef5e8',                                                 // cards, form, raised
  paperDeep: '#f5d6ac',                                                 // founder block, deeper peach

  // ── Ink ───────────────────────────────────────────────────────────────
  ink:       '#241710',  // headlines, body
  soft:      '#5a4332',  // body when on warm bg
  muted:     '#937259',  // tertiary, metadata
  rule:      '#ecc99c',  // standard hairline
  ruleSoft:  '#f3d9b7',  // softer hairline for cards on cards

  // ── Accents (use sparingly) ───────────────────────────────────────────
  accent:    '#c2532f',  // terracotta — single POP, italic emphasis, primary CTA
  accentSoft:'#f4caa5',  // accent-tinted bg
  butter:    '#f0c25a',  // butter yellow — highlighter swipes, marks ONLY
  butterSoft:'#f8e2a8',  // softer highlighter (default)
};

window.GC_FONTS = {
  serif: '"Instrument Serif", "DM Serif Display", Georgia, serif',  // headlines + display
  sans:  '"Geist", ui-sans-serif, system-ui, sans-serif',           // body + UI
  mono:  '"Geist Mono", ui-monospace, monospace',                   // rarely — code-ish details only
};

// ── Type scale ─────────────────────────────────────────────────────────
// Use as inline styles. Headlines are clamp()ed for responsive scaling.
window.GC_TYPE = {
  display:   { fontFamily: window.GC_FONTS.serif, fontSize: 'clamp(48px, 8vw, 96px)',   lineHeight: 1.02, letterSpacing: '-0.022em', fontWeight: 400 },
  h1:        { fontFamily: window.GC_FONTS.serif, fontSize: 'clamp(34px, 4.4vw, 52px)', lineHeight: 1.06, letterSpacing: '-0.022em', fontWeight: 400 },
  h2:        { fontFamily: window.GC_FONTS.serif, fontSize: 'clamp(26px, 3vw, 34px)',   lineHeight: 1.14, letterSpacing: '-0.016em', fontWeight: 400 },
  h3:        { fontFamily: window.GC_FONTS.serif, fontSize: 26, lineHeight: 1.12, letterSpacing: '-0.014em', fontWeight: 400 },
  lede:      { fontFamily: window.GC_FONTS.serif, fontSize: 'clamp(20px, 2.4vw, 26px)', lineHeight: 1.45, letterSpacing: '-0.008em', fontWeight: 400 },
  pullquote: { fontFamily: window.GC_FONTS.serif, fontSize: 'clamp(22px, 2.8vw, 30px)', lineHeight: 1.36, letterSpacing: '-0.014em', fontWeight: 400, fontStyle: 'italic' },
  body:      { fontFamily: window.GC_FONTS.sans,  fontSize: 16,   lineHeight: 1.6 },
  bodySmall: { fontFamily: window.GC_FONTS.sans,  fontSize: 14.5, lineHeight: 1.6 },
  caption:   { fontFamily: window.GC_FONTS.sans,  fontSize: 13,   lineHeight: 1.5 },
  eyebrow:   { fontFamily: window.GC_FONTS.sans,  fontSize: 12,   lineHeight: 1.4, letterSpacing: '0.1em', textTransform: 'uppercase', fontWeight: 500 },
};

// ── Spacing / radii / shadows ──────────────────────────────────────────
window.GC_SPACE = {
  pageMaxWidth: 1100,
  pagePadX: 32,
  sectionGap: 96,
  cardPad: 26,
  founderPad: 40,
};

window.GC_RADIUS = {
  pill:      999,
  button:    11,
  formRow:   16,
  card:      22,
  cardLarge: 28,
};

window.GC_SHADOW = {
  // Always pair with a `0 1px 0 rgba(255,255,255,.6) inset` for paper highlight
  paperInset:  '0 1px 0 rgba(255,255,255,.6) inset',
  cardSoft:    '0 1px 0 rgba(255,255,255,.6) inset, 0 12px 28px -22px rgba(120,60,20,.25)',
  founderSoft: '0 1px 0 rgba(255,255,255,.5) inset, 0 18px 36px -28px rgba(120,60,20,.3)',
};

// ── Headline copy variants (testable) ─────────────────────────────────
window.GC_HEADLINES = {
  nobody:  { a: 'The thing nobody tells you', b: 'when your startup',       c: "doesn't make it.", mark: 'circle' },
  proper:  { a: 'Close your UK startup',      b: '',                        c: 'properly.',        mark: 'circle' },
  finally: { a: 'Finally — a clear guide',    b: 'to shutting down your',   c: 'UK startup.',      mark: 'circle' },
};

// ── Voice rules (copywriting) ──────────────────────────────────────────
// Not consumed by code — documented here so the system is self-describing.
window.GC_VOICE = {
  do: [
    'Short sentences. British, dry, peer-to-peer.',
    'Write as a founder, not a service. Say "I" — never "we".',
    'Be specific: real numbers (£3,500, £350/hr), real acronyms (DS01, MVL, CVL, EMI).',
    'Acknowledge the emotional weight without dwelling on it.',
    'Italic serif for human/emotional emphasis. Sans for clarity.',
  ],
  dont: [
    'No "journey", "embark", "navigate", "empower", "unlock".',
    'No SaaS hype. No exclamation marks. No emoji beyond the rare ✦/◐/☉ glyph.',
    'No corporate first-person plural ("we", "our team", "our mission").',
    'No fake testimonials, no logo strips, no comparison tables.',
    'No drama, no failure imagery, no metaphors about death or graves.',
  ],
};
