/* ==========================================================================
   Goodfire LLC — Design System
   Brand: Agile + AI consulting. Palette derived from the Goodfire flame logo
   (ember orange + gold), anchored by a professional charcoal "ink".
   Single stylesheet, no build step. Edit tokens in :root to re-theme.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------- */
:root {
  /* Brand */
  --ember: #f2751c;        /* primary orange (logo "fire") */
  --ember-deep: #e0531a;   /* deeper flame */
  --gold: #fbb040;         /* logo highlight */
  --flame: linear-gradient(135deg, #fbb040 0%, #f2751c 52%, #e0531a 100%);
  --flame-soft: linear-gradient(135deg, rgba(251,176,64,.16), rgba(224,83,26,.16));

  /* Neutrals */
  --ink: #14161c;          /* near-black anchor */
  --ink-2: #1d212b;        /* raised dark surface */
  --ink-3: #2a2f3b;        /* dark borders */
  --slate: #5b6472;        /* muted body text on light */
  --slate-2: #828b99;      /* lighter muted */
  --line: #e7e9ee;         /* light borders */
  --mist: #f6f7f9;         /* light section bg */
  --paper: #ffffff;
  --ink-text-soft: #aeb6c4;/* muted text on dark */
  --ink-text: #e9ecf2;     /* body text on dark */

  /* Typography */
  --font-head: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Scale & rhythm */
  --container: 1140px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20,22,28,.06), 0 2px 8px rgba(20,22,28,.05);
  --shadow: 0 8px 30px rgba(20,22,28,.10);
  --shadow-lg: 0 24px 60px rgba(20,22,28,.16);
  --ring: 0 0 0 3px rgba(242,117,28,.35);
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body {
  font-family: var(--font-body);
  color: #232734;
  background: var(--paper);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--ember-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.2em; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ---- Typography ---------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.12; color: var(--ink); letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.3rem; letter-spacing: -.01em; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
strong { color: #11141b; font-weight: 600; }

.eyebrow {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ember-deep);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--flame); border-radius: 2px; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--slate); line-height: 1.6; }
.text-balance { text-wrap: balance; }

/* ---- Layout -------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.container-narrow { max-width: 760px; }
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--mist { background: var(--mist); }
.section--ink { background: var(--ink); color: var(--ink-text); }
.section--ink h1, .section--ink h2, .section--ink h3, .section--ink h4 { color: #fff; }
.section--ink .lead { color: var(--ink-text-soft); }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.measure { max-width: 65ch; }
.stack > * + * { margin-top: 1rem; }

.grid { display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2-wide { grid-template-columns: 1.05fr .95fr; align-items: center; gap: 3rem; }
}

/* ---- Header / nav -------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s var(--ease), background .2s;
}
.site-header.is-scrolled { box-shadow: 0 4px 24px rgba(20,22,28,.08); background: rgba(255,255,255,.92); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.brand img { height: 30px; width: auto; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-block; padding: .5rem .7rem; border-radius: 8px;
  color: #3b4250; font-weight: 500; font-size: .95rem; transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-links a:hover { background: var(--mist); color: var(--ink); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--ember-deep); }
.nav-cta { margin-left: .4rem; }
.nav-toggle { display: none; }

/* Mobile nav */
.hamburger {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; align-items: center; justify-content: center; flex-direction: column; gap: 4px;
}
.hamburger span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 940px) {
  .hamburger { display: inline-flex; }
  .nav-links {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: .15rem;
    background: #fff; border-bottom: 1px solid var(--line); padding: .8rem clamp(1.1rem,4vw,2rem) 1.3rem;
    box-shadow: var(--shadow); transform: translateY(-130%); transition: transform .3s var(--ease); max-height: calc(100vh - 72px); overflow:auto;
  }
  .nav[data-open="true"] .nav-links { transform: translateY(0); }
  .nav-links a { padding: .8rem .6rem; font-size: 1.05rem; }
  .nav-cta { margin: .5rem 0 0; }
  .nav-cta .btn { width: 100%; }
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--font-head); font-weight: 600; font-size: .98rem; line-height: 1;
  padding: .85rem 1.4rem; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s, color .2s; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--flame); color: #fff; box-shadow: 0 6px 20px rgba(224,83,26,.32); }
.btn-primary:hover { box-shadow: 0 10px 28px rgba(224,83,26,.42); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ember); color: var(--ember-deep); background: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #fff; color: var(--ember-deep); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-outline-light:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.08); }
.btn-lg { padding: 1rem 1.7rem; font-size: 1.05rem; }
.btn-group { display: flex; flex-wrap: wrap; gap: .8rem; }
.arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow, .link-arrow:hover .arrow { transform: translateX(3px); }

.link-arrow { font-family: var(--font-head); font-weight: 600; color: var(--ember-deep); display: inline-flex; align-items: center; gap: .4rem; }
.link-arrow:hover { text-decoration: none; }

/* ---- Hero ---------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: var(--ink); color: var(--ink-text); isolation: isolate; }
.hero::before { /* ember glow */
  content: ""; position: absolute; z-index: -1; width: 70vw; height: 70vw; max-width: 720px; max-height: 720px;
  right: -12%; top: -28%; border-radius: 50%;
  background: radial-gradient(circle, rgba(242,117,28,.42), rgba(242,117,28,0) 62%);
  filter: blur(6px);
}
.hero::after { /* subtle grid texture */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 40%, transparent 78%);
}
.hero .container { padding-block: clamp(3.5rem, 9vw, 7rem); position: relative; }
.hero h1 { color: #fff; max-width: 16ch; }
.hero .lead { color: var(--ink-text-soft); max-width: 56ch; margin-top: 1.2rem; }
.hero .eyebrow { color: var(--gold); }
.hero .btn-group { margin-top: 2rem; }
.hero-grad { background: var(--flame); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* trust bar */
.trustbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; margin-top: 2.6rem; color: var(--ink-text-soft); font-size: .9rem; }
.trustbar .label { font-family: var(--font-head); letter-spacing: .12em; text-transform: uppercase; font-size: .72rem; color: var(--slate-2); }
.trustbar .orgs { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; font-weight: 600; color: #cfd5e0; font-family: var(--font-head); letter-spacing: .02em; }

/* ---- Cards --------------------------------------------------------------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem;
  box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .25s var(--ease), border-color .2s;
  height: 100%;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #dfe3ea; }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--slate); margin-bottom: 0; font-size: 1rem; }
.card .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 1.1rem; background: var(--flame-soft); color: var(--ember-deep); }
.card .icon svg { width: 24px; height: 24px; }
.card-link { display: block; }
.card-link:hover { text-decoration: none; }
.card--ghost { background: var(--ink-2); border-color: var(--ink-3); }
.card--ghost h3 { color: #fff; } .card--ghost p { color: var(--ink-text-soft); }

.numbered { counter-reset: step; }
.numbered .card { position: relative; }
.step-num { font-family: var(--font-head); font-weight: 700; font-size: .95rem; color: var(--ember-deep); background: var(--flame-soft); width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 1rem; }

/* ---- Stats band ---------------------------------------------------------- */
.stats { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat { text-align: center; padding: 1.2rem; }
.stat .num { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.4rem, 5vw, 3.2rem); line-height: 1; background: var(--flame); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: -.03em; }
.stat .label { margin-top: .6rem; color: var(--slate); font-size: 1rem; }
.section--ink .stat .label { color: var(--ink-text-soft); }

/* ---- Feature / split ----------------------------------------------------- */
.feature-list { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: 1.1rem; }
.feature-list li { display: grid; grid-template-columns: 28px 1fr; gap: .85rem; align-items: start; }
.feature-list .tick { width: 26px; height: 26px; border-radius: 50%; background: var(--flame-soft); color: var(--ember-deep); display: grid; place-items: center; margin-top: .1rem; }
.feature-list .tick svg { width: 15px; height: 15px; }
.feature-list b { font-family: var(--font-head); color: var(--ink); }
.section--ink .feature-list b { color: #fff; }

.media-card { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); background: #fff; }
.panel { background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: var(--radius-lg); padding: clamp(1.6rem, 3vw, 2.4rem); color: var(--ink-text); }
.panel--flame { background: var(--flame); color: #fff; border: 0; }
.panel--flame h2, .panel--flame h3 { color: #fff; }

/* pill / badge */
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem; border-radius: 999px; font-size: .8rem; font-weight: 600; font-family: var(--font-head); background: var(--flame-soft); color: var(--ember-deep); letter-spacing: .02em; }
.badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
.badge { font-size: .82rem; font-weight: 500; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #3b4250; }
.section--ink .badge { background: var(--ink-2); border-color: var(--ink-3); color: var(--ink-text); }

/* ---- CTA band ------------------------------------------------------------ */
.cta-band { position: relative; overflow: hidden; background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: clamp(2.2rem, 5vw, 3.6rem); text-align: center; isolation: isolate; }
.cta-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 60% 120% at 50% -10%, rgba(242,117,28,.5), transparent 60%); }
.cta-band h2 { color: #fff; max-width: 22ch; margin-inline: auto; }
.cta-band p { color: var(--ink-text-soft); max-width: 50ch; margin: 1rem auto 0; }
.cta-band .btn-group { justify-content: center; margin-top: 1.8rem; }

/* ---- Forms --------------------------------------------------------------- */
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field label { font-family: var(--font-head); font-weight: 600; font-size: .92rem; color: var(--ink); }
.field .req { color: var(--ember-deep); }
.field input, .field textarea, .field select {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .8rem .9rem; width: 100%; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--ember); box-shadow: var(--ring); }
.field textarea { min-height: 150px; resize: vertical; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .85rem; color: var(--slate); }
.alert { padding: .9rem 1.1rem; border-radius: var(--radius-sm); font-size: .95rem; border: 1px solid; }
.alert-error { background: #fff5f3; border-color: #f6c8bb; color: #a23316; }
.alert-success { background: #f0faf2; border-color: #bce4c6; color: #1e7a3a; }

/* contact split */
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 880px) { .contact-grid { grid-template-columns: 1fr 1.2fr; gap: 3.5rem; } }
.contact-aside .contact-item { display: grid; grid-template-columns: 42px 1fr; gap: .9rem; align-items: start; margin-bottom: 1.4rem; }
.contact-aside .ci-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--flame-soft); color: var(--ember-deep); display: grid; place-items: center; }
.contact-aside .ci-icon svg { width: 20px; height: 20px; }
.contact-aside h4 { margin-bottom: .15rem; } .contact-aside a { color: var(--ink); } .contact-aside p { color: var(--slate); margin: 0; }

/* ---- Prose (manifesto / privacy) ---------------------------------------- */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 2.4rem; margin-bottom: .8rem; }
.prose h3 { margin-top: 1.8rem; margin-bottom: .5rem; }
.prose p, .prose li { color: #353b48; }
.prose ul, .prose ol { margin: 0 0 1.2rem; }
.prose li { margin-bottom: .5rem; }
.prose a { color: var(--ember-deep); text-decoration: underline; text-underline-offset: 2px; }

.values { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1rem; }
.values li { background: var(--mist); border: 1px solid var(--line); border-left: 4px solid var(--ember); border-radius: var(--radius-sm); padding: 1rem 1.2rem; font-size: 1.1rem; }
.values b { font-family: var(--font-head); color: var(--ink); }
.values .over { color: var(--slate-2); font-style: italic; font-weight: 400; }

.principles { counter-reset: p; list-style: none; padding: 0; display: grid; gap: .9rem; }
@media (min-width:720px){ .principles { grid-template-columns: 1fr 1fr; gap: .9rem 2rem; } }
.principles li { counter-increment: p; display: grid; grid-template-columns: 34px 1fr; gap: .8rem; align-items: start; }
.principles li::before { content: counter(p); font-family: var(--font-head); font-weight: 700; font-size: .9rem; color: var(--ember-deep); background: var(--flame-soft); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }

/* ---- Profile (leadership) ----------------------------------------------- */
.profile { display: grid; gap: 2rem; }
@media (min-width: 820px) { .profile { grid-template-columns: 300px 1fr; gap: 3rem; align-items: start; } }
.profile-card { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 2rem; text-align: center; position: sticky; top: 96px; overflow:hidden; isolation:isolate; }
.profile-card::before { content:""; position:absolute; inset:0; z-index:-1; background: radial-gradient(ellipse 90% 60% at 50% 0%, rgba(242,117,28,.4), transparent 65%); }
.profile-avatar { width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 1.1rem; background: var(--flame); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 2.4rem; color: #fff; box-shadow: 0 10px 30px rgba(224,83,26,.4); }
.profile-card h3 { color: #fff; margin-bottom: .2rem; } .profile-card .role { color: var(--gold); font-family: var(--font-head); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .8rem; }
.profile-card .role + p { color: var(--ink-text-soft); font-size: .92rem; margin-top: .8rem; }

/* ---- Footer -------------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--ink-text-soft); padding-block: clamp(2.8rem, 5vw, 4rem) 1.5rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; } }
.site-footer .brand img { height: 28px; }
.site-footer h5 { font-family: var(--font-head); color: #fff; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1rem; font-weight: 600; }
.footer-nav { list-style: none; padding: 0; display: grid; gap: .55rem; }
.footer-nav a { color: var(--ink-text-soft); font-size: .95rem; }
.footer-nav a:hover { color: #fff; text-decoration: none; }
.footer-about { max-width: 38ch; font-size: .95rem; margin-top: 1rem; }
.footer-bottom { border-top: 1px solid var(--ink-3); margin-top: 2.5rem; padding-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--slate-2); }
.footer-bottom a { color: var(--slate-2); } .footer-bottom a:hover { color: #fff; text-decoration: none; }

/* ---- Page header (interior pages) --------------------------------------- */
.page-head { background: var(--ink); color: var(--ink-text); position: relative; overflow: hidden; isolation: isolate; }
.page-head::before { content:""; position:absolute; z-index:-1; right:-10%; top:-50%; width:60vw; height:120%; max-width:680px; background: radial-gradient(circle at 70% 40%, rgba(242,117,28,.34), transparent 60%); }
.page-head .container { padding-block: clamp(3rem, 7vw, 5rem); }
.page-head h1 { color: #fff; max-width: 20ch; }
.page-head .lead { color: var(--ink-text-soft); margin-top: 1rem; max-width: 60ch; }
.breadcrumb { font-size: .85rem; color: var(--slate-2); margin-bottom: 1rem; }
.breadcrumb a { color: var(--ink-text-soft); } .breadcrumb a:hover { color:#fff; }

/* ---- Utilities ----------------------------------------------------------- */
.skip-link { position: absolute; left: 50%; transform: translateX(-50%) translateY(-200%); top: 8px; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 8px; z-index: 100; transition: transform .2s; }
.skip-link:focus { transform: translateX(-50%) translateY(0); text-decoration: none; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-2 { margin-top: 2rem; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: .5rem; }
