/* TraceLock — Component styles (v2 · light-first enterprise)
 * All components read from tokens.css. Light is default; dark inherits via [data-theme="dark"].
 */

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  min-height: 42px;
  transition:
    background-color var(--dur-med) var(--ease-out),
    border-color     var(--dur-med) var(--ease-out),
    color            var(--dur-med) var(--ease-out),
    transform        var(--dur-fast) var(--ease-out),
    box-shadow       var(--dur-med) var(--ease-out);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -0.005em;
}
.btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading::after {
  content: '';
  width: 14px; height: 14px; margin-left: 4px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 700ms linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

.btn-sm { padding: 7px 14px; min-height: 34px; font-size: 0.8125rem; border-radius: 8px; }
.btn-lg { padding: 14px 22px; min-height: 50px; font-size: 1rem; }
.btn-xl { padding: 16px 26px; min-height: 56px; font-size: 1.0625rem; border-radius: 12px; }

/* Primary — deep ink. The default CTA. Confident, not cyan-glowy. */
.btn-primary {
  background: var(--text);
  color: var(--panel);
  border-color: var(--text);
}
.btn-primary:hover { background: #000; border-color: #000; }
[data-theme="dark"] .btn-primary { background: var(--text); color: var(--base); border-color: var(--text); }
[data-theme="dark"] .btn-primary:hover { background: #FFF; border-color: #FFF; }

/* Accent — cyan. For moments where the CTA should feel branded. */
.btn-accent {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}
.btn-accent:hover { background: #065F78; border-color: #065F78; }
[data-theme="dark"] .btn-accent { color: var(--accent-ink); }
[data-theme="dark"] .btn-accent:hover { background: var(--accent-bright); border-color: var(--accent-bright); }

/* Secondary — outline */
.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border-color: var(--stroke);
}
.btn-secondary:hover { border-color: var(--text); }

/* Ghost — text only */
.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover { background: var(--elevate); }

/* Danger */
.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
  border-color: var(--danger);
}
.btn-danger:hover { filter: brightness(0.92); }

/* ==================== NAV ==================== */
.tl-nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--base) 78%, transparent);
  border-bottom: 1px solid var(--stroke-soft);
}
/* backdrop-filter lives on ::before so it does NOT become a containing block
   for the position:fixed mobile drawer inside the nav. Putting backdrop-filter
   directly on .tl-nav would make it the containing block for fixed children,
   causing the drawer's top/right/bottom coords to be relative to the ~60px nav
   box rather than the viewport — the drawer would be clipped / mis-positioned. */
.tl-nav::before {
  content: '';
  position: absolute; inset: 0;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  z-index: -1;
  pointer-events: none;
}
.tl-nav-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: 36px;
}
.tl-nav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 600; letter-spacing: -0.015em;
  color: var(--text); font-size: 1.0625rem;
}
.tl-nav-brand .wordmark {
  display: inline-flex; align-items: baseline;
  letter-spacing: -0.02em;
}
.tl-nav-brand .wordmark .lock-o {
  color: var(--accent);
  font-feature-settings: "ss01";
}
.tl-nav-brand img { height: 34px; width: auto; display: block; }
/* Light-theme wordmark ships as soft gray; darken it so it reads on the off-white nav. */
:root[data-theme="light"] .tl-nav-brand img[data-logo-light] { filter: brightness(0.35) contrast(1.2); }
.tl-nav-links {
  display: flex; align-items: center; gap: 26px;
  list-style: none; margin: 0; padding: 0;
  font-size: 0.9375rem; font-weight: 500;
}
.tl-nav-link {
  position: relative;
  color: var(--muted);
  padding: 6px 2px;
  transition: color var(--dur-med) var(--ease-out);
}
.tl-nav-link:hover { color: var(--text); }
.tl-nav-link.is-active { color: var(--text); }
.tl-nav-link.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--text); border-radius: 2px;
}
.tl-nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Nav submenu */
.tl-nav-links li.has-menu { position: relative; }
.tl-submenu {
  position: absolute; top: calc(100% + 10px); left: -16px;
  min-width: 280px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  z-index: 80;
}
/* Invisible hover-bridge so cursor can cross the 10px gap between nav link and submenu
   without :hover breaking. Lives inside .tl-submenu so hovering it keeps the parent open. */
.tl-submenu::before {
  content: '';
  position: absolute;
  top: -10px; left: 0; right: 0; height: 10px;
}
.tl-nav-links li.has-menu:hover .tl-submenu,
.tl-nav-links li.has-menu:focus-within .tl-submenu { display: block; }
.tl-submenu a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text);
  transition: background var(--dur-fast) var(--ease-out);
}
.tl-submenu a:hover { background: var(--elevate); }
.tl-submenu a strong { font-weight: 600; font-size: 0.9375rem; color: var(--text); }
.tl-submenu a span { font-size: 0.8125rem; color: var(--muted); }

/* Footer marquee block */
.tl-footer-marquee {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px;
  padding: 48px 0;
  border-bottom: 1px solid var(--stroke-soft);
  margin-bottom: 48px;
  align-items: flex-end;
}
.tl-foot-claim .eyebrow-mono {
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-subtle);
}
.tl-foot-claim p {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.375rem, 1.5vw + 0.5rem, 1.875rem);
  line-height: 1.25; letter-spacing: -0.018em;
  color: var(--text); margin: 14px 0 24px; max-width: 36ch;
}
.tl-foot-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.tl-foot-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--panel);
  border: 1px solid var(--stroke-soft);
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-strong);
}
.tl-foot-badge .g {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 0 3px var(--success-tint);
}
.tl-foot-cta h4 {
  font-family: var(--font-display)!important; font-weight: 600!important;
  font-size: 1.25rem!important; letter-spacing: -0.01em!important;
  text-transform: none!important; color: var(--text)!important;
  margin: 0 0 4px!important;
}
.tl-foot-cta p { color: var(--muted); font-size: 0.9375rem; margin: 0 0 16px; }
.tl-foot-cta .btn { margin-right: 8px; }
@media (max-width: 860px) {
  .tl-footer-marquee { grid-template-columns: 1fr; gap: 32px; align-items: flex-start; }
}

/* Theme toggle */
.tl-theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: transparent; border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--muted); cursor: pointer;
  font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
  min-height: 34px;
}
.tl-theme-toggle:hover { color: var(--text); border-color: var(--text); }
.tl-theme-toggle svg { width: 14px; height: 14px; }

.tl-nav-burger { display: none; }
@media (max-width: 960px) {
  .tl-nav-links, .tl-nav-right .tl-btn-auth { display: none; }
  .tl-nav-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-left: auto;
    background: transparent; border: 1px solid var(--stroke); border-radius: 8px;
    color: var(--text); cursor: pointer;
  }
  /* Open-state drawer styling lives in the MOBILE NAV DRAWER block below */
}

/* ==================== MOBILE NAV DRAWER ==================== */
/* Toggled by body.nav-open (see site.js initMobileNav).
   Works at <=960px; desktop nav renders above it and the drawer stays hidden. */
@media (max-width: 960px) {
  /* Drawer uses transform translateX(100%) to slide off-screen; that box
     still contributes to layout width. Clip horizontally so the drawer
     doesn't force a document-wide scrollbar when closed. */
  html, body { overflow-x: clip; }
  @supports not (overflow-x: clip) {
    html, body { overflow-x: hidden; }
  }
  body.nav-open .tl-nav {
    /* Raise above the backdrop (z-index:50) so the nav stacking context
       paints the drawer on top. Do NOT use position:static — changing
       position mid-animation cancels the transform transition in Chromium. */
    z-index: 55;
  }
  body.nav-open .tl-nav::before { content: none; }
  /* Backdrop — full-viewport, fades in */
  body::after {
    content: '';
    position: fixed; inset: 0;
    background: rgba(17, 24, 39, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms var(--ease-out);
    z-index: 50;
  }
  body.nav-open::after {
    opacity: 1;
    pointer-events: auto;
  }
  body.nav-open { overflow: hidden; }

  /* Drawer panel — unhides the injected <nav> + auth buttons in a slide-in sheet */
  .tl-nav nav[aria-label="Primary"] {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(85vw, 360px);
    background: var(--panel);
    border-left: 1px solid var(--stroke-soft);
    box-shadow: -24px 0 48px rgba(17, 24, 39, 0.18);
    /* bottom padding reserves space so the fixed auth-buttons row
       (tl-nav-right, ~158px tall) never overlaps the last nav link */
    padding: 72px 20px 180px;
    transform: translateX(100%);
    transition: transform 260ms var(--ease-out);
    z-index: 60;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: block !important;
  }
  /* Subtle fade-out above the pinned auth block so content underneath is
     visually muted, not abruptly cut off */
  body.nav-open .tl-nav::after {
    content: '';
    position: fixed;
    right: 0; bottom: 158px;
    width: min(85vw, 360px);
    height: 28px;
    background: linear-gradient(180deg, transparent 0%, var(--panel) 100%);
    z-index: 60;
    pointer-events: none;
  }
  body.nav-open .tl-nav nav[aria-label="Primary"] {
    transform: translateX(0);
  }
  body.nav-open .tl-nav nav[aria-label="Primary"] .tl-nav-links {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
  }
  .tl-nav nav[aria-label="Primary"] .tl-nav-links li { list-style: none; width: 100%; }
  .tl-nav nav[aria-label="Primary"] .tl-nav-link {
    display: block;
    padding: 14px 12px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    border-radius: var(--r-md);
    border-bottom: 1px solid var(--stroke-soft);
  }
  .tl-nav nav[aria-label="Primary"] .tl-nav-link:hover,
  .tl-nav nav[aria-label="Primary"] .tl-nav-link:active { background: var(--elevate); }
  /* Flatten submenu — show its items inline as a sub-list */
  .tl-nav nav[aria-label="Primary"] .tl-submenu {
    position: static;
    display: block;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 4px 0 10px 14px;
    min-width: 0;
  }
  .tl-nav nav[aria-label="Primary"] .tl-submenu::before { display: none; }
  .tl-nav nav[aria-label="Primary"] .tl-submenu a {
    padding: 10px 12px;
    border-radius: var(--r-sm);
  }
  .tl-nav nav[aria-label="Primary"] .tl-submenu a strong { font-size: 0.875rem; }
  .tl-nav nav[aria-label="Primary"] .tl-submenu a span { font-size: 0.75rem; }

  /* Auth CTAs: unhide inside the drawer */
  body.nav-open .tl-nav-right .tl-btn-auth {
    display: inline-flex !important;
  }
  /* Pull the auth buttons into the drawer visually (they're in tl-nav-right).
     We use a floating pinned block via fixed positioning. */
  body.nav-open .tl-nav-right {
    position: fixed;
    right: 0;
    bottom: 0;
    z-index: 61;
    width: min(85vw, 360px);
    padding: 14px 20px 20px;
    background: var(--panel);
    border-top: 1px solid var(--stroke-soft);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    box-sizing: border-box;
  }
  body.nav-open .tl-nav-right .tl-theme-toggle { order: 3; justify-content: center; }
  body.nav-open .tl-nav-right .btn { justify-content: center; width: 100%; }
  body.nav-open .tl-nav-burger {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 62;
    background: var(--panel);
  }
  /* Burger → X when open */
  body.nav-open .tl-nav-burger svg line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
    transform-origin: center;
  }
  body.nav-open .tl-nav-burger svg line:nth-child(2) { opacity: 0; }
  body.nav-open .tl-nav-burger svg line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    transform-origin: center;
  }
  .tl-nav-burger svg line { transition: transform 200ms var(--ease-out), opacity 200ms var(--ease-out); }
}

/* ==================== CARDS ==================== */
.card {
  background: var(--panel);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: border-color var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}
.card-elevate { background: var(--elevate); border-color: var(--stroke); }
.card-hover:hover { border-color: var(--stroke-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ==================== CHIPS ==================== */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  border: 1px solid var(--stroke);
  color: var(--muted-strong);
  background: var(--panel);
  line-height: 1.4;
}
.chip-dot::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.chip-accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-tint); }
.chip-success{ color: var(--success); border-color: var(--success-line); background: var(--success-tint); }
.chip-warn   { color: var(--warn);    border-color: var(--warn-line);    background: var(--warn-tint); }
.chip-danger { color: var(--danger);  border-color: var(--danger-line);  background: var(--danger-tint); }
.chip-ink    { color: var(--text);    border-color: var(--stroke);       background: var(--elevate); }

/* Stage chips — map to pipeline stages */
.chip-stage-lead   { color: var(--stage-lead);  background: var(--stage-lead-tint);  border-color: transparent; }
.chip-stage-quote  { color: var(--stage-quote); background: var(--stage-quote-tint); border-color: transparent; }
.chip-stage-won    { color: var(--stage-won);   background: var(--stage-won-tint);   border-color: transparent; }
.chip-stage-job    { color: var(--stage-job);   background: var(--stage-job-tint);   border-color: transparent; }
.chip-stage-field  { color: var(--stage-field); background: var(--stage-field-tint); border-color: transparent; }
.chip-stage-done   { color: var(--stage-done);  background: var(--stage-done-tint);  border-color: transparent; }

/* ==================== SECTION HEADER ==================== */
.section-header {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 780px;
}
.section-header h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 600; }
.section-header .sub { color: var(--muted); font-size: var(--fs-lead); line-height: 1.5; max-width: 62ch; }
.section-header.center { margin-left: auto; margin-right: auto; text-align: center; align-items: center; }
.section-header.with-link {
  flex-direction: row; justify-content: space-between; align-items: flex-end; max-width: none; gap: 24px;
}
@media (max-width: 860px) {
  .section-header.with-link { flex-direction: column; align-items: flex-start; }
}

/* ==================== FORM INPUTS ==================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 0.8125rem; font-weight: 500;
  color: var(--text-soft);
  letter-spacing: -0.005em;
}
.input, .textarea, .select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--stroke);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  padding: 11px 14px;
  border-radius: var(--r-md);
  transition: border-color var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
  min-height: 42px;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-subtle); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--stroke-strong); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.field.has-error .input, .field.has-error .textarea { border-color: var(--danger); }
.field.has-error .helper { color: var(--danger); }
.helper { font-size: 0.8125rem; color: var(--muted); }

.field-group {
  display: flex; align-items: stretch;
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: var(--panel);
  overflow: hidden;
  transition: border-color var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}
.field-group:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.field-group .input { border: 0; background: transparent; }
.field-group .affix {
  display: inline-flex; align-items: center; padding: 0 12px;
  color: var(--muted); background: var(--elevate);
  border-left: 1px solid var(--stroke-soft);
  font-size: 0.875rem;
}
.field-group .affix:first-child { border-left: 0; border-right: 1px solid var(--stroke-soft); }

/* Check / radio */
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.9375rem; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--stroke-strong);
  background: var(--panel);
  border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color var(--dur-med) var(--ease-out), background-color var(--dur-med) var(--ease-out);
  flex-shrink: 0;
}
.check.radio .box { border-radius: 50%; }
.check:hover .box { border-color: var(--text); }
.check input:checked + .box { border-color: var(--text); background: var(--text); }
.check.checkbox input:checked + .box::after {
  width: 10px; height: 10px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
  content: '';
}
.check.radio input:checked + .box::after {
  width: 8px; height: 8px; background: var(--panel); border-radius: 50%;
  content: '';
}

/* Switch */
.switch {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 0.9375rem; color: var(--text);
}
.switch .track {
  width: 40px; height: 22px;
  background: var(--stroke);
  border-radius: 999px;
  position: relative;
  transition: background-color var(--dur-med) var(--ease-out);
  flex-shrink: 0;
}
.switch .thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-med) var(--ease-out);
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch input:checked ~ .track { background: var(--text); }
.switch input:checked ~ .track .thumb { transform: translateX(18px); }

/* ==================== ACCORDION ==================== */
.accordion { border-top: 1px solid var(--stroke-soft); }
.acc-item { border-bottom: 1px solid var(--stroke-soft); }
.acc-btn {
  width: 100%;
  display: flex; align-items: center; gap: 20px;
  padding: 22px 0;
  background: transparent; border: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.0625rem; font-weight: 500;
  text-align: left; cursor: pointer;
  letter-spacing: -0.01em;
  transition: color var(--dur-med) var(--ease-out);
}
.acc-btn:hover { color: var(--accent); }
.acc-btn .chev {
  margin-left: auto; width: 16px; height: 16px; color: var(--muted);
  transition: transform var(--dur-med) var(--ease-out), color var(--dur-med) var(--ease-out);
  flex-shrink: 0;
}
.acc-item.is-open .acc-btn .chev { transform: rotate(180deg); color: var(--accent); }
.acc-body {
  max-height: 0; overflow: hidden;
  transition: max-height var(--dur-slow) var(--ease-out);
}
.acc-item.is-open .acc-body { max-height: 400px; }
.acc-body-inner {
  padding: 0 0 24px;
  color: var(--muted);
  font-size: 0.9375rem; line-height: 1.65;
  max-width: 72ch;
}
.acc-item .acc-cat {
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted-subtle);
  flex-shrink: 0; width: 110px;
}

/* ==================== PIPELINE RIBBON (hero centerpiece) ==================== */
.pipeline-ribbon {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  position: relative;
}
@media (max-width: 1023px) { .pipeline-ribbon { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px)  { .pipeline-ribbon { grid-template-columns: repeat(2, 1fr); gap: 8px; } }

.pipeline-stage {
  background: var(--panel);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-md);
  padding: 14px 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative;
  transition: border-color var(--dur-med) var(--ease-out),
              background-color var(--dur-med) var(--ease-out),
              transform var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out);
  min-height: 118px;
}
.pipeline-stage .stage-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-subtle);
  display: flex; align-items: center; gap: 6px;
}
.pipeline-stage .stage-label .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.6;
}
.pipeline-stage .stage-title {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.pipeline-stage .stage-meta {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.pipeline-stage[data-stage="lead"]  { --stage-c: var(--stage-lead);  --stage-tc: var(--stage-lead-tint); }
.pipeline-stage[data-stage="quote"] { --stage-c: var(--stage-quote); --stage-tc: var(--stage-quote-tint); }
.pipeline-stage[data-stage="won"]   { --stage-c: var(--stage-won);   --stage-tc: var(--stage-won-tint); }
.pipeline-stage[data-stage="job"]   { --stage-c: var(--stage-job);   --stage-tc: var(--stage-job-tint); }
.pipeline-stage[data-stage="field"] { --stage-c: var(--stage-field); --stage-tc: var(--stage-field-tint); }
.pipeline-stage[data-stage="done"]  { --stage-c: var(--stage-done);  --stage-tc: var(--stage-done-tint); }

.pipeline-stage.is-active {
  border-color: var(--stage-c);
  background: var(--stage-tc);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.pipeline-stage.is-active .stage-label { color: var(--stage-c); }
.pipeline-stage.is-active .stage-label .dot { opacity: 1; }

.pipeline-stage .count-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px;
  background: transparent;
  overflow: hidden;
  border-bottom-left-radius: var(--r-md);
  border-bottom-right-radius: var(--r-md);
}
.pipeline-stage.is-active .count-bar::before {
  content: '';
  display: block;
  height: 100%;
  background: var(--stage-c);
  animation: ribbon-progress var(--dur-ribbon) var(--ease-in-out) forwards;
}
@keyframes ribbon-progress { from { width: 0%; } to { width: 100%; } }

/* ==================== LIFECYCLE STEPS ==================== */
.lifecycle-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.4fr);
  gap: 64px;
  align-items: center;
  padding: 48px 0;
  border-bottom: 1px solid var(--stroke-soft);
}
.lifecycle-row:last-child { border-bottom: 0; }
.lifecycle-row.reverse { grid-template-columns: minmax(320px, 1.4fr) minmax(280px, 1fr); }
.lifecycle-row.reverse .lifecycle-copy { order: 2; }
@media (max-width: 960px) {
  .lifecycle-row, .lifecycle-row.reverse { grid-template-columns: 1fr; gap: 32px; padding: 32px 0; }
  .lifecycle-row.reverse .lifecycle-copy { order: 0; }
}

.lifecycle-copy .stage-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  border-radius: 4px;
  margin-bottom: 20px;
}
.lifecycle-copy .stage-pill .num {
  opacity: 0.6;
}
.lifecycle-copy h3 {
  font-size: clamp(1.5rem, 1.2vw + 1rem, 2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin-bottom: 16px;
}
.lifecycle-copy p.blurb {
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.55;
  max-width: 48ch;
  margin-bottom: 24px;
}
.lifecycle-copy ul.features {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.lifecycle-copy ul.features li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.9375rem; color: var(--text-soft);
  line-height: 1.45;
}
.lifecycle-copy ul.features li::before {
  content: ''; flex-shrink: 0;
  width: 16px; height: 16px; margin-top: 3px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B7A97' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
}
[data-theme="dark"] .lifecycle-copy ul.features li::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338C8EC' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}

/* ==================== PRODUCT MOCK FRAME (for mocked UIs) ==================== */
.product-shot {
  background: var(--panel);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}
.product-shot .chrome-bar {
  height: 36px;
  border-bottom: 1px solid var(--stroke-soft);
  background: var(--elevate);
  display: flex; align-items: center; padding: 0 14px;
  gap: 10px;
}
.product-shot .chrome-bar .dots { display: flex; gap: 6px; }
.product-shot .chrome-bar .dots span {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--stroke-strong); opacity: 0.55;
}
.product-shot .chrome-bar .addr {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono); font-size: 0.6875rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.product-shot .chrome-bar .addr::before {
  content: '⌘';
  margin-right: 6px;
  opacity: 0.6;
}

/* ==================== KANBAN / PIPELINE BOARD MOCK ==================== */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 18px;
  background: var(--base);
}
.kanban-col { display: flex; flex-direction: column; gap: 8px; min-height: 240px; }
.kanban-col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 4px;
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.kanban-col-head .count { color: var(--muted-subtle); }
.kanban-card {
  background: var(--panel);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
.kanban-card:hover { border-color: var(--stroke-strong); transform: translateY(-1px); }
.kanban-card .name {
  font-size: 0.8125rem; font-weight: 500; color: var(--text);
  letter-spacing: -0.005em;
}
.kanban-card .meta {
  font-size: 0.6875rem; color: var(--muted);
  display: flex; gap: 6px; align-items: center;
}
.kanban-card .amt {
  font-family: var(--font-mono); color: var(--text);
  font-size: 0.6875rem; letter-spacing: 0.02em;
  margin-top: 2px;
}
.kanban-card.stage-lead  { border-top: 2px solid var(--stage-lead); }
.kanban-card.stage-quote { border-top: 2px solid var(--stage-quote); }
.kanban-card.stage-won   { border-top: 2px solid var(--stage-won); }
.kanban-card.stage-job   { border-top: 2px solid var(--stage-job); }

/* ==================== JOB CARD MOCK ==================== */
.job-card {
  background: var(--panel);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.job-card .header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
}
.job-card .job-title {
  font-size: 1rem; font-weight: 600; letter-spacing: -0.01em;
  line-height: 1.3;
}
.job-card .job-addr {
  font-size: 0.8125rem; color: var(--muted); margin-top: 2px;
}
.job-card .job-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--stroke-soft); border-bottom: 1px solid var(--stroke-soft);
}
.job-card .job-meta .mk { display: flex; flex-direction: column; gap: 2px; }
.job-card .job-meta .mk .label {
  font-family: var(--font-mono); font-size: 0.625rem;
  color: var(--muted-subtle); letter-spacing: 0.1em; text-transform: uppercase;
}
.job-card .job-meta .mk .val { font-size: 0.8125rem; color: var(--text); font-weight: 500; }
.job-card .job-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.job-card .assignee {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8125rem; color: var(--muted);
}
.job-card .assignee .avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink-accent-soft);
  color: var(--text);
  font-family: var(--font-mono); font-size: 0.625rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 500;
  border: 1px solid var(--stroke-soft);
}

/* ==================== INVOICE MOCK ==================== */
.invoice {
  background: var(--panel);
  padding: 28px;
  font-size: 0.8125rem;
  color: var(--text);
}
.invoice .inv-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px;
}
.invoice .inv-head .brand {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1rem; letter-spacing: -0.02em;
}
.invoice .inv-head .num {
  font-family: var(--font-mono); font-size: 0.6875rem;
  color: var(--muted); letter-spacing: 0.06em;
}
.invoice table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.invoice th, .invoice td {
  text-align: left;
  padding: 8px 0;
  border-bottom: 1px solid var(--stroke-soft);
  font-size: 0.75rem;
}
.invoice th {
  font-family: var(--font-mono); font-size: 0.625rem;
  color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 500;
}
.invoice td.num-col { text-align: right; font-family: var(--font-mono); }
.invoice .totals {
  display: flex; flex-direction: column; gap: 4px;
  align-items: flex-end; margin-top: 8px;
}
.invoice .totals .row {
  display: flex; gap: 28px; font-size: 0.8125rem;
}
.invoice .totals .row.grand {
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  padding-top: 8px; border-top: 2px solid var(--text);
  margin-top: 4px;
}

/* ==================== DATA TABLE ==================== */
.dtable {
  width: 100%; border-collapse: collapse;
  font-size: 0.8125rem;
}
.dtable thead th {
  text-align: left;
  padding: 10px 14px;
  font-family: var(--font-mono); font-size: 0.625rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--stroke-soft);
  background: var(--elevate);
}
.dtable tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke-soft);
  color: var(--text);
}
.dtable tbody tr:hover td { background: var(--elevate); }
.dtable td.mono { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted-strong); }

/* ==================== DASHBOARD TILES ==================== */
.dash-tile {
  background: var(--panel);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.dash-tile .label {
  font-family: var(--font-mono); font-size: 0.625rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.dash-tile .value {
  font-family: var(--font-display);
  font-size: 1.875rem; font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
}
.dash-tile .delta {
  font-family: var(--font-mono); font-size: 0.6875rem;
  color: var(--success);
  display: inline-flex; align-items: center; gap: 4px;
}
.dash-tile .delta.down { color: var(--danger); }
.dash-tile .spark { height: 40px; margin-top: auto; }

/* ==================== FEATURE CARD (grid) ==================== */
.feature-card {
  background: var(--panel);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-lg);
  padding: 28px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}
.feature-card:hover {
  border-color: var(--stroke-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature-card .icon-wrap {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  background: var(--accent-tint);
  border-radius: 9px;
}
.feature-card .icon-wrap svg { width: 20px; height: 20px; }
.feature-card h3 {
  font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.005em;
}
.feature-card p {
  color: var(--muted); font-size: 0.9375rem; line-height: 1.55;
}
.feature-card .learn-more {
  margin-top: auto;
  color: var(--accent); font-size: 0.8125rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.feature-card .learn-more:hover { gap: 8px; }

/* ==================== QUOTE / TESTIMONIAL ==================== */
.quote {
  background: var(--panel);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-lg);
  padding: 32px;
  position: relative;
}
.quote-body {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 20px;
}
.quote-attr { display: flex; align-items: center; gap: 12px; }
.quote-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink-accent-soft);
  border: 1px solid var(--stroke-soft);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--text);
  font-weight: 500;
}
.quote-meta { display: flex; flex-direction: column; }
.quote-name { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.quote-role { font-size: 0.8125rem; color: var(--muted); }

/* ==================== PRICING ==================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 1023px) { .pricing-grid { grid-template-columns: 1fr; } }

.price-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  display: flex; flex-direction: column; gap: 18px;
  transition: border-color var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}
.price-card:hover { box-shadow: var(--shadow-md); }
.price-card.is-recommended {
  border-color: var(--text);
  box-shadow: var(--shadow-md);
}
.price-card.is-recommended::before {
  content: 'MOST POPULAR';
  position: absolute; top: -10px; left: 24px;
  padding: 4px 10px;
  background: var(--text);
  color: var(--panel);
  font-family: var(--font-mono); font-size: 0.625rem; font-weight: 500;
  letter-spacing: 0.14em;
  border-radius: 4px;
}
.price-card .tier-name {
  font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.02em; color: var(--muted);
  text-transform: uppercase;
}
.price-card .price {
  display: flex; align-items: baseline; gap: 6px;
  font-family: var(--font-display);
}
.price-card .price .amount {
  font-size: 2.75rem; font-weight: 600;
  letter-spacing: -0.025em; color: var(--text); line-height: 1;
}
.price-card .price .unit {
  font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted);
}
.price-card .positioning { color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
.price-card ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.price-card li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.9375rem; color: var(--text);
  line-height: 1.45;
}
.price-card li::before {
  content: ''; flex-shrink: 0;
  width: 16px; height: 16px; margin-top: 3px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
}
.price-card .btn { margin-top: auto; }

/* ==================== INTEGRATIONS ==================== */
.int-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  border-left: 1px solid var(--stroke-soft);
  border-top: 1px solid var(--stroke-soft);
  background: var(--stroke-soft);
}
@media (max-width: 1023px) { .int-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px)  { .int-grid { grid-template-columns: repeat(2, 1fr); } }

.int-tile {
  background: var(--panel);
  border-right: 1px solid var(--stroke-soft);
  border-bottom: 1px solid var(--stroke-soft);
  padding: 28px 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 132px;
  transition: background-color var(--dur-med) var(--ease-out);
}
.int-tile:hover { background: var(--elevate); }
.int-tile .logo {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text);
}
.int-tile .logo svg { width: 100%; height: 100%; }
.int-tile .name {
  font-size: 0.8125rem; font-weight: 500;
  color: var(--text);
}
.int-tile .sub {
  font-family: var(--font-mono); font-size: 0.625rem;
  color: var(--muted-subtle); letter-spacing: 0.08em;
}

/* ==================== DEVICE FRAME (phone) ==================== */
.phone-frame {
  width: 272px;
  aspect-ratio: 9 / 19.5;
  background: #0F1116;
  border-radius: 36px;
  padding: 10px;
  box-shadow: var(--shadow-hero), inset 0 0 0 1px rgba(255,255,255,0.04);
  position: relative;
}
.phone-frame .notch {
  position: absolute; top: 18px; left: 50%;
  transform: translateX(-50%);
  width: 84px; height: 22px; border-radius: 22px;
  background: #000; z-index: 2;
}
.phone-frame .screen {
  width: 100%; height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: #000;
  position: relative;
}
.phone-frame .screen img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ==================== FOOTER ==================== */
.tl-footer {
  border-top: 1px solid var(--stroke-soft);
  margin-top: var(--sp-24);
  padding-top: var(--sp-16);
  padding-bottom: var(--sp-10);
  background: var(--base);
}
.tl-footer-grid {
  display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: var(--sp-10);
}
@media (max-width: 860px) { .tl-footer-grid { grid-template-columns: 1fr 1fr; } }
.tl-footer h4 {
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted-subtle); margin-bottom: 14px;
}
.tl-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.tl-footer li a { color: var(--muted); font-size: 0.9375rem; transition: color var(--dur-med) var(--ease-out); }
.tl-footer li a:hover { color: var(--text); }
.tl-footer-brand-tag {
  color: var(--muted); font-size: 0.9375rem;
  margin-top: 14px; max-width: 32ch; line-height: 1.55;
}
.tl-footer-bottom {
  border-top: 1px solid var(--stroke-soft);
  padding-top: var(--sp-6);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  color: var(--muted-subtle); font-size: 0.8125rem;
}
.trust-badges { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.trust-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono); font-size: 0.625rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--stroke); border-radius: 4px;
  color: var(--muted);
  background: var(--panel);
}

/* ==================== UTILS ==================== */
.stack-4  > * + * { margin-top: 4px; }
.stack-8  > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }
.stack-32 > * + * { margin-top: 32px; }
.row     { display: flex; align-items: center; gap: 12px; }
.row-8   { display: flex; align-items: center; gap: 8px; }
.row-16  { display: flex; align-items: center; gap: 16px; }
.row-24  { display: flex; align-items: center; gap: 24px; }
.grow    { flex: 1; }
.center-text { text-align: center; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
