/*
  Clearpeakweb. The page borrows from the paper the service replaces, the same
  way the demo does: a desk, green-bar order paper with tractor-feed edges,
  highlighter over anything doubtful, and a rubber stamp for status.
  One family (Barlow Semi Condensed, the kind of grotesque used on bin labels)
  plus a mono for part numbers, where 0 and O must never be confused.
*/

@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/barlow-semi-condensed-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/barlow-semi-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --desk: #e6ebe7;
  --paper: #ffffff;
  --bar: #e2efe5;
  --ink: #14233a;
  --ink-soft: #4d5b6e;
  --rule: #b8c4bc;
  --carbon: #1b45c0;
  --carbon-deep: #15379b;
  --highlighter: #ffe766;
  --go: #1c7446;
  --hold: #b0301e;
  --on-ink: #dbe3ee;
  --on-ink-soft: #b9c6d8;

  --sans: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;

  --wrap: 76rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4.5rem, 9vw, 8rem);
  --split: minmax(0, 5fr) minmax(0, 6fr);
  --split-gap: clamp(2rem, 5vw, 5rem);
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1.5rem; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font: 400 1.1875rem/1.5 var(--sans);
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; }

h1 {
  font-size: clamp(2.875rem, 6.2vw, 5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 3.5vw, 2.875rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.008em;
  text-wrap: balance;
}

h3, .h3 {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

p { max-width: 62ch; text-wrap: pretty; }

a { color: var(--carbon); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--carbon-deep); }

:focus-visible { outline: 3px solid var(--carbon); outline-offset: 2px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.figure { font-family: var(--mono); font-size: 0.875em; }
.small { font-size: 0.9375rem; }
.quiet { color: var(--ink-soft); }
.band { background: var(--bar); }
.no-js .js-only { display: none; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999rem; top: 0; background: var(--paper); padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* Buttons: plain by default, carbon blue for the one action that moves things forward. */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 500 1.0625rem/1 var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 0.6rem 0.95rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover { background: var(--bar); color: var(--ink); }
.button.primary { background: var(--carbon); border-color: var(--carbon); color: #fff; font-weight: 600; }
.button.primary:hover { background: var(--carbon-deep); border-color: var(--carbon-deep); color: #fff; }
.button.big { font-size: 1.1875rem; padding: 0.9rem 1.3rem; }
.button:disabled, .button.primary:disabled { cursor: not-allowed; opacity: 0.45; }
.button.primary:disabled:hover { background: var(--carbon); }

/* A rubber stamp. Stamps are cut in capitals, so this is the one place they appear. */
.stamp {
  flex: none;
  display: inline-block;
  border: 0.16rem solid currentColor;
  border-radius: 0.2rem;
  padding: 0.2rem 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  transform: rotate(-3deg);
  white-space: nowrap;
}

.stamp-check { color: var(--hold); }
.stamp-ready { color: var(--go); }
.stamp-posted { color: var(--carbon); }
.stamp-other { color: var(--ink-soft); }
.stamp-small { font-size: 0.8125rem; }

/* Highlighter: a pass of yellow over the words to look at. */
.hl {
  background: var(--highlighter);
  font-weight: 500;
  padding: 0.14em 0.35em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- Header ---------- */

.site-head { display: flex; align-items: center; gap: 1.5rem; padding-block: 1.1rem; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.wordmark:hover { color: var(--ink); }
.wordmark svg { flex: none; }

.site-nav { display: flex; gap: 1.6rem; font-size: 1.0625rem; }
.site-nav a { color: var(--ink); font-weight: 500; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* ---------- Opening ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6.5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  padding-block: clamp(1.5rem, 4vw, 3.5rem) var(--section);
}

.hero-words { padding-top: clamp(0.5rem, 3.5vw, 3.5rem); }

.lede {
  margin-top: 1.5rem;
  max-width: 34em;
  font-size: clamp(1.1875rem, 1.55vw, 1.375rem);
  line-height: 1.45;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* The email that arrived, half under the order it became. */
.scene { position: relative; }

.mail {
  position: relative;
  width: min(84%, 25rem);
  margin-left: 1.5rem;
  padding: 0.85rem 1.1rem 2.5rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-size: 0.9375rem;
  line-height: 1.4;
  transform: rotate(-1.4deg);
  transform-origin: left bottom;
  box-shadow: 0 10px 24px -18px rgba(20, 35, 58, 0.5);
}

.mail-head { display: grid; grid-template-columns: auto 1fr; gap: 0.1rem 0.8rem; }
.mail-head dt { color: var(--ink-soft); }
.mail-head dd { font-weight: 500; }
.mail-body { margin-top: 0.6rem; max-width: none; }
.mail-file { display: inline-block; margin-top: 0.55rem; padding: 0.15rem 0.5rem; background: #f4f6f1; border: 1px solid var(--rule); }

/* A sheet of green-bar paper with tractor-feed edges. */
.sheet {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1.25rem 2.6rem 1.4rem;
  box-shadow: 0 24px 48px -30px rgba(20, 35, 58, 0.55);
}

.sheet::before,
.sheet::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.75rem;
  background: radial-gradient(circle, var(--desk) 0 0.28rem, transparent 0.31rem) center top / 1.75rem 1.5rem repeat-y;
}

.sheet::before { left: 0; border-right: 1px dashed var(--rule); }
.sheet::after { right: 0; border-left: 1px dashed var(--rule); }

.draft { z-index: 1; margin-top: -1.7rem; font-size: 0.9375rem; line-height: 1.4; }
.draft .small { font-size: 0.8125rem; }
.draft p { max-width: none; }

.sheet-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.customer { font-size: 1.5rem; font-weight: 700; line-height: 1.15; }

.order-head {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1.25rem;
  margin: 1rem 0 0.9rem;
  padding-top: 0.85rem;
  border-top: 2px solid var(--ink);
}

.order-head dt { font-size: 0.8125rem; color: var(--ink-soft); }
.order-head dd { font-weight: 500; }

.lines-head,
.line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 6.75rem 4.75rem;
  column-gap: 0.9rem;
  padding: 0.55rem 0.6rem;
}

.lines-head {
  padding-block: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--ink);
}

.line span { display: block; }
.num { text-align: right; }
.part { font-weight: 500; }
.wrote { line-height: 1.3; }
.amount { white-space: nowrap; }

.flag {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  margin-top: 0.5rem;
  padding: 0.45rem 0.7rem;
  background: var(--highlighter);
  font-weight: 500;
}

.flag p { flex: 1 1 14rem; }
.flag .button { padding: 0.4rem 0.65rem; font-size: 0.9375rem; }

.flag-checked {
  background: transparent;
  outline: 1px dashed var(--rule);
  outline-offset: -1px;
  color: var(--ink-soft);
  font-weight: 400;
}

.checked { color: var(--go); font-weight: 600; }

.more { padding: 0.55rem 0.6rem; color: var(--ink-soft); }

.subtotal {
  display: flex;
  justify-content: flex-end;
  gap: 1.25rem;
  padding: 0.6rem 0.6rem 0;
  border-top: 2px solid var(--ink);
  font-weight: 700;
}

.subtotal .figure { font-weight: 500; font-size: 1rem; }

.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.reading-note { flex: 1 1 14rem; font-size: 0.875rem; }
.foot-actions { display: flex; gap: 0.5rem; }
.scene-note { margin-top: 0.9rem; max-width: none; }

@keyframes feed {
  from { transform: translateY(2.5rem); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes thunk {
  0% { transform: rotate(-3deg) scale(1.4); opacity: 0; }
  60% { transform: rotate(-3deg) scale(0.96); opacity: 1; }
  100% { transform: rotate(-3deg) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  /* The one moment on load: the sheet feeds in, then the stamp lands. */
  .js .draft { animation: feed 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both; }
  .js .stamp.land { animation: thunk 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.9s both; }
  .stamp.thunk { animation: thunk 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Who it is for ---------- */

.for { padding-bottom: var(--section); }
.for-words { max-width: 46rem; }
.for-words p { margin-top: 1rem; }

.slips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-top: 2.5rem; }

.slip {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem 1.3rem;
  background: var(--paper);
  border: 1px solid var(--rule);
}

.slip h3 { font-size: 1.1875rem; margin-bottom: 0.15rem; }
.slip-label { margin-bottom: -0.45rem; font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); }

.slip-wrote {
  display: flex;
  align-items: center;
  min-height: 3.4rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--rule);
  font-size: 1.0625rem;
  line-height: 1.35;
}

.slip-wrote.figure { font-size: 0.875rem; }

.slip-wrote.hand {
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  font-size: 1.3125rem;
}

.slip-becomes { padding: 0.5rem 0.75rem; background: var(--bar); font-weight: 600; }
.slip-becomes .figure { margin-right: 0.4rem; }
.slip-held { background: var(--highlighter); }
.slip > .small { margin-top: 0.1rem; }
.slips-note { margin-top: 1rem; }

/* ---------- The demo video ---------- */

.demo { background: var(--ink); color: #fff; padding-block: var(--section); }
.demo-words { max-width: 46rem; margin-bottom: 2rem; }
.demo-words p { margin-top: 1rem; color: var(--on-ink); }

.video { position: relative; aspect-ratio: 16 / 9; background: #0c1626; border: 1px solid #3a4a66; }

.video-play {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.video-play img { display: block; width: 100%; height: 100%; object-fit: cover; }

.video-button {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  background: var(--carbon);
  border-radius: 2px;
  box-shadow: 0 0 0 0.4rem rgba(20, 35, 58, 0.6);
  color: #fff;
  font: 600 1.25rem/1 var(--sans);
  white-space: nowrap;
}

.video-play:hover .video-button { background: var(--carbon-deep); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-fallback { position: absolute; left: 1rem; bottom: 1rem; }
.demo-note { margin-top: 1rem; max-width: none; color: var(--on-ink-soft); }
.demo a { color: #fff; }
.demo :focus-visible { outline-color: #fff; }

/* ---------- How it works ---------- */

.how {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: var(--split-gap);
  align-items: start;
  padding-block: var(--section);
}

.steps { counter-reset: step; display: grid; gap: 1.75rem; margin-top: 2.25rem; }

.steps li,
.offer-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  column-gap: 1rem;
}

.steps li::before,
.offer-steps li::before {
  content: counter(step);
  grid-row: 1 / span 2;
  color: var(--carbon);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 0.9;
}

.steps h3, .steps p, .offer-steps h3, .offer-steps p { grid-column: 2; }
.steps p, .offer-steps p { margin-top: 0.35rem; }
.how-after { margin-top: 2rem; padding-left: 4.25rem; font-weight: 500; }

.stops { padding: 1.5rem 1.6rem 1.75rem; background: var(--paper); border: 1px solid var(--rule); }
.stops > p { margin-top: 0.35rem; }
.stops-list { display: grid; gap: 1.05rem; margin-top: 1.25rem; font-size: 1.0625rem; }
.stops-list .hl { line-height: 1.6; }
.why { display: block; margin-top: 0.3rem; font-size: 0.9375rem; color: var(--ink-soft); }
.stops-list .stamp { margin: 0.2rem 0 0.15rem 0.15rem; }

/* ---------- What is measured ---------- */

.proof {
  display: grid;
  grid-template-columns: var(--split);
  gap: 3rem var(--split-gap);
  align-items: start;
  padding-bottom: var(--section);
}

.proof-words p { margin-top: 1rem; }

.record { background: var(--paper); border: 1px solid var(--rule); font-size: 1.0625rem; }
.record-title { max-width: none; padding: 1rem 1.4rem 0.8rem; border-bottom: 2px solid var(--ink); font-weight: 600; }
.record dl > div { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; padding: 0.7rem 1.4rem; }
.record dt { color: var(--ink-soft); }
.record dd { font-weight: 600; }
.record .record-open { border-top: 2px solid var(--ink); }

.today {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--split);
  gap: 2rem var(--split-gap);
  padding-top: 2.25rem;
  border-top: 1px solid var(--rule);
}

.plain { display: grid; gap: 0.45rem; margin-top: 0.8rem; }
.plain li { position: relative; padding-left: 1.4rem; }
.plain li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 0.7rem; height: 2px; background: var(--ink); }

/* ---------- The offer ---------- */

.offer { padding-bottom: var(--section); }
.offer-sheet { padding: clamp(1.75rem, 4vw, 3.25rem) clamp(2.6rem, 6vw, 5rem); }
.offer-sheet h2 { max-width: 19em; }

.offer-steps {
  counter-reset: step;
  margin-top: 2rem;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.offer-steps li { padding: 1.15rem 1.25rem; }
.offer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-top: 1.75rem; }

/* ---------- Who is behind this, and questions ---------- */

.about,
.faq {
  display: grid;
  grid-template-columns: var(--split);
  gap: 1.5rem var(--split-gap);
  align-items: start;
  padding-bottom: var(--section);
}

.about-words p + p { margin-top: 1rem; }

/* Details the owner still has to supply. Nothing with this class should go live. */
mark.todo { padding: 0 0.3em; background: none; border: 1px dashed var(--hold); color: var(--hold); font-weight: 500; }

.faq-list { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--rule); }

.faq summary {
  position: relative;
  padding: 1rem 2.75rem 1rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.3rem; top: 0.8rem; color: var(--carbon); font-size: 1.75rem; font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { max-width: 58ch; padding-bottom: 1.2rem; }

/* ---------- Footer ---------- */

.site-foot { background: var(--ink); color: #fff; padding-block: clamp(3.5rem, 8vw, 6rem); }
.foot-ask { font-size: 1.25rem; color: var(--on-ink-soft); }
.foot-mail { margin-top: 0.4rem; max-width: none; }

.foot-mail a {
  color: #fff;
  font-size: clamp(1.75rem, 6.2vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}

.foot-mail a:hover { color: var(--highlighter); }
.foot-logo { display: flex; align-items: center; gap: 0.55rem; margin-top: 3rem; font-size: 1.375rem; font-weight: 700; line-height: 1; }
.foot-small { margin-top: 0.9rem; max-width: 60ch; font-size: 0.9375rem; color: var(--on-ink-soft); }
.site-foot :focus-visible { outline-color: #fff; }

/* ---------- The page that is not there ---------- */

.lost { min-height: 70vh; padding-block: var(--section); }
.lost .stamp { margin-bottom: 1.5rem; }
.lost p { margin-top: 1rem; }
.lost .actions { margin-top: 2rem; }

/* ---------- Narrower screens ---------- */

@media (max-width: 980px) {
  .hero, .how, .proof, .about, .faq { grid-template-columns: minmax(0, 1fr); }
  .hero-words { padding-top: 0; }
  .scene { max-width: 44rem; }
}

@media (max-width: 820px) {
  .site-nav { display: none; }
  .slips { grid-template-columns: minmax(0, 1fr); }
  .slip-wrote { min-height: 0; }
  .today { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  body { font-size: 1.125rem; }
  .wordmark { font-size: 1.375rem; }
  .actions .button { flex: 1 1 100%; justify-content: center; }

  .sheet { padding-inline: 2.15rem; }
  .mail { margin-left: 0.75rem; }
  .sheet-top { flex-direction: column-reverse; gap: 0.6rem; }
  .order-head { grid-template-columns: 1fr 1fr; }

  /* Each order line stacks: what was written, what it enters as, then quantity and amount. */
  .lines-head { display: none; }
  .lines { border-top: 2px solid var(--ink); }
  .line { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.45rem; }
  .wrote, .enters { grid-column: 1 / -1; }
  .wrote::before, .enters::before { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); }
  .wrote::before { content: "Customer wrote"; }
  .enters::before { content: "Enters as"; }
  .qty { text-align: left; }
  .flag .button { flex: 1 1 100%; justify-content: center; }
  .foot-actions { flex: 1 1 100%; }
  .foot-actions .button { flex: 1; justify-content: center; }

  .steps li, .offer-steps li { grid-template-columns: 2.25rem minmax(0, 1fr); column-gap: 0.75rem; }
  .steps li::before, .offer-steps li::before { font-size: 2.25rem; }
  .how-after { padding-left: 0; }
  .stops { padding-inline: 1.15rem; }
  .record dl > div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .offer-steps li { padding-inline: 0.75rem; }
  .offer-actions .button { flex: 1 1 100%; justify-content: center; font-size: 1.0625rem; padding-inline: 0.75rem; }
  .video-button { font-size: 1.0625rem; padding: 0.8rem 1.1rem; }
}
