/* ConnectedWorkOS — marketing site.
   Direction: blueprint. The trades' own drawing language — drafting blue, fine grid,
   hairline rules, mono annotations — rather than a generic SaaS gradient. Hi-vis amber
   is reserved for money moments only (deposit, payment, primary CTA), so colour carries
   meaning instead of decoration. */

:root {
  --bp-900: #05192c;
  --bp-800: #082744;
  --bp-700: #0c355c;
  --bp-600: #14507f;
  --paper: #f3f7fa;
  --paper-2: #e7eef4;
  --ink: #0a1b2e;
  --ink-soft: #46617a;
  --cyan: #2bd4e8;
  --blue: #2b8ede;
  --hivis: #ffb020;
  --rule: rgba(255, 255, 255, 0.16);
  --rule-dark: #cbdae6;

  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1120px;
  --gut: clamp(1.25rem, 4vw, 3rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.075rem);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

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

a { color: var(--bp-600); }
/* The base link colour is tuned for light sections. On a blueprint band it drops to
   2.1:1, so links there take the cyan instead. Buttons are excluded because they set
   their own colours and a bare `.field a` would out-specify .btn--ghost. */
.field a:not(.btn) { color: var(--cyan); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--hivis);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* ── Type ─────────────────────────────────────────────────────────────────── */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  margin: 0;
}

h1 { font-size: clamp(2.75rem, 1.6rem + 5.6vw, 5.75rem); }
h2 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.5rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem); letter-spacing: 0.01em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 0 1.25rem;
  color: var(--cyan);
}
.eyebrow--dark { color: var(--bp-600); }

.lede { font-size: clamp(1.075rem, 1rem + 0.4vw, 1.3rem); line-height: 1.55; }

/* ── Blueprint field ──────────────────────────────────────────────────────── */

.field {
  position: relative;
  color: #dceaf5;
  background-color: var(--bp-900);
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 44px 44px;
  overflow: hidden;
}
.field--glow::after {
  /* Soft glow behind the hero only, echoing the logo's own halo. Repeating it on every
     blueprint band would turn a signature into wallpaper. */
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 90%;
  background: radial-gradient(60% 60% at 30% 40%, rgba(43, 212, 232, 0.16), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Dissolves the white masthead band into the blueprint so the two meet without a seam.
   Layering is explicit because ::after paints after ::before by default, which would let
   the cyan glow tint the white it is supposed to be fading from. */
.field--fade::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: clamp(90px, 12vw, 158px);
  /* Multi-stop rather than white-to-transparent: a two-stop fade over a dark ground
     reads as a flat grey band, because alpha falls off linearly while perceived
     lightness does not. These stops approximate an ease-out. */
  background: linear-gradient(180deg,
    #fff 0%,
    rgba(255, 255, 255, 0.94) 16%,
    rgba(255, 255, 255, 0.76) 32%,
    rgba(255, 255, 255, 0.48) 52%,
    rgba(255, 255, 255, 0.22) 72%,
    rgba(255, 255, 255, 0.06) 88%,
    rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 1;
}
.field > * { position: relative; z-index: 2; }

/* ── Header ───────────────────────────────────────────────────────────────── */

/* White band across the full width, so the wordmark sits on its own ground rather than
   on a plate pasted over the artwork. */
.masthead { background: #fff; padding: 1.35rem 0 1.15rem; }
.masthead__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
.masthead__brand { display: inline-block; line-height: 0; }
.masthead__logo { width: clamp(190px, 30vw, 258px); }
.masthead__links { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
/* Both states sit dark on the white band. Because they are close in value, hover carries
   its affordance with an underline rather than relying on the colour shift alone. */
.masthead__links a { color: var(--ink); text-decoration: none; }
.masthead__links a:hover,
.masthead__links a:focus-visible {
  color: var(--bp-700);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

/* Top padding must clear .field--fade, or the cyan eyebrow lands on the still-light part
   of the gradient and drops to unreadable contrast. */
.hero { padding: clamp(6.25rem, 14vw, 10.5rem) 0 clamp(3.5rem, 8vw, 7rem); }
.hero h1 { max-width: 15ch; color: #fff; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero__lede { max-width: 58ch; margin: 1.75rem 0 0; color: #bdd5e7; }

.actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2.25rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.075rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: transform 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn--go { background: var(--hivis); color: var(--bp-900); }
.btn--go:hover { background: #ffc451; }
.btn--ghost { border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }
.btn--dark { background: var(--bp-900); color: #fff; }
.btn--dark:hover { background: var(--bp-700); }
.btn--outline { border-color: var(--rule-dark); color: var(--ink); }
.btn--outline:hover { border-color: var(--bp-600); }

.hero__note { margin: 1.5rem 0 0; font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.05em; color: #7fa3bf; }

/* ── Section frame ────────────────────────────────────────────────────────── */

.band { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.band--paper { background: var(--paper); }
.band--tint { background: var(--paper-2); }
.band__head { max-width: 62ch; }
.band__head p { color: var(--ink-soft); margin: 1.25rem 0 0; }
.field .band__head p { color: #b6cfe2; }

/* ── Trades ───────────────────────────────────────────────────────────────── */

.trades { padding-block: clamp(2.25rem, 5vw, 3.25rem); }
.trades__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}
.trades__list li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule-dark);
  border-radius: 2px;
  padding: 0.4rem 0.7rem;
}
.trades__note { max-width: 62ch; margin: 1.5rem 0 0; color: var(--ink-soft); }

/* ── The run: the signature element ───────────────────────────────────────────
   A conduit line down the page with a connector node per stage, drawn from the
   pin-and-trace motif in the logo. A job genuinely is a sequence, so the numbers
   carry real information rather than decorating the list. */

.run { margin-top: clamp(2.5rem, 5vw, 4rem); }

.run__list { list-style: none; margin: 0; padding: 0; position: relative; }
.run__list::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 0.65rem;
  bottom: 0.65rem;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--blue) 55%, rgba(43, 212, 232, 0.15));
}

.stage { position: relative; padding: 0 0 2.25rem 3.25rem; }
.stage:last-child { padding-bottom: 0; }
.stage::before {
  /* Connector node. */
  content: "";
  position: absolute;
  left: 4px;
  top: 0.55rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bp-900);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 0 4px rgba(43, 212, 232, 0.12);
}
.stage--pay::before { border-color: var(--hivis); box-shadow: 0 0 0 4px rgba(255, 176, 32, 0.16); }

.stage__no { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; color: #6f97b5; display: block; margin-bottom: 0.3rem; }
.stage--pay .stage__no { color: var(--hivis); }
.stage h3 { color: #fff; }
.stage p { margin: 0.45rem 0 0; color: #b6cfe2; max-width: 54ch; }

@media (min-width: 780px) {
  .run__list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3.5rem; }
  .run__list::before { left: 50%; transform: translateX(-1px); }

  /* Each step gets its OWN row, alternating sides, so the eye travels down the run in
     order. Left to auto-placement, steps 1 and 2 would share the first row and the
     sequence would read as two parallel columns instead of one line. */
  .stage { padding: 0 3.5rem 2.5rem 0; text-align: right; grid-column: 1; }
  .stage::before { left: auto; right: -8px; }
  .stage:nth-child(even) { grid-column: 2; text-align: left; padding-left: 3.5rem; padding-right: 0; }
  .stage:nth-child(even)::before { right: auto; left: -8px; }
  .stage:nth-child(1) { grid-row: 1; }
  .stage:nth-child(2) { grid-row: 2; }
  .stage:nth-child(3) { grid-row: 3; }
  .stage:nth-child(4) { grid-row: 4; }
  .stage:nth-child(5) { grid-row: 5; }
  .stage:nth-child(6) { grid-row: 6; }
  .stage:nth-child(7) { grid-row: 7; }
  .stage:nth-child(8) { grid-row: 8; }
  .stage p { max-width: none; }
}

/* ── Split: Ledger tie-in ─────────────────────────────────────────────────── */

.split { display: grid; gap: clamp(2rem, 5vw, 3.5rem); margin-top: clamp(2rem, 4vw, 3rem); }
@media (min-width: 860px) { .split { grid-template-columns: 1.05fr 0.95fr; align-items: center; } }

/* A receipt-to-ledger diagram, drawn in CSS rather than shipped as an image. */
/* Sets its own white background, so it must set its own colour — inside a .field band it
   otherwise inherits #dceaf5 and the values render at 1.2:1. Same trap as .doc. */
.flow { border: 1px solid var(--rule-dark); background: #fff; color: var(--ink); border-radius: 3px; overflow: hidden; }
.flow__row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.15rem; border-bottom: 1px dashed var(--rule-dark); }
.flow__row:last-child { border-bottom: 0; }
.flow__label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.flow__val { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.flow__val--pay { color: #0a7d4f; }
.flow__head { background: var(--bp-900); color: #fff; padding: 0.75rem 1.15rem; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.flow__arrow { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 1.15rem; background: var(--paper-2); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.flow__arrow span { color: var(--hivis); font-size: 1rem; }

/* ── Card grid ────────────────────────────────────────────────────────────── */

.cards { display: grid; gap: 1px; margin-top: clamp(2rem, 4vw, 3rem); background: var(--rule-dark); border: 1px solid var(--rule-dark); }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards--three { grid-template-columns: repeat(3, 1fr); } }
/* Three cards in a two-column grid leave a dangling empty cell, which shows as a grey
   block because the grid's own background is what draws the hairlines. Let the odd one
   run the full width instead. */
@media (min-width: 720px) and (max-width: 999px) {
  .cards--three .card:last-child { grid-column: 1 / -1; }
}

/* Stacked variant sits inside a narrow column of .split, so it must stay single-file at
   every width. Declared after the media queries above so it actually wins. */
.cards--stack { grid-template-columns: 1fr; margin-top: 0; }

/* Disclosure copy. Quiet, but present — a page that shows a price should say what the
   price does not cover. */
.fineprint {
  max-width: 74ch;
  margin: 1.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-soft);
  border-left: 2px solid var(--rule-dark);
  padding-left: 1rem;
}

.card { background: #fff; padding: clamp(1.5rem, 3vw, 2.1rem); }
/* --blue reads at only 3.5:1 at this size; --bp-600 keeps it unmistakably blue at ~8.9:1. */
.card__tag { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bp-600); }
.card h3 { margin: 0.75rem 0 0; color: var(--ink); }
.card p { margin: 0.6rem 0 0; color: var(--ink-soft); }

/* ── Closing CTA ──────────────────────────────────────────────────────────── */

.close { text-align: center; }
.close h2 { color: #fff; max-width: 20ch; margin-inline: auto; text-wrap: balance; }
.close p { color: #b6cfe2; max-width: 54ch; margin: 1.5rem auto 0; }
.close .actions { justify-content: center; }

/* ── Footer ───────────────────────────────────────────────────────────────── */

.foot { background: var(--bp-900); color: #7fa3bf; border-top: 1px solid var(--rule); padding: 2.5rem 0; }
.foot__row { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; }
.foot a { color: #a9c6dc; text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; }

/* ── Inner page header ────────────────────────────────────────────────────── */
/* Same clearance rule as .hero: content must start below .field--fade or the cyan
   eyebrow lands on the still-light part of the gradient. */
.pagehead { padding: clamp(6.25rem, 14vw, 9rem) 0 clamp(2.5rem, 5vw, 4rem); }
.pagehead h1 { max-width: 18ch; color: #fff; text-wrap: balance; font-size: clamp(2.25rem, 1.4rem + 4vw, 4.25rem); }
.pagehead__lede { max-width: 62ch; margin: 1.5rem 0 0; color: #bdd5e7; }

/* ── Example documents (how-it-works) ─────────────────────────────────────── */
/* Rendered as HTML rather than screenshots: readable on a phone, indexable as text, and
   they cannot silently go stale against a UI change the way an image does. */
.doc {
  background: #fff;
  /* Set the text colour explicitly, because .doc carries its own white background but can
     sit inside a .field band whose colour is #dceaf5 — pale text on white, essentially
     unreadable. Anything that paints its own background must also state its own colour. */
  color: var(--ink);
  border: 1px solid var(--rule-dark);
  border-radius: 3px;
  margin-top: clamp(2rem, 4vw, 3rem);
  overflow: hidden;
}
.doc__head {
  display: flex; flex-wrap: wrap; gap: .5rem 1rem;
  align-items: baseline; justify-content: space-between;
  padding: .9rem 1.15rem; background: var(--bp-900); color: #fff;
}
.doc__kind { display: block; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.doc__title { font-family: var(--font-display); font-size: 1.25rem; text-transform: uppercase; letter-spacing: .01em; }
.doc__meta { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; color: #9dbdd6; }
.doc__meta--ok { color: #7ce3b1; }

/* The line-item table cannot shrink below its content, and .doc clips (overflow:hidden,
   for the rounded corners) — so without this wrapper the Amount column is silently cut
   off on a phone rather than being reachable. Scroll the table, never the page. */
.doc__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.doc__table { width: 100%; min-width: 380px; border-collapse: collapse; font-size: .92rem; }
.doc__table th, .doc__table td { padding: .6rem 1.15rem; border-bottom: 1px solid #eef2f5; text-align: left; }
.doc__table th {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft); background: var(--paper);
}
.doc__table .num { text-align: right; white-space: nowrap; }
.doc__included td { color: var(--ink-soft); font-style: italic; }

.doc__totals { padding: .5rem 1.15rem 1rem; }
.doc__totals > div { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; font-size: .92rem; }
.doc__totals .is-total { border-top: 1px solid var(--rule-dark); margin-top: .35rem; padding-top: .6rem; font-family: var(--font-display); font-size: 1.2rem; }
/* The one number the reader is looking for gets the money colour. */
.doc__totals .is-due { color: var(--bp-700); font-weight: 500; }
.doc__totals .is-due span:last-child { color: #8a5200; font-weight: 600; }

.doc__fields { margin: 0; padding: 1rem 1.15rem; display: grid; gap: .75rem; }
@media (min-width: 620px) { .doc__fields { grid-template-columns: 1fr 1fr; } }
.doc__fields dt { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.doc__fields dd { margin: .15rem 0 0; font-size: .95rem; }

.doc--dark { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.04); color: #dceaf5; }
.doc--dark .doc__totals .is-total { border-top-color: rgba(255,255,255,.2); }
.doc--dark .doc__head { background: rgba(0,0,0,.25); }

.doc__note { max-width: 74ch; margin: 1.5rem 0 0; font-size: .92rem; color: var(--ink-soft); }
.field .doc__note { color: #b6cfe2; }

/* ── Numbered steps (getting-paid) ────────────────────────────────────────── */
.steps { list-style: none; margin: clamp(2rem, 4vw, 3rem) 0 0; padding: 0; }
.steps__item { display: flex; gap: 1.15rem; padding: 1.1rem 0; border-top: 1px solid var(--rule-dark); }
.steps__item:first-child { border-top: 0; }
.steps__no { font-family: var(--font-mono); font-size: .8rem; color: var(--bp-600); flex: 0 0 auto; padding-top: .2rem; }
.steps__item h3 { margin: 0; }
.steps__item p { margin: .4rem 0 0; color: var(--ink-soft); max-width: 68ch; }

/* ── Callouts ─────────────────────────────────────────────────────────────── */
.callout {
  max-width: 74ch; margin: 1.75rem 0 0; padding: .9rem 1.15rem;
  font-size: .92rem; line-height: 1.6; color: var(--ink);
  background: #fff; border-left: 3px solid var(--blue); border-radius: 2px;
}
/* Amber means money elsewhere on this site; here it means "this will stop you taking
   money", which is the same idea pointed at a warning. */
.callout--warn { border-left-color: var(--hivis); }

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.faq { max-width: 82ch; }
.faq__item { border-bottom: 1px solid var(--rule-dark); }
.faq__q {
  cursor: pointer; list-style: none;
  padding: 1rem 2rem 1rem 0; position: relative;
  font-family: var(--font-display); font-size: 1.2rem; text-transform: uppercase; letter-spacing: .01em;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: "+"; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 1.25rem; color: var(--blue);
}
.faq__item[open] .faq__q::after { content: "−"; }
.faq__q:focus-visible { outline: 3px solid var(--hivis); outline-offset: 2px; }
.faq__a { padding: 0 2rem 1.1rem 0; }
.faq__a p { margin: 0; color: var(--ink-soft); max-width: 74ch; }

/* ── Footer nav row ───────────────────────────────────────────────────────── */
.foot__nav a { margin-right: .15rem; }
