/* bexit.io
   Design language: a spreadsheet canvas. Faint grid, content sitting in cells
   with shared borders, tabular figures, and the accent blue used the way Excel
   uses it: as the selected-cell outline, complete with the corner handle.
   One accent (#0210FF). One radius (2px). Theme follows the system.
   Motion is hover and focus only, so it is instant on a phone at a job site. */

@font-face { font-family: Figtree; src: url(/assets/fonts/figtree-400.woff2) format("woff2");
  font-weight: 400; font-display: swap; }
@font-face { font-family: Figtree; src: url(/assets/fonts/figtree-600.woff2) format("woff2");
  font-weight: 600; font-display: swap; }
@font-face { font-family: Figtree; src: url(/assets/fonts/figtree-800.woff2) format("woff2");
  font-weight: 800; font-display: swap; }

:root {
  --paper: #fcfcfb;
  --cell: #ffffff;
  --fill: #f4f5f3;
  --ink: #0e0f11;
  --muted: #5f646d;
  --rule: #dcdedb;
  --grid: #e5e6e3;
  --mark: #0210ff;
  --on-mark: #fbfbff;
  --r: 2px;
  --pad: clamp(1.125rem, 4.5vw, 2.5rem);
  --gap: clamp(2.75rem, 6.5vw, 5rem);
  --sans: Figtree, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a0a0c;
    --cell: #101114;
    --fill: #16181c;
    --ink: #f1f2f4;
    --muted: #9aa0a9;
    --rule: #26282d;
    --grid: #1d1e23;
    --mark: #4a57ff;
    --on-mark: #f7f8ff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 84px 84px;
  background-position: -1px -1px;
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--pad); }

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.032em; line-height: 1.06; }
h1 { font-size: clamp(2rem, 5.8vw, 3.625rem); }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.25rem); }
p { margin: 0; }
a { color: inherit; }

.lede { color: var(--muted); font-size: clamp(1rem, 2vw, 1.1875rem); line-height: 1.55; }
.tag {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- banner: logo left, login right, one line ---------- */
.banner {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.banner-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 60px; }
.banner .wordmark { width: 76px; height: auto; display: block; }
.banner a.brand { display: flex; align-items: center; text-decoration: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  padding: 0.75rem 1.375rem; border-radius: var(--r); border: 1px solid transparent;
  font-family: var(--sans); font-weight: 800; font-size: 0.9375rem; letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-primary { background: var(--mark); color: var(--on-mark); }
.btn-primary:hover { background: color-mix(in srgb, var(--mark) 84%, var(--ink)); }
.btn-line { border-color: var(--rule); color: var(--ink); background: var(--cell); }
.btn-line:hover { border-color: var(--mark); color: var(--mark); }
.btn:active { transform: translateY(1px); }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }

/* ---------- the Excel selection motif, used sparingly ---------- */
.sel { position: relative; outline: 2px solid var(--mark); outline-offset: -1px; }
.sel::after {
  content: ""; position: absolute; right: -4px; bottom: -4px;
  width: 7px; height: 7px; background: var(--mark);
  border: 1px solid var(--paper);
}

/* ---------- sections ---------- */
section { padding: var(--gap) 0; }
.head { max-width: 44rem; }
.head .tag { display: block; margin-bottom: 0.875rem; }
.head p { margin-top: 1rem; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(2.5rem, 6vw, 4rem); padding-bottom: clamp(2.25rem, 5vw, 3.5rem); }
.hero h1 { max-width: 20ch; }
.hero .lede { margin-top: 1.5rem; max-width: 36rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }

/* ---------- a range of cells: shared borders, like a real sheet ---------- */
.range {
  display: grid; gap: 0; margin-top: 2.75rem;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--cell); overflow: hidden;
}
.range-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.range-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.range > * {
  padding: clamp(1.25rem, 3vw, 1.875rem);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.range-2 > *:nth-child(2n), .range-3 > *:nth-child(3n) { border-right: 0; }
.range-2 > *:nth-last-child(-n+2), .range-3 > *:nth-last-child(-n+3) { border-bottom: 0; }
.range h3 { font-size: 1.0625rem; margin-bottom: 0.5rem; letter-spacing: -0.018em; }
.range p { color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
.range .tag { display: block; margin-bottom: 0.75rem; }
.range .fig { font-size: clamp(1.5rem, 3.2vw, 2rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin-bottom: 0.5rem; }
@media (max-width: 820px) {
  .range-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .range-3 > *:nth-child(3n) { border-right: 1px solid var(--rule); }
  .range-3 > *:nth-child(2n) { border-right: 0; }
  .range-3 > *:nth-last-child(-n+3) { border-bottom: 1px solid var(--rule); }
  .range-3 > *:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 560px) {
  .range-2, .range-3 { grid-template-columns: 1fr; }
  .range > * { border-right: 0 !important; border-bottom: 1px solid var(--rule) !important; }
  .range > *:last-child { border-bottom: 0 !important; }
}

/* ---------- statement band ---------- */
.band { background: var(--fill); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.band .quote {
  font-size: clamp(1.375rem, 3.4vw, 2.125rem); font-weight: 800;
  letter-spacing: -0.032em; line-height: 1.2; max-width: 34ch;
}

/* ---------- closing ---------- */
.close { background: var(--mark); color: var(--on-mark); border-radius: var(--r); padding: clamp(1.75rem, 5.5vw, 3.5rem); }
.close h2 { max-width: 26ch; }
.close p { margin-top: 1.125rem; max-width: 42rem; color: var(--on-mark); font-size: clamp(1rem, 2vw, 1.0625rem); line-height: 1.55; opacity: 1; }
.close .btn { background: var(--on-mark); color: var(--mark); margin-top: 1.875rem; }
.close .btn:hover { background: color-mix(in srgb, var(--on-mark) 86%, var(--mark)); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--rule); padding: 1.75rem 0; background: var(--paper); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; color: var(--muted); font-size: 0.875rem; }
.foot .wordmark { width: 74px; height: auto; display: block; }

/* ---------- 404 ---------- */
.shell { min-height: 68dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; text-align: center; padding: var(--gap) var(--pad); }
.shell .wordmark { width: min(96px, 22vw); height: auto; }
.code { font-size: clamp(2rem, 7vw, 3rem); font-weight: 800; letter-spacing: -0.03em; }
.shell .lede a { color: inherit; text-decoration-color: var(--mark); text-underline-offset: 3px; }

.band { padding: clamp(2.5rem, 6vw, 4rem) 0; }

/* ---------- enquiry form ---------- */
.enq { margin-top: 2rem; }
.enq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
@media (max-width: 620px) { .enq-grid { grid-template-columns: 1fr; } }

.field { display: grid; gap: 0.4375rem; margin-bottom: 1.25rem; }
.enq-grid .field { margin-bottom: 0; }
.field label { font-size: 0.875rem; font-weight: 800; letter-spacing: -0.008em; }
.field .opt { font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 0.25rem; }
.field .hint { color: var(--muted); font-size: 0.875rem; line-height: 1.45; }

.field input, .field textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--cell);
  border: 1px solid var(--rule); border-radius: var(--r);
  padding: 0.6875rem 0.8125rem; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 7rem; line-height: 1.55; }
.field input:hover, .field textarea:hover { border-color: color-mix(in srgb, var(--ink) 34%, var(--rule)); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--mark);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--mark) 28%, transparent);
}
.field [aria-invalid="true"] { border-color: #c02626; }
@media (prefers-color-scheme: dark) { .field [aria-invalid="true"] { border-color: #ff6b6b; } }

.field .err { font-size: 0.875rem; font-weight: 600; color: #a81f1f; }
@media (prefers-color-scheme: dark) { .field .err { color: #ff8f8f; } }

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

.enq-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; margin-top: 0.5rem; }
.enq-msg { font-size: 0.9375rem; font-weight: 600; color: var(--muted); }
.enq-msg.is-ok { color: var(--mark); }
.enq-msg.is-bad { color: #a81f1f; }
@media (prefers-color-scheme: dark) { .enq-msg.is-bad { color: #ff8f8f; } }
.btn[disabled] { opacity: 0.62; cursor: default; }

/* ---------- hero, split with a photo ---------- */
.hero-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; }
.hero-split .copy h1 { max-width: 18ch; }
.hero-split .copy .lede { margin-top: 1.25rem; max-width: 32rem; }
.shot { position: relative; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: var(--fill); }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot-3x2 { aspect-ratio: 3 / 2; }
.shot-16x9 { aspect-ratio: 16 / 9; }
@media (max-width: 860px) { .hero-split { grid-template-columns: 1fr; } }

/* ---------- money band ---------- */
.money { background: var(--ink); color: var(--paper); border-top: 1px solid var(--ink); }
.money h2 { max-width: 30ch; }
.money .tag { color: color-mix(in srgb, var(--paper) 62%, var(--ink)); }
.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 2.5rem; background: color-mix(in srgb, var(--paper) 22%, var(--ink)); border: 1px solid color-mix(in srgb, var(--paper) 22%, var(--ink)); border-radius: var(--r); overflow: hidden; }
.fig-cell { background: var(--ink); padding: clamp(1.25rem, 3vw, 1.75rem); }
.fig-cell b { display: block; font-variant-numeric: tabular-nums; font-size: clamp(1.875rem, 4.6vw, 2.875rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--paper); }
.fig-cell.hot b { color: #7f8bff; }
.fig-cell span { display: block; margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.5; color: color-mix(in srgb, var(--paper) 72%, var(--ink)); }
@media (max-width: 700px) { .figs { grid-template-columns: 1fr; } }

/* ---------- proof ---------- */
.proof-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; }
.proof-grid h2 { max-width: 20ch; }
.proof-grid p { margin-top: 1rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.0625rem); line-height: 1.55; }
.pstats { display: grid; gap: 0; margin-top: 1.75rem; border-top: 1px solid var(--rule); }
.pstats div { display: flex; align-items: baseline; gap: 0.875rem; padding: 0.8125rem 0; border-bottom: 1px solid var(--rule); }
.pstats b { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.02em; color: var(--mark); min-width: 5.5rem; }
.pstats span { color: var(--muted); font-size: 0.9375rem; }
@media (max-width: 860px) { .proof-grid { grid-template-columns: 1fr; } }

/* ---------- comparison table ---------- */
.cmp { margin-top: 2.5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule); border-radius: var(--r); }
.cmp table { width: 100%; min-width: 32rem; border-collapse: collapse; font-size: 0.9375rem; background: var(--cell); }
.cmp th, .cmp td { text-align: left; padding: 0.9375rem 1.125rem; }
.cmp thead th { font-size: 0.6875rem; font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--rule); }
.cmp thead th.ours { color: var(--mark); }
.cmp tbody tr + tr th, .cmp tbody tr + tr td { border-top: 1px solid var(--rule); }
.cmp tbody th { font-weight: 600; color: var(--ink); }
.cmp td.theirs { color: var(--muted); }
.cmp td.ours { background: var(--fill); font-weight: 700; color: var(--ink); }
.cmp td.ours, .cmp th.ours { border-left: 1px solid var(--rule); }

/* ---------- credits ---------- */
.credits { font-size: 0.75rem; color: var(--muted); }
.credits a { color: inherit; text-decoration-color: var(--rule); }
.credits a:hover { color: var(--ink); }

/* The money band is a near-black accent on a light page. Deriving its
   background from --ink meant that in dark mode it flipped to near-white,
   inverting one section in the middle of an otherwise dark page. Give it its
   own dark-mode surface instead so the page keeps one theme throughout. */
@media (prefers-color-scheme: dark) {
  .money { background: #15171b; color: var(--ink); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
  .money .tag { color: var(--muted); }
  .figs { background: var(--rule); border-color: var(--rule); }
  .fig-cell { background: #15171b; }
  .fig-cell b { color: var(--ink); }
  .fig-cell.hot b { color: #8f97ff; }
  .fig-cell span { color: var(--muted); }
}
