/*
 * CostWorkX marketing site.
 *
 * Hand-written, no build step. The CSP in marketing/vercel.json is
 * `style-src 'self'` with no `unsafe-inline`, so there are no <style> blocks
 * and no style="" attributes anywhere — everything lives here.
 *
 * Two rules that are not preferences, both from measured contrast:
 *   - orange is a MARKER, never a button. White on #FF5A1F is 3.12 and fails AA.
 *   - --muted (#8A8378) is never body copy. It is 3.33 on the screen surface.
 * Use the semantic variables in tokens.css and the pairing is right by default.
 */

/* ---------- fonts: self-hosted, latin subset, ~76 KB for all five ---------- */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/fonts/plex-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/fonts/plex-sans-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/plex-mono-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

/* ---------- reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--app-bg);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  height: auto;
}

/* ---------- a11y furniture ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--cta-bg);
  color: var(--cta-fg);
  border-radius: 0 0 var(--radius-control) 0;
  z-index: 20;
}
.skip-link:focus {
  left: 0;
}
:focus-visible {
  outline: 2px solid var(--accent-bg);
  outline-offset: 2px;
}
.band-ink :focus-visible {
  outline-color: var(--primary-light);
}

/* ---------- layout ---------- */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.wrap-narrow {
  max-width: 46rem;
}
.center {
  text-align: center;
}
.band {
  padding: 3.5rem 0;
}
.band-alt {
  background: var(--screen);
  border-block: 1px solid var(--border-09);
}
.band-ink {
  background: var(--ink);
  color: #ddd8cf;
}

/* ---------- type ---------- */
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-strong);
  margin: 0 0 0.6rem;
  letter-spacing: -0.015em;
}
h1 {
  font-size: var(--step-h1);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}
h2 {
  font-size: var(--step-h2);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}
h3 {
  font-size: var(--step-h3);
  line-height: 1.3;
}
.band-ink h1,
.band-ink h2,
.band-ink h3 {
  color: var(--screen);
}
p {
  margin: 0 0 1rem;
}
.lede {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--text-subtle);
  max-width: 40rem;
}
.lede-tight {
  font-size: var(--step-body);
}
.lede-on-ink {
  color: #ddd8cf;
  margin-inline: auto;
}
.prose,
.section-lede {
  max-width: 42rem;
  color: var(--text-body);
}
.section-lede {
  margin-bottom: 2rem;
}
.prose-on-ink {
  color: #ddd8cf;
}
.kicker {
  font-family: var(--font-mono);
  font-size: var(--step-mono);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-bg);
  margin: 0 0 0.6rem;
}
.kicker-on-ink {
  color: var(--primary-light);
}
.mono-label {
  font-family: var(--font-mono);
  font-size: var(--step-mono);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 0 0 0.35rem;
}
.mono-on-ink {
  color: #b9b2a5;
}

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--app-bg);
  border-bottom: 1px solid var(--border-09);
}
.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--primary);
  display: inline-block;
}
.head-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 1rem;
  flex-wrap: wrap;
}
.head-nav a {
  color: var(--text-subtle);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.4rem 0;
}
.head-nav a:hover {
  color: var(--text-strong);
}
.head-signin {
  color: var(--text-strong) !important;
  font-weight: 600;
}

/* ---------- hero ---------- */
.hero {
  padding: 3rem 0 3.25rem;
}
.runs-on {
  font-family: var(--font-mono);
  font-size: var(--step-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
  max-width: 34rem;
  margin-top: 1.5rem;
  line-height: 1.7;
}

/* ---------- links & buttons ---------- */
/*
 * Measured on the desk background #DAD5CC: ink is 12.6 (AAA), primaryDeep is
 * 3.48 and FAILS. So links are ink, and the underline carries the affordance.
 */
a:not(.btn):not(.skip-link):not(.brand):not(.head-nav a):not(.foot-nav a):not(.sticky-cta) {
  color: inherit;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.75rem;
}
.cta-row-center {
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target);
  padding: 0 1.35rem;
  border-radius: var(--radius-control);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    background var(--fade-ms) ease,
    color var(--fade-ms) ease;
}
.btn-wa {
  background: var(--cta-bg);
  color: var(--cta-fg);
}
.btn-wa:hover {
  background: var(--cta-bg-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--text-strong);
  border-color: var(--border-20);
}
.btn-ghost:hover {
  border-color: var(--ink);
}
.btn-invert {
  background: var(--screen);
  color: var(--ink);
}
.btn-invert:hover {
  background: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--screen);
  border-color: rgba(244, 241, 235, 0.35);
}
.btn-outline:hover {
  border-color: var(--screen);
}
.btn-plan {
  background: var(--cta-bg);
  color: var(--cta-fg);
  margin-top: auto;
  align-self: flex-start;
}
.btn-plan:hover {
  background: var(--cta-bg-hover);
}
/* WhatsApp first on phone; email first from tablet up. */
@media (min-width: 768px) {
  .btn-wa {
    order: 2;
  }
  .btn-mail {
    order: 1;
  }
}

/* ---------- lists ---------- */
.three-up,
.cards,
.plans {
  list-style: none;
  padding: 0;
  margin: 2.25rem 0 0;
  display: grid;
  gap: 1rem;
}
.three-up > li {
  padding: 1.25rem 0 0;
  border-top: 2px solid var(--border-20);
}
.card {
  background: var(--card);
  border: 1px solid var(--border-09);
  border-radius: var(--radius-card);
  padding: 1.4rem;
}
.card p:last-child,
.plan p:last-child {
  margin-bottom: 0;
}

/* status chips — the register's wording is product law, so it is quoted, not paraphrased */
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.15em 0.5em;
  border-radius: var(--radius-pill);
  background: rgba(46, 125, 50, 0.12);
  /*
   * MEASURED. The app's own chip pairing — success #2E7D32 on a 12% tint of
   * itself — composites to 4.37 against white at this 10.9px size, just under
   * the 4.5 AA floor. The tint is kept (it is the chip's identity) and the text
   * is darkened until it clears: #256A28 measures 5.65. The app has the same
   * pairing at a similar size and is backlogged separately; this page is not
   * the place to leave it failing while waiting for that.
   */
  color: #256a28;
  white-space: nowrap;
}
.chip-warn {
  background: rgba(176, 135, 10, 0.14);
  /* Same correction: warningDeep #8A6D08 composites to 4.25; #7A6007 gives 5.18. */
  color: #7a6007;
}
.chip-mute {
  background: rgba(23, 20, 15, 0.07);
  color: var(--text-subtle);
}

/* ---------- steps ---------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 2rem;
}
.steps > li {
  border-top: 2px solid var(--border-20);
  padding-top: 1.1rem;
  max-width: 44rem;
}
.step-no {
  font-family: var(--font-mono);
  font-size: var(--step-mono);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-bg);
  margin: 0 0 0.35rem;
}

/* ---------- what's built ---------- */
.built-cols {
  display: grid;
  gap: 2.25rem;
  margin-top: 2rem;
}
.col-head {
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(244, 241, 235, 0.18);
  margin-bottom: 1rem;
}
.col-yes {
  color: #7fc784;
}
.col-no {
  color: #d9a441;
}
.built-col dl {
  margin: 0;
}
.built-col dt {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--screen);
  margin-top: 1.05rem;
}
.built-col dd {
  margin: 0.25rem 0 0;
  color: #b9b2a5;
  font-size: 0.95rem;
  line-height: 1.55;
}
.updated {
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: var(--step-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8f887c;
}

/* ---------- pricing ---------- */
.plan {
  background: var(--card);
  border: 1px solid var(--border-09);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}
.plan-for {
  color: var(--text-subtle);
}
.ticks {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.ticks li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.6rem;
  font-size: 0.97rem;
  line-height: 1.5;
}
.ticks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--primary);
}
.pricing-note {
  margin-top: 1.75rem;
  max-width: 42rem;
  color: var(--text-subtle);
}

/* ---------- FAQ (details/summary — works with JS off) ---------- */
details {
  border-top: 1px solid var(--border-12);
  padding: 0.35rem 0;
}
details:last-of-type {
  border-bottom: 1px solid var(--border-12);
}
summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 2rem 0.9rem 0;
  font-weight: 600;
  color: var(--text-strong);
  position: relative;
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: '+';
  position: absolute;
  right: 0.25rem;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--accent-bg);
}
details[open] summary::after {
  content: '–';
}
details p {
  margin: 0 0 1rem;
  color: var(--text-body);
  max-width: 42rem;
}

/* ---------- footer ---------- */
.site-foot {
  padding: 2.5rem 0 5.5rem;
  border-top: 1px solid var(--border-09);
}
.foot-line {
  color: var(--text-subtle);
  margin-bottom: 0.85rem;
}
.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-bottom: 0.85rem;
}
.foot-nav a {
  color: var(--text-strong);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-color: var(--border-20);
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
}
.foot-nav a:hover {
  text-decoration-color: currentColor;
}
.foot-copy {
  font-family: var(--font-mono);
  font-size: var(--step-mono);
  letter-spacing: 0.04em;
  color: var(--text-subtle);
  margin: 0;
}

/* ---------- sticky CTA: phone only ---------- */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 1rem calc(env(safe-area-inset-bottom, 0px));
  background: var(--cta-bg);
  color: var(--cta-fg);
  font-weight: 600;
  text-decoration: none;
}
@media (min-width: 768px) {
  .sticky-cta {
    display: none;
  }
  .site-foot {
    padding-bottom: 3rem;
  }
}

/* ---------- breakpoints: 768 and 1100, matching the app's own ---------- */
@media (min-width: 768px) {
  :root {
    --step-h1: 2.75rem;
    --step-h2: 1.875rem;
    --step-h3: 1.2rem;
  }
  .wrap {
    padding: 0 2rem;
  }
  .band {
    padding: 4.5rem 0;
  }
  .hero {
    padding: 4.5rem 0;
  }
  .three-up {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .plans {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  .built-cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }
  .steps {
    gap: 2.5rem;
  }
}

@media (min-width: 1100px) {
  :root {
    --step-h1: 3.5rem;
    --step-h2: 2.125rem;
  }
  .wrap {
    padding: 0 2.5rem;
  }
  .band {
    padding: 5.5rem 0;
  }
  .hero {
    padding: 5.5rem 0 5rem;
  }
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
  h1 {
    max-width: 18ch;
  }
}

@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;
  }
}

/* ---------- phone nav: brand + Sign in only ---------- */
/*
 * At 375px the five section anchors wrapped to a second row and pushed the
 * headline below the fold. On a phone the nav's job is the brand and the one
 * link a returning user needs; the sticky bar below carries the action, and the
 * sections are a scroll away rather than a menu.
 */
@media (max-width: 767px) {
  .head-nav a:not(.head-signin) {
    display: none;
  }
  .head-inner {
    min-height: 52px;
    flex-wrap: nowrap;
  }
}

/* ---------- sticky CTA: always on, phone only, no script ---------- */
/*
 * An earlier version hid this bar and revealed it with an IntersectionObserver
 * once the hero's button scrolled away, to avoid showing two identical calls to
 * action at once. It was removed deliberately.
 *
 * Its failure mode is silent and total: if the script does not run, the bar
 * never appears and the phone loses its primary action with nothing to show
 * that anything is wrong. That is a bad trade for cosmetics, and it could not
 * be verified here either — the preview pane freezes frames between paints, so
 * neither the transition nor the observer could be measured honestly.
 *
 * The duplication it existed to prevent is solved in markup instead: on a phone
 * the hero offers Email and the bar offers WhatsApp, so the two never repeat.
 * This page now ships ZERO JavaScript.
 */
.hero .btn-wa {
  display: none;
}
@media (min-width: 768px) {
  .hero .btn-wa {
    display: inline-flex;
  }
}
