/* Custom software development for small business. Scoped to .csb-page.
   Thesis: the owner's real system is a spreadsheet. The page walks from the
   sheet they have to the screen they could have, with honest arithmetic between. */

.csb-page {
  --csb-paper: #f6f1e5;
  --csb-paper-2: #ece5d3;
  --csb-sheet: #fffdf7;
  --csb-grid: #d9d1bd;
  --csb-ink: #1d1b17;
  --csb-muted: #5a554b;
  --csb-hl: #f4dd73;
  --csb-hl-soft: #fbf0b4;
  --csb-pen: #a93a24;
  --csb-slate: #1b2329;
  --csb-slate-2: #232d34;
  --csb-slate-line: #3a4852;
  --csb-slate-text: #e9e5da;
  --csb-slate-muted: #b6bec4;
  --csb-green: #1f6b4f;
  --csb-green-soft: #d3e6db;
  --csb-brass: #c9a35a;
  --csb-brass-deep: #7a5718;
  --csb-ease: cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--csb-ink);
  background: var(--csb-paper);
  font-family: "DM Sans Variable", "DM Sans", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: clip;
}
.csb-page *,
.csb-page *::before,
.csb-page *::after { box-sizing: border-box; }
.csb-page ::selection { color: #fff; background: var(--csb-green); }
.csb-page a { text-underline-offset: 0.25em; }
.csb-page a:focus-visible,
.csb-page summary:focus-visible,
.csb-page input:focus-visible {
  outline: 2px solid var(--csb-green);
  outline-offset: 3px;
}
.csb-page [id] { scroll-margin-top: 112px; }
:where(.csb-page) :is(h1, h2, h3, p, figure, ol, ul, dl, dd, table) { margin: 0; }
.csb-page h1,
.csb-page h2,
.csb-page h3 {
  font-family: "Cormorant Garamond Variable", Georgia, serif;
  font-weight: 500;
  text-wrap: balance;
}
.csb-wrap {
  width: min(100%, 1280px);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 64px);
}

/* Buttons */
.csb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 28px; }
.csb-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 10px;
  background: var(--csb-ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.25s var(--csb-ease), transform 0.25s var(--csb-ease);
}
.csb-btn svg { width: 18px; height: 18px; transition: transform 0.25s var(--csb-ease); }
.csb-btn:hover { background: var(--csb-green); }
.csb-btn:hover svg { transform: translateX(3px); }
.csb-quiet { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer; color: var(--csb-ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--csb-brass); text-decoration-thickness: 2px; }
.csb-quiet:hover { color: var(--csb-green); }

/* Section heads */
.csb-section-head { max-width: 62ch; margin-bottom: clamp(28px, 4vw, 48px); }
.csb-section-head h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); line-height: 1.04; letter-spacing: -0.015em; }
.csb-section-head p { margin-top: 16px; color: var(--csb-muted); }

/* Hero */
.csb-hero {
  padding: 112px 0 clamp(48px, 6vw, 80px);
  border-bottom: 1px solid var(--csb-grid);
}
.csb-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.csb-hero h1 {
  font-size: clamp(2.3rem, 3.9vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 19ch;
}
.csb-lede { margin-top: 20px; max-width: 58ch; font-size: 1.125rem; color: #3b372f; }
.csb-priceline {
  margin-top: 20px;
  max-width: 58ch;
  padding: 14px 0;
  border-top: 1px solid var(--csb-grid);
  border-bottom: 1px solid var(--csb-grid);
  font-weight: 600;
  color: var(--csb-ink);
}
.csb-hero .ns-trustline { margin-top: 16px; }

/* The sheet and the screen */
.csb-figure { position: relative; padding-bottom: 176px; }
.csb-sheet {
  width: 88%;
  border: 1px solid #bdb59f;
  border-radius: 6px;
  background: var(--csb-sheet);
  font-size: 0.8125rem;
  line-height: 1.35;
  overflow: hidden;
}
.csb-sheet-file { padding: 9px 12px; background: #e6e0cf; border-bottom: 1px solid #bdb59f; font-size: 0.75rem; color: #4a463c; }
.csb-sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.csb-sheet th, .csb-sheet td { padding: 7px 9px; border: 1px solid var(--csb-grid); text-align: left; font-weight: 400; overflow-wrap: anywhere; }
.csb-sheet thead th { background: #efe9d8; font-weight: 600; font-size: 0.6875rem; color: #4a463c; }
.csb-sheet tbody th { width: 28px; background: #efe9d8; text-align: center; color: #6b6556; font-size: 0.6875rem; }
.csb-sheet thead th:first-child { width: 28px; }
.csb-hl { background: var(--csb-hl); font-weight: 600; }
.csb-pen { color: var(--csb-pen); font-style: italic; }
.csb-row-dup td { text-decoration: line-through; text-decoration-color: var(--csb-pen); color: #7a7466; }
.csb-tabs { display: flex; gap: 2px; padding: 6px 8px 0; background: #e6e0cf; border-top: 1px solid #bdb59f; font-size: 0.6875rem; color: #5a554b; }
.csb-tabs span { padding: 5px 10px; border-radius: 0 0 5px 5px; background: #d9d2bd; }
.csb-tabs .is-on { background: var(--csb-sheet); font-weight: 600; color: var(--csb-ink); }

.csb-screen {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 76%;
  border-radius: 12px;
  background: var(--csb-slate);
  color: var(--csb-slate-text);
  box-shadow: 0 22px 44px -18px rgba(20, 24, 28, 0.55);
  overflow: hidden;
  animation: csb-rise 0.9s var(--csb-ease) 0.25s both;
}
.csb-screen-bar { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--csb-slate-line); font-size: 0.8125rem; }
.csb-screen-bar b { font-weight: 600; }
.csb-screen-bar span { color: var(--csb-slate-muted); }
.csb-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px; }
.csb-col-name { margin-bottom: 8px; font-size: 0.6875rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--csb-slate-muted); }
.csb-card {
  position: relative;
  display: grid;
  gap: 4px;
  margin-bottom: 8px !important;
  padding: 9px 10px 10px;
  border-radius: 8px;
  background: var(--csb-slate-2);
  font-size: 0.75rem;
  line-height: 1.3;
}
.csb-card-job { font-weight: 600; padding-right: 22px; color: #fff; }
.csb-card-tag { color: #bfe3cf; }
.csb-card-owner {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--csb-brass);
  color: #1d1b17;
  font-size: 0.6875rem;
  font-weight: 700;
}
@keyframes csb-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* Payback sheet */
.csb-payback { padding: clamp(56px, 8vw, 104px) 0; background: var(--csb-paper-2); border-bottom: 1px solid var(--csb-grid); }
.csb-calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: 1px solid #bdb59f;
  border-radius: 12px;
  background: var(--csb-sheet);
  overflow: hidden;
}
.csb-inputs { display: grid; align-content: start; }
.csb-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: stretch;
  border-bottom: 1px solid var(--csb-grid);
}
.csb-input-row:last-child { border-bottom: 0; }
.csb-input-row label { padding: 16px 18px; font-weight: 600; line-height: 1.35; cursor: pointer; }
.csb-input-row label small { display: block; margin-top: 4px; font-weight: 400; font-size: 0.8125rem; color: var(--csb-muted); }
.csb-cell { display: flex; align-items: center; gap: 4px; padding: 0 14px; border-left: 1px solid var(--csb-grid); background: var(--csb-hl-soft); }
.csb-cell i { font-style: normal; color: var(--csb-muted); }
.csb-cell input {
  width: 100%;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  background: transparent;
  color: var(--csb-ink);
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.csb-cell input::placeholder { color: #9c9582; font-weight: 400; }
.csb-cell:focus-within { background: var(--csb-hl); }
.csb-cell input:focus-visible { outline: none; }
.csb-cell:has(input:focus-visible) { outline: 2px solid var(--csb-green); outline-offset: -2px; }
.csb-input-own .csb-cell { background: transparent; }
.csb-input-own .csb-cell:focus-within { background: var(--csb-hl-soft); }

.csb-result { padding: clamp(20px, 3vw, 32px); background: var(--csb-slate); color: var(--csb-slate-text); border-left: 1px solid #bdb59f; }
.csb-formula { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.75rem; line-height: 1.5; color: var(--csb-slate-muted); }
.csb-cost { margin-top: 16px !important; display: grid; gap: 4px; }
.csb-cost > span { font-family: "Cormorant Garamond Variable", Georgia, serif; font-size: clamp(2.6rem, 5vw, 3.8rem); line-height: 1; color: #fff; font-variant-numeric: lining-nums tabular-nums; }
.csb-cost small { font-size: 0.9375rem; color: var(--csb-slate-muted); }
.csb-cost small b { color: var(--csb-slate-text); font-weight: 600; }
.csb-table { width: 100%; margin-top: 22px !important; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.csb-table caption { padding-bottom: 8px; text-align: left; font-size: 0.875rem; color: var(--csb-slate-muted); }
.csb-table th, .csb-table td { padding: 10px 0; border-top: 1px solid var(--csb-slate-line); text-align: left; font-weight: 400; }
.csb-table th { color: var(--csb-slate-muted); }
.csb-table td { text-align: right; font-weight: 600; color: #fff; }
.csb-table tr.is-own th, .csb-table tr.is-own td { color: var(--csb-hl); }
.csb-grid-note { margin-top: 12px !important; font-size: 0.8125rem; color: var(--csb-slate-muted); }

.csb-reading { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); margin-top: 32px; align-items: start; }
.csb-reading dl { display: grid; gap: 0; border-top: 1px solid #bdb59f; }
.csb-reading dl > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid #bdb59f; }
.csb-reading dt { font-weight: 700; }
.csb-reading dd { color: #3b372f; }
.csb-reading > p { color: var(--csb-muted); font-size: 0.9375rem; }

/* Worksheet */
.csb-shapes { padding: clamp(56px, 8vw, 104px) 0; border-bottom: 1px solid var(--csb-grid); }
.csb-worksheet { border-top: 2px solid var(--csb-ink); }
.csb-ws-head,
.csb-ws-row { display: grid; grid-template-columns: 1fr 1.15fr 0.7fr; gap: clamp(20px, 3vw, 44px); }
.csb-ws-head { padding: 12px 0; border-bottom: 1px solid var(--csb-ink); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--csb-muted); }
.csb-ws-row { padding: 22px 0; border-bottom: 1px solid var(--csb-grid); }
.csb-ws-row p:first-child { color: var(--csb-muted); }
.csb-ws-row p:nth-child(2) b { font-weight: 600; color: var(--csb-ink); }
.csb-ws-row p:last-child { color: var(--csb-green); font-weight: 500; }
.csb-footnote { margin-top: 20px; max-width: 70ch; font-size: 0.9375rem; color: var(--csb-muted); }

/* Steps */
.csb-steps { padding: clamp(56px, 8vw, 104px) 0; background: var(--csb-paper-2); border-bottom: 1px solid var(--csb-grid); }
.csb-steps-grid { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.csb-steps .csb-section-head { position: sticky; top: 112px; margin-bottom: 0; }
.csb-rail { list-style: none; padding: 0; position: relative; display: grid; gap: 0; }
.csb-rail::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 2px; background: #bdb59f; }
.csb-rail li { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 22px; padding-bottom: 36px; }
.csb-rail li:last-child { padding-bottom: 0; }
.csb-step-no {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--csb-ink);
  color: #fff;
  font-weight: 700;
}
.csb-rail li:last-child .csb-step-no { background: var(--csb-green); }
.csb-rail h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.1; }
.csb-rail li > div > p { margin-top: 8px; max-width: 58ch; color: #3b372f; }
.csb-rail dl { display: grid; gap: 8px; margin-top: 16px; max-width: 58ch; }
.csb-rail dl > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 12px; font-size: 0.9375rem; }
.csb-rail dt { font-weight: 700; color: var(--csb-green); }
.csb-rail dd { color: var(--csb-muted); }

/* Smaller answers (dark band) */
.csb-smaller { padding: clamp(56px, 8vw, 104px) 0; background: var(--csb-slate); color: var(--csb-slate-text); }
.csb-smaller .csb-section-head p { color: var(--csb-slate-muted); }
.csb-ladder { list-style: none; padding: 0; border-top: 1px solid var(--csb-slate-line); }
.csb-ladder li { border-bottom: 1px solid var(--csb-slate-line); }
.csb-ladder a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 24px;
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
  padding: 22px 0;
  color: inherit;
  text-decoration: none;
  transition: padding 0.3s var(--csb-ease), background 0.3s var(--csb-ease);
}
.csb-ladder a:hover { padding-inline: 14px; background: var(--csb-slate-2); }
.csb-ladder a:focus-visible { outline-color: var(--csb-hl); }
.csb-ladder-situation { color: var(--csb-slate-muted); }
.csb-ladder-name { font-weight: 600; font-size: 1.125rem; color: #fff; }
.csb-ladder-name small { display: block; margin-top: 2px; font-weight: 400; font-size: 0.9375rem; color: var(--csb-brass); }
.csb-ladder svg { width: 20px; height: 20px; color: var(--csb-brass); transition: transform 0.3s var(--csb-ease); }
.csb-ladder a:hover svg { transform: translateX(4px); }

/* Build or do not build */
.csb-fit { padding: clamp(56px, 8vw, 104px) 0; border-bottom: 1px solid var(--csb-grid); }
.csb-fit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 3vw, 32px); }
.csb-fit-yes, .csb-fit-no { padding: clamp(22px, 3vw, 36px); border-radius: 12px; }
.csb-fit-yes { background: var(--csb-green-soft); }
.csb-fit-no { background: #f1ddd5; }
.csb-fit h3 { font-size: clamp(1.7rem, 2.8vw, 2.2rem); margin-bottom: 18px; }
.csb-fit ul { list-style: none; padding: 0; display: grid; gap: 14px; }
.csb-fit li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; }
.csb-fit li svg { width: 20px; height: 20px; margin-top: 3px; }
.csb-fit-yes svg { color: var(--csb-green); }
.csb-fit-no svg { color: var(--csb-pen); }

/* After launch */
.csb-after { padding: clamp(56px, 8vw, 104px) 0; background: var(--csb-paper-2); border-bottom: 1px solid var(--csb-grid); }
.csb-after-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.csb-after-grid > div { padding: 4px clamp(18px, 3vw, 40px); border-left: 1px solid #bdb59f; }
.csb-after-grid > div:first-child { padding-left: 0; border-left: 0; }
.csb-after-grid h3 { font-size: 1.9rem; margin-bottom: 8px; }
.csb-after-grid p { color: #3b372f; }

/* Go deeper */
.csb-deeper { padding: clamp(48px, 6vw, 80px) 0; }
.csb-deeper-grid { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.csb-deeper h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.05; }
.csb-deeper ul { list-style: none; padding: 0; border-top: 1px solid var(--csb-grid); }
.csb-deeper li { display: grid; gap: 2px; padding: 16px 0; border-bottom: 1px solid var(--csb-grid); }
.csb-deeper li a { font-weight: 700; color: var(--csb-ink); }
.csb-deeper li a:hover { color: var(--csb-green); }
.csb-deeper li span { color: var(--csb-muted); font-size: 0.9375rem; }

/* FAQ */
.csb-faq { padding: clamp(56px, 8vw, 104px) 0; background: var(--csb-paper-2); border-top: 1px solid var(--csb-grid); }
.csb-faq-grid { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.csb-faq h2 { font-size: clamp(2rem, 3.8vw, 3rem); line-height: 1.05; position: sticky; top: 112px; }
.csb-faq details { border-bottom: 1px solid #bdb59f; }
.csb-faq details:first-child { border-top: 1px solid #bdb59f; }
.csb-faq summary { list-style: none; display: flex; justify-content: space-between; gap: 20px; padding: 20px 0; font-weight: 600; font-size: 1.0625rem; cursor: pointer; }
.csb-faq summary::-webkit-details-marker { display: none; }
.csb-faq summary::after { content: "+"; flex: none; font-size: 1.5rem; line-height: 1; color: var(--csb-green); transition: transform 0.25s var(--csb-ease); }
.csb-faq details[open] summary::after { transform: rotate(45deg); }
.csb-faq details p { padding: 0 0 22px; max-width: 64ch; color: #3b372f; }

/* Close */
.csb-close { padding: clamp(56px, 8vw, 96px) 0; background: var(--csb-ink); color: #f1ede2; }
.csb-close-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
.csb-close h2 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); line-height: 1.04; }
.csb-close p { margin-top: 16px; max-width: 56ch; color: #cfc9ba; }
.csb-close .csb-actions { margin-top: 0; }
.csb-close .csb-btn { background: var(--csb-hl); color: var(--csb-ink); }
.csb-close .csb-btn:hover { background: #fff; }
.csb-close .csb-quiet { color: #f1ede2; text-decoration-color: var(--csb-brass); }
.csb-close a:focus-visible { outline-color: var(--csb-hl); }

.csb-crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; padding-block: 22px 34px; font-size: 0.9rem; color: var(--csb-muted); }
.csb-crumbs a { color: var(--csb-green); }

/* Tablet and phone */
@media (max-width: 1000px) {
  .csb-hero-grid,
  .csb-steps-grid,
  .csb-deeper-grid,
  .csb-faq-grid,
  .csb-close-grid { grid-template-columns: 1fr; }
  .csb-steps .csb-section-head,
  .csb-faq h2 { position: static; }
  .csb-calc { grid-template-columns: 1fr; }
  .csb-result { border-left: 0; border-top: 1px solid #bdb59f; }
  .csb-reading { grid-template-columns: 1fr; }
  .csb-hero h1 { max-width: 18ch; }
}
@media (max-width: 760px) {
  .csb-hero { padding-top: 96px; }
  .csb-hero h1 { font-size: 2.15rem; }
  .csb-lede { margin-top: 14px; font-size: 1rem; line-height: 1.55; }
  .csb-priceline { margin-top: 14px; padding: 10px 0; font-size: 0.9375rem; line-height: 1.5; }
  .csb-hero .ns-trustline { margin-top: 12px; }
  .csb-actions { margin-top: 18px; }
  .csb-fit-grid,
  .csb-after-grid { grid-template-columns: 1fr; }
  .csb-after-grid > div { padding: 20px 0; border-left: 0; border-top: 1px solid #bdb59f; }
  .csb-after-grid > div:first-child { border-top: 0; padding-top: 4px; }
  .csb-ws-head { display: none; }
  .csb-ws-row { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
  .csb-ws-row p::before { content: attr(data-label); display: block; margin-bottom: 1px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--csb-muted); }
  .csb-ws-row p:last-child { color: var(--csb-green); }
  .csb-ladder a { grid-template-columns: minmax(0, 1fr) 20px; gap: 6px 14px; }
  .csb-ladder-situation { grid-column: 1 / -1; font-size: 0.9375rem; }
  .csb-ladder a:hover { padding-inline: 0; background: transparent; }
  .csb-reading dl > div { grid-template-columns: 1fr; gap: 2px; }
  .csb-input-row { grid-template-columns: minmax(0, 1fr) 124px; }
  .csb-rail li { grid-template-columns: 38px minmax(0, 1fr); gap: 16px; }
  .csb-rail::before { left: 18px; }
  .csb-step-no { width: 38px; height: 38px; }
  .csb-rail dl > div { grid-template-columns: 1fr; gap: 0; }
  .csb-figure { padding-bottom: 0; }
  .csb-sheet { width: 100%; }
  .csb-sheet th, .csb-sheet td { padding: 6px 6px; font-size: 0.75rem; }
  .csb-sheet thead th:nth-child(3),
  .csb-sheet tbody td:nth-child(3),
  .csb-sheet thead th:nth-child(5),
  .csb-sheet tbody td:nth-child(5) { display: none; }
  .csb-screen { position: relative; width: 94%; margin: -18px 0 0 auto; }
  .csb-board { grid-template-columns: 1fr 1fr; }
  .csb-board .csb-col:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .csb-screen { animation: none; }
  .csb-page * { transition-duration: 0.01ms !important; }
}
