/* =====================================================================
   InvoiceBud — marketing site
   Theme matches the app (invoicebud/web/static/style.css): same brand blue,
   same light background, same shadow language. Type is deliberately NOT Inter:
   Space Grotesk (display) + IBM Plex Sans (body) + IBM Plex Mono (data).
   ===================================================================== */

:root {
  /* ---- Brand palette (from the app) ---- */
  --brand: #004aad;
  --brand-600: #0a57bd;
  --brand-400: #3f7ede;
  --grad-a: #5b7fd6;
  --grad-b: #4f60af;
  --grad-c: #004aad;

  --ink: #16243b;
  --ink-soft: #33445e;
  --muted: #6a7891;
  --panel: #ffffff;
  --line: #e4eaf2;
  --line-soft: #eef2f8;
  --bg-top: #eaf1fb;
  --bg-bot: #f5f7fb;

  /* ---- Accents (grounded: the app's flag amber + status colors) ---- */
  --amber: #e39a1c;
  --amber-bg: #fff6e6;
  --amber-ink: #9a6412;
  --ok: #157a44;
  --ok-bg: #e9f7ee;
  --ok-line: #bfe6cd;

  /* ---- Shadows (from the app, plus a bigger "float" for the hero) ---- */
  --shadow-sm: 0 1px 2px rgba(16,40,80,.06), 0 1px 3px rgba(16,40,80,.08);
  --shadow-md: 0 2px 6px rgba(16,40,80,.06), 0 12px 30px rgba(16,40,80,.10);
  --shadow-brand: 0 6px 18px rgba(0,74,173,.28);
  --shadow-float: 0 24px 60px rgba(16,40,80,.20), 0 8px 20px rgba(16,40,80,.10);

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", monospace;

  --maxw: 1180px;
  --nav-h: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }
html, body { margin: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.6;
  /* The app's background, fixed — so the hero window casts its shadow onto the
     same surface the app uses. */
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bot) 320px, var(--bg-bot) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; line-height: 1.08; margin: 0; }

:where(a, button, input):focus-visible {
  outline: 3px solid var(--brand-400);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Shared eyebrow / section heads ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand); margin: 0 0 18px;
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow.center { justify-content: center; }
.eyebrow .ic { width: 15px; height: 15px; }

.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); }
.section-sub { color: var(--muted); font-size: 18px; margin: 14px 0 26px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px; cursor: pointer;
  padding: 11px 20px; border-radius: 11px; border: 1px solid transparent;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, filter .14s ease;
  white-space: nowrap;
}
.btn-lg { padding: 15px 28px; font-size: 16px; border-radius: 13px; }

.btn-primary { background: linear-gradient(135deg, var(--brand-400), var(--brand)); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 10px 26px rgba(0,74,173,.34); transform: translateY(-1px); }

.btn-ghost { background: #fff; color: var(--ink-soft); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: #cdd9ec; color: var(--brand); transform: translateY(-1px); }

.btn-onblue { background: #fff; color: var(--brand); }
.btn-onblue:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(0,0,0,.22); }
.btn-ghost-onblue { background: rgba(255,255,255,.10); color: #fff; border-color: rgba(255,255,255,.55); }
.btn-ghost-onblue:hover { background: rgba(255,255,255,.18); transform: translateY(-1px); }

/* ===================== NAV ===================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease, background .2s ease;
}
.nav.scrolled { box-shadow: 0 6px 20px rgba(16,40,80,.08); background: rgba(255,255,255,.9); }
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; height: var(--nav-h);
  display: flex; align-items: center; gap: 26px; padding: 0 24px;
}
.nav-brand img { height: 30px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 26px; margin-left: 8px; }
.nav-links a { color: var(--ink-soft); font-weight: 600; font-size: 15px; padding: 6px 0; border-bottom: 2px solid transparent; transition: color .14s; }
.nav-links a:hover { color: var(--brand); }
.nav-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.accent-bar { height: 3px; background: linear-gradient(90deg, var(--grad-a), var(--grad-b), var(--grad-c)); }

.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { display: none; flex-direction: column; gap: 12px; padding: 18px 24px 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.mobile-menu a:not(.btn) { font-weight: 600; color: var(--ink-soft); padding: 8px 0; }
.mobile-menu .btn { width: 100%; }

/* ===================== HERO ===================== */
.hero { padding: clamp(18px, 3.1vw, 40px) 24px clamp(40px, 6vw, 72px); }
.hero-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.14fr 1fr; gap: clamp(20px, 2vw, 28px);
  align-items: center;
}
.hero-copy { max-width: 620px; }
/* As large as it can be while "automated in a click." still fits on one line (2 lines total)
   across normal + small laptops. Column is ~614px on standard laptops → ~58px max. */
/* Headline is 700 (bold) via the global h1 rule; the hairline same-color stroke adds
   a touch more heft (Space Grotesk stops at 700), applied on desktop + mobile alike. */
.hero h1 { font-size: clamp(34px, 4.72vw, 58px); letter-spacing: -.03em; -webkit-text-stroke: 0.5px currentColor; }
.hero h1 .accent { color: var(--brand); }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-soft); margin: 22px 0 30px; max-width: 30em; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-proof { margin: 26px 0 0; max-width: 32em; }
.hero-proof .stars { display: block; color: var(--amber); letter-spacing: 2px; font-size: 15px; margin-bottom: 8px; }
.hero-proof blockquote { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); font-style: italic; }
.hero-proof blockquote strong { font-weight: 700; color: var(--ink); }

/* "First invoice free" — reassurance microcopy under the hero CTA (amber = the site's one attention accent) */
.hero-freebie { display: inline-flex; align-items: center; gap: 9px; margin: 16px 0 0; font-size: 15px; color: var(--ink-soft); font-weight: 500; }
.hero-freebie strong { color: var(--amber-ink); font-weight: 700; }
.hero-freebie-ic { width: 20px; height: 20px; color: var(--amber); flex: none; }

/* The floating window: matte-cut app screenshot + a fresh CSS shadow on the page bg */
.hero-visual { justify-self: center; width: 100%; }
.hero-window {
  position: relative; width: 100%; max-width: 505px; margin: 0 auto; transform: translateY(34px);
  border-radius: 18px; overflow: hidden; container-type: inline-size;
  background: linear-gradient(160deg, #f0f1f8 0%, #e7e9f4 100%);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 30px 58px rgba(16,40,80,.24), 0 11px 22px rgba(16,40,80,.13);
}
/* window title bar */
.hw-bar { display: flex; align-items: center; gap: 1.4cqw; padding: 2.3cqw 3cqw; border-bottom: 1px solid #e3e5f1; }
.hw-dot { width: 2.1cqw; height: 2.1cqw; border-radius: 50%; }
.hw-red { background: #fa7375; }
.hw-yellow { background: #fbca4e; }
.hw-green { background: #3fd573; }
/* invoice table */
.hw-table { width: 100%; border-collapse: collapse; table-layout: fixed;
  font-family: "IBM Plex Sans", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.hw-table th, .hw-table td {
  text-align: left; padding: 2cqw 1.7cqw; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; border-left: 1px solid #e0e3f2;
}
.hw-table th:first-child, .hw-table td:first-child { border-left: 0; }
.hw-table thead th {
  color: #3b4257; font-weight: 600; font-size: 2.25cqw;
  padding-top: 2.3cqw; padding-bottom: 2.3cqw; border-bottom: 1px solid #d8dbeb;
}
.hw-table tbody td { color: #272d3e; font-weight: 500; font-size: 2.15cqw; }
.hw-table tbody tr:nth-child(odd)  { background: #f6f4fa; }
.hw-table tbody tr:nth-child(even) { background: #e8e9f6; }
/* status pills */
.hw-badge { display: inline-block; border-radius: 1.2cqw; padding: .8cqw 2.2cqw;
  font-size: 2.1cqw; font-weight: 600; line-height: 1.25; }
.b-amber { background: #f8cf86; color: #6b5518; }
.b-red   { background: #d05a5c; color: #fff; }
.b-green { background: #3ebd8a; color: #fff; }

/* ===================== VALUE STRIP ===================== */
.valuestrip { max-width: 1340px; margin: 0 auto; padding: clamp(24px, 3.4vw, 46px) 24px 8px; }
.valuestrip-inner {
  list-style: none; margin: 0 auto; padding: 18px 30px;
  width: max-content; max-width: 100%;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 26px;
  background: rgba(255,255,255,.6); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.valuestrip li { display: inline-flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 500; color: var(--ink-soft); font-family: var(--font-mono); letter-spacing: -.01em; }
.valuestrip .ic { width: 18px; height: 18px; color: var(--brand); flex: 0 0 auto; }
.valuestrip li.vs-dup { display: none; }   /* duplicate ticker items: hidden by default (specificity must beat `.valuestrip li`); only the phone marquee reveals them */

/* ===================== FEATURES ===================== */
.features { max-width: var(--maxw); margin: 0 auto; padding: clamp(52px, 5.9vw, 80px) 24px clamp(54px, 7.5vw, 96px); }
.features .section-head { max-width: 1160px; }
.features .section-head h2 { font-size: clamp(26px, 3.5vw, 40px); }
/* Responsive text-swap utility: hidden on desktop, shown on phones (pair with .only-desktop). */
.only-mobile { display: none; }
/* Line break that only takes effect on phones. */
.br-mobile { display: none; }

.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 76px);
  align-items: center; margin-bottom: clamp(56px, 8vw, 104px);
}
.feature:last-child { margin-bottom: 0; }
.feature.reverse .feature-media { order: 2; }
/* Every demo window must be able to shrink to its grid track; without this the fixed-width
   tables force the track (and the whole page) wider than the viewport on mobile. */
.feature-media { min-width: 0; }
/* Step 2 gets a wider window (a good "eye-catcher" size) so its zoomed-out output stays
   readable. min-width:0 keeps the fixed-width demo from forcing the grid track wider than
   its share. The subtext stays full size and wraps to ~5 lines. */
.feature-step2 { grid-template-columns: 0.72fr 1.28fr; }
.feature-step2 .feature-media { min-width: 0; }

.feature-text .step { font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin: 0 0 12px; }
.feature-text h3 { font-size: clamp(24px, 3vw, 34px); margin-bottom: 14px; }
.feature-text p { color: var(--ink-soft); font-size: 17.5px; max-width: 34em; }

/* ---- Mock "window" used as a video placeholder ---- */
.mock { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden; }
.mock-bar { display: flex; gap: 7px; padding: 13px 16px; background: linear-gradient(180deg,#fbfcfe,#f2f6fc); border-bottom: 1px solid var(--line-soft); }
.mock-bar span { width: 11px; height: 11px; border-radius: 50%; background: #d7dfeb; }
.mock-bar span:nth-child(1){ background:#f0837b; } .mock-bar span:nth-child(2){ background:#f4c14e; } .mock-bar span:nth-child(3){ background:#69c583; }
.mock-body { padding: 20px; min-height: 236px; }

/* play affordance = "a clip goes here" */
.mock .play {
  position: absolute; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,74,173,.92); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-brand);
}
.mock .play svg { width: 20px; height: 20px; margin-left: 2px; }

/* mock table */
.mock-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.mock-table th { text-align: left; font-family: var(--font-body); font-weight: 700; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--brand); background: #f1f6fd; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.mock-table th.r, .mock-table td.r { text-align: right; }
.mock-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); }
.mock-table tr:last-child td { border-bottom: 0; }
.mock-table .mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); }
.mock-table td.flag { background: var(--amber-bg); box-shadow: inset 3px 0 0 var(--amber); font-family: var(--font-mono); color: var(--ink); position: relative; }
.mock-table td.flag em { color: var(--amber); font-style: normal; font-weight: 700; margin-left: 4px; }
.mock-table td.flag .cur { background: rgba(227,154,28,.28); border-radius: 3px; padding: 0 1px; }

.mock-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.mock .mini { font-family: var(--font-body); font-size: 12.5px; font-weight: 700; color: var(--brand); background: #eaf1fd; border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.mock .legend { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.mock .legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--amber-bg); box-shadow: inset 3px 0 0 var(--amber); }

/* mock upload */
.mock-upload { display: grid; place-items: center; }
.dz { width: 100%; text-align: center; border: 2px dashed #b9c9e2; border-radius: var(--radius); padding: 26px 18px; background: linear-gradient(180deg,#fbfdff,#f3f7fd); }
.dz-ic { width: 40px; height: 40px; color: var(--brand-400); margin: 0 auto 8px; }
.dz-big { font-weight: 700; font-size: 15px; }
.dz-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.dz-file { margin-top: 14px; display: inline-flex; align-items: center; gap: 9px; font-size: 13px; }
.pill-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-line); border-radius: 999px; padding: 3px 10px; font-weight: 700; font-size: 12px; }
.mono { font-family: var(--font-mono); }

/* mock output */
.mock-output { display: flex; flex-direction: column; gap: 10px; }
.out-row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; color: var(--ink); background: #f7faff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.out-ic { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: #eaf1fd; color: var(--brand); font-size: 14px; }
.out-ic.ok { background: var(--ok-bg); color: var(--ok); }
.out-hint, .out-sep { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.out-log { margin-top: 4px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.out-log .lg { display: flex; align-items: center; gap: 10px; padding: 9px 13px; font-size: 13px; color: var(--ink-soft); border-bottom: 1px solid var(--line-soft); }
.out-log .lg:last-child { border-bottom: 0; }
.out-log .r { margin-left: auto; color: var(--muted); }

/* ---- Step 1: scripted "Create an invoice" demo (scoped to .demo1) ---- */
.demo1 .mock-body { position: relative; height: 384px; padding: 16px 18px; overflow: hidden; }
.demo1 .d1-head { display: flex; gap: 10px; align-items: center; }
.demo1 .d1-tile { width: 32px; height: 32px; border: 1px solid #dbe7fb; border-radius: 9px; padding: 4px; background: linear-gradient(145deg,#fbfdff,#eaf1fd); }
.demo1 .d1-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); letter-spacing: -.01em; }
.demo1 .d1-sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.demo1 .d1-label { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin: 13px 0 7px; }
.demo1 .d1-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; }
.demo1 .d1-field { display: flex; flex-direction: column; gap: 3px; }
.demo1 .d1-flabel { font-size: 9px; font-weight: 600; color: var(--muted); }
.demo1 .d1-input { display: flex; align-items: center; height: 27px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 11px; color: var(--ink); }
.demo1 .d1-input.filled .d1-val { color: var(--ink-soft); }
.demo1 .d1-field.active .d1-input { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(63,126,222,.18); }
.demo1 .d1-ph { color: #a9b4c6; }
.demo1 .d1-field.dirty .d1-ph { display: none; }
.demo1 .d1-val { white-space: nowrap; }
.demo1 .d1-caret { width: 1.5px; height: 13px; background: var(--brand); margin-left: 1px; opacity: 0; }
.demo1 .d1-field.active .d1-caret { animation: d1blink 1s step-end infinite; }
@keyframes d1blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.demo1 .d1-drop { margin-top: 1px; padding: 12px; text-align: center; border: 1.6px dashed #b9c9e2; border-radius: 10px; background: linear-gradient(180deg,#fbfdff,#f3f7fd); transition: border-color .15s, background .15s, box-shadow .15s; }
.demo1 .d1-drop.hot { border-color: var(--brand); background: #e7f0fd; box-shadow: inset 0 0 0 3px rgba(0,74,173,.07); }
.demo1 .d1-drop-ic { width: 26px; height: 26px; opacity: .92; margin: 0 auto 5px; }
.demo1 .d1-drop-big { font-size: 11.5px; font-weight: 700; color: var(--ink); }
.demo1 .d1-file { margin-top: 8px; display: none; align-items: center; justify-content: center; gap: 7px; font-size: 10.5px; color: var(--brand); }
.demo1 .d1-file.show { display: inline-flex; animation: d1pop .28s ease both; }
@keyframes d1pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.demo1 .d1-file-badge { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-line); border-radius: 999px; padding: 2px 8px; font-weight: 700; }
.demo1 .d1-btn { margin-top: 13px; padding: 9px 15px; border: 0; border-radius: 9px; background: linear-gradient(135deg,var(--brand-400),var(--brand)); color: #fff; font-family: var(--font-body); font-weight: 600; font-size: 12px; box-shadow: var(--shadow-brand); cursor: default; transition: transform .1s ease, filter .1s ease; }
.demo1 .d1-btn.press { transform: translateY(1px) scale(.985); filter: brightness(.94); }
.demo1 .d1-cursor { position: absolute; left: 60%; top: 82%; width: 22px; height: 22px; z-index: 9; pointer-events: none; opacity: 0; filter: drop-shadow(0 2px 3px rgba(16,40,80,.3)); transition: left .62s cubic-bezier(.5,0,.2,1), top .62s cubic-bezier(.5,0,.2,1), opacity .2s ease; }
.demo1 .play { border: 0; padding: 0; cursor: pointer; transition: opacity .2s ease; }
.demo1.playing .play { opacity: 0; pointer-events: none; }

/* ---- Step 2: compact, theme-built "read-through" of the finished output (scoped to .demo2) ---- */
.demo2 .mock-body { position: relative; height: 384px; padding: 0; overflow: hidden; background: var(--bg-top); }
/* Motion is state-class driven (JS toggles .d2-down / .d2-up) so the durations live
   in CSS — this lets the reduced-motion carve-out below re-enable them on ▶. */
.demo2 .d2-strip, .demo2 .d2-thumb { will-change: transform; transition: none; }
/* Built at a fixed natural width so rows stay on one line, then scaled to fit the window
   by JS (transform: translateY(...) scale(k)) — i.e. a clean "zoom out". */
.demo2 .d2-strip { width: 720px; transform-origin: top left; }
.demo2.d2-down .d2-strip, .demo2.d2-down .d2-thumb { transition: transform 8000ms cubic-bezier(.4,.08,.5,.95); }
.demo2.d2-up .d2-strip, .demo2.d2-up .d2-thumb { transition: transform 2400ms cubic-bezier(.4,0,.2,1); }
.demo2 .d2-sprite { position: absolute; width: 0; height: 0; }

/* compact output cards (rebuilt from the app, no wasted column space) */
.demo2 .d2-card { background: #fff; margin: 0; border: 0; border-radius: 0; padding: 12px 12px 13px; box-shadow: none; }
.demo2 .d2-card + .d2-card { margin-top: 13px; }   /* only the blue between the two cards stays, to separate them */
.demo2 .d2-h { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink); letter-spacing: -.01em; }
.demo2 .d2-sub { font-size: 9.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.demo2 .d2-sub b { color: var(--ink-soft); font-weight: 600; }
.demo2 .d2-chips { display: flex; gap: 6px; margin: 9px 0 8px; }
.demo2 .d2-chip { font-size: 9px; font-weight: 700; color: var(--ink-soft); background: #eef3fb; border-radius: 999px; padding: 3px 9px; }
.demo2 .d2-chip.warn { color: var(--amber); background: var(--amber-bg); }
.demo2 .d2-note { font-size: 9px; color: #33507e; background: #eaf1fd; border: 1px solid #d5e3f8; border-radius: 8px; padding: 6px 9px; margin-bottom: 9px; line-height: 1.35; }

.demo2 table.d2-tbl { width: 100%; table-layout: auto; border-collapse: separate; border-spacing: 0; }
.demo2 .d2-tbl th, .demo2 .d2-tbl td { white-space: nowrap; }   /* one straight line per row */
.demo2 .d2-tbl th { font-family: var(--font-body); font-weight: 700; font-size: 7.8px; letter-spacing: .03em; text-transform: uppercase; color: var(--brand); text-align: left; background: #f1f6fd; padding: 6px 7px; border-bottom: 1px solid var(--line); }
.demo2 .d2-tbl td { font-size: 10px; line-height: 1.28; color: var(--ink-soft); padding: 6px 7px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.demo2 .d2-tbl tr:last-child td { border-bottom: 0; }
.demo2 .d2-tbl .num { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink); white-space: nowrap; }
.demo2 .d2-tbl .r { text-align: right; }
.demo2 .d2-tbl .idx { color: var(--muted); font-size: 9px; }
.demo2 .d2-tbl .date { white-space: nowrap; font-size: 9.5px; }
.demo2 .d2-group td { background: #eaf1fb; color: var(--brand); font-weight: 700; font-size: 8.5px; letter-spacing: .04em; text-align: center; padding: 5px; }
.demo2 .d2-tbl td.f { background: var(--amber-bg); box-shadow: inset 2px 0 0 var(--amber); position: relative; padding-right: 11px; }
.demo2 .d2-tbl td.f::after { content: "!"; position: absolute; right: 3px; top: 4px; color: var(--amber); font-weight: 700; font-size: 8px; }
.demo2 .d2-view-link { color: var(--brand); font-weight: 700; font-size: 9px; white-space: nowrap; }
.demo2 .d2-del { width: 11px; height: 11px; color: #c2ccdb; display: block; }

.demo2 .d2-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.demo2 .d2-btn { font-size: 9px; font-weight: 700; border-radius: 7px; padding: 6px 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); }
.demo2 .d2-btn.primary { background: linear-gradient(135deg,var(--brand-400),var(--brand)); color: #fff; border: 0; box-shadow: var(--shadow-brand); }
.demo2 .d2-legend { font-size: 8px; color: var(--muted); margin-top: 8px; line-height: 1.35; }
.demo2 .d2-totals { width: 168px; margin: 10px 0 2px auto; font-size: 9.5px; }
.demo2 .d2-totals .tr { display: flex; justify-content: space-between; padding: 4px 9px; border: 1px solid var(--line); border-top: 0; }
.demo2 .d2-totals .tr:first-child { border-top: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.demo2 .d2-totals .tr.total { background: #eaf1fb; color: var(--brand); font-weight: 700; border-radius: 0 0 8px 8px; }

/* thin scroll indicator — only visible while playing */
.demo2 .d2-track { position: absolute; top: 8px; right: 6px; bottom: 8px; width: 5px; border-radius: 999px; background: rgba(22,36,59,.08); opacity: 0; transition: opacity .3s ease; }
.demo2.playing .d2-track { opacity: 1; }
.demo2 .d2-thumb { position: absolute; top: 0; left: 0; width: 100%; height: 48px; border-radius: 999px; background: rgba(0,74,173,.38); }
.demo2 .play { border: 0; padding: 0; cursor: pointer; transition: opacity .2s ease; }
.demo2.playing .play { opacity: 0; pointer-events: none; }

/* ---- Step 3: scripted "fix a flagged row" — a close-up of row 2's three flagged
   cells, corrected one by one by a moving cursor (scoped to .demo3) ---- */
.demo3 .mock-body { position: relative; height: 384px; padding: 20px 22px; overflow: hidden; display: flex; flex-direction: column; }

/* row-identity strip + live review counter */
.demo3 .d3-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.demo3 .d3-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.demo3 .d3-rownum { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #eef3fb; color: var(--brand); font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.demo3 .d3-org { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo3 .d3-truck { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.demo3 .d3-chip { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--ink-soft); background: #eef3fb; border-radius: 999px; padding: 4px 11px; }
.demo3 .d3-chip.warn { color: var(--amber); background: var(--amber-bg); }

/* the three big editable cells, side by side */
.demo3 .d3-stage { flex: 1; display: grid; place-items: center; }
.demo3 .d3-cells { display: grid; grid-template-columns: 1.28fr 1fr 0.86fr; gap: 12px; width: 100%; }
.demo3 .d3-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.demo3 .d3-clabel { font-family: var(--font-body); font-weight: 700; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--brand); }
.demo3 .d3-cell { position: relative; display: flex; align-items: center; min-height: 60px; padding: 14px 26px 14px 15px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 15px; color: var(--ink); white-space: nowrap; transition: background .25s ease, border-color .25s ease, box-shadow .25s ease; }
.demo3 .d3-cell.num .d3-val { font-family: var(--font-mono); font-size: 14px; }
.demo3 .d3-val { overflow: hidden; text-overflow: ellipsis; }
.demo3 .d3-val.sel { background: rgba(63,126,222,.28); border-radius: 3px; }
.demo3 .d3-caret { display: inline-block; width: 2px; height: 17px; background: var(--brand); margin-left: 1px; vertical-align: middle; opacity: 0; }
.demo3 .d3-cell.active .d3-caret { animation: d3blink 1s step-end infinite; }
@keyframes d3blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* flagged (amber) → editing (brand focus ring) → confirmed (green) */
.demo3 .d3-cell.flag { background: var(--amber-bg); box-shadow: inset 3px 0 0 var(--amber); }
.demo3 .d3-cell.flag::after { content: "!"; position: absolute; right: 9px; top: 7px; color: var(--amber); font-weight: 700; font-size: 12px; }
.demo3 .d3-cell.active { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(63,126,222,.18); }
.demo3 .d3-cell.done { background: var(--ok-bg); border-color: var(--ok-line); box-shadow: inset 3px 0 0 var(--ok); }
.demo3 .d3-cell.done::after { content: "✓"; position: absolute; right: 9px; top: 6px; color: var(--ok); font-weight: 700; font-size: 12px; }

.demo3 .d3-legend { font-size: 11px; color: var(--muted); text-align: center; }

/* cursor — reuses the Step 1 pointer; taps as it clicks into each cell */
.demo3 .d3-cursor { position: absolute; left: 58%; top: 90%; width: 22px; height: 22px; z-index: 9; pointer-events: none; opacity: 0; filter: drop-shadow(0 2px 3px rgba(16,40,80,.3)); transition: left .6s cubic-bezier(.5,0,.2,1), top .6s cubic-bezier(.5,0,.2,1), opacity .2s ease; }
.demo3 .d3-cursor.tap { animation: d3tap .28s ease; }
@keyframes d3tap { 0% { transform: scale(1); } 45% { transform: scale(.8); } 100% { transform: scale(1); } }
.demo3 .play { border: 0; padding: 0; cursor: pointer; transition: opacity .2s ease; }
.demo3.playing .play { opacity: 0; pointer-events: none; }

/* ---- Step 4: scripted "export" — copy rows, download CSV + Excel (with browser-style
   download notifications), save to log. Reuses the Step 2 output look (scoped to .demo4) ---- */
.demo4 .mock-body { position: relative; height: auto; padding: 0; overflow: hidden; background: #fff; }
.demo4 .d4-card { background: #fff; margin: 0; border: 0; border-radius: 0; padding: 13px 14px 14px; box-shadow: none; }
.demo4 .d4-h { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); letter-spacing: -.01em; }
.demo4 .d4-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.demo4 .d4-sub b { color: var(--ink-soft); font-weight: 600; }
.demo4 .d4-chips { display: flex; gap: 6px; margin: 10px 0 9px; }
.demo4 .d4-chip { font-size: 10px; font-weight: 700; color: var(--ink-soft); background: #eef3fb; border-radius: 999px; padding: 3px 10px; }
.demo4 .d4-chip.ok { color: var(--ok); background: var(--ok-bg); }

.demo4 table.d4-tbl { width: 100%; table-layout: auto; border-collapse: separate; border-spacing: 0; }
.demo4 .d4-tbl th, .demo4 .d4-tbl td { white-space: nowrap; text-align: left; }
.demo4 .d4-tbl th { font-family: var(--font-body); font-weight: 700; font-size: 8.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--brand); background: #f1f6fd; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.demo4 .d4-tbl td { font-size: 10.5px; color: var(--ink-soft); padding: 6px 8px; border-bottom: 1px solid var(--line-soft); }
.demo4 .d4-tbl .num { font-family: var(--font-mono); font-size: 10px; color: var(--ink); }
.demo4 .d4-tbl .r { text-align: right; }
.demo4 .d4-tbl .idx { color: var(--muted); font-size: 9.5px; }
.demo4 .d4-tbl .d4-more td { text-align: center; color: var(--muted); font-size: 9px; background: #fafcff; padding: 5px; border-bottom: 0; }

.demo4 .d4-acts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.demo4 .d4-btn { font-family: var(--font-body); font-size: 10.5px; font-weight: 700; border-radius: 8px; padding: 8px 12px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); cursor: default; transition: transform .1s ease, filter .1s ease, box-shadow .1s ease; }
.demo4 .d4-btn.primary { background: linear-gradient(135deg,var(--brand-400),var(--brand)); color: #fff; border: 0; box-shadow: var(--shadow-brand); }
.demo4 .d4-btn.press { transform: translateY(1px) scale(.98); filter: brightness(.95); }

/* copy / save confirmation toast */
.demo4 .d4-toast { position: absolute; left: 50%; top: 14px; transform: translate(-50%,-8px); display: flex; align-items: center; gap: 7px; background: #0f2c4d; color: #fff; font-size: 11px; font-weight: 600; padding: 8px 13px; border-radius: 999px; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 8; }
.demo4 .d4-toast.show { opacity: 1; transform: translate(-50%,0); }
.demo4 .d4-toast-ic { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 10px; }

/* browser-style download notifications */
.demo4 .d4-downloads { position: absolute; top: 12px; right: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 8; }
.demo4 .d4-dl { display: flex; align-items: center; gap: 10px; width: 244px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(10px); transition: opacity .28s ease, transform .28s ease; }
.demo4 .d4-dl.in { opacity: 1; transform: translateY(0); }
.demo4 .d4-dl-ic { flex: 0 0 auto; width: 26px; height: 30px; border-radius: 4px; display: grid; place-items: end center; padding-bottom: 3px; font-size: 7px; font-weight: 800; color: #fff; letter-spacing: .02em; position: relative; }
.demo4 .d4-dl-ic::before { content: ""; position: absolute; top: 3px; left: 4px; right: 4px; height: 12px; border-radius: 2px; background: rgba(255,255,255,.35); }
.demo4 .d4-dl-ic.csv { background: linear-gradient(160deg,#3f7ede,#004aad); }
.demo4 .d4-dl-ic.xls { background: linear-gradient(160deg,#2fa46a,#1c7a4a); }
.demo4 .d4-dl-meta { flex: 1; min-width: 0; }
.demo4 .d4-dl-name { font-size: 10.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo4 .d4-dl-status { font-size: 9px; color: var(--muted); margin-top: 2px; }
.demo4 .d4-dl-bar { height: 3px; border-radius: 999px; background: #e7eef8; margin-top: 5px; overflow: hidden; }
.demo4 .d4-dl-bar i { display: block; height: 100%; width: 0; background: var(--brand-400); border-radius: 999px; }
.demo4 .d4-dl.in .d4-dl-bar i { width: 100%; transition: width 760ms linear; }
.demo4 .d4-dl.done .d4-dl-bar { display: none; }
.demo4 .d4-dl.done .d4-dl-status { color: var(--ok); }
.demo4 .d4-dl-check { flex: 0 0 auto; width: 18px; height: 18px; display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.demo4 .d4-dl.done .d4-dl-check { color: var(--ok); font-weight: 700; }

/* cursor — reuses the Step 1 pointer; taps as it clicks each action */
.demo4 .d4-cursor { position: absolute; left: 58%; top: 88%; width: 22px; height: 22px; z-index: 9; pointer-events: none; opacity: 0; filter: drop-shadow(0 2px 3px rgba(16,40,80,.3)); transition: left .6s cubic-bezier(.5,0,.2,1), top .6s cubic-bezier(.5,0,.2,1), opacity .2s ease; }
.demo4 .d4-cursor.tap { animation: d4tap .28s ease; }
@keyframes d4tap { 0% { transform: scale(1); } 45% { transform: scale(.8); } 100% { transform: scale(1); } }
.demo4 .play { border: 0; padding: 0; cursor: pointer; transition: opacity .2s ease; }
.demo4.playing .play { opacity: 0; pointer-events: none; }

/* Desktop only: the mock now hugs its content (no dead space), so give Step 4 a bit
   more presence — slightly larger type, roomier rows and buttons. Mobile keeps its own
   sizes from the max-width block below, untouched. */
@media (min-width: 641px) {
  .demo4 .d4-card { padding: 16px 16px 16px; }
  .demo4 .d4-h { font-size: 18px; }
  .demo4 .d4-sub { font-size: 11.5px; }
  .demo4 .d4-chips { margin: 12px 0 11px; }
  .demo4 .d4-chip { font-size: 11px; padding: 4px 11px; }
  .demo4 .d4-tbl th { font-size: 9px; padding: 8px 9px; }
  .demo4 .d4-tbl td { font-size: 11.5px; padding: 9px 9px; }
  .demo4 .d4-tbl .num { font-size: 11px; }
  .demo4 .d4-tbl .idx { font-size: 10px; }
  .demo4 .d4-tbl .d4-more td { font-size: 9.5px; padding: 7px; }
  .demo4 .d4-acts { margin-top: 14px; }
  .demo4 .d4-btn { font-size: 11.5px; padding: 10px 14px; }
}

/* ===================== SOCIAL PROOF ===================== */
.social { max-width: var(--maxw); margin: 0 auto; padding: clamp(36px, 4.1vw, 54px) 24px clamp(56px, 8vw, 104px); text-align: center; }
.social .section-head { max-width: 900px; margin-bottom: 44px; }
.social .section-head h2 { font-size: clamp(28px, 4vw, 44px); }

.reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; text-align: left; }
.review { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-sm); }
.review .stars { color: var(--amber); letter-spacing: 2px; font-size: 15px; margin-bottom: 12px; }
.review blockquote { margin: 0 0 18px; font-size: 16px; color: var(--ink); line-height: 1.55; }
.review figcaption { display: flex; flex-direction: column; }
.review figcaption b { font-family: var(--font-display); font-size: 15px; }
.review figcaption span { color: var(--muted); font-size: 13px; }
.reviews .r-extra { display: none; }   /* hero review — surfaced only in the phone marquee */

.stats { list-style: none; padding: 0; margin: 48px auto 0; max-width: 760px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stats li { background: rgba(255,255,255,.6); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 16px; }
.stats b { display: block; font-family: var(--font-display); font-size: clamp(26px, 3.4vw, 38px); color: var(--brand); letter-spacing: -.02em; }
.stats span { color: var(--muted); font-size: 14px; }
/* Animated time stat: "10 Hours" deletes and retypes as "5 Min" (driven by script.js).
   .stat-num is a <span>, so it would otherwise inherit the small muted sublabel styling
   above — force it back to the big number look so it matches the other tiles exactly. */
.stats .stat-num { font-size: inherit; color: inherit; font-weight: inherit; }
.stats .stat-caret { display: inline-block; width: 3px; height: .72em; margin-left: 3px; border-radius: 1px; background: var(--brand); vertical-align: -.04em; opacity: 0; }
.stats .stat-time.typing .stat-caret { animation: statblink 1s step-end infinite; }
@keyframes statblink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ===================== FINAL CTA ===================== */
/* Full-bleed blue band (like the Contact Us header) with a soft, downward-bulging bottom
   edge (Slack-style). The page background shows above it; the section's own background is
   the footer colour, which shows below the curve and flows straight into the footer. */
.cta-band {
  position: relative;
  padding: clamp(56px, 7vw, 92px) 24px clamp(66px, 7.5vw, 96px);
  background: rgba(255,255,255,.5);          /* = footer colour, visible below the curve */
}
/* the blue layer: straight top, curved bottom across the full width */
.cta-band::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  bottom: clamp(18px, 2vw, 30px);            /* small footer-colour gap below the curve's deepest point */
  background: radial-gradient(120% 150% at 12% 0%, var(--grad-a) 0%, var(--brand) 55%, #06356f 100%);
  /* horizontal radius 50% on both bottom corners spans the full width; the small vertical
     radius makes it a shallow arc that dips lowest at the centre. */
  border-radius: 0 0 50% 50% / 0 0 clamp(42px, 5vw, 88px) clamp(42px, 5vw, 88px);
  box-shadow: var(--shadow-float);
  z-index: 0;
}
.cta-inner {
  position: relative; z-index: 1;
  max-width: var(--maxw); margin: 0 auto; text-align: center; color: #fff;
}
.cta-inner h2 { font-size: clamp(28px, 4vw, 44px); }
.cta-inner p { color: rgba(255,255,255,.86); font-size: 18px; margin: 14px 0 28px; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ===================== CONTACT SALES ===================== */
/* Top padding matches the Contact Us page's .ch-inner so both headers sit at the same
   height below the nav; the roomier bottom padding is kept. */
.contact-sales { max-width: var(--maxw); margin: 0 auto; padding: clamp(40px, 5vw, 60px) 24px clamp(56px, 8vw, 104px); }
.cs-inner { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: clamp(32px, 5vw, 72px); align-items: start; }

/* left: intro + points + envelope visual */
.cs-intro h2 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.01em; }
.cs-sub { color: var(--ink-soft); font-size: 17px; line-height: 1.6; margin: 16px 0 22px; max-width: 34em; }
.cs-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.cs-points li { position: relative; padding-left: 30px; color: var(--ink-soft); font-size: 15.5px; }
.cs-points li::before { content: ""; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--ok-bg); }
.cs-points li::after { content: ""; position: absolute; left: 6px; top: 6px; width: 8px; height: 5px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
/* "First invoice free" callout on the quote page (soft amber box in the left column) */
.cs-freebie { display: flex; align-items: center; gap: 11px; margin: 22px 0 0; padding: 12px 15px; background: var(--amber-bg); border: 1px solid #f1e0bd; border-radius: 12px; font-size: 15px; color: var(--ink-soft); }
.cs-freebie strong { color: var(--amber-ink); font-weight: 700; }
.cs-freebie-ic { width: 22px; height: 22px; color: var(--amber); flex: none; }
.cs-visual { margin-top: clamp(4px, 2.5vw, 40px); display: flex; justify-content: center; }
.cs-mail { width: min(300px, 82%); height: auto; filter: drop-shadow(0 14px 26px rgba(16,40,80,.12)); }

/* right: form card */
.cs-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: clamp(22px, 3vw, 34px); }
.cs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.cs-span2 { grid-column: 1 / -1; }
.cs-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cs-field label { font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--ink); }
.cs-req, .cs-opt { font-weight: 400; color: var(--muted); font-size: 12px; }
.cs-field input, .cs-field select, .cs-field textarea {
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; width: 100%; transition: border-color .15s, box-shadow .15s, background .15s;
}
.cs-field textarea { resize: vertical; min-height: 84px; }
.cs-field input::placeholder, .cs-field textarea::placeholder { color: #a9b4c6; }
.cs-field input:focus, .cs-field select:focus, .cs-field textarea:focus {
  outline: none; background: #fff; border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(63,126,222,.18);
}
.cs-field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236a7891' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.cs-field.err input, .cs-field.err select, .cs-field.err textarea { border-color: #d64545; background: #fef6f6; box-shadow: 0 0 0 3px rgba(214,69,69,.14); }
.cs-submit { width: 100%; margin-top: 20px; }
.cs-error { color: #c23b3b; font-size: 14px; margin: 13px 0 0; }
.cs-success { background: var(--ok-bg); border: 1px solid var(--ok-line); color: #12673a; border-radius: 12px; padding: 16px 18px; font-size: 15px; line-height: 1.5; margin: 0; }

@media (max-width: 900px) {
  .cs-inner { grid-template-columns: 1fr; }
  .cs-sub { max-width: none; }
  /* Stacked layout only: shrink the freebie pill to hug its text (no empty tail) and
     drop the second sentence so it stays a slim one-liner. Desktop keeps the original
     full-width badge with the full "See it before you pay a cent." line. */
  .cs-freebie { width: fit-content; max-width: 100%; }
  .cs-freebie-more { display: none; }
}
@media (max-width: 560px) {
  .cs-grid { grid-template-columns: 1fr; }
  .cs-visual { display: none; }
}

/* ===================== CONTACT US (questions / talk-to-sales page) =====================
   Slack's Contact Us layout, rebuilt in InvoiceBud's blue theme: a brand-gradient band
   across the top (the same surface as the final CTA), a white form card overlapping it,
   and a welcoming avatar cluster on the right. */
.contact-hero { position: relative; overflow: hidden; }
/* the blue band: full-bleed, fixed height, sits behind the content */
.contact-hero::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: clamp(280px, 30vw, 360px);
  background: radial-gradient(120% 150% at 12% 0%, var(--grad-a) 0%, var(--brand) 55%, #06356f 100%);
  z-index: 0;
}
.ch-inner {
  position: relative; z-index: 1;
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(40px, 5vw, 60px) 24px clamp(56px, 8vw, 96px);
  display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr);
  column-gap: clamp(32px, 5vw, 72px); align-items: start;
}

/* heading — white, on the blue band */
.ch-head { grid-column: 1; grid-row: 1; color: #fff; margin-bottom: clamp(22px, 3vw, 32px); }
.ch-head h1 { font-size: clamp(34px, 4.6vw, 48px); letter-spacing: -.02em; }
.ch-sub { color: rgba(255,255,255,.9); font-size: clamp(15px, 1.5vw, 17.5px); line-height: 1.6; margin: 16px 0 0; max-width: 46em; }

/* form card — overlaps the band's lower edge */
.ch-form {
  grid-column: 1; grid-row: 2;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float); padding: clamp(24px, 3vw, 36px);
}
.ch-form-body { display: flex; flex-direction: column; gap: 18px; }
.ch-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.ch-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ch-field > label, .ch-flabel { font-family: var(--font-body); font-weight: 600; font-size: 13.5px; color: var(--ink); }
.ch-field input, .ch-field textarea {
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; width: 100%; transition: border-color .15s, box-shadow .15s, background .15s;
}
.ch-field textarea { resize: vertical; min-height: 92px; }
.ch-field input::placeholder, .ch-field textarea::placeholder { color: #a9b4c6; }
.ch-field input:focus, .ch-field textarea:focus {
  outline: none; background: #fff; border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(63,126,222,.18);
}
.ch-field.err input, .ch-field.err textarea { border-color: #d64545; background: #fef6f6; box-shadow: 0 0 0 3px rgba(214,69,69,.14); }
.ch-topics-field.err .ch-flabel { color: #c23b3b; }

/* topic pills — Slack-style chips, selected = brand blue */
.ch-topics { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.ch-topic-in { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ch-topic {
  display: inline-flex; align-items: center; padding: 9px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .14s, color .14s, background .14s, box-shadow .14s, transform .14s;
}
.ch-topic:hover { border-color: #cdd9ec; color: var(--brand); transform: translateY(-1px); }
.ch-topic-in:checked + .ch-topic { background: linear-gradient(135deg, var(--brand-400), var(--brand)); border-color: transparent; color: #fff; box-shadow: var(--shadow-brand); }
.ch-topic-in:focus-visible + .ch-topic { outline: 3px solid var(--brand-400); outline-offset: 2px; }

.ch-submit { width: 100%; margin-top: 22px; }
/* On a confirmed submit the JS sets [hidden] on these; the attribute+class selector
   outranks the author `display` above (flex / inline-flex) so they actually disappear.
   The .cs-* pair does the same for the quote form on contact.html (same latent gotcha). */
.ch-form-body[hidden], .ch-submit[hidden],
.cs-grid[hidden], .cs-submit[hidden] { display: none; }
.ch-error { color: #c23b3b; font-size: 14px; margin: 13px 0 0; }
.ch-success { background: var(--ok-bg); border: 1px solid var(--ok-line); color: #12673a; border-radius: 12px; padding: 16px 18px; font-size: 15px; line-height: 1.5; margin: 0; }

/* Cross-link under each form's button, pointing visitors to the other page so nobody
   lands on the wrong one (quote form <-> "just a question" form). Hidden on success. */
.form-altlink { margin: 14px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.form-altlink a { color: var(--brand); font-weight: 600; text-decoration: none; }
.form-altlink a:hover { text-decoration: underline; }
.form-altlink[hidden] { display: none; }

/* right: welcoming avatar cluster (placeholder). Faces overlap into a loose group with
   small emoji badges + a dotted accent, echoing Slack but in InvoiceBud's palette. */
/* Dropped low so only the top face (f1) crosses the blue band; its centre sits on the
   band's bottom edge (~half on blue, half on white), and the rest hang below on white,
   Slack-style. margin-top is tuned to the pinned band height (360) + padding (60) at >=1200px. */
.ch-art { grid-column: 2; grid-row: 1 / span 2; position: relative; width: 380px; height: 420px; justify-self: center; align-self: start; margin-top: 208px; }
.ch-face {
  position: absolute; border-radius: 50%; display: grid; place-items: center;
  color: rgba(255,255,255,.92); border: 4px solid rgba(255,255,255,.9);
  box-shadow: 0 14px 30px rgba(16,40,80,.22);
}
.ch-face svg { width: 60%; height: 60%; }
.ch-face.f1 { width: 168px; height: 168px; left: 200px; top: 8px;   background: linear-gradient(150deg, var(--grad-a), var(--brand)); }
.ch-face.f2 { width: 128px; height: 128px; left: 84px;  top: 116px; background: linear-gradient(150deg, #f3b24a, var(--amber)); }
.ch-face.f3 { width: 112px; height: 112px; left: 204px; top: 206px; background: linear-gradient(150deg, #43c98b, #1c7a4a); }
.ch-face.f4 { width: 98px;  height: 98px;  left: 74px;  top: 302px; background: linear-gradient(150deg, #6f9be6, #3f60af); }
/* dotted accent (near f1's top-left) */
.ch-dots { position: absolute; left: 150px; top: 0; width: 96px; height: 66px; color: rgba(255,255,255,.55); background-image: radial-gradient(currentColor 1.6px, transparent 1.7px); background-size: 14px 14px; }
/* small emoji "chat" badges */
.ch-emoji { position: absolute; display: grid; place-items: center; width: 40px; height: 40px; background: #fff; border-radius: 12px; box-shadow: 0 8px 18px rgba(16,40,80,.18); font-size: 20px; line-height: 1; }
.ch-emoji.e1 { left: 178px; top: 20px; }
.ch-emoji.e2 { left: 300px; top: 214px; }
.ch-emoji.e3 { left: 62px;  top: 124px; }
.ch-emoji.e4 { left: 150px; top: 310px; }

/* small founders note under the form + icons (spans both columns) */
.ch-founders { grid-column: 1 / -1; margin: 6px 0 0; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.ch-founders strong { color: var(--ink); font-weight: 700; }
.ch-founders a { color: var(--brand); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.ch-founders a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .ch-inner { grid-template-columns: 1fr; }
  .ch-art { display: none; }   /* decorative cluster (desktop only for now) */
  .ch-founders { margin-top: 22px; text-align: left; }
}

/* ===================== LEGAL PAGES (Privacy Policy, Terms of Use) =====================
   Plain, readable prose pages: a single narrow column on the app's light background, a
   quiet mono "Legal" eyebrow that ties to the site's ticket-number motif. */
.legal { padding: clamp(36px, 5vw, 66px) 24px clamp(56px, 8vw, 96px); }
.legal-inner { max-width: 780px; margin: 0 auto; }
.legal-head { border-bottom: 1px solid var(--line); padding-bottom: clamp(20px, 3vw, 30px); margin-bottom: clamp(26px, 4vw, 40px); }
.legal-eyebrow { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .14em; font-size: 12.5px; font-weight: 600; color: var(--brand); margin: 0 0 12px; }
.legal-head h1 { font-family: var(--font-display); font-size: clamp(30px, 5vw, 44px); line-height: 1.08; letter-spacing: -.02em; color: var(--ink); margin: 0; }
.legal-updated { color: var(--muted); font-size: 14.5px; margin: 14px 0 0; }

.legal-body { color: var(--ink-soft); font-size: clamp(15.5px, 1.6vw, 16px); line-height: 1.75; }
.legal-body h2 { font-family: var(--font-display); font-size: clamp(19px, 2.4vw, 23px); line-height: 1.25; letter-spacing: -.01em; color: var(--ink); margin: 36px 0 12px; }
.legal-body h3 { font-size: 16.5px; font-weight: 700; color: var(--ink); margin: 22px 0 6px; }
.legal-body p { margin: 0 0 16px; }
.legal-body ul { margin: 0 0 16px; padding-left: 22px; }
.legal-body li { margin: 0 0 8px; }
.legal-body a { color: var(--brand); font-weight: 600; text-decoration: none; }
.legal-body a:hover { text-decoration: underline; }
.legal-body strong { color: var(--ink); font-weight: 700; }

/* ===================== FOOTER ===================== */
.footer { border-top: 1px solid var(--line); background: rgba(255,255,255,.5); margin-top: 20px; }
/* On the homepage the curved CTA band already provides the footer colour above the footer,
   so drop the gap + divider and let them read as one continuous surface. */
body:has(.cta-band) .footer { margin-top: 0; border-top: 0; }
/* Homepage: the curve sits just above, so keep the footer's own top padding tight. */
body:has(.cta-band) .footer-inner { padding-top: 30px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 48px 24px 28px; display: grid; grid-template-columns: 1.4fr 2fr; gap: 40px; }
.footer-brand { display: flex; gap: 15px; align-items: flex-start; max-width: 340px; }
.footer-brand img { width: 42px; height: 42px; }
.footer-brand p { margin: 0; color: var(--muted); font-size: 15px; }
.footer-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.footer-cols h4 { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin: 0 0 12px; }
.footer-cols a { display: block; color: var(--muted); font-size: 14.5px; padding: 5px 0; }
.footer-cols a:hover { color: var(--brand); }
.footer-bar { max-width: var(--maxw); margin: 0 auto; padding: 18px 24px 28px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.footer-bar b { color: var(--ink-soft); }

/* ===================== REVEAL ANIMATION ===================== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .nav-links, .nav-actions { display: none; }
  .nav-toggle { display: block; }
  .nav.open .mobile-menu { display: flex; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-copy { max-width: none; text-align: center; margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .hero-proof { text-align: center; margin-inline: auto; }
  /* Text-first on mobile: headline/CTA come before the invoice window.
     (Desktop keeps the 2-col layout; this only fires at ≤900px.) */
  .hero-visual { order: 0; }
  .hero-window { transform: none; }
  .feature { grid-template-columns: 1fr; gap: 26px; }
  .feature.reverse .feature-media { order: 0; }
  .feature-text { text-align: center; order: -1; }
  .feature-text p { margin-inline: auto; }
  .reviews { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .valuestrip-inner { flex-direction: column; align-items: flex-start; }
}

/* =====================================================================
   PHONE (≤640px) — mobile-only refinements. Desktop (>900px) is never
   touched. This block sits after the ≤900/≤560 blocks so it wins the
   cascade where widths overlap. The four demos render as clean static
   frames here (their scripts are gated off on phones in script.js).
   ===================================================================== */
@media (max-width: 640px) {
  /* ---- Global: no sideways scroll, tidy anchor offsets, even rhythm ---- */
  body { overflow-x: clip; }                 /* clip (not hidden) so the sticky nav is unaffected */
  #how, #features, #reviews, #pricing { scroll-margin-top: calc(var(--nav-h) + 12px); }

  /* ---- Nav drawer: solid full-height panel, even spacing, full-width CTAs ---- */
  .nav.open .mobile-menu {
    display: flex; flex-direction: column; gap: 10px;
    padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    background: #fff; border-bottom: 0;
    min-height: calc(100vh - var(--nav-h) - 3px);
    min-height: calc(100dvh - var(--nav-h) - 3px);
    box-shadow: 0 24px 40px rgba(16,40,80,.10);
  }
  .mobile-menu a:not(.btn) {
    display: flex; align-items: center; min-height: 48px;
    margin: 0; padding: 0 2px; font-size: 16px; color: var(--ink);
    border-bottom: 1px solid var(--line-soft);
  }
  .mobile-menu .btn { width: 100%; min-height: 50px; font-size: 16px; }
  .mobile-menu .btn-ghost { margin-top: 10px; }

  /* ---- Hero: clean + balanced on phones. The reassurance line and the
     review quote are hidden here so the section reads headline -> lead ->
     one CTA -> invoice window (desktop >900px keeps both). ---- */
  .hero { padding-left: 20px; padding-right: 20px; }
  .hero-freebie, .hero-proof { display: none; }
  /* Heavier headline on phones. Space Grotesk tops out at 700 (already the weight),
     so a hairline same-color stroke adds the extra heft the larger number can't. */
  /* As large as it goes while "automated in a click." stays on one line (2 lines total).
     Floor 35px is the 2-line max at 375px; it scales up to ~40px at 430px, capped at 41px
     (the 2-line max there). The bold/stroke lives in the base .hero h1 rule. */
  .hero h1 { font-size: clamp(35px, 9.3vw, 41px); }
  .hero .lead { margin: 18px auto 28px; }          /* center the paragraph as a block */
  /* Even hero rhythm: the button->window gap equals the lead->button gap (both 28px). */
  .hero-inner { gap: 28px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { width: auto; }                  /* hug the label — no wasted side space */
  .hw-bar { gap: 6px; padding: 10px 13px; }
  .hw-dot { width: 9px; height: 9px; }
  /* Drop the colgroup's 5-column map, hide "Invoice #", keep ~6 rows, and
     size the four survivors with fixed px so the cqw text stays legible. */
  .hw-table colgroup { display: none; }
  .hw-table th:nth-child(3), .hw-table td:nth-child(3) { display: none; }
  .hw-table tbody tr:nth-child(n+9) { display: none; }   /* show 8 rows on phones (was 6) */
  .hw-table thead th:nth-child(1) { width: 28%; }   /* Date */
  .hw-table thead th:nth-child(2) { width: 26%; }   /* Client */
  .hw-table thead th:nth-child(4) { width: 23%; }   /* Amount */
  .hw-table thead th:nth-child(5) { width: 23%; }   /* Status */
  .hw-table thead th { font-size: 11px; padding: 9px 6px; }
  .hw-table tbody td { font-size: 11px; padding: 9px 6px; }
  .hw-badge { font-size: 10px; padding: 3px 8px; border-radius: 6px; }

  /* ---- Value strip -> panning ticker: the four features scroll across the
     full width like a marquee (duplicate set makes the loop seamless).
     Edges fade so items appear/vanish smoothly instead of popping. ---- */
  .valuestrip {
    max-width: none; margin: 0; padding: 20px 0 12px; overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  }
  .valuestrip-inner {
    width: max-content; max-width: none; margin: 0;
    flex-direction: row; flex-wrap: nowrap; justify-content: flex-start; align-items: center;
    gap: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none;
    animation: vs-marquee 22s linear infinite; will-change: transform;
  }
  .valuestrip li {
    flex: 0 0 auto; min-height: 0; padding: 0; margin: 0; border-bottom: 0;
    white-space: nowrap; font-family: var(--font-body); font-size: 14.5px; font-weight: 500;
  }
  .valuestrip li::after {   /* separator dot sits in the gap between features */
    content: "\2022"; margin: 0 26px; color: var(--muted); opacity: .5; font-size: 13px;
  }
  .valuestrip li.vs-dup { display: inline-flex; }   /* reveal the duplicate set for the loop */
  .valuestrip .ic { width: 19px; height: 19px; }

  /* ---- Features: static mocks, auto height, no clipping, no cursor/▶ ---- */
  .features { padding-top: 44px; padding-bottom: 48px; }
  .only-desktop { display: none; }   /* text/content shown on desktop only */
  .only-mobile { display: inline; }  /* text/content shown on phones only */
  .br-mobile { display: inline; }    /* footer note wraps to two lines on phones */
  .chf-or, .chf-end { display: none; }   /* founders note: drop the "or" and trailing period when it stacks on phones */
  .features .section-head { margin-bottom: 24px; }   /* tighten the big gap under the "How it works" heading */
  /* Big + bold so it dominates the "STEP 01" / step h3 below it, but kept a notch
     smaller than the hero headline at every width (hero floor 35 -> ~40; this 30 -> ~35). */
  .features .section-head h2 { font-size: clamp(30px, 8.2vw, 36px); letter-spacing: -.02em; -webkit-text-stroke: 0.5px currentColor; }
  .feature { gap: 22px; margin-bottom: 52px; }
  .feature-text h3 { font-size: 24px; }
  .feature-text p { font-size: 16px; }
  /* The scripted demos now play on phones (auto-play + loop on scroll-in), so the
     pointer cursors stay visible. The ▶ affordance is hidden — the tightly-wrapped
     mobile cards leave no free corner for it, and playback is automatic. */
  .mock .play { display: none; }
  /* Form/fix demos wrap to their content; the cursor is absolutely placed inside so
     it still lands right. (demo2 + demo4 keep a fixed window — see their blocks.) */
  .demo1 .mock-body, .demo3 .mock-body { height: auto; overflow: visible; }

  /* Step 1 — full form + "Read documents" button visible, enlarged a touch */
  .demo1 .mock-body { padding: 16px 16px 18px; }
  .demo1 .d1-title { font-size: 17px; }
  .demo1 .d1-sub { font-size: 11px; }
  .demo1 .d1-label { font-size: 10.5px; }
  .demo1 .d1-flabel { font-size: 10px; }
  .demo1 .d1-input { height: 30px; font-size: 12.5px; }
  .demo1 .d1-drop { padding: 9px 12px; cursor: pointer; }      /* slightly shorter box; tap to "upload" */
  .demo1 .d1-drop-ic { margin-bottom: 3px; }
  .demo1 .d1-drop-big { font-size: 12.5px; }
  .demo1 .d1-file { font-size: 11px; }   /* hidden until the drop zone is tapped (JS toggles .show) */
  .demo1 .d1-btn { font-size: 13px; padding: 11px 16px; }

  /* Step 2 — trim to # / Date / Origin / Weight, ~5 rows, drop 2nd card */
  /* One flat white surface: drop the blue page-tint backdrop and let the invoice
     card fill the window flush (no floating card / no blue margin behind it). */
  /* A real read-through scroll on phones: a fixed-height window with the full column
     of loads inside, so the strip is taller than the frame and glides down + back up.
     JS drives the transform (no more `transform: none` lock). */
  .demo2 .mock-body { padding: 0; background: #fff; position: relative; height: 360px; overflow: hidden; }
  .demo2 .d2-strip { width: auto; }                               /* fit the phone width */
  .demo2 .d2-card + .d2-card { display: none; }                   /* drop the Waiting-Time card */
  .demo2 .d2-card { margin: 0; border: 0; border-radius: 0; box-shadow: none; padding: 14px 14px 16px; }
  .demo2 .d2-tbl { table-layout: fixed; width: 100%; }
  .demo2 .d2-tbl th:nth-child(4), .demo2 .d2-tbl td:nth-child(4),
  .demo2 .d2-tbl th:nth-child(5), .demo2 .d2-tbl td:nth-child(5),
  .demo2 .d2-tbl th:nth-child(6), .demo2 .d2-tbl td:nth-child(6),
  .demo2 .d2-tbl th:nth-child(8), .demo2 .d2-tbl td:nth-child(8),
  .demo2 .d2-tbl th:nth-child(9), .demo2 .d2-tbl td:nth-child(9) { display: none; }
  .demo2 .d2-tbl th:nth-child(1) { width: 7%; }
  .demo2 .d2-tbl th:nth-child(2) { width: 30%; }
  .demo2 .d2-tbl th:nth-child(3) { width: 41%; }
  .demo2 .d2-tbl td:nth-child(3) { white-space: normal; }         /* let long origins wrap */
  .demo2 .d2-tbl th:nth-child(7) { width: 22%; }
  /* All 13 loads stay in the table so the read-through has a full column to scroll. */
  .demo2 .d2-tbl th { font-size: 10px; padding: 7px 7px; }
  .demo2 .d2-tbl td { font-size: 12px; padding: 8px 7px; }
  .demo2 .d2-tbl .num, .demo2 .d2-tbl .date { font-size: 11.5px; }
  .demo2 .d2-group td { font-size: 10px; }
  /* All four export buttons on one line: don't wrap, size to content, smaller. */
  .demo2 .d2-acts { flex-wrap: nowrap; gap: 5px; }
  .demo2 .d2-btn { flex: none; font-size: 9.5px; padding: 6px 7px; white-space: nowrap; }
  .demo2 .d2-legend { font-size: 10px; }

  /* Step 3 — stack the header, stack the 3 cells, remove dead whitespace */
  .demo3 .mock-body { display: block; padding: 18px 18px 20px; }
  /* Center the "Cells to review" chip: equal space above (to the truck line) and
     below (to the cells) instead of hugging the cells. */
  .demo3 .d3-top { flex-direction: column; align-items: flex-start; gap: 15px; margin-bottom: 15px; }
  .demo3 .d3-stage { display: block; }
  .demo3 .d3-cells { grid-template-columns: 1fr; gap: 12px; }
  .demo3 .d3-cell { min-height: 52px; }
  .demo3 .d3-legend { margin-top: 14px; }

  /* Step 4 — trim to # / Date / Weight, 2×2 buttons */
  /* One flat white surface (like Step 2): drop the blue page-tint backdrop and let the
     invoice card fill the window flush — no floating card, no blue frame behind it. */
  .demo4 .mock-body { position: relative; height: auto; overflow: visible; padding: 0; background: #fff; }
  .demo4 .d4-card { margin: 0; border: 0; border-radius: 0; box-shadow: none; padding: 14px 14px 16px; }
  /* Confirmation toast: keep it on one line, centred at the top of the window. The
     max-content width lets the centred pill grow past the default 50%-of-window cap
     (which was forcing the text onto two lines); the max-width guards against overflow. */
  .demo4 .d4-toast { white-space: nowrap; width: max-content; max-width: calc(100% - 24px); }
  /* Downloads dock to the top-right corner (Mac-style), floating over the invoice as a
     compact card instead of a full-width tray. Some padding trimmed so it fits up there. */
  .demo4 .d4-downloads { top: 12px; right: 12px; left: auto; bottom: auto; flex-direction: column; }
  .demo4 .d4-dl { width: 212px; gap: 8px; padding: 7px 9px; box-shadow: 0 10px 24px rgba(16,40,80,.20); }
  .demo4 .d4-dl-ic { width: 22px; height: 26px; }
  .demo4 .d4-dl-name { font-size: 10px; }
  .demo4 .d4-dl-status { font-size: 8.5px; }
  .demo4 .d4-dl-check { width: 16px; height: 16px; }
  .demo4 .d4-tbl { table-layout: fixed; width: 100%; }
  .demo4 .d4-tbl th:nth-child(3), .demo4 .d4-tbl td:nth-child(3),
  .demo4 .d4-tbl th:nth-child(4), .demo4 .d4-tbl td:nth-child(4) { display: none; }
  .demo4 .d4-tbl th:nth-child(1) { width: 14%; }
  .demo4 .d4-tbl th:nth-child(2) { width: 52%; }
  .demo4 .d4-tbl th:nth-child(5) { width: 34%; }
  .demo4 .d4-tbl th { font-size: 10px; padding: 7px 9px; }
  .demo4 .d4-tbl td { font-size: 12px; padding: 8px 9px; }
  .demo4 .d4-tbl .num { font-size: 11.5px; }
  .demo4 .d4-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .demo4 .d4-btn { width: 100%; font-size: 12px; padding: 10px 12px; }

  /* ---- Reviews -> panning marquee: the testimonial cards glide left, echoing the
     value-strip ticker at the top of the page. JS (phones only) wraps the cards in
     .reviews-track and clones them for a seamless loop; press-and-hold pauses it so a
     card can be read. Reduced-motion visitors keep the vertical stack (JS doesn't build
     the marquee), so the extra hero review is shown here unconditionally. ---- */
  .reviews .r-extra { display: block; }
  .reviews.reviews-marquee {
    display: block; grid-template-columns: none; max-width: none;
    margin-left: -24px; margin-right: -24px;      /* bleed past the section's 24px padding */
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  }
  .reviews-track {
    display: flex; flex-wrap: nowrap; width: max-content; align-items: stretch; gap: 0;
    animation: reviews-marquee 38s linear infinite; will-change: transform;
  }
  .reviews.reviews-marquee:active .reviews-track { animation-play-state: paused; }  /* hold to read */
  .reviews-track .review {
    flex: 0 0 80vw; max-width: 300px; margin: 0 14px 0 0; text-align: left;
    display: flex; flex-direction: column;
  }
  .reviews-track .review blockquote { flex: 1; }   /* equalise heights, caption pinned to the bottom */

  /* ---- Final CTA: full-bleed blue band (the .cta-band handles the side padding now).
     Tighten the vertical rhythm and shallow the curve so the band isn't overly tall on
     phones; the headline still stacks at the sentence boundary (<br> in markup). ---- */
  .cta-band { padding: clamp(44px, 11vw, 64px) 20px clamp(52px, 13vw, 74px); }
  .cta-band::before { bottom: clamp(14px, 4vw, 24px); border-radius: 0 0 50% 50% / 0 0 clamp(30px, 8vw, 48px) clamp(30px, 8vw, 48px); }
  .cta-inner h2 { font-size: clamp(27px, 7vw, 31px); line-height: 1.2; }
  .cta-inner p { font-size: 14.5px; }

  /* ---- Social: drop the duplicate "Talk to Sales" (kept on desktop) ---- */
  .social .section-head .btn { display: none; }

  /* ---- Contact form: comfortable 44px+ touch targets, no iOS zoom ---- */
  .cs-field input, .cs-field select, .cs-field textarea { padding: 12px 13px; font-size: 16px; }

  /* ---- Contact Us page: shorter band, stacked name row, no iOS zoom ---- */
  .contact-hero::before { height: clamp(210px, 44vw, 270px); }
  .ch-inner { padding-left: 20px; padding-right: 20px; }
  .ch-head h1 { font-size: clamp(30px, 8.4vw, 38px); }
  .ch-row { grid-template-columns: 1fr; }
  .ch-field input, .ch-field textarea { font-size: 16px; padding: 12px 13px; }
  .ch-topic { font-size: 13px; padding: 9px 14px; }
}

/* Phone value-strip ticker: two identical halves, so -50% loops seamlessly. */
@keyframes vs-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Phone reviews marquee: two identical halves, so -50% loops seamlessly (each card
   carries its own right margin, keeping the seam gap identical to the inner gaps). */
@keyframes reviews-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Accessible fallback: if the visitor prefers reduced motion, don't slide the
   ticker — restore the clean stacked card (phones only; desktop is untouched). */
@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  .valuestrip { overflow: visible; padding: 28px 20px 6px; -webkit-mask-image: none; mask-image: none; }
  .valuestrip-inner {
    width: 100%; max-width: 440px; margin: 0 auto;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0;
    padding: 6px 16px; background: rgba(255,255,255,.6);
    border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm);
    animation: none;
  }
  .valuestrip li { gap: 12px; min-height: 46px; padding: 6px 2px; white-space: normal; border-bottom: 1px solid var(--line-soft); }
  .valuestrip li::after { content: none; }
  .valuestrip li.vs-dup { display: none; }
  .valuestrip li:not(.vs-dup):last-of-type { border-bottom: 0; }
}

/* ===================== REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }

  /* The Step 1 demo is click-to-play (an explicit user action, like pressing play on a
     video), so its motion is kept even when reduce-motion is on. */
  .demo1 .d1-cursor { transition: left .62s cubic-bezier(.5,0,.2,1), top .62s cubic-bezier(.5,0,.2,1), opacity .2s ease !important; }
  .demo1 .d1-file.show { animation: d1pop .28s ease both !important; }
  .demo1 .d1-field.active .d1-caret { animation: d1blink 1s step-end infinite !important; }
  .demo1 .d1-drop { transition: border-color .15s, background .15s, box-shadow .15s !important; }
  .demo1 .d1-btn { transition: transform .1s ease, filter .1s ease !important; }

  /* Same reasoning for the Step 2 read-through — kept alive for the ▶ button. */
  .demo2.d2-down .d2-strip, .demo2.d2-down .d2-thumb { transition: transform 8000ms cubic-bezier(.4,.08,.5,.95) !important; }
  .demo2.d2-up .d2-strip, .demo2.d2-up .d2-thumb { transition: transform 2400ms cubic-bezier(.4,0,.2,1) !important; }

  /* Same for the Step 3 fix-a-row demo — motion kept for the ▶ button. */
  .demo3 .d3-cursor { transition: left .6s cubic-bezier(.5,0,.2,1), top .6s cubic-bezier(.5,0,.2,1), opacity .2s ease !important; }
  .demo3 .d3-cursor.tap { animation: d3tap .28s ease !important; }
  .demo3 .d3-cell { transition: background .25s ease, border-color .25s ease, box-shadow .25s ease !important; }
  .demo3 .d3-cell.active .d3-caret { animation: d3blink 1s step-end infinite !important; }

  /* Same for the Step 4 export demo — motion kept for the ▶ button. */
  .demo4 .d4-cursor { transition: left .6s cubic-bezier(.5,0,.2,1), top .6s cubic-bezier(.5,0,.2,1), opacity .2s ease !important; }
  .demo4 .d4-cursor.tap { animation: d4tap .28s ease !important; }
  .demo4 .d4-btn { transition: transform .1s ease, filter .1s ease, box-shadow .1s ease !important; }
  .demo4 .d4-toast { transition: opacity .25s ease, transform .25s ease !important; }
  .demo4 .d4-dl { transition: opacity .28s ease, transform .28s ease !important; }
  .demo4 .d4-dl.in .d4-dl-bar i { transition: width 760ms linear !important; }
}
