/* Marksai shared stylesheet.
   Order: tokens, base, layout, type, buttons, cards, components, responsive. */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: Manrope;
  src: url("../fonts/manrope-latin-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("../fonts/inter-latin-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --indigo: #5B5AC7;
  --indigo-deep: #4A49B0;
  --ink: #1A1A2E;
  --soft: #F5F5FB;
  --muted: #4B4C63;
  --navy: #0A1628; /* only for sections about InsightStream.ai */
  --white: #FFFFFF;

  /* Supporting tints */
  --indigo-tint: #EEEEFA;
  --rule: #E3E4EF;
  --outline: #C9CADB;
  --field-border: #8587A3; /* 3:1 or better against white and the soft background */
  --on-ink-accent: #C9C7F2;
  --on-ink-muted: #C5C6D8;
  --on-navy: #E8ECF4;
  --on-navy-muted: #B7C1D4;
  --navy-tint: #1E2C47;
  --navy-outline: #3A4A6B;

  /* Type */
  --font-head: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-xs: 0.84375rem;  /* 13.5px */
  --text-sm: 0.9375rem;   /* 15px */
  --text-md: 1rem;        /* 16px */
  --text-base: 1.0625rem; /* 17px */
  --text-lg: 1.25rem;     /* 20px */
  --display: clamp(2.4rem, 4.8vw, 4rem);
  --title: clamp(1.9rem, 3.4vw, 2.75rem);
  --title-sm: clamp(1.6rem, 2.6vw, 2rem);
  --title-cta: clamp(2rem, 4vw, 3rem);

  /* Shape and space */
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 24px;
  --r-xl: 28px;
  --r-pill: 999px;
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 32px);
  --section-y: clamp(64px, 9vw, 104px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--indigo-deep); }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 3px;
  border-radius: 4px;
}
.section--navy :focus-visible,
.cta-band :focus-visible,
.card--ink :focus-visible { outline-color: var(--white); }

[id] { scroll-margin-top: 24px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  background: var(--ink);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 16px; color: var(--white); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--soft { background: var(--soft); }
.section--navy { background: var(--navy); color: var(--on-navy); }
.section--flush-top { padding-top: 0; }

.stack { display: flex; flex-direction: column; gap: var(--stack-gap, 24px); }
.stack--lg { --stack-gap: 48px; }
.stack--sm { --stack-gap: 12px; }

/* Two columns that wrap to one */
.split {
  display: flex;
  flex-wrap: wrap;
  gap: var(--split-gap, 56px 64px);
}
.split > * { flex: 1 1 min(420px, 100%); }
.split--center { align-items: center; }

/* Auto-fitting card grid. Set --min on the element to change the column floor. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 220px), 100%), 1fr));
  gap: var(--grid-gap, 24px);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 48px;
}

/* ---------- Type ---------- */
.display,
.title,
.title-sm,
.card-title {
  font-family: var(--font-head);
  font-weight: 800;
  text-wrap: balance;
}
.display { font-size: var(--display); line-height: 1.08; letter-spacing: -0.025em; }
.title { font-size: var(--title); line-height: 1.12; letter-spacing: -0.02em; max-width: 22ch; }
.title-sm { font-size: var(--title-sm); line-height: 1.15; letter-spacing: -0.02em; }
.card-title { font-size: 1.25rem; font-weight: 700; line-height: 1.3; }

.lead { font-size: var(--text-lg); color: var(--muted); max-width: 35rem; }
.muted { color: var(--muted); }
.link-strong { font-weight: 600; font-size: var(--text-sm); }

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--indigo-deep);
}
.eyebrow--muted { color: var(--muted); }

.tag {
  align-self: flex-start;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--indigo-deep);
  background: var(--indigo-tint);
  padding: 7px 14px;
  border-radius: var(--r-pill);
}

/* Short indigo label above a heading */
.kicker {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--indigo-deep);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn--sm { min-height: 44px; padding: 10px 20px; font-size: var(--text-sm); }

.btn--primary { background: var(--indigo); color: var(--white); }
.btn--primary:hover { background: var(--indigo-deep); color: var(--white); }

.btn--outline { border-color: var(--outline); color: var(--ink); }
.btn--outline:hover { border-color: var(--ink); color: var(--ink); }

.btn--light { background: var(--white); color: var(--ink); }
.btn--light:hover { background: var(--indigo-tint); color: var(--ink); }

/* Outline button for navy backgrounds */
.btn--outline-dark { border-color: var(--navy-outline); color: var(--white); }
.btn--outline-dark:hover { border-color: var(--white); color: var(--white); }

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

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card p { font-size: 0.96875rem; color: var(--muted); }
.card--roomy { padding: clamp(24px, 3vw, 32px); gap: 10px; }
.card--roomy p { font-size: var(--text-md); }
.card--soft { background: var(--soft); }
.card--featured { box-shadow: inset 0 0 0 2px var(--indigo); }
.card .card__meta { font-size: var(--text-sm); font-weight: 600; color: var(--indigo-deep); }
.card--ink { background: var(--ink); color: var(--white); }
.card--ink p { color: var(--on-ink-muted); }

/* ---------- Header ---------- */
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding-block: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.375rem;
}
.brand img { width: 38px; height: 24px; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a:not(.btn) {
  display: inline-block;
  padding: 12px 0;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:not(.btn):hover { color: var(--indigo-deep); }
.site-nav a[aria-current="page"]:not(.btn) { color: var(--indigo-deep); font-weight: 600; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--outline);
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px 64px;
  padding-block: clamp(40px, 6vw, 72px) clamp(64px, 8vw, 96px);
}
.hero__copy {
  flex: 1 1 min(520px, 100%);
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.hero__panel { flex: 1 1 min(400px, 100%); }

/* Stage panel: "The path we build along" */
.path {
  background: var(--soft);
  border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 36px);
}
.path__list { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.path__list li {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--white);
  border-radius: var(--r-sm);
  padding: 18px 22px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1875rem;
}
/* Each stage reaches further than the last */
.path__list li:nth-child(1) { width: 64%; }
.path__list li:nth-child(2) { width: 76%; }
.path__list li:nth-child(3) { width: 88%; }
.path__list li.is-final { background: var(--ink); color: var(--white); }

/* Operating loop panel (homepage hero) */
.ops {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 36px);
}
.ops .eyebrow { color: var(--on-ink-accent); }
.ops__list { display: flex; flex-direction: column; margin-top: 18px; }
.ops__list li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 22px 34px;
}
.ops__list li:last-child { padding-bottom: 0; }
/* Ring marker and the rail joining one step to the next */
.ops__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--on-ink-accent);
  border-radius: 50%;
}
.ops__list li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 25px;
  bottom: 1px;
  width: 2px;
  background: var(--navy-outline);
}
.ops__list strong { font-family: var(--font-head); font-weight: 700; font-size: 1.1875rem; }
.ops__list span { color: var(--on-ink-muted); font-size: var(--text-md); }

/* Proof strip under the hero */
.proof { padding-bottom: clamp(56px, 7vw, 88px); }
.proof__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 20px 40px;
  border-top: 1px solid var(--rule);
  padding-top: 28px;
}
.proof__list li { display: flex; flex-direction: column; gap: 6px; }
.proof__list strong { font-family: var(--font-head); font-weight: 700; font-size: 1.125rem; line-height: 1.3; }

/* Founder story */
.title--wide { max-width: 30ch; }
.founder { display: flex; flex-wrap: wrap; gap: 40px 72px; }
.founder__who {
  flex: 0 1 260px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.founder__photo { width: 144px; height: 144px; object-fit: cover; border-radius: var(--r-lg); }
.founder__name { font-family: var(--font-head); font-weight: 800; font-size: 1.375rem; line-height: 1.2; }
.founder__promise { font-family: var(--font-head); font-weight: 700; font-size: 1.125rem; line-height: 1.35; }

.chapter-list { flex: 1 1 min(480px, 100%); display: flex; flex-direction: column; }
.chapter-list li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 0 32px 36px;
  border-left: 2px solid var(--rule);
}
.chapter-list li:last-child { padding-bottom: 0; border-left-color: transparent; }
.chapter-list li::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--indigo);
  box-shadow: 0 0 0 4px var(--white);
}
.section--soft .chapter-list li::before { box-shadow: 0 0 0 4px var(--soft); }
.chapter-list p:not(.kicker) { color: var(--muted); max-width: 34rem; }

.cred-list { display: flex; flex-wrap: wrap; gap: 10px; }
.cred-list li {
  background: var(--soft);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
}

/* About page: portrait beside the hero copy */
.hero--about { align-items: flex-start; }
.portrait {
  flex: 0 1 300px;
  margin: 0;
  background: var(--soft);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-md); }
.portrait figcaption { display: flex; flex-direction: column; gap: 2px; }
.portrait strong { font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; }
.portrait span { font-size: var(--text-sm); color: var(--muted); }

/* Chapters as cards on a soft background (About page) */
.chapter-list--cards { gap: 16px; max-width: 880px; }
.chapter-list--cards li,
.chapter-list--cards li:last-child {
  background: var(--white);
  border-left: 4px solid var(--indigo);
  border-radius: var(--r-md);
  padding: clamp(22px, 3vw, 30px);
}
.chapter-list--cards li::before { content: none; }
.chapter-list--cards p:not(.kicker) { max-width: 44rem; }
.chapter-list .chapter-list__take { color: var(--ink); margin-top: 6px; }

/* Service groups (Services page) */
.group { display: flex; flex-direction: column; gap: 16px; }
.group__head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.feature-row__summary .feature-row__note { font-size: var(--text-sm); color: var(--ink); font-weight: 500; }

.jump-list { display: flex; flex-wrap: wrap; gap: 10px; }
.jump-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 20px;
  border: 1px solid var(--outline);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
}
.jump-list a:hover { border-color: var(--ink); }

/* Plain line above the hero headline */
.hero__where { font-size: var(--text-sm); font-weight: 600; color: var(--indigo-deep); }
.section--navy .hero__where { color: var(--on-ink-accent); }

/* One-sentence background line under the hero */
.proof__line {
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  max-width: 62rem;
  color: var(--muted);
}
.proof__line span { color: var(--ink); font-weight: 600; }

/* First-person note */
.note { display: flex; flex-direction: column; gap: 18px; max-width: 34rem; }
.note p { font-size: 1.125rem; line-height: 1.65; }
.note .note__sign { font-family: var(--font-head); font-weight: 700; font-size: var(--text-md); margin-top: 6px; }
.ops { align-self: flex-start; }
.ops__title { font-family: var(--font-head); font-weight: 800; font-size: 1.375rem; line-height: 1.2; }

/* Services as plain ruled rows */
.svc-list { border-top: 2px solid var(--ink); }
.svc-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 32px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.svc-list a {
  flex: 0 0 220px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1875rem;
  color: var(--ink);
  text-decoration: none;
}
.svc-list a:hover { color: var(--indigo-deep); text-decoration: underline; }
.svc-list span { flex: 1 1 min(320px, 100%); color: var(--muted); }

/* Links at the foot of a card */
.link-list { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: auto; padding-top: 8px; }
.link-list a { display: inline-block; padding: 8px 0; font-weight: 600; font-size: var(--text-sm); }

.statement-list--white li { background: var(--white); }

/* ---------- Inner page hero ---------- */
.page-hero {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-block: clamp(40px, 6vw, 72px) clamp(56px, 7vw, 80px);
}
.page-hero .display { font-size: clamp(2.3rem, 4.6vw, 3.75rem); max-width: 860px; }
.page-hero .lead { max-width: 40rem; }

/* Navy version, only for the InsightStream.ai integration page */
.section--navy .page-hero { padding-block: clamp(56px, 7vw, 88px) clamp(64px, 8vw, 96px); gap: 24px; }
.section--navy .page-hero .display { color: var(--white); max-width: 900px; }
.section--navy .page-hero .lead { color: var(--on-navy-muted); max-width: 41rem; }
.section--navy .tag { background: var(--navy-tint); color: var(--white); }

/* ---------- Feature row (large card: summary left, details right) ---------- */
.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 56px;
  background: var(--white);
  border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 40px);
}
.feature-row > * { flex: 1 1 min(380px, 100%); }
.feature-row__summary { display: flex; flex-direction: column; gap: 12px; }
.feature-row__summary p:not(.kicker) { color: var(--muted); }

.feature-row--outlined { border: 1px solid var(--rule); }
.feature-row--ink { background: var(--ink); color: var(--white); }
.feature-row--ink .kicker { color: var(--on-ink-accent); }
.feature-row--ink .feature-row__summary p:not(.kicker),
.feature-row--ink .def-pairs dt { color: var(--on-ink-muted); }

/* Narrow summary, wide detail (methodology stages) */
.feature-row--detail-wide > :first-child { flex: 1 1 min(300px, 100%); }
.feature-row--detail-wide > :last-child { flex: 2 1 min(480px, 100%); }

/* Paired definitions: "What we do" / "You leave with" */
.def-pairs { display: flex; flex-wrap: wrap; gap: 20px 40px; margin: 0; }
.def-pairs > div {
  flex: 1 1 min(220px, 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.def-pairs dt {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.def-pairs dd { margin: 0; }

.rule-list li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.rule-list li:last-child { border-bottom: 0; }

/* ---------- Stage list (ruled row of steps) ---------- */
.stage-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 32px;
}
.stage-list li {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 2px solid var(--ink);
  padding-top: 20px;
}
.stage-list li.is-final { border-top-color: var(--indigo); }
.stage-list h3 { font-family: var(--font-head); font-size: 1.3125rem; font-weight: 700; }
.stage-list p { font-size: var(--text-md); color: var(--muted); }

/* ---------- InsightStream.ai band ---------- */
.partner-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px 64px;
}
.partner-band__copy {
  flex: 1 1 min(480px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.partner-band .title { color: var(--white); max-width: 24ch; }
.partner-band p { color: var(--on-navy-muted); max-width: 35rem; }
/* With a product screenshot beside the copy */
.partner-band--shot { align-items: center; }
.partner-band__shot { flex: 1.3 1 min(480px, 100%); margin: 0; }
.partner-band__shot img { width: 100%; border-radius: var(--r-md); border: 1px solid var(--navy-outline); }
.partner-band__shot figcaption { margin-top: 12px; font-size: var(--text-xs); color: var(--on-navy-muted); }

/* ---------- Statement and point lists ---------- */
.statement-list { display: flex; flex-direction: column; gap: 12px; }
.statement-list li {
  background: var(--soft);
  border-radius: var(--r-sm);
  padding: 20px 24px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1.35;
}

.point-list { display: flex; flex-direction: column; gap: 22px; }
.point-list li { display: flex; flex-direction: column; gap: 4px; }
.point-list strong { font-weight: 600; }
.point-list span { color: var(--muted); }

/* ---------- Profile photo ---------- */
.profile-photo {
  width: 128px;
  height: 128px;
  margin-top: 8px;
  object-fit: cover;
  border-radius: var(--r-md);
}

/* ---------- Long-form text (Privacy, Terms) ---------- */
.prose { max-width: 45rem; padding-bottom: var(--section-y); }
.prose > * + * { margin-top: 1em; }
.prose h2 {
  margin-top: 2.25em;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.prose ul { padding-left: 1.25em; }
.prose li + li { margin-top: 0.4em; }
.prose .prose__meta { color: var(--muted); font-size: var(--text-sm); }

/* ---------- Contact page ---------- */
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 72px;
  padding-block: clamp(40px, 6vw, 72px) var(--section-y);
}
.contact__copy {
  flex: 1 1 min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.contact__copy .display { font-size: clamp(2.3rem, 4.4vw, 3.5rem); }
.contact__copy .lead { max-width: 30rem; }

/* Numbered steps joined by a rail */
.step-list { display: flex; flex-direction: column; margin-top: 16px; }
.step-list li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 22px;
}
.step-list li:last-child { padding-bottom: 0; }
.step-list li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--rule);
}
.step-list li > span:last-child { padding-top: 3px; }
.step-dot {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--indigo-tint);
  color: var(--indigo-deep);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: var(--text-sm);
  line-height: 1;
}

/* ---------- Forms ---------- */
.form {
  flex: 1 1 min(460px, 100%);
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--soft);
  border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 40px);
}
.form__row { display: flex; flex-wrap: wrap; gap: 20px; }
.form__row > .field { flex: 1 1 min(200px, 100%); }
.form .btn { align-self: flex-start; }
.form__note { font-size: var(--text-sm); color: var(--muted); }
.form__note a { color: var(--indigo-deep); }
.form__status {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--indigo-tint);
  color: var(--ink);
  font-weight: 500;
}
.form__status[data-state="error"] { background: #FDECEC; color: #8A1C1C; }
.form__status a { color: inherit; }
.form .btn[disabled] { opacity: 0.6; cursor: default; }
/* Spam trap field: kept in the page for bots, out of sight and out of reach for people. */
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.90625rem; font-weight: 600; }
.field__hint { font-weight: 400; color: var(--muted); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}
.field textarea { resize: vertical; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { outline-offset: 1px; border-color: var(--indigo); border-radius: 10px; }

/* ---------- Call to action band ---------- */
.cta-band {
  background: var(--indigo-deep);
  color: var(--white);
  border-radius: var(--r-xl);
  padding: clamp(48px, 7vw, 72px) clamp(24px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
}
.cta-band h2 {
  max-width: 720px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: var(--title-cta);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.cta-band p { max-width: 580px; font-size: 1.1875rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  padding-block: 28px;
  font-size: 0.90625rem;
  color: var(--muted);
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.site-footer a { display: inline-block; padding: 12px 0; }

/* Navy hero with a product screenshot (InsightStream.ai integration page) */
.hero--navy { padding-block: clamp(56px, 7vw, 88px) clamp(64px, 8vw, 96px); }
.hero--navy .display { color: var(--white); font-size: clamp(2.3rem, 4.2vw, 3.5rem); }
.hero--navy .lead { color: var(--on-navy-muted); }
/* Package rows: the name, then duration, reach, and contents side by side */
.package { align-items: baseline; }
.package > .card-title { flex: 0 1 180px; }
.package > .def-pairs { flex: 1 1 min(560px, 100%); }

/* ---------- Diagrams ---------- */
/* Operating loop (homepage hero): a marker travels the ring and each step lights as it passes */
.loop { display: block; width: 100%; max-width: 460px; height: auto; margin: 8px auto 0; }
.loop__ring { fill: none; stroke: var(--navy-outline); stroke-width: 2; }
.loop__ticks { fill: none; stroke: var(--navy-outline); stroke-width: 6; stroke-dasharray: 2 10; opacity: 0.7; }
.loop__run {
  fill: none;
  stroke: var(--on-ink-accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 110 832.5;
  stroke-dashoffset: 110;
  animation: loop-run 8s linear infinite;
}
.loop__core { fill: var(--indigo); }
.loop__core-text { fill: var(--white); font-family: var(--font-head); font-weight: 800; font-size: 26px; }
.loop__label { fill: var(--white); font-family: var(--font-head); font-weight: 700; font-size: 24px; }
.loop__node { fill: var(--ink); stroke: var(--on-ink-accent); stroke-width: 4; animation: loop-node 8s linear infinite; }
.loop__node--2 { animation-delay: 2s; }
.loop__node--3 { animation-delay: 4s; }
.loop__node--4 { animation-delay: 6s; }
.loop__caption { margin-top: 14px; color: var(--on-ink-muted); font-size: var(--text-sm); text-align: center; }
@keyframes loop-run { to { stroke-dashoffset: -832.5; } }
@keyframes loop-node {
  0%, 10% { fill: var(--on-ink-accent); }
  24%, 100% { fill: var(--ink); }
}

/* Two timelines: a project that ends at launch, and one that keeps running */
.runline { display: flex; flex-direction: column; gap: 22px; margin: clamp(40px, 6vw, 64px) 0 0; }
.runline__row { display: flex; flex-direction: column; gap: 8px; }
.runline__name { font-family: var(--font-head); font-weight: 700; font-size: var(--text-md); }
.runline__track { display: flex; min-height: 52px; font-size: var(--text-sm); font-weight: 600; }
.runline__track > span { display: flex; align-items: center; padding: 10px 18px; }
.runline__build { flex: 0 0 30%; background: var(--ink); color: var(--white); border-radius: var(--r-pill) 0 0 var(--r-pill); }
.runline__launch { flex: 0 0 auto; background: var(--indigo); color: var(--white); }
.runline__after { flex: 1 1 0; border-radius: 0 var(--r-pill) var(--r-pill) 0; }
.runline__after--fade { color: var(--muted); background: linear-gradient(90deg, var(--outline), rgba(201, 202, 219, 0)); }
.runline__after--run {
  color: var(--indigo-deep);
  background-color: var(--indigo-tint);
  /* A moving dashed line along the bottom edge: the work carries on */
  background-image: linear-gradient(90deg, var(--indigo) 0 50%, transparent 50% 100%);
  background-size: 28px 4px;
  background-repeat: repeat-x;
  background-position: 0 100%;
  animation: runline-move 1.6s linear infinite;
}
@keyframes runline-move { to { background-position: 28px 100%; } }

/* Stage climb (Methodology): each stage stands taller than the last, on one running base */
.climb { margin: 16px 0 0; max-width: 980px; }
.climb__steps { display: grid; grid-template-columns: repeat(4, 1fr); align-items: end; gap: 6px; }
.climb__steps li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: calc(96px + var(--h) * 40px);
  padding: 18px;
  background: var(--soft);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.climb__steps li.is-final { background: var(--ink); color: var(--white); }
.climb__steps strong { font-family: var(--font-head); font-weight: 800; font-size: 1.1875rem; line-height: 1.2; }
.climb__steps span { font-size: var(--text-sm); color: var(--muted); }
.climb__steps li.is-final span { color: var(--on-ink-muted); }
.climb__loop, .practices__base {
  display: block;
  margin-top: 6px;
  padding: 14px 18px 16px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* Two practices on one base (Services) */
.practices { margin: 12px 0 0; max-width: 980px; }
.practices__pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 6px; }
.practices__card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--indigo);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.practices__card--ink { background: var(--ink); }
.practices__card strong { font-family: var(--font-head); font-weight: 800; font-size: 1.375rem; line-height: 1.2; }
.practices__card span { font-size: var(--text-sm); color: var(--white); }
.practices__card:hover { color: var(--white); }
.practices__card:hover strong { text-decoration: underline; text-underline-offset: 4px; }

/* Data flow (InsightStream.ai integration): stations to Execution to Intelligence to teams */
.flowfig { margin: 16px 0 0; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
.flow li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
}
.flow li.is-platform { background: var(--navy); border-color: var(--navy); color: var(--white); }
.flow strong { font-family: var(--font-head); font-weight: 800; font-size: 1.125rem; line-height: 1.25; }
.flow span { font-size: var(--text-sm); color: var(--muted); }
.flow li.is-platform span { color: var(--on-navy-muted); }
/* Connector: a line with an arrowhead across the gap to the next step */
.flow li:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + 6px);
  width: 22px;
  height: 2px;
  background: var(--indigo);
}
.flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(50% - 5px);
  left: calc(100% + 24px);
  border: 6px solid transparent;
  border-left-color: var(--indigo);
}
.flowfig figcaption { margin-top: 18px; font-weight: 600; color: var(--indigo-deep); }

@media (max-width: 859px) {
  .climb__steps { grid-template-columns: 1fr; }
  .climb__steps li { min-height: 0; width: calc(64% + var(--h) * 12%); border-radius: var(--r-sm); }
  .climb__loop { border-radius: var(--r-sm); }
  .flow { grid-template-columns: 1fr; gap: 34px; }
  .flow li:not(:last-child)::before { top: calc(100% + 5px); left: 32px; width: 2px; height: 18px; }
  .flow li:not(:last-child)::after { top: calc(100% + 22px); left: 27px; border: 6px solid transparent; border-top-color: var(--indigo); }
}

/* ---------- Whitepapers ---------- */
.paper h3 { font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; line-height: 1.25; margin-top: 1.6em; }
.paper ol { padding-left: 1.4em; list-style: decimal; }
.paper ul { list-style: disc; }
.paper li { padding-left: 0.2em; }
.paper__figure { margin: 1.6em 0; max-width: 30rem; }
.paper__climb { margin: 1.6em 0; }
.paper .climb__steps { list-style: none; padding-left: 0; }
.paper .climb__steps li { padding-left: 18px; margin-top: 0; }
.hero__where a { color: inherit; }
/* Lessons: example and exercise boxes, and the previous/next row */
.callout { background: var(--soft); border-radius: var(--r-md); padding: 22px 24px; margin-top: 1.6em; }
.callout > * + * { margin-top: 0.5em; }
.callout--do { background: var(--indigo-tint); }
.lesson-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 2.4em; padding-top: 1.6em; border-top: 1px solid var(--rule); }
.chapter-list--cards .card-title a { color: inherit; }
/* The print button needs the page script, so it only shows when that has run */
.paper__actions { display: none; }
.has-js .paper__actions { display: flex; }

/* ---------- Explainer film (homepage) ---------- */
.film { display: flex; flex-wrap: wrap; align-items: center; gap: 32px 64px; padding-bottom: var(--section-y); }
.film__head { flex: 1 1 min(320px, 100%); display: flex; flex-direction: column; gap: 16px; }
.film__player { flex: 2 1 min(520px, 100%); }
.film video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--ink); border-radius: var(--r-lg); }
.film__transcript { margin-top: 14px; font-size: var(--text-sm); color: var(--muted); }
.film__transcript summary { cursor: pointer; font-weight: 600; color: var(--indigo-deep); padding: 8px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
  /* Without JavaScript the nav simply wraps under the logo. */
  .has-js .nav-toggle { display: inline-flex; }
  .has-js .site-nav { display: none; flex-basis: 100%; }
  .has-js .site-nav[data-open] { display: block; }
  .has-js .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 12px;
    border-top: 1px solid var(--rule);
  }
  .has-js .site-nav a:not(.btn) {
    display: block;
    padding: 14px 0;
    font-size: var(--text-base);
    border-bottom: 1px solid var(--rule);
  }
  .has-js .site-nav .btn { width: 100%; margin-top: 16px; }
}

@media (max-width: 479px) {
  .btn-row .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .loop__run, .loop__node, .runline__after--run { animation: none; }
}

/* ---------- Print: a whitepaper saved as PDF ---------- */
@media print {
  @page { margin: 18mm 16mm; }
  .site-header, .site-footer, .skip-link, .cta-band, .paper__actions, .nav-toggle, .lesson-nav { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .container { max-width: none; padding: 0; }
  .page-hero { padding-block: 0 12pt; }
  .page-hero .display { font-size: 26pt; }
  .prose { max-width: none; padding-bottom: 0; }
  .paper h2, .paper h3 { break-after: avoid; }
  .paper li, .paper__figure, .paper__climb { break-inside: avoid; }
  .paper__climb { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .paper__figure { max-width: 90mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .loop__run, .loop__node { animation: none; }
  .paper a { color: inherit; }
  .paper::after {
    content: "Marksai · AI engineering and consulting · marksai.com";
    display: block;
    margin-top: 18pt;
    padding-top: 8pt;
    border-top: 1px solid #999;
    font-size: 9pt;
  }
}
