/* Layout: one narrow reading column, three stacked bands (cost, demo, plans), with the spreadsheet as the visual anchor. */
:root {
  --ink: #14253a;          /* manuscript-ink navy, text and primary buttons */
  --ink-soft: #4a5a6e;
  --paper: #ffffff;        /* white page */
  --tint: #f4f6f8;         /* table header, query field */
  --sheet: #ffffff;        /* spreadsheet / card surface */
  color-scheme: light;
  --rule: #dfe5ec;
  --mark: #ffe066;         /* highlighter, used once for the cost figure */
  --save: #1a8a4a;        /* savings green */
  --accent: #3d9be9;       /* links, slider fill */
  --accent-ink: #ffffff;
  --font: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --step--1: 0.85rem; --step-0: 1rem; --step-1: 1.25rem; --step-2: 1.6rem; --step-3: 2.4rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: var(--step-0); line-height: 1.6;
}
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap {
  max-width: 880px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.narrow { max-width: 640px; }

header.top { padding-block: 1.25rem; }
header.top .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.logo { font-weight: 800; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); font-size: var(--step-1); }
.logo span { color: var(--accent); }
.top nav a { font-weight: 600; font-size: var(--step--1); text-decoration: none; }

section { padding-block: 3.5rem; }
section + section { border-top: 1px solid var(--rule); }
h1, h2 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; margin: 0 0 1rem; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
p { margin: 0 0 1rem; max-width: 62ch; }
.lede { color: var(--ink-soft); font-size: var(--step-1); font-weight: 500; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--step--1); font-weight: 700; color: var(--accent); margin-bottom: 0.5rem; }

/* Cost calculator */
.calc { display: grid; gap: 1.75rem; margin-top: 2rem; }
.field label { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-weight: 600; }
.field output { white-space: nowrap; font-weight: 800; font-size: var(--step-1); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 2rem; margin: 0.25rem 0 0; }
.scale { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.result { margin-top: 0.5rem; padding: 1.5rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; }
.result .big { font-size: var(--step-3); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.result .big mark { background: linear-gradient(transparent 55%, var(--mark) 55%); color: inherit; padding: 0 0.1em; }
.result p { margin: 0.5rem 0 0; color: var(--ink-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  border-radius: 8px; padding: 0.85rem 1.4rem; border: 2px solid var(--ink);
  background: var(--ink); color: var(--paper);
}
.btn:hover { filter: brightness(1.15); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); font-weight: 600; }
.btn.ghost:hover { border-color: var(--ink); filter: none; }
.continue { margin-top: 1.5rem; }

/* Product demo */
.demo { margin-top: 1.5rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.demo-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.demo-bar .q-label { font-size: var(--step--1); font-weight: 700; color: var(--ink-soft); }
.demo-bar .query { flex: 1 1 260px; min-width: 0; font-family: var(--mono); font-size: 0.9rem; padding: 0.5rem 0.7rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--tint); min-height: 2.3rem; white-space: nowrap; overflow: hidden; }
.caret { display: inline-block; width: 1px; height: 1em; background: var(--ink); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.demo-status { font-size: var(--step--1); color: var(--ink-soft); padding: 0.5rem 1rem; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.sheet-scroll { overflow-x: auto; }
table.sheet { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 0.85rem; }
.sheet th, .sheet td { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; }
.sheet th { position: sticky; top: 0; z-index: 1; background: var(--tint); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.sheet td.n { color: var(--ink-soft); width: 2rem; font-variant-numeric: tabular-nums; background: var(--tint); }
.sheet td.mono { font-family: var(--mono); font-size: 0.8rem; }
.sheet tr.row { transition: opacity .35s ease; }
.sheet tr.row.pending { opacity: 0.08; }
.placeholder-note { font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.75rem; }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } .sheet tr.row { transition: none; } }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1.75rem; }
.plan { background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.plan h3 { margin: 0; font-size: var(--step-1); font-weight: 700; }
.price { font-size: var(--step-3); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.price small { font-size: var(--step-0); font-weight: 600; color: var(--ink-soft); }
.plan ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); }
.plan .btn { margin-top: auto; }
.cancel { margin-top: 1rem; font-weight: 600; }
.steps { margin-top: 2.5rem; display: grid; gap: 0.75rem; padding-left: 1.25rem; }
.steps li { padding-left: 0.25rem; }
.notice { font-size: var(--step--1); color: var(--ink-soft); background: var(--sheet); border: 1px dashed var(--rule); padding: 0.6rem 0.8rem; border-radius: 6px; margin-top: 0.75rem; }

/* Forms */
form.intake { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
form.intake label { font-weight: 600; display: grid; gap: 0.35rem; }
form.intake .hint { font-weight: 400; color: var(--ink-soft); font-size: var(--step--1); }
form.intake input, form.intake textarea, form.intake select {
  font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 0.65rem 0.75rem; width: 100%;
}
form.intake textarea { min-height: 10rem; resize: vertical; }
.form-msg { font-weight: 600; }

/* Legal pages */
.legal h2 { font-size: var(--step-1); margin-top: 2rem; }
.legal li { margin-bottom: 0.4rem; }

footer { border-top: 1px solid var(--rule); padding-block: 2rem; color: var(--ink-soft); font-size: var(--step--1); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }
footer nav { display: flex; gap: 0.6rem; flex-wrap: wrap; }

@media (max-width: 480px) {
  section { padding-block: 2.5rem; }
  :root { --step-3: 1.95rem; --step-2: 1.4rem; }
}

/* Founder video (click-to-play, nothing loads from YouTube until clicked) */
.video { margin-top: 2.5rem; }
.video h3 { font-size: var(--step-1); margin: 0 0 0.75rem; }
.video-frame { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 10px; overflow: hidden; background: var(--ink); border: 1px solid var(--rule); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { position: absolute; inset: 0; width: 100%; border: 0; cursor: pointer; background: center / cover no-repeat var(--ink); color: #fff; font: inherit; font-weight: 700; display: grid; place-items: center; }
.video-play .disc { display: inline-flex; align-items: center; gap: 0.6rem; background: rgba(0,0,0,.65); padding: 0.8rem 1.2rem; border-radius: 999px; }
.video-placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1rem; color: var(--paper); font-weight: 600; border: 2px dashed var(--ink-soft); }

/* v2: minimal layout + inbox-to-spreadsheet demo */
section + section { border-top: 0; }
section { padding-block: 4rem; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
.result { border: 0; padding: 0; background: none; }
.result .big { font-size: clamp(2.6rem, 7vw, 3.6rem); }
.result .per { font-size: var(--step-1); font-weight: 600; color: var(--ink-soft); margin-left: 0.25rem; }
.lede { margin-bottom: 0; }
.demo-bar { flex-wrap: nowrap; }
.send { font-size: var(--step--1); font-weight: 700; padding: 0.5rem 0.9rem; border-radius: 6px; background: var(--ink); color: var(--paper); transition: transform .15s; }
.send.pressed { transform: scale(0.92); }
.stage { position: relative; height: calc(2.2rem * 9 + 2px); }
.panel { position: absolute; inset: 0; transition: opacity .4s ease, transform .4s ease; }
.panel.off { opacity: 0; transform: translateY(8px); pointer-events: none; }
.panel-mail { display: grid; place-content: center; justify-items: center; gap: 1.25rem; padding: 1rem; background: var(--tint); }
.clients { display: flex; gap: 1.5rem; }
.client { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: var(--step--1); color: var(--ink-soft); }
.mail { background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 1rem 1.1rem; width: min(440px, 100%); box-shadow: 0 6px 24px rgba(20,37,58,.08); }
.mail-from { display: flex; justify-content: space-between; font-size: var(--step--1); }
.mail-from span { color: var(--ink-soft); }
.mail-subj { font-weight: 700; margin: 0.25rem 0 0.75rem; font-size: 0.95rem; }
.attach { display: flex; align-items: center; gap: 0.6rem; font-size: var(--step--1); font-weight: 600; border: 1px solid var(--rule); border-radius: 8px; padding: 0.5rem 0.7rem; width: max-content; max-width: 100%; }
.attach small { color: var(--ink-soft); font-weight: 500; }
.xls { background: #1d6f42; color: #fff; font-size: 0.65rem; font-weight: 800; padding: 0.2rem 0.35rem; border-radius: 3px; }
.sheet-scroll { height: 100%; overflow: auto; }
.sheet th, .sheet td { white-space: nowrap; height: 2.2rem; padding-block: 0; vertical-align: middle; }
.plans { max-width: 640px; margin: 0 auto; }
.plan { text-align: center; align-items: center; }
.plan .cap { margin: 0; color: var(--ink-soft); }
.cancel { text-align: center; margin-top: 1.25rem; color: var(--ink-soft); }
.notice { max-width: 640px; margin-inline: auto; }

/* v3 */
.save { margin-top: 0.5rem; font-size: var(--step-1); font-weight: 700; color: var(--save); }
.save strong { font-weight: 800; }
/* First screen fills the window so the next section only appears after Continue / scrolling. */
#cost { min-height: calc(100vh - 4.6rem); min-height: calc(100svh - 4.6rem); display: flex; align-items: center; padding-block: 1.5rem; }
#cost > .wrap { width: 100%; }
.cancel { max-width: none; margin-inline: auto; }
.replay { flex: none; display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink-soft); cursor: pointer; padding: 0; }
.replay:hover { color: var(--ink); border-color: var(--ink); }

.to-pricing { display: flex; justify-content: center; margin-top: 2.5rem; }
#plans { border-top: 1px solid var(--rule); }
.plans-title { text-align: center; margin-bottom: 1.75rem; }
.plans { margin-top: 0; }

/* Steps: each revealed section fills the window so the next one never peeks in. */
[hidden] { display: none !important; }
#how, #plans { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
#how > .wrap, #plans > .wrap { width: 100%; }
#cost { min-height: calc(100vh - 4.6rem); min-height: calc(100svh - 4.6rem); }
.sheet a.paper { color: #1a56c4; text-decoration: underline; text-underline-offset: 2px; }
#how > .wrap { max-width: 1240px; }
#how .narrow, #how .placeholder-note { max-width: 880px; margin-inline: auto; width: 100%; }
.sheet { font-size: 0.82rem; }
@media (max-width: 480px) {
  #how, #plans { justify-content: flex-start; padding-block: 1.75rem; }
  #how h2 { margin-bottom: 0.25rem; }
  .demo { margin-top: 1rem; }
  .stage { height: calc(2.2rem * 7 + 2px); }
  .to-pricing { margin-top: 1.25rem; }
}
/* Custom range slider (light-blue fill, light track) */
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; --p: 15%; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--accent) var(--p), var(--rule) var(--p)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--rule); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--accent), 0 1px 3px rgba(20,37,58,.25); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--accent); }
/* Demo heading on one line on wider screens */
@media (min-width: 760px) {
  #how .narrow { max-width: none; }
  #how h2 { white-space: nowrap; font-size: clamp(1.05rem, 2.05vw, 1.6rem); }
}
