/* Feedwyre website — shared design tokens, reset, typography base, header/nav,
   buttons, and the simple footer used by every page except the home page
   (which has its own richer multi-column footer in its own <style> block).
   Change a color, font, header, or footer link style here ONCE — every page
   that links this file picks it up. Page-specific layout (hero, pricing
   cards, docs sidebar, diagrams, legal-page prose sizing, …) stays in each
   page's own <style> block below its <link> to this file, and can freely
   override anything here since it loads later in the cascade. */

:root {
  --bg: #eef4f2;
  --surface: #ffffff;
  --surface-alt: #eef4f2;
  --ink: #1f1c18;
  --ink-soft: #4f493f;
  --muted: #837a6a;
  --border: #ded8c3;
  /* A translucent brand-tinted wash - unlike --brand-tint (solid), this is meant to sit on top
     of any surface (including the alternating white/surface-alt section backgrounds) without
     clashing, e.g. a soft highlight box or an icon tile background. */
  --box: #1f9d5c1f;
  --brand: #1f9d5c;
  --brand-ink: #146b3e;
  --brand-tint: #e3f5f2;
  --accent: #ef5a3a;
  --accent-soft: #fde2d9;
  --success: #12a678;
  --success-soft: #d9f5ea;
  --warn: #a3591a;
  --warn-soft: #fbf0d9;
  --danger: #c0392b;
  --danger-soft: #fbe4e1;
  /* Deliberately NOT redefined in the dark-mode blocks below - a terminal-style code block reads
     the same dark-bg/light-text in both themes, same as most code-focused sites. --brand-ink
     isn't safe for this: it's a text-ink token that intentionally flips to a LIGHT color in dark
     mode, which is exactly why code panels went unreadable there before this token existed. */
  --code-bg: #12302c;
  --code-text: #e4f3f0;
  /* Also deliberately theme-invariant, for the same reason as --code-bg above: a few elements
     (the pricing CTA band, the distributor callout card) are a solid/gradient brand-color surface
     with hardcoded white text - safe in light mode where --brand/--accent are vivid and dark
     enough, but --brand/--accent turn pale in dark mode (by design, so they stay legible as
     foreground text elsewhere), which left white text on a near-pastel background. */
  --brand-vivid: #0f6b64;
  --accent-vivid: #ef5a3a;
  /* --accent itself is NOT dark enough for white text even in light mode (#ef5a3a only clears
     ~3.4:1 against white, short of the 4.5:1 AA minimum for normal text) - and in dark mode it's
     a light peach, which needs dark text anyway. So unlike --brand-ink/--ink, this one text color
     already works against --accent in both themes and doesn't need to flip - kept as one
     theme-invariant dark value rather than re-declared per theme. */
  --accent-ink: #2a0f08;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20,16,10,.05), 0 8px 24px -12px rgba(15,107,100,.18);
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14120d;
    --surface: #1d1a14;
    --surface-alt: #24211a;
    --ink: #f5f2ea;
    --ink-soft: #c9c2b2;
    --muted: #8f8672;
    --border: #362f24;
    --box: #4fb8ae26;
    --brand: #4fb8ae;
    --brand-ink: #b7ece4;
    --brand-tint: #0f2e2a;
    --accent: #ff8a68;
    --accent-soft: #3d1a10;
    --success: #4fd9a8;
    --success-soft: #113828;
    --warn: #e0b45c;
    --warn-soft: #3a2b10;
    --danger: #ff8a80;
    --danger-soft: #3a1414;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 28px -14px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --bg: #14120d;
  --surface: #1d1a14;
  --surface-alt: #24211a;
  --ink: #f5f2ea;
  --ink-soft: #c9c2b2;
  --muted: #8f8672;
  --border: #362f24;
  --box: #4fb8ae26;
  --brand: #4fb8ae;
  --brand-ink: #b7ece4;
  --brand-tint: #0f2e2a;
  --accent: #ff8a68;
  --accent-soft: #3d1a10;
  --success: #4fd9a8;
  --success-soft: #113828;
  --warn: #e0b45c;
  --warn-soft: #3a2b10;
  --danger: #ff8a80;
  --danger-soft: #3a1414;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 28px -14px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); text-wrap: balance; }
p { margin: 0 0 1em; color: var(--ink-soft); max-width: 66ch; }
code, .mono { font-family: var(--font-mono); }
code { background: var(--surface-alt); padding: .15em .4em; border-radius: 5px; font-size: .88em; }
.tabular { font-variant-numeric: tabular-nums; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 1.4em; height: 1px; background: var(--accent); }

/* header - a fixed dark surface (same #0e1a15 used for the architecture diagram's hub and the
   compare table's Feedwyre column header), deliberately theme-invariant rather than following
   --surface/--bg like the rest of the page - so it always reads as the app's own "chrome" rather
   than page content, in both light and dark mode. Every color below is hardcoded to match rather
   than pulled from the light/dark tokens, since those tokens intentionally flip per theme and
   this surface no longer does. Solid/opaque so it's an exact match with footer.site below. */
header.site {
  position: sticky; top: 0; z-index: 40;
  background: #0e1a15;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: .9rem 0; }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 600; font-size: 1.50rem; text-decoration: none; color: #fff; }
.brand .mark { width: 34px; height: 34px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 1.8rem; }
.nav-links a { text-decoration: none; color: rgba(255,255,255,.82); font-size: .93rem; font-weight: 600; }
.nav-links a:hover, .nav-links a.current { color: var(--accent-vivid); }
.nav-cta { display: flex; align-items: center; gap: .9rem; }
.nav-cta .login { text-decoration: none; font-size: .93rem; font-weight: 600; color: rgba(255,255,255,.82); }

/* theme toggle - a 3-way switch (light / dark / system), state kept in the fw_theme cookie by
   partials/header.html's own script; see partials/theme-init.html for the FOUC-avoiding read.
   Colors hardcoded for the dark header surface above rather than the shared light/dark tokens. */
.theme-toggle { display: inline-flex; align-items: center; gap: 2px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 3px; margin-left: 1.2rem; flex: none; }
.theme-btn {
  display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 999px; border: none; background: transparent; color: rgba(255,255,255,.55); cursor: pointer; padding: 0;
}
.theme-btn svg { width: 15px; height: 15px; }
.theme-btn:hover { color: rgba(255,255,255,.85); }
.theme-btn.active { background: rgba(255,255,255,.14); color: var(--accent-vivid); box-shadow: none; }
.theme-btn.active:hover { color: var(--accent-vivid); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-body); font-weight: 700; font-size: .93rem;
  padding: .8rem 1.4rem; border-radius: 14px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn svg.arrow { width: 16px; height: 16px; flex: none; }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-accent:hover { box-shadow: 0 14px 28px -10px color-mix(in srgb, var(--accent) 65%, transparent); }
.btn-ghost { background: var(--surface); border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-ghost svg.prefix { width: 16px; height: 16px; flex: none; color: var(--brand); }
.btn-block { width: 100%; }

/* footer — same markup (see partials/footer.html) on every page. Same fixed dark surface as
   header.site above (deliberately theme-invariant - see that comment), so the two match exactly. */
footer.site { background: #0e1a15; border-top: 0px solid transparent; padding: 3.5rem 0 2.5rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 1.75rem; margin-bottom: 2.5rem; }
.footer-grid p { color: rgba(255,255,255,.6); }
.footer-grid h4 { font-family: var(--font-body); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: rgba(255,255,255,.5); margin: 0 0 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.footer-grid a { text-decoration: none; color: rgba(255,255,255,.82); font-size: .9rem; font-weight: 500; }
.footer-grid a:hover { color: var(--accent-vivid); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .82rem; color: rgba(255,255,255,.5); flex-wrap: wrap; gap: 1rem; }

/* Mobile nav toggle - hidden above 860px; see the media query below for the open/closed panel
   behavior, and partials/header.html for the click/Escape/outside-click handling. Colors
   hardcoded for the dark header surface above rather than the shared light/dark tokens. */
.nav-toggle {
  display: none; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
  border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; padding: 0;
}
.nav-toggle svg { width: 19px; height: 19px; }
.nav-toggle .i-close { display: none; }
header.site.nav-open .nav-toggle .i-menu { display: none; }
header.site.nav-open .nav-toggle .i-close { display: block; }

@media (max-width: 860px) {
  .nav { flex-wrap: wrap; }
  .nav-toggle { display: flex; }
  .nav-links, .nav-cta { display: none; }
  header.site.nav-open .nav-links,
  header.site.nav-open .nav-cta {
    display: flex; flex-direction: column; align-items: stretch; gap: 0; width: 100%;
  }
  header.site.nav-open .nav-links { order: 5; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid rgba(255,255,255,.1); }
  header.site.nav-open .nav-links a { padding: .7rem .1rem; border-bottom: 1px solid rgba(255,255,255,.1); }
  header.site.nav-open .nav-links a:last-child { border-bottom: none; }
  header.site.nav-open .nav-cta { order: 6; margin-top: .75rem; gap: .6rem; }
  header.site.nav-open .nav-cta .login { padding: .5rem .1rem; }
  header.site.nav-open .nav-cta .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
}
