/* Landing page. Visual idea: estimating is measuring, so a cost range is drawn as a dimension line
   (extension lines, arrowheads, a ruler) and it visibly tightens as the visitor gives more detail.
   Wide Archivo for quantities, narrow Archivo for annotations. Amber appears only on the "most likely" marker
   and under the words the visitor can change. */

/* ---------------------------------------------------------------- hero */
.hero { position: relative; isolation: isolate; padding: 52px 0 56px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000 35%, transparent 95%);
  opacity: .9;
}
.hero h1 { font-size: clamp(2.5rem, 5.2vw, 4.25rem); line-height: 1; max-width: 17ch; margin: 0 0 18px; text-wrap: balance; }
.kicker { display: block; font-family: var(--font); font-size: .95rem; font-weight: 650; letter-spacing: .02em; font-stretch: var(--label-width); color: var(--muted); line-height: 1.3; margin-bottom: 12px; }
.hero .sub { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 58ch; margin: 0; }

.instrument { margin-top: 36px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 3.6vw, 40px); }
.say { font-size: clamp(1.3rem, 2.7vw, 2.05rem); line-height: 1.45; font-weight: 450; margin: 0; max-width: 34ch; text-wrap: pretty; }
.pick { position: relative; display: inline-block; white-space: nowrap; }
.pick-face {
  display: inline-block; color: var(--brand); font-weight: 700; padding-right: .95em;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 100% 3px no-repeat;
  line-height: 1.15;
}
.pick-face::after {
  content: ""; position: absolute; right: .12em; top: 50%; width: .42em; height: .42em; margin-top: -.3em;
  border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); color: var(--brand);
}
.pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font: inherit; font-size: 16px; border: 0; }
.pick:focus-within .pick-face { outline: 3px solid var(--brand); outline-offset: 4px; border-radius: 3px; }
.pick:hover .pick-face { color: var(--brand-strong); }

.readout { margin-top: 30px; }
.likely { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.likely-label { font-stretch: var(--label-width); font-weight: 600; color: var(--muted); font-size: .98rem; }
.likely-value {
  font-family: var(--font-display); font-stretch: 122%; font-weight: 780; letter-spacing: -.035em; line-height: .95;
  font-size: clamp(3.1rem, 9vw, 6rem); font-variant-numeric: tabular-nums lining-nums;
}

/* the dimension line: --lo / --at / --hi are percentages of the width, set by landing.js */
.dim { position: relative; height: 96px; margin-top: 18px; }
.dim-ruler {
  position: absolute; left: 0; right: 0; top: 30px; height: 13px; border-bottom: 1px solid var(--line-strong);
  background-image: linear-gradient(90deg, var(--line-strong) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 10% 13px, 2.5% 7px; background-position: left bottom, left bottom; background-repeat: repeat-x;
}
.dim-span {
  position: absolute; top: 20px; height: 34px; left: var(--lo); width: calc(var(--hi) - var(--lo));
  border-left: 2px solid var(--ink); border-right: 2px solid var(--ink);
  transition: left .5s cubic-bezier(.2, .7, .2, 1), width .5s cubic-bezier(.2, .7, .2, 1);
}
.dim-span::before { content: ""; position: absolute; left: 0; right: 0; top: 16px; height: 2px; background: var(--brand); }
.dim-arrow { position: absolute; top: 12px; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.dim-arrow.lo { left: 0; border-right: 10px solid var(--brand); }
.dim-arrow.hi { right: 0; border-left: 10px solid var(--brand); }
.dim-mark {
  position: absolute; top: 26px; left: var(--at); width: 18px; height: 18px; margin-left: -9px;
  background: var(--accent); border: 2px solid var(--ink); transform: rotate(45deg); border-radius: 2px;
  transition: left .5s cubic-bezier(.2, .7, .2, 1);
}
.dim-lab {
  position: absolute; top: 62px; white-space: nowrap; font-stretch: var(--label-width); color: var(--muted); font-size: .95rem;
  transition: left .5s cubic-bezier(.2, .7, .2, 1), right .5s cubic-bezier(.2, .7, .2, 1);
}
.dim-lab b { color: var(--ink); font-weight: 650; font-size: 1.12rem; font-variant-numeric: tabular-nums; margin-right: 3px; }
/* labels sit outside the span by default; landing.js flips one inside when it would run off the edge */
.dim-lab.lo { right: calc(100% - var(--lo)); padding-right: 10px; }
.dim-lab.hi { left: var(--hi); padding-left: 10px; }
.dim-lab.lo.inside { right: auto; left: var(--lo); padding: 0 0 0 10px; }
.dim-lab.hi.inside { left: auto; right: calc(100% - var(--hi)); padding: 0 10px 0 0; }

.readout-meta { margin: 6px 0 0; font-size: 1.02rem; }
.readout-why { margin: 10px 0 0; color: var(--muted); font-size: .95rem; padding-left: 12px; border-left: 3px solid var(--accent); max-width: 70ch; }
.readout[aria-busy="true"] .likely-value, .readout[aria-busy="true"] .dim-lab b { opacity: .45; transition: opacity .2s; }
.readout-error { color: var(--bad); }

.ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.fine { margin: 14px 0 0; font-size: .85rem; color: var(--muted); }

/* ---------------------------------------------------------------- sections */
.section { padding: 72px 0 8px; }
.section h2, .band h2, .closing h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.08; margin-bottom: 16px; max-width: 22ch; }
.intro { color: var(--muted); max-width: 60ch; margin-bottom: 28px; }
.narrow-text > * { max-width: 780px; }

/* why a range: text beside three small dimension lines */
.band { padding: 72px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); }
.split { display: grid; gap: 40px; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
.split p { max-width: 52ch; color: var(--muted); }
.stages { margin: 0; }
.stages ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.stages li { display: grid; grid-template-columns: 11.5em minmax(0, 1fr); grid-template-areas: "name mini" ". val"; gap: 2px 16px; align-items: center; }
.st-name { grid-area: name; font-weight: 600; font-stretch: var(--label-width); }
.st-val { grid-area: val; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; font-stretch: var(--label-width); }
.mini { grid-area: mini; position: relative; height: 22px; border-bottom: 1px solid var(--line); }
.mini-span {
  position: absolute; bottom: 4px; height: 14px; left: var(--lo); width: calc(var(--hi) - var(--lo));
  border-left: 2px solid var(--ink); border-right: 2px solid var(--ink);
  background: linear-gradient(var(--brand), var(--brand)) center / 100% 2px no-repeat;
  transition: left .5s cubic-bezier(.2, .7, .2, 1), width .5s cubic-bezier(.2, .7, .2, 1);
}
.mini-mark { position: absolute; bottom: 6px; left: var(--at); width: 10px; height: 10px; margin-left: -5px; background: var(--accent); border: 1.5px solid var(--ink); transform: rotate(45deg); transition: left .5s cubic-bezier(.2, .7, .2, 1); }
.stages figcaption { margin-top: 18px; font-size: .85rem; color: var(--muted); }

/* how it works: a real sequence, so the steps are numbered and joined by a line */
.steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; counter-reset: step; border-top: 2px solid var(--ink); }
.steps li { position: relative; padding-top: 22px; counter-increment: step; }
.steps li::before {
  content: counter(step); display: block; font-family: var(--font-display); font-stretch: 122%; font-weight: 780;
  font-size: 2.6rem; line-height: 1; color: var(--brand); margin-bottom: 14px; font-variant-numeric: tabular-nums;
}
.steps li::after { content: ""; position: absolute; left: 0; top: -9px; width: 2px; height: 16px; background: var(--ink); }
.steps h3 { font-size: 1.2rem; margin-bottom: 6px; }
.steps p { color: var(--muted); margin: 0; max-width: 34ch; }

/* starting prices: a rate card with dotted leaders, like a bill of quantities */
.rates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.rate h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 1.15rem; padding-top: 12px; border-top: 4px solid var(--build); margin-bottom: 8px; }
.rate.run h3 { border-top-color: var(--run); }
.rate.grow h3 { border-top-color: var(--grow); }
.rate h3 span { font-size: .85rem; font-weight: 500; color: var(--muted); font-stretch: var(--label-width); }
table.leaders { width: 100%; border-collapse: collapse; }
.leaders th, .leaders td { padding: 9px 0; text-align: left; font-weight: inherit; vertical-align: baseline; }
/* dotted leader: a line across the name cell, covered by the name's own background */
.leaders th { position: relative; }
.leaders th::after { content: ""; position: absolute; left: 0; right: 0; bottom: 15px; border-bottom: 2px dotted var(--line-strong); }
.leaders th a { position: relative; z-index: 1; background: var(--bg); padding-right: 8px; color: var(--ink); text-decoration: none; }
.leaders th a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.leaders td { width: 1%; white-space: nowrap; padding-left: 8px; font-weight: 650; font-variant-numeric: tabular-nums; font-stretch: var(--label-width); }
.rates-sum { margin-top: 28px; }
.rate .note { font-size: .9rem; color: var(--muted); margin-top: 10px; }

/* promises */
.promises { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; margin: 24px 0 0; }
.promises > div { padding: 18px 0; border-top: 1px solid var(--line); }
.promises dt { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.promises dd { margin: 0; color: var(--muted); max-width: 46ch; }

/* closing */
.closing { padding: 80px 0 24px; }
.closing-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; border-top: 2px solid var(--ink); padding-top: 32px; }
.closing h2 { margin: 0; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .rates { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 720px) {
  /* keep the first call to action on screen on a phone */
  .hero { padding: 24px 0 36px; }
  .hero h1 { margin-bottom: 12px; }
  .instrument { margin-top: 20px; }
  .readout { margin-top: 18px; }
  .dim { height: 88px; margin-top: 10px; }
  .ctas { margin-top: 18px; }
  .steps { grid-template-columns: 1fr; gap: 0; border-top: 0; border-left: 2px solid var(--ink); padding-left: 20px; }
  .steps li { padding: 0 0 28px; }
  .steps li::after { left: -29px; top: 10px; width: 16px; height: 2px; }
  .promises { grid-template-columns: 1fr; }
  .stages li { grid-template-columns: 1fr; grid-template-areas: "name" "mini" "val"; }
  .dim-lab b { font-size: 1rem; }
}
