/* Resollect — shared mobile shell, drawer, demo modal */

/* Prevent any in-page element (animations, decorative SVGs, fixed-width
   visualisations) from spawning horizontal scroll on narrow viewports.
   `clip` is preferred over `hidden` because it doesn't establish a scroll
   container — that means `position: sticky` continues to work above. */
html, body { overflow-x: clip; }
@supports not (overflow-x: clip) {
  html, body { overflow-x: hidden; }
}
body { max-width: 100vw; }

/* === mobile-first refinements layered on top of styles.css === */

/* nav: hide top desktop links earlier; introduce mobile burger */
.nav_burger {
  display: none;
  position: relative;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  background: #fff;
  border: 1px solid var(--hair-2);
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.nav_burger svg { width: 18px; height: 18px; display: block; }
.nav_burger:hover { border-color: var(--ink); background: var(--paper); }
.nav_burger:active { transform: scale(0.96); }

/* mobile drawer */
.mob_drawer {
  position: fixed; inset: 0;
  background: rgba(11,18,32,0.48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 80;
  opacity: 0; pointer-events: none;
  transition: opacity 220ms ease;
}
.mob_drawer[data-open="true"] { opacity: 1; pointer-events: auto; }
.mob_panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(88vw, 380px);
  background: #fff;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -24px 0 60px -20px rgba(11,18,32,0.25);
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mob_drawer[data-open="true"] .mob_panel { transform: translateX(0); }
.mob_panel_top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hair);
  height: 64px;
}
.mob_panel_top img { height: 36px; width: auto; display: block; }
.mob_close {
  width: 38px; height: 38px;
  background: #fff;
  border: 1px solid var(--hair-2);
  border-radius: 10px;
  cursor: pointer; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 160ms ease, background 160ms ease;
}
.mob_close:hover { border-color: var(--ink); background: var(--paper); }
.mob_close svg { display: block; }
.mob_panel nav {
  display: flex; flex-direction: column;
  padding: 12px 12px;
  gap: 2px;
}
.mob_panel nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  font-size: 15px; font-weight: 500;
  color: var(--ink);
  border-radius: 10px;
  letter-spacing: -0.005em;
  transition: background 160ms ease, color 160ms ease;
}
.mob_panel nav a::after {
  content: ''; width: 14px; height: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A95A5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 6l6 6-6 6'/></svg>");
  background-size: contain; background-repeat: no-repeat;
  opacity: 0.6;
  transition: transform 160ms ease, opacity 160ms ease;
}
.mob_panel nav a:hover { background: var(--paper); }
.mob_panel nav a:hover::after { transform: translateX(2px); opacity: 1; }
.mob_panel nav a.active {
  background: var(--brand-soft); color: var(--brand);
}
.mob_panel nav a.active::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563EB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 6l6 6-6 6'/></svg>");
  opacity: 1;
}
.mob_panel .mob_addr {
  padding: 18px 24px;
  margin-top: auto;
  font-size: 12px; color: var(--n500);
  line-height: 1.55; letter-spacing: 0.01em;
  border-top: 1px solid var(--hair);
}
.mob_panel .mob_cta {
  padding: 12px 16px 18px;
  border-top: 1px solid var(--hair);
  background: #fff;
}
.mob_panel .mob_cta .btn {
  width: 100%; justify-content: center;
  padding: 14px 18px;
  font-size: 15px;
  border-radius: 10px;
}

/* === floating mobile CTA (FAB) === */
.fab {
  display: none;
  position: fixed;
  z-index: 70;
  right: 16px;
  bottom: max(20px, env(safe-area-inset-bottom, 20px));
  align-items: center; gap: 8px;
  padding: 13px 20px 13px 22px;
  font-size: 14px; font-weight: 500; font-family: inherit;
  letter-spacing: -0.005em;
  color: #fff; background: var(--brand);
  border-radius: 999px;
  box-shadow:
    0 14px 30px -10px rgba(37,99,235,0.45),
    0 6px 14px -4px rgba(11,18,32,0.18),
    inset 0 1px 0 rgba(255,255,255,0.18);
  text-decoration: none;
  transition: transform 200ms cubic-bezier(0.2,0,0,1), box-shadow 200ms ease, background 180ms ease;
  -webkit-tap-highlight-color: transparent;
}
.fab svg { transition: transform 200ms cubic-bezier(0.2,0,0,1); }
.fab:hover { background: var(--brand-deep); transform: translateY(-2px); }
.fab:hover svg { transform: translateX(3px); }
.fab:active { transform: translateY(0); box-shadow: 0 8px 20px -8px rgba(37,99,235,0.5); }

/* hide FAB while drawer or modal is open so it doesn't float over them */
body.modal_locked .fab { opacity: 0; pointer-events: none; transform: translateY(8px); }

/* === book a demo modal === */
.bd_overlay {
  position: fixed; inset: 0;
  background: rgba(11,18,32,0.6);
  backdrop-filter: blur(6px);
  z-index: 90;
  opacity: 0; pointer-events: none;
  transition: opacity 220ms ease;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.bd_overlay[data-open="true"] { opacity: 1; pointer-events: auto; }
.bd_modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transform: translateY(16px) scale(0.98);
  transition: transform 240ms cubic-bezier(0.2, 0, 0, 1);
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px -20px rgba(11,18,32,0.4);
}
.bd_overlay[data-open="true"] .bd_modal { transform: translateY(0) scale(1); }
.bd_close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--hair-2);
  border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink);
  z-index: 2;
}
.bd_close:hover { background: #fff; border-color: var(--ink); }
.bd_head {
  padding: 32px 32px 22px;
  background: var(--ink); color: #fff;
}
.bd_head .eyebrow { color: var(--brand); }
.bd_head h2 {
  font-size: 26px; font-weight: 600;
  letter-spacing: -0.018em; line-height: 1.2;
  margin: 10px 0 8px;
  color: #fff;
}
.bd_head p {
  font-size: 14px; line-height: 1.55; color: rgba(255,255,255,0.72);
  margin: 0;
}
.bd_head .signals {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px;
}
.bd_head .signals span {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border-radius: 999px;
}
.bd_body {
  padding: 22px 28px 26px;
  overflow-y: auto;
}
.bd_body form {
  display: flex; flex-direction: column; gap: 14px;
}
.bd_body .row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.bd_body label {
  font-size: 12px; font-weight: 500; color: var(--ink);
  letter-spacing: 0.02em;
}
.bd_body .field { display: flex; flex-direction: column; gap: 6px; }
.bd_body input,
.bd_body select {
  padding: 12px 14px;
  border: 1px solid var(--hair-3);
  border-radius: 8px;
  font-size: 15px; font-family: inherit;
  color: var(--ink); background: #fff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.bd_body input:focus,
.bd_body select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.bd_submit {
  margin-top: 4px;
  padding: 14px 22px;
  background: var(--brand); color: #fff;
  border: 0; font-size: 15px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: background 200ms ease, transform 100ms ease;
}
.bd_submit:hover { background: var(--brand-deep); }
.bd_submit:active { transform: translateY(1px); }
.bd_meta {
  font-size: 11px; color: var(--n500);
  text-align: center; line-height: 1.5;
}
.bd_meta a { color: var(--brand); }
.bd_success {
  padding: 56px 32px;
  text-align: center;
  display: none;
}
.bd_success[data-on="true"] { display: block; }
.bd_success .check {
  width: 56px; height: 56px;
  border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.bd_success h3 {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0 0 8px;
}
.bd_success p {
  font-size: 14px; color: var(--slate); line-height: 1.55;
  max-width: 36ch; margin: 0 auto;
}

/* === sitewide mobile responsiveness on top of styles.css === */
@media (max-width: 920px) {
  /* top bar on mobile: brand left, hamburger right.
     The inline "Book a demo" CTA is hidden — it lives in the drawer
     and as a floating pill (.fab) so the bar stays uncluttered. */
  nav.top .btn_primary { display: none !important; }
  .nav_burger { display: inline-flex; }
  .fab { display: inline-flex; }

  /* tighter nav inner — keep hamburger flush right and vertically centered */
  .nav_inner { height: 68px; align-items: center; }
  .nav_brand img { height: 40px; }

  /* hero typography: cap the very large display headings so they
     never blow past the viewport on tablets (560–920px range). */
  .hero_top h1.display { font-size: clamp(36px, 7vw, 56px); line-height: 1.04; }
  .hero_top p.lede { font-size: 17px; }
  .subhero_inner h1.display { font-size: clamp(34px, 6vw, 48px); }

  /* media-card visualisations should never push horizontal scroll */
  .chaos, .tying, .modules_viz, .inside_visual,
  .story_phone, .tying_stack {
    max-width: 100%;
  }

  /* footer trim */
  footer.foot { padding: 56px 0 28px; }
  .foot_top { gap: 32px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .bd_body .row { grid-template-columns: 1fr; }
  .bd_head { padding: 26px 24px 20px; }
  .bd_head h2 { font-size: 22px; }
  .bd_body { padding: 18px 20px 22px; }

  /* hero refinements on phones */
  .hero_top h1.display { font-size: 36px !important; line-height: 1.04; }
  .hero_top p.lede { font-size: 16px !important; }
  .hero_top { gap: 18px; margin-bottom: 36px !important; }
  .hero_actions .btn_lg { padding: 12px 18px; font-size: 14px; }
  .hero_split > div { padding: 28px 20px; }
  .hero_split .col_h { font-size: 20px; }

  h2.h { font-size: 26px !important; }
  p.lede { font-size: 15px; }
  .subhero_inner h1.display { font-size: 32px !important; }

  section.section { padding: 52px 0 !important; }
  section.subhero { padding: 56px 0 44px; }

  .demo_left, .demo_right { padding: 32px 22px !important; }
  .demo_left h2.h { font-size: 28px !important; }

  .problem_stat .num { font-size: 26px; }
  .outcome_cell { padding: 32px 22px; }
  .outcome_cell .num { font-size: 52px; }
  .module { padding: 28px 22px 32px; }
  .module .name { font-size: 19px; }

  .shift_col { padding: 26px 20px; }
  .shift_col h3 { font-size: 22px; }
  .shift_col table { font-size: 13px; }
  .shift_col table .lbl { width: 110px; padding-right: 14px; }

  .faq_item summary { padding: 18px 20px; font-size: 15px; }
  .faq_item .body_text { padding: 0 20px 20px; font-size: 14px; }

  .news_box .news_left, .news_box .news_form { padding: 28px 22px; }

  /* chaos artefact: shrink */
  .chaos { height: 380px; }
  .chaos_excel .ce_subbar span:not(.active) { display: none; }
  .chaos_excel th:nth-child(5), .chaos_excel td:nth-child(5),
  .chaos_excel th:nth-child(6), .chaos_excel td:nth-child(6) { display: none; }
  .chaos_anno { font-size: 10px; padding: 4px 8px; }
  .chaos_wa .wa_body { min-height: 100px; }

  /* footer */
  .foot_top { grid-template-columns: 1fr 1fr !important; gap: 28px !important; }
  .foot_brand { grid-column: 1 / -1; }
  .foot_bot { flex-direction: column; align-items: flex-start; }

  /* leadership */
  .leader { padding: 26px 22px; }
  .leader .avatar { width: 96px; height: 96px; font-size: 32px; }
  .leader .name { font-size: 19px; }
  .leader .bio { font-size: 13px; }

  /* values, etc */
  .value { padding: 26px 22px; }
  .why_cell { padding: 22px; }
  .loop_grid { grid-template-columns: 1fr !important; }

  /* careers job rows */
  .job { grid-template-columns: 1fr 24px !important; gap: 8px; padding: 18px 0; }
  .job .meta, .job .team { display: none; }
  .job .role { font-size: 16px; }
  .job .pitch { font-size: 12px; }

  /* press coverage rows */
  .cv { grid-template-columns: 1fr 24px !important; gap: 6px; padding: 18px 0; }
  .cv .date, .cv .pub { font-size: 11px; }
  .cv .pub { color: var(--brand); }
  .cv .date_pub_row { display: flex; gap: 10px; align-items: center; }
  .cv .ttl { font-size: 15px; }

  /* press fast facts/contact */
  .pc_grid { grid-template-columns: 1fr; }
  .pc_cell { border-right: 0; border-bottom: 1px solid var(--hair); }
  .pc_cell:last-child { border-bottom: 0; }
  .facts_grid, .why_grid, .team_grid { grid-template-columns: 1fr 1fr !important; }
  .rel_grid { grid-template-columns: 1fr !important; }
  .rel { padding: 24px 22px; }

  .blog_filters .pills { gap: 6px; }
  .blog_filters .pills button { padding: 6px 10px; font-size: 12px; }
  .blog_filters .search input { min-width: 0; width: 100%; }
  .blog_filters .search { width: 100%; }

  /* table-y feat header on blog */
  .feat .feat_visual { min-height: 240px; padding: 28px 22px; }
  .feat .feat_visual .feat_h { font-size: 22px; }
  .feat .feat_body { padding: 26px 22px; }

  /* outcomes cell num smaller */
  .outcome_cell .num { font-size: 56px; }
}

/* lock body when modal open */
body.modal_locked { overflow: hidden; }
