/* ==========================================================================
   IncoDynamix (incodynamix.co.za)
   Palette from the brand logo: taupe #84716B, red #CF302C.
   Type: Bricolage Grotesque (display) / IBM Plex Sans (body) / IBM Plex Mono (data)
   Signature: the Sophia "analytics slip" (till-receipt) in the hero.
   ========================================================================== */

:root {
  --ink: #241C19;
  --ink-soft: #4A403B;
  --taupe: #84716B;
  --red: #CF302C;
  --red-deep: #A02220;
  --ground: #EFEBE5;
  --paper: #FFFFFF;
  --line: #DCD4CB;
  --line-dark: #3A312D;
  --putty: #CFC6BC;

  --font-display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --container: 1160px;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--red-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 2px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.center { text-align: center; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ===== Type roles ===== */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.1rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.18rem; font-weight: 600; line-height: 1.3; }

/* red-deep on the light grounds is 6.4:1; plain --red is only 4.3:1 and fails AA. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-deep);
  margin-bottom: 14px;
}
.section-dark .eyebrow, .cta-band .eyebrow { color: #E8A5A0; }

.accent { color: var(--red); }

/* ===== Header ===== */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 84px; gap: 24px;
}
.brand-logo { width: 182px; height: auto; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  font-weight: 500; font-size: 0.98rem; color: var(--ink-soft);
  padding: 9px 14px; border-radius: 999px;
}
.nav a:hover { color: var(--ink); text-decoration: none; background: var(--ground); }
.nav a.active { color: var(--ink); background: var(--ground); }
.nav a.nav-cta {
  background: var(--red); color: #fff; margin-left: 8px;
}
.nav a.nav-cta:hover { background: var(--red-deep); color: #fff; }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 10px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2.5px; background: var(--ink);
  margin: 5px 0; border-radius: 2px; transition: transform 0.25s, opacity 0.25s;
}

/* ===== Hero ===== */
.hero { padding: 90px 0 70px; overflow: hidden; }
.hero-sub { padding: 70px 0 50px; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px; align-items: center;
}
.hero-copy-wide { max-width: 780px; }
.hero-lead {
  font-size: 1.16rem; color: var(--ink-soft); max-width: 560px; margin-top: 22px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.center-actions { justify-content: center; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 1rem;
  padding: 14px 26px; border-radius: 999px;
  transition: background 0.2s, transform 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-deep); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--ground); }
.section-dark .btn-ghost, .cta-band .btn-ghost { color: var(--ground); box-shadow: inset 0 0 0 2px var(--putty); }
.section-dark .btn-ghost:hover, .cta-band .btn-ghost:hover { background: var(--ground); color: var(--ink); }

/* ===== The Sophia analytics slip (signature) ===== */
.hero-slip { display: flex; justify-content: center; }
.slip {
  font-family: var(--font-mono);
  background: var(--paper);
  color: var(--ink);
  width: min(400px, 100%);
  padding: 26px 28px 22px;
  box-shadow: 0 24px 48px -20px rgba(36, 28, 25, 0.35);
  transform: rotate(1.6deg);
  border-radius: 3px;
  /* torn top & bottom edges */
  --notch: 12px;
  clip-path: polygon(
    0 8px, 4% 0, 8% 8px, 12% 0, 16% 8px, 20% 0, 24% 8px, 28% 0, 32% 8px, 36% 0,
    40% 8px, 44% 0, 48% 8px, 52% 0, 56% 8px, 60% 0, 64% 8px, 68% 0, 72% 8px,
    76% 0, 80% 8px, 84% 0, 88% 8px, 92% 0, 96% 8px, 100% 0,
    100% calc(100% - 8px), 96% 100%, 92% calc(100% - 8px), 88% 100%, 84% calc(100% - 8px),
    80% 100%, 76% calc(100% - 8px), 72% 100%, 68% calc(100% - 8px), 64% 100%,
    60% calc(100% - 8px), 56% 100%, 52% calc(100% - 8px), 48% 100%, 44% calc(100% - 8px),
    40% 100%, 36% calc(100% - 8px), 32% 100%, 28% calc(100% - 8px), 24% 100%,
    20% calc(100% - 8px), 16% 100%, 12% calc(100% - 8px), 8% 100%, 4% calc(100% - 8px), 0 100%
  );
}
.slip-head {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 0.68rem; letter-spacing: 0.1em; color: var(--taupe);
  padding-top: 6px;
}
.slip-tear { border-top: 1.5px dashed var(--line); margin: 14px 0; }
.slip-label {
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--red); margin: 12px 0 4px;
}
.slip-q { font-size: 0.98rem; font-weight: 500; line-height: 1.5; }
.slip-a { font-size: 0.88rem; line-height: 1.55; color: var(--ink-soft); }
.slip-a strong { color: var(--red-deep); }
.slip-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.8rem; }
.slip-table th {
  text-align: left; font-weight: 500; color: var(--taupe);
  border-bottom: 1.5px dashed var(--line); padding: 4px 0;
  font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.slip-table td { padding: 5px 0; border-bottom: 1px dotted var(--line); }
.slip-table td:last-child, .slip-table th:last-child { text-align: right; }
.slip-table td:nth-child(2), .slip-table th:nth-child(2) { text-align: right; }
.slip-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 0.72rem; letter-spacing: 0.08em; color: var(--ink-soft); padding-bottom: 4px;
}
.slip-barcode {
  display: inline-block; width: 86px; height: 22px; flex: none;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0, var(--ink) 2px, transparent 2px, transparent 4px,
    var(--ink) 4px, var(--ink) 5px, transparent 5px, transparent 9px,
    var(--ink) 9px, var(--ink) 12px, transparent 12px, transparent 14px
  );
}

/* ===== Logo strip ===== */
.logo-strip { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 34px 0; }
.logo-strip-label {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--taupe); text-align: center; margin-bottom: 18px;
}
/* Logos are pre-scaled to a common canvas height, so height alone sizes the row. */
.logo-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 34px; }
.logo-row img {
  height: 46px; width: auto; filter: grayscale(1); opacity: 0.6; transition: filter 0.25s, opacity 0.25s;
}
.logo-row img:hover { filter: none; opacity: 1; }

/* ===== Stat bar ===== */
.statbar { background: var(--ink); color: var(--ground); padding: 40px 0; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-n { font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700; color: #fff; line-height: 1; }
.stat-l { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--putty); }

/* ===== Sections ===== */
.section { padding: 84px 0; }
.section-tint { background: #E7E1D8; }
.section-dark { background: var(--ink); color: var(--ground); }
.section-dark h2 { color: #fff; }
.section-dark a { color: #E8A5A0; }

.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-sub { color: var(--ink-soft); margin-top: 14px; font-size: 1.05rem; }
.section-dark .section-sub { color: var(--putty); }
.section-sub-left { color: var(--ink-soft); margin-top: 10px; max-width: 620px; }
.section-note { text-align: center; margin-top: 36px; color: var(--ink-soft); }
.section-dark .section-note { color: var(--putty); }

/* ===== Ask grid (sample questions) ===== */
.ask-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 40px; }
.ask-grid-3 { margin-bottom: 0; }
.ask {
  font-family: var(--font-mono); font-size: 0.95rem; line-height: 1.55;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius); padding: 22px 24px;
}
.section:not(.section-dark) .ask { background: var(--paper); border-color: var(--line); color: var(--ink-soft); }

/* ===== Cards ===== */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px; color: var(--ink);
  transition: transform 0.2s, box-shadow 0.2s;
}
a.card:hover {
  text-decoration: none; transform: translateY(-4px);
  box-shadow: 0 18px 34px -22px rgba(36, 28, 25, 0.4);
}
.card p { color: var(--ink-soft); font-size: 0.97rem; flex: 1; }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--ground); color: var(--red); flex: none;
}
.card-icon svg { width: 24px; height: 24px; }
.card-more {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.94rem; color: var(--red-deep);
}
.card-more svg { width: 16px; height: 16px; transition: transform 0.2s; }
a.card:hover .card-more svg { transform: translateX(4px); }
.section-dark .card, .section-tint .card { background: var(--paper); }

/* ===== Steps (QWRI how-it-works: a real sequence) ===== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step {
  border: 1px solid var(--line-dark); border-radius: var(--radius); padding: 30px 28px;
  background: rgba(255, 255, 255, 0.04);
}
.step h3 { color: #fff; margin: 14px 0 8px; }
.step p { color: var(--putty); font-size: 0.96rem; }
.step-num {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 999px; background: var(--red);
  color: #fff; font-weight: 500;
}

/* ===== Product sections (solutions) ===== */
.product-head { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 36px; }
.feature-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.feature-cols-2 { grid-template-columns: repeat(2, 1fr); max-width: 780px; }
.feature-list { list-style: none; }
.feature-list li {
  position: relative; padding: 8px 0 8px 30px; color: var(--ink-soft);
  border-bottom: 1px dotted var(--line); font-size: 0.97rem;
}
.feature-list li::before {
  content: ""; position: absolute; left: 2px; top: 15px;
  width: 14px; height: 14px;
  background: var(--red);
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>') center / contain no-repeat;
}

/* ===== Tag cloud (verticals) ===== */
.tag-cloud {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  max-width: 820px; margin: 0 auto;
}
.tag-cloud li {
  font-family: var(--font-mono); font-size: 0.85rem;
  padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--line-dark); color: var(--ground);
}
/* Same chips on a light ground. */
.tag-cloud-light li { border-color: var(--line); color: var(--ink-soft); background: var(--paper); }

/* ===== Heritage ===== */
.heritage-grid {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px;
}
.heritage-grid p + p { margin-top: 16px; }
.text-link { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.text-link svg { width: 16px; height: 16px; }

/* ===== Client grid ===== */
.client-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.client-tile {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 26px; display: flex; align-items: center; justify-content: center;
}
.client-tile img { height: 62px; width: auto; max-width: 100%; }

/* ===== Contact ===== */
.contact-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 48px; }
.contact-methods-2 { grid-template-columns: repeat(2, 1fr); max-width: 760px; margin-left: auto; margin-right: auto; }
.contact-method {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; color: var(--ink); transition: transform 0.2s, box-shadow 0.2s;
}
.contact-method:hover {
  text-decoration: none; transform: translateY(-3px);
  box-shadow: 0 18px 34px -22px rgba(36, 28, 25, 0.4);
}
.cm-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; background: var(--ground); color: var(--red);
  margin-bottom: 8px;
}
.cm-icon svg { width: 22px; height: 22px; }
.cm-label {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--taupe);
}
.cm-value { font-weight: 600; font-size: 1.05rem; }

.branches { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
/* One location: address card beside the map rather than two address cards. */
.branches-single { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: stretch; }
.branches-single .map-embed { height: 100%; }
.branches-single .map-embed iframe { height: 100%; min-height: 340px; }
.branch-note { margin-top: 18px; padding-top: 16px; border-top: 1px dotted var(--line); color: var(--ink-soft); font-size: 0.94rem; }
.branch {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px;
}
.branch h3 { margin-bottom: 12px; }
.branch-addr { color: var(--ink-soft); margin-bottom: 16px; }
.branch-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--ink-soft);
  font-size: 0.97rem;
}
.branch-row svg { width: 17px; height: 17px; color: var(--red); flex: none; }
.map-embed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map-embed iframe { display: block; width: 100%; height: 380px; border: 0; }

/* ===== CTA band ===== */
.cta-band { background: var(--ink); color: var(--ground); }
.cta-band h2 { color: #fff; }
.cta-band .section-sub { color: var(--putty); margin-bottom: 8px; }
.cta-band .hero-actions { margin-top: 26px; }

/* ===== Footer ===== */
.site-footer { background: #1B1512; color: var(--putty); padding: 64px 0 28px; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 44px; margin-bottom: 44px;
}
.footer-word {
  font-family: var(--font-display); font-size: 1.7rem; color: #fff; letter-spacing: -0.01em;
}
.footer-word strong { font-weight: 700; }
.footer-red { color: var(--red); }
.footer-tag { margin-top: 12px; font-size: 0.95rem; }
.footer-tag a { color: #E8A5A0; }
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-nav a { color: var(--putty); }
.footer-nav a:hover { color: #fff; }
.footer-contact p { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 0.97rem; }
.footer-contact svg { width: 16px; height: 16px; color: var(--red); flex: none; }
.footer-contact a { color: var(--putty); }
.footer-contact a:hover { color: #fff; }
.footer-legal {
  border-top: 1px solid var(--line-dark); padding-top: 22px;
  font-size: 0.85rem; color: #9A8C84;
}

/* ===== Reveal animations =====
   Gated on .js so that with scripting unavailable every section renders normally
   instead of the page appearing blank below the hero. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-slip { justify-content: flex-start; }
  .card-grid, .steps, .contact-methods, .ask-grid { grid-template-columns: 1fr 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .feature-cols { grid-template-columns: 1fr 1fr; }
  .client-grid { grid-template-columns: 1fr 1fr; }
  .heritage-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .hero { padding: 56px 0 48px; }
  .section { padding: 60px 0; }
  .card-grid, .steps, .contact-methods, .ask-grid, .feature-cols, .feature-cols-2, .branches { grid-template-columns: 1fr; }
  .client-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .client-tile { padding: 22px 16px; }
  .header-inner { min-height: 66px; }
  .brand-logo { width: 150px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .slip { transform: rotate(0.8deg); }

  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 12px 18px 18px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { border-radius: 8px; padding: 12px 14px; }
  .nav a.nav-cta { margin-left: 0; margin-top: 8px; text-align: center; }
  .nav-toggle { display: block; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
}
