/* ==========================================================================
   TruNorth AI — trunorthai.com
   Palette and type carried over from the services one-pager.
   White ground, navy type, blue accents. No dark blocks.
   ========================================================================== */

:root {
  --navy:        #1c5d99;
  --navy-deep:   #14456f;
  --accent:      #2f80c4;
  --spark:       #4285f4;
  --ink:         #1d2830;
  --muted:       #5d6b76;
  --line:        #e2e8ee;
  --band:        #f6f8fa;
  --white:       #ffffff;

  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  --section-y: clamp(72px, 9vw, 132px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--spark);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
}
.skip:focus { left: 12px; top: 12px; color: #fff; }

/* --------------------------------------------------------------- type ---- */

h1, h2, h3 {
  font-weight: 600;
  color: var(--navy-deep);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.05rem, 5.3vw, 4.05rem);
  letter-spacing: -0.038em;
  line-height: 1.04;
}

h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.6rem);
  max-width: 20ch;
}

h3 {
  font-size: 1.12rem;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

p { max-width: 68ch; }

.lead {
  font-size: clamp(1.08rem, 1.6vw, 1.28rem);
  line-height: 1.6;
  color: var(--muted);
  max-width: 56ch;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
  flex: none;
}

.section-intro { max-width: 60ch; margin-bottom: clamp(40px, 5vw, 64px); }
.section-intro p { color: var(--muted); margin-top: 18px; font-size: 1.05rem; }

/* ------------------------------------------------------------- header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 14px rgba(28, 93, 153, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 20px;
  padding-bottom: 20px;
  transition: padding 0.3s var(--ease);
}
.site-header.scrolled .header-inner { padding-top: 12px; padding-bottom: 12px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
  color: var(--navy-deep);
  flex: none;
}
.brand:hover { color: var(--navy-deep); }
.brand img {
  width: 30px;
  height: 30px;
  transition: transform 1.1s var(--ease);
}
.brand:hover img { transform: rotate(45deg); }
.brand span i { font-style: normal; color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 34px);
}
.site-nav a {
  font-size: 0.93rem;
  color: var(--muted);
  font-weight: 450;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--navy); }
.site-nav a.current { color: var(--navy-deep); font-weight: 550; }

/* ------------------------------------------------------------ buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.97rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  padding: 13px 24px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: transform 0.22s var(--ease), background 0.22s var(--ease),
              border-color 0.22s var(--ease), color 0.22s var(--ease),
              box-shadow 0.22s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 10px rgba(28, 93, 153, 0.18);
}
.btn-primary:hover {
  background: var(--navy-deep);
  color: #fff;
  box-shadow: 0 8px 22px rgba(28, 93, 153, 0.24);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(47, 128, 196, 0.04);
}

.btn .arrow { transition: transform 0.22s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

/* --------------------------------------------------------------- hero ---- */

.hero { padding: clamp(56px, 8vw, 104px) 0 clamp(48px, 6vw, 76px); }
.hero h1 { max-width: 16ch; }
.hero.wide h1 { max-width: 23ch; }
.hero .lead { margin-top: 26px; }

/* ------------------------------------------------- signature: the flow ---- */
/* A real sequence from a real build. Work moves left to right and stops at
   a person, because that is what actually happens.                          */

.flow {
  margin-top: clamp(52px, 7vw, 84px);
  padding: 30px clamp(18px, 3vw, 34px) 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfcfd 0%, #ffffff 100%);
}

.flow-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 26px;
}

.flow-track {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
}

/* the rail the pulse rides */
.flow-track::before,
.flow-rail {
  content: "";
  position: absolute;
  top: 7px;
  left: calc(100% / var(--n) / 2);
  right: calc(100% / var(--n) / 2);
  height: 2px;
  border-radius: 2px;
}
.flow-track::before { background: var(--line); }
.flow-rail {
  background: linear-gradient(90deg, var(--accent), var(--spark));
  transform-origin: left center;
  transform: scaleX(0);
  animation: railRun 7s var(--ease) infinite;
}

@keyframes railRun {
  0%   { transform: scaleX(0);   opacity: 1; }
  62%  { transform: scaleX(1);   opacity: 1; }
  86%  { transform: scaleX(1);   opacity: 1; }
  97%  { transform: scaleX(1);   opacity: 0; }
  100% { transform: scaleX(0);   opacity: 0; }
}

.flow-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 6px;
}

.flow-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--line);
  position: relative;
  z-index: 2;
  animation: dotOn 7s var(--ease) infinite;
  animation-delay: calc(var(--i) * 0.62s);
}

@keyframes dotOn {
  0%, 4%   { border-color: var(--line);  background: #fff; box-shadow: 0 0 0 0 rgba(66,133,244,0.28); }
  9%       { border-color: var(--spark); background: var(--spark); box-shadow: 0 0 0 7px rgba(66,133,244,0.16); }
  16%, 76% { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 0 rgba(66,133,244,0); }
  92%,100% { border-color: var(--line);  background: #fff; box-shadow: 0 0 0 0 rgba(66,133,244,0); }
}

/* the last step is a person, and it is drawn as one */
.flow-step.human .flow-dot {
  width: 20px;
  height: 20px;
  margin-top: -2px;
  border: 2px solid var(--navy);
  background: #fff;
  animation: none;
}
.flow-step.human .flow-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--navy);
  transform: scale(0);
  animation: humanOn 7s var(--ease) infinite;
  animation-delay: calc(var(--i) * 0.62s);
}
@keyframes humanOn {
  0%, 6%   { transform: scale(0); }
  14%, 78% { transform: scale(1); }
  93%,100% { transform: scale(0); }
}

.flow-step span:not(.flow-dot) {
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--muted);
  margin-top: 14px;
  max-width: 14ch;
  hyphens: none;
}
.flow-step.human span:not(.flow-dot) { color: var(--navy-deep); font-weight: 500; }

.flow-note {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
  color: var(--muted);
  max-width: 62ch;
}
.flow-note strong { color: var(--navy-deep); font-weight: 550; }

/* ----------------------------------------------------------- sections ---- */

section { padding: var(--section-y) 0; }
.band { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.4vw, 30px);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 2.4vw, 30px);
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(22px, 2.4vw, 30px);
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease),
              box-shadow 0.28s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: #cfdce8;
  box-shadow: 0 10px 30px rgba(28, 93, 153, 0.07);
}
.card h3 { margin-bottom: 10px; }
.card p { font-size: 0.98rem; color: var(--muted); }

.card-eg {
  display: block;
  margin-top: 16px;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}
.card-eg b { color: var(--navy-deep); font-weight: 550; display: block; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 5px; }

/* ---------------------------------------------------------- the steps ---- */
/* Numbered because this genuinely is a sequence. */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 48px); }
.step { border-top: 2px solid var(--navy); padding-top: 20px; }
.step-n {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}
.step h3 { margin-bottom: 9px; }
.step p { font-size: 0.98rem; color: var(--muted); }

/* --------------------------------------------------------------- list ---- */

.ticks { list-style: none; display: grid; gap: 14px; max-width: 68ch; }
.ticks li {
  position: relative;
  padding-left: 30px;
  font-size: 1rem;
  line-height: 1.6;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}
.ticks li b { color: var(--navy-deep); font-weight: 600; }

.plain { list-style: none; display: grid; gap: 11px; }
.plain li { position: relative; padding-left: 22px; color: var(--muted); font-size: 0.98rem; }
.plain li::before {
  content: "";
  position: absolute; left: 2px; top: 0.68em;
  width: 8px; height: 1px; background: var(--muted);
}

/* --------------------------------------------------------- guarantees ---- */

.guarantees { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(18px, 2vw, 26px); }
.guarantee {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  padding: 24px 26px;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}
.guarantee:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(28,93,153,0.07); }
.guarantee h3 { font-size: 1.02rem; margin-bottom: 8px; }
.guarantee p { font-size: 0.95rem; color: var(--muted); }

/* ------------------------------------------------------------ modules ---- */

.module {
  border-top: 2px solid var(--navy);
  padding-top: 26px;
}
.module h3 { font-size: 1.34rem; margin-bottom: 8px; }
.module > p { color: var(--muted); font-size: 1rem; margin-bottom: 22px; }

/* ---------------------------------------------------------- fit / not ---- */

.fit-col h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.fit-col h3 .mark {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 500;
}
.fit-col.yes h3 .mark { color: var(--navy); border-color: #c6d9ea; background: rgba(47,128,196,0.06); }

/* ------------------------------------------------------------ callout ---- */

.callout {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: clamp(28px, 3.4vw, 44px);
}
.callout .eyebrow { margin-bottom: 18px; }
.callout p + p { margin-top: 16px; }
.callout p { color: var(--muted); font-size: 1.02rem; }
.callout strong { color: var(--navy-deep); font-weight: 550; }

/* ------------------------------------------------------------ contact ---- */

.contact h2 { max-width: 22ch; }
.contact-lines {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 44px;
}
.contact-lines a {
  font-size: clamp(1.1rem, 2vw, 1.42rem);
  font-weight: 550;
  letter-spacing: -0.02em;
  color: var(--navy-deep);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  transition: border-color 0.24s var(--ease), color 0.24s var(--ease);
}
.contact-lines a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------- footer ---- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
  background: var(--white);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: flex-end;
  justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--navy-deep); letter-spacing: -0.02em; }
.footer-brand img { width: 24px; height: 24px; }
.footer-meta { font-size: 0.86rem; color: var(--muted); line-height: 1.6; }
.footer-stack {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  text-align: right;
}

/* ------------------------------------------------------------ reveals ---- */

/* Scoped to .js so that if the script never runs, nothing is ever hidden. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js .reveal.in { opacity: 1; transform: none; }

/* hero entrance, no observer needed */
.rise { opacity: 0; transform: translateY(16px); animation: rise 0.85s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 110ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ------------------------------------------------------- mobile toggle ---- */

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-right: -6px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.22s var(--ease);
  flex: none;
}
.nav-toggle:hover { border-color: var(--accent); }

.nav-toggle-bars { position: relative; width: 17px; height: 11px; }
.nav-toggle-bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.8px;
  border-radius: 2px;
  background: var(--navy-deep);
  transition: top 0.26s var(--ease), transform 0.26s var(--ease),
              opacity 0.16s var(--ease);
}
.nav-toggle-bars span:nth-child(1) { top: 0; }
.nav-toggle-bars span:nth-child(2) { top: 4.6px; }
.nav-toggle-bars span:nth-child(3) { top: 9.2px; }

/* bars fold into an X while the panel is open */
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { top: 4.6px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { top: 4.6px; transform: rotate(-45deg); }

/* ---------------------------------------------------------- responsive --- */

@media (max-width: 900px) {
  .grid-3, .steps { grid-template-columns: 1fr 1fr; }
  .site-nav { gap: 18px; }
  .site-nav a.nav-hide { display: none; }
}

/* Phones get the hamburger, which carries every link including the in-page
   anchors that used to be dropped. */
@media (max-width: 700px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px var(--gutter) 12px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 30px rgba(28, 93, 153, 0.09);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.26s var(--ease), transform 0.26s var(--ease),
                visibility 0.26s var(--ease);
  }
  .site-nav.open { opacity: 1; visibility: visible; transform: none; }

  .site-nav a {
    display: block;
    font-size: 1rem;
    padding: 14px 2px;
    border-bottom: 1px solid var(--line);
  }
  .site-nav a:last-child { border-bottom: 0; }

  .brand { font-size: 1rem; }
  .brand img { width: 26px; height: 26px; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .grid-3, .grid-2, .steps, .guarantees { grid-template-columns: 1fr; }

  .flow-track {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 20px;
  }
  .flow-track::before, .flow-rail {
    top: 8px; bottom: 8px; left: 7px; right: auto;
    width: 2px; height: auto;
  }
  .flow-rail { transform-origin: center top; }
  @keyframes railRun {
    0%   { transform: scaleY(0); opacity: 1; }
    62%  { transform: scaleY(1); opacity: 1; }
    86%  { transform: scaleY(1); opacity: 1; }
    97%  { transform: scaleY(1); opacity: 0; }
    100% { transform: scaleY(0); opacity: 0; }
  }
  .flow-step { flex-direction: row; align-items: center; text-align: left; gap: 14px; padding: 0; }
  .flow-step span:not(.flow-dot) { margin-top: 0; max-width: none; font-size: 0.78rem; }
  .flow-step.human .flow-dot { margin-top: 0; margin-left: -2px; }

  .footer-stack { text-align: left; }
}

/* ----------------------------------------------------- reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal, .reveal, .rise { opacity: 1 !important; transform: none !important; }
  .flow-rail { transform: scaleX(1); opacity: 1; }
  .flow-dot { border-color: var(--accent); background: var(--accent); }
  .flow-step.human .flow-dot { background: #fff; border-color: var(--navy); }
  .flow-step.human .flow-dot::after { transform: scale(1); }
}

/* --------------------------------------------------------------- print ---- */
/* Nothing stays hidden on paper or in a PDF export. */
@media print {
  .js .reveal, .rise { opacity: 1 !important; transform: none !important; animation: none !important; }
  .site-header { position: static; background: none; box-shadow: none; }
  .flow-rail { transform: scaleX(1); }
  .flow-dot { border-color: var(--accent); background: var(--accent); }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
}

/* ------------------------------------------------------- copy feedback ---- */
.btn.copied { background: var(--navy-deep); }

/* ----------------------------------------------------------- card link ---- */
/* One of the three cards goes somewhere, so it needs to look like it does. */
.card-link {
  display: flex;
  flex-direction: column;
  color: inherit;
}
.card-link:hover { color: inherit; border-color: var(--accent); }
