/* ============================================================
   CrewHelix — marketing site design system
   Pure CSS. No framework, no build step. Pairs with site.js.
   Load order in <head>:
     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
     <link rel="stylesheet" href="assets/brand.css">
   ============================================================ */

:root {
  /* Brand — blues */
  --ch-ink-navy:     #1e2a6e;  /* headlines, primary text */
  --ch-deep-navy:    #2a2f73;  /* hero floor, table headers */
  --ch-royal:        #3d4cc4;  /* primary accent, links, popular tier */
  --ch-eyebrow:      #3a49b0;  /* section kickers */
  --ch-periwinkle:   #8fa0f3;  /* highlighted hero word on dark */
  /* Brand — teal */
  --ch-teal:         #1fa98c;  /* CTAs, "yes" / positive */
  --ch-teal-light:   #7dffd9;  /* teal text on dark */
  --ch-teal-deep:    #138a6e;  /* teal text on light */
  --ch-grad:         linear-gradient(145deg, #26c0a0, #2f6fd6); /* logo tile */
  /* Support */
  --ch-amber:        #d98f3a;  /* partial / add-on / caution */
  --ch-amber-deep:   #9a5a12;  /* amber TEXT on light — clears AA 4.5:1 (parallels teal-deep) */
  /* Neutrals */
  --ch-body:         #4a4f5c;
  --ch-body-soft:    #5a5f6c;
  --ch-muted:        #8a8f9c;
  --ch-faint:        #9a9fac;
  --ch-hairline:     #e6e7ec;
  --ch-cloud:        #f7f8fc;  /* alt section background */
  --ch-lavender:     #eef0fb;  /* info callout */
  --ch-lavender-2:   #eef0ff;  /* highlighted table column */
  --ch-mint:         #e8f6f1;  /* positive callout */
  --ch-paper:        #ffffff;
  /* Hero gradient */
  --ch-hero:         linear-gradient(158deg,#3a3f86 0%,#262d72 52%,#1a1f57 100%);
  --ch-cta:          linear-gradient(135deg,#3a3f86,#222a6e);
  /* Radii / shadow */
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-pill: 999px;
  --shadow-card: 0 1px 3px rgba(0,0,0,.08);
  --shadow-float: 0 16px 40px rgba(42,47,115,.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: #fff; font-family: 'Figtree', system-ui, -apple-system, sans-serif; color: var(--ch-ink-navy); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
img, svg { display: block; }

/* ---------- layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }
.wrap--narrow { max-width: 1000px; }
.wrap--tight  { max-width: 820px; }
.section { padding: clamp(52px, 8vw, 88px) 0; }
.section--sm { padding: clamp(40px, 5vw, 64px) 0; }
.bg-cloud { background: var(--ch-cloud); }
.center { text-align: center; }

/* fluid auto-collapsing grids */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ---------- type ---------- */
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--ch-eyebrow); text-transform: uppercase; }
.h1 { font-size: clamp(38px, 5.6vw, 62px); font-weight: 800; line-height: 1.04; letter-spacing: -.02em; margin: 0; }
.h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.08; letter-spacing: -.01em; color: var(--ch-ink-navy); margin: 0; }
.h3 { font-size: clamp(22px, 2.8vw, 30px); font-weight: 800; letter-spacing: -.01em; margin: 0; }
.lead { font-size: clamp(16px, 1.9vw, 19px); line-height: 1.55; color: var(--ch-body-soft); }
.accent { color: var(--ch-periwinkle); }       /* highlighted hero word (on dark) */
.accent-royal { color: var(--ch-royal); }       /* highlighted word (on light) */
.muted { color: var(--ch-muted); }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(26,31,87,.82); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.1); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto; padding: 16px clamp(20px,5vw,40px); }
.nav__brand { display: flex; align-items: center; gap: 11px; }
.nav__brand img { width: 38px; height: 38px; }
.nav__brand span { font-size: 19px; font-weight: 800; color: #fff; letter-spacing: -.01em; }
.nav__links { display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 600; color: rgba(255,255,255,.78); }
.nav__links a:hover { color: #fff; }
.nav__links a[aria-current="page"] { color: #fff; }
.nav__cta { display: flex; align-items: center; gap: 16px; }
.nav__cta .signin { font-size: 15px; font-weight: 600; color: rgba(255,255,255,.78); }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; border-radius: 2px; }

@media (max-width: 1120px) {
  .nav__toggle { display: block; }
  .nav__links, .nav__cta { display: none; }
  .nav[data-open="true"] .nav__links,
  .nav[data-open="true"] .nav__cta {
    display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
    position: absolute; left: 0; right: 0; top: 100%;
    background: #1a1f57; padding: 20px clamp(20px,5vw,40px); border-bottom: 1px solid rgba(255,255,255,.12);
  }
  .nav__cta { top: calc(100% + 1px); }
}

/* ---------- buttons / pills ---------- */
.btn { display: inline-block; font-size: 15.5px; font-weight: 800; padding: 15px 28px; border-radius: var(--r-pill); border: 1px solid transparent; cursor: pointer; font-family: inherit; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--ch-teal); color: #fff; }
.btn--white   { background: #fff; color: var(--ch-deep-navy); }
.btn--ghost   { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
.btn--outline { background: #fff; border-color: var(--ch-hairline); color: var(--ch-ink-navy); }
.btn--sm { font-size: 14px; padding: 10px 19px; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

.pill { display: inline-flex; align-items: center; gap: 8px; background: rgba(31,169,140,.16); border: 1px solid rgba(95,227,196,.35); border-radius: var(--r-pill); padding: 7px 15px; font-size: 13px; font-weight: 700; color: var(--ch-teal-light); }
.badge-new { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; color: var(--ch-royal); background: var(--ch-lavender-2); border-radius: 5px; padding: 3px 8px; }
.tag-illustrative { font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--ch-faint); background: var(--ch-cloud); border: 1px solid var(--ch-hairline); border-radius: 6px; padding: 4px 9px; }

/* ---------- cards / callouts ---------- */
.card { background: #fff; border: 1px solid var(--ch-hairline); border-radius: var(--r-md); padding: 24px; }
.card--pad-lg { padding: clamp(24px,3.5vw,40px); }
.card__icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.card__title { font-size: 17px; font-weight: 800; margin: 0 0 7px; }
.card__body { font-size: 13.5px; line-height: 1.55; color: var(--ch-body-soft); }

.callout { background: var(--ch-lavender); border-left: 4px solid var(--ch-royal); border-radius: 0 12px 12px 0; padding: 20px 24px; }
.callout--mint { background: var(--ch-mint); border-left-color: var(--ch-teal); }
.callout p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ch-body); }

/* hero & cta sections */
.hero { position: relative; background: var(--ch-hero); color: #fff; padding: clamp(56px,8vw,92px) 0 clamp(64px,9vw,104px); overflow: hidden; }
.hero .lead { color: rgba(255,255,255,.82); font-weight: 500; }
.section--cta { background: var(--ch-cta); color: #fff; text-align: center; padding: clamp(64px,9vw,96px) clamp(20px,5vw,40px); }
.section--cta .lead { color: rgba(255,255,255,.82); }

/* ---------- footer ---------- */
.footer { background: #1a1f57; color: rgba(255,255,255,.7); padding: 56px clamp(20px,5vw,40px) 36px; }
.footer__grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px,1fr)); gap: 40px; }
.footer__col { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.footer__col h4 { font-weight: 800; color: #fff; margin: 0 0 4px; font-size: 13.5px; }
.footer__legal { max-width: 1200px; margin: 36px auto 0; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: rgba(255,255,255,.5); }

/* ---------- table ---------- */
.ch-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ch-table th, .ch-table td { padding: 13px 14px; }
.ch-table thead th { background: #fff; }
.ch-table .col-hl { background: var(--ch-lavender-2); }
.ch-table .yes { color: var(--ch-teal); font-weight: 800; }
.ch-table .partial { color: var(--ch-amber); }
.ch-table .none { color: var(--ch-faint); }
.table-scroll { overflow-x: auto; border: 1px solid var(--ch-hairline); border-radius: var(--r-md); }
.table-scroll table { min-width: 640px; }

/* ---------- reveal (progressive enhancement; visible if JS off) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1); }
.js [data-reveal].is-shown { opacity: 1; transform: none; }

/* Reduced motion: reveals show immediately, decorative motion is neutralised. */
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- tabs ---------- */
.tabs__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tabs__btn { border: 1px solid var(--ch-hairline); background: #fff; color: var(--ch-body-soft); cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 700; padding: 11px 18px; border-radius: var(--r-pill); transition: all .2s; }
.tabs__btn[aria-selected="true"] { background: var(--ch-royal); color: #fff; border-color: var(--ch-royal); box-shadow: 0 6px 16px rgba(61,76,196,.28); }
.tabs__panel[hidden] { display: none; }

/* ---------- accordion ---------- */
.acc__trigger { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-family: inherit; }
.acc__trigger .q { font-size: 16.5px; font-weight: 700; color: var(--ch-ink-navy); }
.acc__trigger .sign { font-size: 24px; color: var(--ch-royal); flex: none; }
.acc__panel { padding: 0 24px 22px; font-size: 14.5px; line-height: 1.6; color: var(--ch-body-soft); }
.acc__panel[hidden] { display: none; }

/* ---------- segmented control (calculator / recommender) ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; background: #f1f2f8; border-radius: var(--r-pill); padding: 5px; }
.seg button { border: 0; cursor: pointer; font-family: inherit; font-size: 13.5px; font-weight: 700; padding: 9px 16px; border-radius: var(--r-pill); background: transparent; color: var(--ch-body-soft); transition: all .2s; }
.seg button[aria-pressed="true"] { background: var(--ch-royal); color: #fff; }

input[type="range"] { accent-color: var(--ch-royal); width: 100%; }

/* ---------- pricing tier cards ---------- */
.tier-card { background: #fff; border: 1.5px solid var(--ch-hairline); border-radius: 16px; padding: 24px 22px; display: flex; flex-direction: column; transition: border-color .25s, box-shadow .25s; }
.tier-card.is-recommended { border-color: var(--ch-royal); box-shadow: 0 0 0 3px rgba(61,76,196,.12); }
.tier-card--popular { border: 2px solid var(--ch-royal); background: var(--ch-royal); color: #fff; box-shadow: 0 16px 38px rgba(61,76,196,.32); position: relative; }
.tier-card__name { font-size: 12px; font-weight: 700; letter-spacing: .13em; color: var(--ch-eyebrow); }
.tier-card--popular .tier-card__name { color: #c4ccff; }
.tier-card__price { display: flex; align-items: baseline; gap: 5px; margin: 14px 0 4px; }
.tier-card__price b { font-size: 38px; font-weight: 800; }
.tier-card__desc { font-size: 13px; color: var(--ch-muted); min-height: 38px; }
.tier-card--popular .tier-card__desc { color: rgba(255,255,255,.8); }
.tier-card__feats { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--ch-body); }
.tier-card__feats > div { display: flex; gap: 9px; }
.tier-card__feats .ok { color: var(--ch-teal); font-weight: 800; }
.tier-card--popular .tier-card__feats { color: rgba(255,255,255,.92); }
.tier-card--popular .tier-card__feats .ok { color: var(--ch-teal-light); }
.tier-badge { position: absolute; top: 0; right: 0; background: var(--ch-deep-navy); font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 6px 13px; border-radius: 0 14px 0 12px; color: #fff; }

/* ---------- book-a-demo modal (bottom-sheet on mobile) ---------- */
.demo-modal { position: fixed; inset: 0; z-index: 100; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.demo-modal[hidden] { display: none; }
.demo-modal__card { position: relative; background: #fff; border-radius: 18px; width: 100%; max-width: 440px; max-height: 92vh; overflow: auto; padding: 30px; box-shadow: var(--shadow-float); }
@media (max-width: 520px) { .demo-modal { align-items: flex-end; padding: 0; } .demo-modal__card { max-width: 100%; border-radius: 18px 18px 0 0; max-height: 90vh; } }
.demo-modal__x { position: absolute; top: 14px; right: 16px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--ch-muted); cursor: pointer; }
.demo-modal__title { font-size: 22px; font-weight: 800; color: var(--ch-ink-navy); }
.demo-modal__sub { font-size: 14px; color: var(--ch-body-soft); margin: 6px 0 18px; }
.demo-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.demo-field > span { font-size: 13px; font-weight: 700; color: var(--ch-ink-navy); }
.demo-field input, .demo-field select, .demo-field textarea { font-family: inherit; font-size: 14.5px; padding: 10px 12px; border: 1.5px solid var(--ch-hairline); border-radius: 10px; color: var(--ch-ink-navy); background: #fbfbfd; resize: vertical; }
.demo-field input:focus, .demo-field select:focus, .demo-field textarea:focus { outline: none; border-color: var(--ch-royal); box-shadow: 0 0 0 3px rgba(61,76,196,.14); }
.demo-modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------- platform cross-link cards ("Explore the platform" grids) ---------- */
.plat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 16px; }
.plat-card { display: block; background: #fff; border: 1px solid var(--ch-hairline); border-radius: var(--r-md); padding: 24px; transition: border-color .2s, box-shadow .2s, transform .2s; }
.plat-card:hover { border-color: var(--ch-royal); box-shadow: 0 8px 24px rgba(42,47,115,.1); transform: translateY(-2px); }
.plat-card__top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.plat-card__icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.plat-card__title { font-size: 17px; font-weight: 800; color: var(--ch-ink-navy); margin-bottom: 5px; }
.plat-card__title .arr { color: var(--ch-royal); }
.plat-card__body { font-size: 13px; line-height: 1.5; color: var(--ch-body-soft); }

/* ---------- nav dropdown (Features mega-menu) ---------- */
.nav__dd { position: relative; display: inline-flex; align-items: center; }
.nav__dd-head { display: inline-flex; align-items: center; gap: 3px; }
.nav__dd-toggle { display: inline-flex; align-items: center; background: none; border: 0; padding: 4px 2px; margin: 0; cursor: pointer; color: inherit; }
.nav__dd-caret { transition: transform .2s; }
.nav__dd-menu { position: absolute; top: calc(100% + 12px); left: 0; min-width: 232px; background: #1a1f57; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 8px; display: none; flex-direction: column; gap: 2px; box-shadow: 0 22px 54px rgba(8,11,38,.55); z-index: 60; }
.nav__dd-menu a { display: block; padding: 9px 13px; border-radius: 9px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.82); white-space: nowrap; }
.nav__dd-menu a:hover { background: rgba(255,255,255,.09); color: #fff; }
/* desktop: open on hover or when toggled; bridge the gap so the menu is reachable */
@media (min-width: 1121px) {
  .nav__dd::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 12px; }
  .nav__dd:hover .nav__dd-menu, .nav__dd[data-open="true"] .nav__dd-menu { display: flex; }
  .nav__dd:hover .nav__dd-caret, .nav__dd[data-open="true"] .nav__dd-caret { transform: rotate(180deg); }
}
/* mobile: render the menu inline under Features, toggled by the caret */
@media (max-width: 1120px) {
  .nav__dd { width: 100%; flex-direction: column; align-items: flex-start; }
  .nav__dd-menu { position: static; min-width: 0; background: transparent; border: 0; box-shadow: none; padding: 4px 0 6px 14px; }
  .nav__dd[data-open="true"] .nav__dd-menu { display: flex; }
  .nav__dd[data-open="true"] .nav__dd-caret { transform: rotate(180deg); }
}
/* dropdown group subhead — labels a cluster of Platform surfaces (e.g. Estimating & cost) */
.nav__dd-group { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.42); padding: 11px 13px 5px; margin-top: 5px; border-top: 1px solid rgba(255,255,255,.1); }
@media (max-width: 1120px) { .nav__dd-group { padding: 8px 0 3px; border-top: 0; } }

/* ---------- a11y utilities ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 200; background: #fff; color: var(--ch-ink-navy); padding: 9px 16px; border-radius: var(--r-sm); font-weight: 800; font-size: 14px; box-shadow: var(--shadow-float); transition: top .16s; }
.skip-link:focus { top: 12px; outline: 2px solid var(--ch-royal); outline-offset: 2px; }
