/* =========================================================================
   build.coviecraft.dev

   The subject is a barter deal with a local trade: a painter, an appliance
   repairer, a piano teacher. So the page is built like an estimate being
   written, not like a pricing page. Line items are rows split by hairlines
   with the money in a fixed right column — the way a written quote reads.
   No cards, no shadows, no gradients.

   Boldness is spent in exactly one place: the receipt, a pine block that
   builds itself as you choose. Everything else is rules and space.

   Palette is trade signage and ledger ink — oat ground, deep pine, brass.
   Brass appears only on chosen state and actions, never as decoration.

   Type: Bricolage Grotesque (display only, 700-800) against Public Sans
   (everything else). Both self-hosted; CSP forbids inline styles and any
   external origin.
   ========================================================================= */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/static/fonts/bricolage.woff2") format("woff2");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("/static/fonts/publicsans.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --oat: #f2efe4;
  --oat-deep: #e7e2d1;
  --pine: #1e3a2c;
  --pine-lift: #2b5140;
  --ink: #22261e;
  --muted: #6b7061;
  --brass: #a9761f;
  --brass-deep: #7f570f;
  --rule: #d5cfbb;
  --card: #fbf8ef;
  --bad: #8c3521;

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --pad: clamp(1.15rem, 4vw, 2.25rem);
  --measure: 62ch;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--oat);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1rem; }
a { color: var(--brass-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brass); }

.money {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-weight: 600;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--pine);
  color: var(--oat);
  padding: .7rem 1rem;
  z-index: 20;
}
.skip-link:focus { left: 0; }

/* --- hero --------------------------------------------------------------
   The characteristic thing in this subject's world is the deal itself, so
   the page opens by stating it plainly rather than with a big number. */

.hero {
  background: var(--pine);
  color: var(--oat);
  padding: clamp(3rem, 9vw, 6rem) var(--pad) clamp(2.5rem, 7vw, 4.5rem);
}

.hero-inner { max-width: 46rem; margin: 0 auto; }

.hero-kicker {
  font-family: var(--display);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .06em;
  color: #9fb3a4;
  margin: 0 0 1.1rem;
}

.hero-title {
  font-size: clamp(2.3rem, 7.5vw, 4.1rem);
  color: #fbf8ef;
}

.hero-lede {
  margin: 1.4rem 0 0;
  max-width: 40rem;
  font-size: clamp(1.02rem, 2.2vw, 1.16rem);
  color: #cdd8cf;
  line-height: 1.65;
}

.hero-intro {
  margin-top: 1.5rem;
  padding-top: 1.3rem;
  border-top: 1px solid rgba(251, 248, 239, .18);
  color: #cdd8cf;
}
.hero-intro :last-child { margin-bottom: 0; }

/* --- the conversation ---------------------------------------------------- */

.talk {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3.25rem) var(--pad) 0;
}

.talk-head { margin-bottom: 2rem; }

.pips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pip-area { min-width: 0; }

.pip-name {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .45rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pip-area.is-current .pip-name { color: var(--brass-deep); }
.pip-area.is-done .pip-name { color: var(--pine-lift); }

.pip-track { display: flex; gap: .3rem; }

.pip {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--rule);
  transition: background .25s ease;
}

.pip-area.is-current .pip.is-spent { background: var(--brass); }
.pip-area.is-done .pip { background: var(--pine-lift); }

.pip-left {
  margin: .9rem 0 0;
  font-size: .93rem;
  color: var(--muted);
}
.pip-left strong { color: var(--brass-deep); font-weight: 700; }

.thread { margin: 0 0 1.5rem; }

.said {
  margin: 0 0 .9rem;
  padding: 0;
  max-width: var(--measure);
}

/* Mine — the question. Set in display type: it is the voice of the page,
   not a chat bubble. */
.said-mine {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.3rem, 3.6vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.said-theirs {
  margin-left: 1.1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
  font-size: .98rem;
}

.said-wait {
  color: var(--muted);
  font-style: italic;
}

.reply-label {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .45rem;
}

textarea, input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], input:not([type]) {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .7rem .8rem;
  resize: vertical;
}

textarea:focus, input:focus { border-color: var(--brass); }

.detail {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: .6rem 0 1rem;
}

.detail-track {
  flex: 0 0 5.5rem;
  height: 3px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
}

.detail-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brass);
  transition: width .2s ease, background .2s ease;
}

.detail-note { font-size: .88rem; color: var(--muted); }

.detail[data-state="good"] .detail-fill { background: var(--pine-lift); }
.detail[data-state="good"] .detail-note { color: var(--pine-lift); }

.reply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}

.btn {
  font: inherit;
  font-weight: 700;
  border-radius: 3px;
  padding: .68rem 1.15rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-go { background: var(--pine); color: var(--card); }
.btn-go:hover { background: var(--pine-lift); }

.btn-brass { background: var(--brass); color: #1b1a12; }
.btn-brass:hover { background: #c08c2c; }

.btn-quiet {
  background: transparent;
  color: var(--muted);
  border-color: var(--rule);
}
.btn-quiet:hover { color: var(--ink); border-color: var(--muted); }

.btn-wide { width: 100%; }

.btn[disabled] { opacity: .5; cursor: default; }

.bail {
  margin: 1.6rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: .93rem;
  color: var(--muted);
}

/* --- the work strip ----------------------------------------------------- */

.work {
  max-width: 58rem;
  margin: clamp(3rem, 8vw, 5rem) auto 0;
  padding: clamp(2rem, 5vw, 3rem) var(--pad) clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--rule);
}

.work-title {
  font-size: clamp(1.35rem, 3.5vw, 1.7rem);
  margin-bottom: 1.5rem;
}

.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.5rem 1.75rem;
}

.work-item { display: flex; flex-direction: column; gap: .7rem; min-width: 0; }

.work-shot {
  display: block;
  border: 1px solid var(--rule);
  background: var(--card);
  overflow: hidden;
}

.work-shot img { display: block; width: 100%; height: auto; }

.work-name {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.work-name a { color: var(--ink); text-decoration: none; }
.work-name a:hover { color: var(--brass-deep); text-decoration: underline; }

.work-what {
  display: block;
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.45;
}

/* --- review: head ------------------------------------------------------- */

.rv-head {
  background: var(--pine);
  color: var(--oat);
  padding: clamp(2.5rem, 7vw, 4rem) var(--pad) clamp(2rem, 5vw, 2.75rem);
}

.rv-head-inner { max-width: 66rem; margin: 0 auto; }

.rv-title {
  font-size: clamp(2rem, 5.5vw, 3rem);
  color: #fbf8ef;
}

.rv-summary {
  margin: 1rem 0 0;
  max-width: 42rem;
  color: #cdd8cf;
  font-size: 1.05rem;
}

.rv { max-width: 66rem; margin: 0 auto; padding: 0 var(--pad) 4rem; }

.rv-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

@media (min-width: 62rem) {
  .rv-cols { grid-template-columns: minmax(0, 1fr) 18.5rem; gap: 2.75rem; }
}

/* --- review: the floor -------------------------------------------------- */

.floor {
  margin-top: clamp(1.75rem, 5vw, 2.75rem);
  border: 1px solid var(--pine);
  background: var(--card);
}

.floor-head { padding: 1.1rem 1.25rem .8rem; border-bottom: 1px solid var(--rule); }

.floor-title { font-size: 1.22rem; }

.floor-note { margin: .3rem 0 0; font-size: .92rem; color: var(--muted); }

.floor-list { list-style: none; margin: 0; padding: 0; }

.floor-item {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: baseline;
  padding: .65rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.floor-tick {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--pine-lift);
  align-self: center;
}

.floor-name { display: block; font-weight: 600; }

.floor-blurb { display: block; font-size: .9rem; color: var(--muted); line-height: 1.45; }

.floor-money { color: var(--muted); font-size: .95rem; }

.floor-total {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin: 0;
  padding: .85rem 1.25rem;
  background: var(--pine);
  color: var(--card);
  font-weight: 600;
}
.floor-total .money { font-size: 1.15rem; }

/* --- review: presets ---------------------------------------------------- */

.presets { margin-top: 2.5rem; }

.presets-title { font-size: 1.22rem; margin-bottom: 1rem; }

.preset-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: .75rem;
}

.preset {
  font: inherit;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .85rem .9rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.preset:hover { border-color: var(--muted); }

.preset.is-on { border-color: var(--brass); background: #f7efdd; }

.preset-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
}

.preset-tag { font-size: .9rem; color: var(--ink); }

.preset-for { font-size: .84rem; color: var(--muted); line-height: 1.4; }

/* --- review: the line items --------------------------------------------
   Rows split by hairlines, money in a fixed right column. An estimate,
   not a card grid. */

.cat { margin-top: 2.5rem; }

.cat-title {
  font-size: 1.22rem;
  padding-bottom: .55rem;
  border-bottom: 2px solid var(--pine);
}

.rows { list-style: none; margin: 0; padding: 0; }

.row { border-bottom: 1px solid var(--rule); }

.row-label {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr) auto;
  gap: .85rem;
  align-items: baseline;
  padding: .8rem .25rem;
  cursor: pointer;
}

.row-label:hover { background: rgba(30, 58, 44, .035); }

.row-box {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  align-self: center;
  border: 1.5px solid var(--muted);
  border-radius: 2px;
  background: var(--card);
  cursor: pointer;
  position: relative;
}

.row-box:checked { background: var(--brass); border-color: var(--brass); }

.row-box:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #1b1a12;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

.row-name { display: block; font-weight: 600; }

.row-blurb { display: block; font-size: .92rem; color: var(--muted); line-height: 1.45; }

.row-why {
  display: block;
  margin-top: .3rem;
  font-size: .9rem;
  color: var(--brass-deep);
  border-left: 2px solid var(--brass);
  padding-left: .6rem;
}

.row-why-not { color: var(--muted); border-left-color: var(--rule); }

.row-seen { display: block; margin-top: .3rem; font-size: .85rem; color: var(--muted); }

.row-money { font-size: .98rem; }

/* Two different facts, so two different marks: is-advised means "I suggested
   this" and stays put even if they drop it; is-chosen means "it's in your
   build right now" and follows the checkbox. */
.row.is-advised { box-shadow: inset 3px 0 0 var(--brass); }
.row.is-chosen { background: rgba(30, 58, 44, .05); }

/* --- review: the receipt -----------------------------------------------
   The one bold element. Everything else on the page stays quiet so this
   can carry the weight. */

.receipt { position: static; }

@media (min-width: 62rem) {
  .receipt { position: sticky; top: 1.5rem; }
}

.receipt-inner {
  background: var(--pine);
  color: var(--card);
  padding: 1.25rem 1.25rem 1.4rem;
}

.receipt-title {
  font-size: 1.1rem;
  color: #fbf8ef;
  padding-bottom: .7rem;
  border-bottom: 1px solid rgba(251, 248, 239, .22);
}

.receipt-lines {
  list-style: none;
  margin: 0;
  padding: .5rem 0 0;
  max-height: 17rem;
  overflow-y: auto;
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  gap: .9rem;
  align-items: baseline;
  padding: .3rem 0;
  font-size: .93rem;
  color: #cdd8cf;
  border-bottom: 1px dotted rgba(251, 248, 239, .18);
}

.receipt-line .money { color: #e4ecdf; }

.receipt-base { color: #fbf8ef; font-weight: 600; }

/* Motion answers an action: a line arriving when you tick something. */
.receipt-line.is-new { animation: line-in .22s ease-out; }

@keyframes line-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: .9rem 0 1rem;
  padding-top: .8rem;
  border-top: 1px solid rgba(251, 248, 239, .22);
}

.receipt-total-label { font-weight: 600; color: #fbf8ef; }

.receipt-amount {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
  color: #edc06a;
}

.receipt-foot {
  margin: .8rem 0 0;
  font-size: .84rem;
  color: #9fb3a4;
  line-height: 1.45;
}

/* --- forms -------------------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 1.35rem 1.25rem 1.5rem;
}

.tell { margin-top: 2.75rem; }

.tell-title { font-size: 1.3rem; }

.tell-note { margin: .35rem 0 1.2rem; color: var(--muted); font-size: .93rem; }

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0 1rem;
}

.field { margin: 0 0 1rem; }

.field label {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .35rem;
}

/* --- thanks / gate ------------------------------------------------------ */

.done, .gate { padding: clamp(3rem, 9vw, 6rem) var(--pad); }

.done-inner { max-width: 38rem; margin: 0 auto; }

.done-title { font-size: clamp(2.2rem, 6vw, 3.2rem); }

.done-lede { margin-top: 1rem; font-size: 1.1rem; }

.done-sub { font-size: 1.15rem; margin: 2rem 0 .6rem; }

.done-list { margin: 0; padding-left: 1.1rem; color: var(--muted); }

.done-back { margin-top: 2rem; }

.gate-card {
  max-width: 22rem;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 1.5rem;
}

.gate-title { font-size: 1.5rem; margin-bottom: 1.1rem; }

.gate-error { color: var(--bad); font-size: .93rem; }

/* --- footer ------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--rule);
  padding: 1.75rem var(--pad);
  background: var(--oat-deep);
}

.foot p {
  margin: 0;
  max-width: 66rem;
  margin-inline: auto;
  font-size: .9rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* The AI failing is information, not an error state — it reads as another
   turn in the conversation, just quieter. No red, no icon. */
.said-notice {
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--rule);
  padding-top: .9rem;
  margin-top: 1.1rem;
}

.rv-degraded {
  max-width: 62ch;
  margin: 0 0 1.6rem;
  padding-left: .9rem;
  border-left: 2px solid var(--brass);
  color: var(--muted);
  font-size: .95rem;
}
