/* ───────────── Brand token system (ported from the portal) ─────────────
   Shared design tokens + utilities for the CapeFear.ai marketing site.
   This is a faithful copy of the homepage's inline <style> so the SEO
   landing pages are cut from the same cloth. The homepage keeps its own
   inline <style>; new pages link this file via <link rel="stylesheet">. */
:root, .theme-light {
  --paper:        #fbfaf6;
  --paper-2:      #f4f1ea;
  --paper-3:      #ece9df;
  --ink:          #1a1b1f;
  --ink-2:        #4a4c52;
  --ink-3:        #76787e;
  --ink-4:        #a8aab0;
  --rule:         #e6e3db;
  --rule-strong:  #d4d2cc;
  --brand:        #2f4858;
  --brand-deep:   #1a2a35;
  --brand-fg:     #fbfaf6;
  --good:         #3e5a48;  --good-soft: #d8eadc;
  --warn:         #7a4d2e;  --warn-soft: #f4dccb;
  --info:         #3a5468;  --info-soft: #d4e2ec;

  /* Text colors used on the brand-colored "ownership" band — defined
     per theme so the band stays legible on either ground. */
  --on-brand:        rgba(251, 250, 246, 1);
  --on-brand-soft:   rgba(251, 250, 246, 0.85);
  --on-brand-muted:  rgba(251, 250, 246, 0.55);
  --brand-italic:    #cbd9e3;
  --brand-chip-bd:   rgba(251, 250, 246, 0.25);
  --brand-chip-dot:  #cbd9e3;

  /* Footer uses its own pair so we can keep it dark-on-light even when
     the page is in graphite mode. */
  --footer-bg:       #1a1b1f;
  --footer-fg:       #fbfaf6;
  --footer-fg-muted: rgba(251, 250, 246, 0.65);
  --footer-fg-dim:   rgba(251, 250, 246, 0.45);
}
.theme-graphite {
  --paper:        #161614;
  --paper-2:      #1f1f1d;
  --paper-3:      #2a2a26;
  --ink:          #ecebe4;
  --ink-2:        #c0bdb4;
  --ink-3:        #908d85;
  --ink-4:        #66645e;
  --rule:         #2e2e2a;
  --rule-strong:  #3e3e38;
  --brand:        #88a8b8;       /* lifted for dark ground */
  --brand-deep:   #2a3a45;
  --brand-fg:     #14171a;
  --good:         #9bc1a5;  --good-soft: #1f2e23;
  --warn:         #d4a16a;  --warn-soft: #2e2218;
  --info:         #9ab6c4;  --info-soft: #1c2932;

  /* Brand-bg band in graphite uses a lighter blue ground, so on-brand
     text needs to flip to near-black. */
  --on-brand:        rgba(20, 23, 26, 1);
  --on-brand-soft:   rgba(20, 23, 26, 0.88);
  --on-brand-muted:  rgba(20, 23, 26, 0.6);
  --brand-italic:    #2a3a45;
  --brand-chip-bd:   rgba(20, 23, 26, 0.28);
  --brand-chip-dot:  #2a3a45;

  --footer-bg:       #0c0c0a;
  --footer-fg:       #c0bdb4;
  --footer-fg-muted: rgba(192, 189, 180, 0.7);
  --footer-fg-dim:   rgba(192, 189, 180, 0.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: hidden;
}
.ms-mono  { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.ms-serif { font-family: 'Source Serif 4', Georgia, serif; }

/* Anchored hover for inline links */
a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* ───────────── Responsive ─────────────
   Hero collapses to single column under 1024px.
   Multi-column section grids collapse to single column under 768px.
   Nav hides secondary links under 768px.
*/
.ms-hero { display: grid; grid-template-columns: 1fr 560px; gap: 48px; align-items: start; }
.ms-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.ms-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ms-grid-3-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding-top: 12px; }
.ms-grid-compare { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 18px; }
.ms-grid-own { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.ms-tech-row { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.ms-nav-links { display: flex; gap: 22px; align-items: center; }
.ms-section-inner { max-width: 1180px; margin: 0 auto; padding: 0 56px; }

@media (max-width: 1024px) {
  .ms-hero { grid-template-columns: 1fr; gap: 32px; }
  .ms-grid-compare { grid-template-columns: 1fr; }
  .ms-grid-own { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 768px) {
  .ms-section-inner { padding: 0 24px; }
  .ms-grid-3 { grid-template-columns: 1fr; }
  .ms-grid-4 { grid-template-columns: 1fr 1fr; }
  .ms-grid-3-foot { grid-template-columns: 1fr; gap: 18px; }
  .ms-tech-row { flex-direction: column; align-items: flex-start; gap: 18px; }
  .ms-nav-links a:not(.ms-nav-cta) { display: none; }
  /* The Industries dropdown is a <div>/<span>, so the rule above doesn't
     catch it — hide it (and FAQ) on phones the same way, matching the
     existing pattern. Full navigation lives in the footer on mobile. */
  .ms-nav-dd { display: none; }
  .ms-h1 { font-size: 44px !important; }
  .ms-h2 { font-size: 30px !important; }
  .ms-section-pad-lg { padding-top: 48px !important; padding-bottom: 48px !important; }
}
@media (max-width: 480px) {
  .ms-grid-4 { grid-template-columns: 1fr; }
  .ms-h1 { font-size: 36px !important; }
}

/* Animation responsiveness — the hero loop and bot/agent diagram have
   hard-coded widths that need explicit mobile rules to behave. */
@media (max-width: 768px) {
  /* Hero loop container: drop the side padding on phones */
  .ms-hero-anim-frame { padding: 48px 16px 24px !important; }

  /* Hero loop cards and pills can shrink below their desktop min-width */
  .ms-hero-card, .ms-hero-pill { min-width: 0 !important; width: 100% !important; }

  /* Hero loop layout: stack the trigger, tools, and done vertically;
     connectors become short vertical lines */
  .ms-hero-row { flex-direction: column !important; align-items: stretch !important; gap: 8px !important; }
  .ms-hero-conn { height: 16px !important; width: 1px !important; flex: 0 0 16px !important; align-self: center; min-width: 0 !important; }

  /* Bot/agent diagram: stack the label above the timeline rather than
     reserving a 160px left column that eats the screen */
  .ms-track { padding-left: 0 !important; }
  .ms-track-label { position: static !important; margin-bottom: 12px !important; }
  .ms-track-timeline { flex-wrap: wrap !important; row-gap: 8px !important; padding-top: 4px !important; }
  .ms-track-line { display: none !important; }
  .ms-track-step { margin-right: 0 !important; margin-bottom: 0 !important; }

  /* Bot/agent outer frame: drop side padding on phones */
  .ms-anim-frame { padding: 20px 14px !important; }
}

/* ───────────── SEO landing-page helpers ─────────────
   These classes are ONLY used by the static SEO landing pages (legal,
   insurance, property-management, faq, blog). They reuse the brand tokens
   above and the same section rhythm as the homepage, expressed as plain
   CSS so the pages need no inline styles and no React runtime. */

.ms-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 18px;
}
.ms-h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 56px;
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin: 0 0 22px;
  color: var(--ink);
}
.ms-h1 em { font-style: italic; color: var(--brand); }
.ms-h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 0 0 16px;
  color: var(--ink);
}
.ms-h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 10px;
  color: var(--ink);
}
.ms-lede {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 640px;
  margin: 0 0 30px;
}
.ms-prose { font-size: 16px; line-height: 1.65; color: var(--ink-2); max-width: 720px; }
.ms-prose p { margin: 0 0 18px; }
.ms-prose strong { color: var(--ink); font-weight: 600; }
.ms-prose a { color: var(--brand); font-weight: 500; }
.ms-prose ul, .ms-prose ol { margin: 0 0 22px; padding-left: 22px; }
.ms-prose li { margin: 0 0 10px; }

/* Buttons — static equivalents of the homepage's <Btn> component */
.ms-btn {
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  padding: 13px 22px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  text-decoration: none;
}
.ms-btn:hover { text-decoration: none; }
.ms-btn-primary { background: var(--brand); color: var(--brand-fg); }
.ms-btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--rule-strong); }
.ms-btn-sm { font-size: 12px; padding: 8px 13px; }

/* Header / nav — static equivalent of the homepage <Nav> */
.ms-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.ms-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ms-brand { display: flex; align-items: center; gap: 15px; color: inherit; }
.ms-brand:hover { text-decoration: none; }
.ms-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-fg);
  flex: none;
}
.ms-brand-name { font-size: 22.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.ms-brand-name span { color: var(--ink-3); }
.ms-nav-links a { font-size: 13px; color: var(--ink-2); cursor: pointer; }

/* Nav dropdown — pure CSS hover/focus-within, no JS. Collapses the three
   vertical pages into one "Industries" item so the bar can't overflow. */
.ms-nav-dd { position: relative; display: inline-flex; align-items: center; }
.ms-nav-dd-trigger {
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  white-space: nowrap;
}
.ms-nav-dd-trigger:hover,
.ms-nav-dd:hover .ms-nav-dd-trigger,
.ms-nav-dd:focus-within .ms-nav-dd-trigger { color: var(--ink); }
.ms-nav-dd-trigger:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 3px; }
.ms-nav-dd-caret { font-size: 9px; line-height: 1; color: var(--ink-3); transition: transform 160ms ease, color 160ms ease; }
.ms-nav-dd:hover .ms-nav-dd-caret,
.ms-nav-dd:focus-within .ms-nav-dd-caret { transform: rotate(180deg); color: var(--ink-2); }
.ms-nav-dd-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-top: 10px;
  min-width: 176px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 14px 36px -22px rgba(0,0,0,0.55), 0 2px 8px -4px rgba(0,0,0,0.3);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 0s linear 150ms;
  z-index: 30;
}
/* Hover-gap bridge so the menu doesn't vanish when the cursor crosses the
   margin between the trigger and the menu. */
.ms-nav-dd-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}
.ms-nav-dd:hover .ms-nav-dd-menu,
.ms-nav-dd:focus-within .ms-nav-dd-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity 150ms ease, transform 150ms ease, visibility 0s;
}
.ms-nav-dd-menu a {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  padding: 8px 12px;
  border-radius: 5px;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}
.ms-nav-dd-menu a:hover { text-decoration: none; color: var(--ink); background: var(--paper-3); }

/* Sections */
.ms-section { background: transparent; }
.ms-section-paper-2 { background: var(--paper-2); }
.ms-section-brand { background: var(--brand); }
.ms-pad-lg { padding-top: 72px; padding-bottom: 72px; }
.ms-pad-md { padding-top: 56px; padding-bottom: 56px; }

/* Cards — capability / use-case grid */
.ms-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 22px 24px;
}
.ms-section-paper-2 .ms-card { background: var(--paper); }
.ms-card .ms-tag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.ms-card .ms-tag .ms-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.ms-card p { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin: 0; }
.ms-card h3 { font-family: 'Source Serif 4', Georgia, serif; font-size: 19px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 8px; color: var(--ink); }

/* FAQ accordion-free list */
.ms-faq { max-width: 820px; }
.ms-faq-item { border-top: 1px solid var(--rule); padding: 26px 0; }
.ms-faq-item:first-of-type { border-top: none; }
.ms-faq-item h3 { font-family: 'Source Serif 4', Georgia, serif; font-size: 21px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 12px; color: var(--ink); }
.ms-faq-item p { font-size: 15px; line-height: 1.65; color: var(--ink-2); margin: 0 0 12px; max-width: 760px; }
.ms-faq-item p:last-child { margin-bottom: 0; }

/* Product screenshot frame */
.ms-shot {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px;
  max-width: 980px;
  box-shadow: 0 18px 48px -28px rgba(0,0,0,0.45);
}
.ms-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--rule-strong);
}
.ms-shot figcaption {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin: 14px 4px 2px;
}
figure.ms-shot { margin: 0; }

/* Blog index list */
.ms-post-list { max-width: 820px; display: grid; gap: 4px; }
.ms-post {
  border-top: 1px solid var(--rule);
  padding: 26px 0;
  display: block;
  color: inherit;
}
.ms-post:hover { text-decoration: none; }
.ms-post:first-of-type { border-top: none; }
.ms-post .ms-post-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 10px;
}
.ms-post h3 { font-family: 'Source Serif 4', Georgia, serif; font-size: 24px; font-weight: 500; letter-spacing: -0.015em; margin: 0 0 8px; color: var(--ink); }
.ms-post:hover h3 { color: var(--brand); }
.ms-post p { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin: 0; max-width: 720px; }

/* Article body */
.ms-article { max-width: 720px; }
.ms-article .ms-article-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 18px;
}
.ms-article h2 { font-family: 'Source Serif 4', Georgia, serif; font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; margin: 36px 0 14px; color: var(--ink); }
.ms-article h3 { font-family: 'Source Serif 4', Georgia, serif; font-size: 20px; font-weight: 500; margin: 28px 0 10px; color: var(--ink); }
.ms-article p { font-size: 16px; line-height: 1.7; color: var(--ink-2); margin: 0 0 18px; }
.ms-article strong { color: var(--ink); font-weight: 600; }
.ms-article a { color: var(--brand); font-weight: 500; }
.ms-article ul, .ms-article ol { margin: 0 0 22px; padding-left: 22px; }
.ms-article li { font-size: 16px; line-height: 1.7; color: var(--ink-2); margin: 0 0 10px; }

/* Cross-link chips row */
.ms-links-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ms-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  font-size: 13px;
  color: var(--ink-2);
  background: var(--paper);
}
.ms-link-chip:hover { text-decoration: none; border-color: var(--brand); color: var(--ink); }
.ms-link-chip .ms-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

/* Brand band (ownership / CTA) */
.ms-section-brand .ms-eyebrow { color: var(--on-brand-muted); }
.ms-section-brand h2 { color: var(--on-brand); }
.ms-section-brand p { color: var(--on-brand-soft); }

/* Footer — static equivalent of the homepage footer + a links block */
.ms-footer { background: var(--footer-bg); color: var(--footer-fg); }
.ms-footer-inner { max-width: 1180px; margin: 0 auto; padding: 0 56px; }
.ms-footer-links {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 44px 0 32px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ms-footer-links h4 {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--footer-fg-dim);
  margin: 0 0 14px;
}
.ms-footer-links a { display: block; font-size: 13px; color: var(--footer-fg-muted); margin-bottom: 9px; }
.ms-footer-links a:hover { color: var(--footer-fg); }
.ms-footer-blurb { font-size: 13px; line-height: 1.6; color: var(--footer-fg-muted); max-width: 320px; margin: 12px 0 0; }
.ms-footer-bar { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 22px 0; }
.ms-footer-bar .ms-mono { font-size: 11px; }
.ms-footer-bar .l { letter-spacing: 0.14em; text-transform: uppercase; color: var(--footer-fg-muted); }
.ms-footer-bar .r { letter-spacing: 0.04em; color: var(--footer-fg-dim); }

@media (max-width: 768px) {
  .ms-header-inner { padding: 14px 24px; }
  .ms-footer-inner { padding: 0 24px; }
  .ms-footer-links { grid-template-columns: 1fr 1fr; gap: 24px; }
  .ms-footer-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .ms-h1 { font-size: 40px; }
  .ms-h2 { font-size: 30px; }
}
@media (max-width: 480px) {
  .ms-footer-links { grid-template-columns: 1fr; }
  .ms-h1 { font-size: 34px; }
}
