/* Kettlewick Decks. A made-up builder; a concept by ALLOIC.
   Direction: the name as a monument. Putty and black, one teal for the action. Imbue and Albert Sans. */

/* If the display face does not arrive, a serif scaled to about its width keeps every line in place. */
@font-face {
  font-family: "Imbue Fallback";
  src: local("Georgia"), local("Times New Roman"), local("Times");
  size-adjust: 54%;
  ascent-override: 150%;
  descent-override: 36%;
}

:root {
  /* the dealt palette */
  --bg: #dedad3;
  --surface: #d3cec6;
  --ink: #0a0a0a;
  --muted: #5c5852;
  --accent: #256f82;
  --accent-ink: #ffffff;
  --accent-strong: #1b5868;   /* the accent, pressed */
  --ink-step: #201f1d;        /* one tone step on the inverse field */

  /* the drawing's colours: the materials themselves */
  --pt-a: #a97f52; --pt-b: #9c7347; --pt-c: #b68c5e; --pt-d: #7b5a36;
  --cedar-a: #c58a5f; --cedar-b: #b97b50; --cedar-c: #d0986c; --cedar-d: #94603d;
  --comp-a: #8c8881; --comp-b: #807c75; --comp-c: #98948d; --comp-d: #625f59;
  --lumber: #c6a56e; --lumber-mid: #ab8b55; --lumber-dark: #7c6137;
  --concrete: #f3f1ec; --zinc: #ecece8;

  --font-display: "Imbue", "Imbue Fallback", Georgia, serif;
  --font-text: "Albert Sans", "Helvetica Neue", Arial, sans-serif;

  /* five sizes, far apart */
  --step-small: 0.9375rem;                                   /* 15px */
  --step-body: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);     /* 18-20px */
  --step-lead: clamp(1.25rem, 1.05rem + 0.75vw, 1.5rem);      /* 20-24px */
  --step-head: clamp(1.75rem, 1.2rem + 1.45vw, 2.5rem);       /* 28-40px */
  --step-d2: clamp(2.5rem, 5.2vw, 5rem);                      /* 40-80px */
  --mon: clamp(3.5rem, 18vw, 7.5rem);                         /* the monument; set again for wide screens below */
  --mon-row: calc(var(--mon) * 0.86);

  --margin: clamp(1.25rem, 2vw, 1.75rem);
  --gutter: clamp(0.75rem, 1.4vw, 1.25rem);
  --gap-section: clamp(5rem, 11vw, 10rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-body)/1.5 var(--font-text);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, p, ul, ol, figure, fieldset, legend, table { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; }
svg { display: block; }
button, input { font: inherit; color: inherit; border-radius: 0; }
button { cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.price :focus-visible, .foot :focus-visible, .strip :focus-visible { outline-color: var(--bg); }

.sr {
  position: absolute; margin: -1px; padding: 0; overflow: hidden; white-space: nowrap; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%); width: 1px; height: 1px;
}

/* a line that can rise out of its own mask */
.line { display: block; overflow: clip; padding-bottom: 0.08em; margin-bottom: -0.08em; }
[data-line] { display: block; }

/* ---------- shared pieces ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.5rem; padding: 0.9rem 1.6rem;
  background: var(--accent); color: var(--accent-ink);
  font: 500 var(--step-body)/1.2 var(--font-text); text-decoration: none; text-align: center;
  border: 0;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease;
}
.btn:active { transform: scale(0.97); }
.btn--ink { background: var(--ink); color: var(--bg); }
.link {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0; background: none; border: 0;
  font-weight: 500; text-align: left;
  text-decoration: underline; text-decoration-thickness: 0.08em; text-underline-offset: 0.22em;
  text-decoration-color: currentColor;
  transition: text-decoration-color var(--t-hover) ease, opacity var(--t-hover) ease;
}
.link:active { opacity: 0.7; }
.toggle {
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-height: 3rem; padding: 0.5rem 1rem 0.5rem 0.8rem;
  background: var(--surface); color: var(--ink); border: 0;
  font: 500 var(--step-body)/1.2 var(--font-text); white-space: nowrap;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}
.toggle:active { transform: scale(0.97); }
.toggle__box { width: 1.05rem; height: 1.05rem; border: 2px solid currentColor; display: grid; place-items: center; flex: none; }
.toggle__box::after { content: ""; width: 0.5rem; height: 0.5rem; background: currentColor; opacity: 0; transform: scale(0.6); transition: transform var(--t-ui) var(--ease-out), opacity var(--t-ui) ease; }
.toggle[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.toggle[aria-pressed="true"] .toggle__box::after { opacity: 1; transform: none; }
.toggle__short { display: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--accent-strong); }
  .btn--ink:hover { background: var(--ink-step); }
  .link:hover { text-decoration-color: transparent; }
  .toggle:hover { background: var(--ink); color: var(--bg); }
}

/* ---------- the concept strip ---------- */
.strip { background: var(--ink); color: var(--bg); padding: 0.7rem var(--margin); font-size: var(--step-small); line-height: 1.4; }
.strip a { font-weight: 500; text-underline-offset: 0.2em; white-space: nowrap; margin-left: 0.4em; }

/* ---------- the tool ---------- */
.tool { padding-inline: var(--margin); }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 0.6rem; min-height: 3.25rem; }
.masthead { font-size: 1.125rem; white-space: nowrap; }
.wordmark { font-weight: 500; text-decoration: none; letter-spacing: -0.005em; display: inline-flex; align-items: center; min-height: 2.75rem; }
.masthead__nav { display: none; gap: clamp(0.8rem, 1.5vw, 1.5rem); }
.masthead__nav a { text-decoration: none; display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration-line: underline; text-decoration-color: transparent; text-underline-offset: 0.25em; transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .masthead__nav a:hover { text-decoration-color: currentColor; } }
@media (min-width: 620px) { .masthead__nav { display: flex; } }

/* the stage: the deck's name in two halves, the plan with them.
   On a phone the name stands above and the plan holds its place while the column scrolls;
   on wide screens the two halves take opposite corners and the plan is drawn between them. */
.mon {
  display: grid; margin: 0.15rem 0 0.75rem;
  font: 400 var(--mon)/0.86 var(--font-display); text-transform: uppercase; letter-spacing: -0.01em;
  font-variant-numeric: lining-nums; white-space: nowrap;
}
.mon__w { justify-self: start; }
.mon__d { justify-self: end; }
.band {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: clamp(210px, 29svh, 400px) auto; gap: 0.4rem 1rem; align-items: center;
  margin-inline: calc(var(--margin) * -1); padding: 0.5rem var(--margin) 0.6rem;
  background: var(--bg); border-bottom: 4px solid var(--ink);
}
.plan { grid-column: 1 / -1; grid-row: 1; min-height: 0; height: 100%; position: relative; z-index: 1; }
.plan__svg { width: 100%; height: 100%; -webkit-user-select: none; user-select: none; }
.readout { grid-column: 1; grid-row: 2; position: relative; z-index: 3; }
.readout__price { font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; }
.readout__note { font-size: var(--step-small); line-height: 1.3; }
.readout__more, .readout__est { display: none; }
.stage__foot { grid-column: 2; grid-row: 2; position: relative; z-index: 3; }
.stage__counts { display: none; }
.band .toggle__long { display: none; }
.band .toggle__short { display: inline; }
@media (max-height: 599px) { .band { position: static; } }

/* the plan, drawn */
.p-wall { fill: var(--ink); }
.p-door { fill: var(--surface); }
.p-wall-t { fill: var(--bg); font: 500 14px var(--font-text); }
.p-foot { fill: var(--surface); }
.p-conc { fill: var(--concrete); }
.p-beam { fill: var(--lumber-dark); }
.p-joist { fill: var(--lumber); }
.p-rim { fill: var(--lumber-mid); }
.p-post, .p-arrowhead { fill: var(--ink); }
.p-zinc { fill: var(--zinc); }
.p-gap { fill: var(--surface); }
.p-ground { fill: var(--ink); }
.p-screw { fill: none; stroke: rgba(10, 10, 10, 0.36); stroke-width: 1.7; stroke-linecap: round; }
.p-rail { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.p-bal { fill: none; stroke: var(--ink); stroke-width: 7; }
.p-dim, .p-arrow { fill: none; stroke: var(--ink); stroke-width: 1.25; }
.p-tick { fill: none; stroke: var(--ink); stroke-width: 2; }
.p-dim-t, .p-note { font: 500 15px var(--font-text); fill: var(--ink); font-variant-numeric: tabular-nums; }
.p-note--halo { paint-order: stroke; stroke: var(--surface); stroke-width: 6px; stroke-linejoin: round; }
[data-mat="pt"] .b-under { fill: var(--pt-d); } [data-mat="cedar"] .b-under { fill: var(--cedar-d); } [data-mat="comp"] .b-under { fill: var(--comp-d); }
[data-mat="pt"] .b0 { fill: var(--pt-a); } [data-mat="pt"] .b1 { fill: var(--pt-b); } [data-mat="pt"] .b2 { fill: var(--pt-c); }
[data-mat="cedar"] .b0 { fill: var(--cedar-a); } [data-mat="cedar"] .b1 { fill: var(--cedar-b); } [data-mat="cedar"] .b2 { fill: var(--cedar-c); }
[data-mat="comp"] .b0 { fill: var(--comp-a); } [data-mat="comp"] .b1 { fill: var(--comp-b); } [data-mat="comp"] .b2 { fill: var(--comp-c); }
.has-focus .part:not(.is-lit) { opacity: 0.2; }

.handle { cursor: ew-resize; touch-action: none; outline: none; }
#h-d, .handle--stairs.is-vertical { cursor: ns-resize; }
#h-c { cursor: nwse-resize; }
.handle__hit { fill: transparent; }
.handle__dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2.5; transition: transform var(--t-press) var(--ease-out), fill var(--t-hover) ease; }
.handle__glyph { fill: var(--accent-ink); pointer-events: none; }
.handle--stairs.is-vertical .handle__glyph { transform: rotate(90deg); }
.handle__ring { fill: none; stroke: var(--ink); stroke-width: 3; opacity: 0; }
.handle:focus-visible .handle__ring { opacity: 1; }
.handle.is-held .handle__dot { transform: scale(1.18); fill: var(--accent-strong); }
@media (hover: hover) and (pointer: fine) { .handle:hover .handle__dot { transform: scale(1.18); } }
.is-small .handle__dot, .is-small .handle__glyph { transform: scale(0.82); }
.is-small .handle--stairs.is-vertical .handle__glyph { transform: rotate(90deg) scale(0.82); }
.is-small .handle.is-held .handle__dot { transform: scale(1); }
.is-dragging, .is-dragging * { -webkit-user-select: none; user-select: none; }

/* the column beside the plan */
.tool__col { padding-top: 1.25rem; padding-bottom: var(--gap-section); }
.lead { font-size: var(--step-lead); line-height: 1.32; max-width: 34ch; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.75rem; margin-top: 1.5rem; }

.controls { margin-top: 2.5rem; display: grid; gap: 1.75rem; font-size: 1rem; line-height: 1.35; }
.ctl legend, .stepper > label, .slide > label { display: block; font-weight: 500; margin-bottom: 0.5rem; }
.ctl__hint, .ctl__ground { font-size: var(--step-small); color: var(--muted); margin-top: 0.6rem; }
.ctl__ground { color: var(--ink); margin-top: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; }
.seg label {
  display: grid; place-items: center; min-height: 3rem; padding: 0.45rem 0.6rem; text-align: center; text-wrap: balance;
  background: var(--surface); cursor: pointer;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.seg label:active { transform: scale(0.97); }
.seg input:checked + label { background: var(--ink); color: var(--bg); }
.seg input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; position: relative; z-index: 1; }
@media (hover: hover) and (pointer: fine) { .seg input:not(:checked) + label:hover { background: var(--bg); outline: 2px solid var(--ink); outline-offset: -2px; } }
.steppers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1rem; }
.stepper > label { font-weight: 400; font-size: var(--step-small); }
.stepper__row { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 3rem; gap: 2px; }
.stepper__btn { min-height: 3rem; background: var(--surface); border: 0; font-size: 1.375rem; line-height: 1; transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.stepper__btn:active { transform: scale(0.94); }
.stepper__btn:disabled { opacity: 0.45; cursor: default; }
.stepper__val { display: flex; align-items: baseline; justify-content: center; gap: 0.3rem; background: var(--surface); padding: 0.45rem 0.4rem; }
.stepper__val input {
  width: 3.4ch; border: 0; background: transparent; padding: 0; text-align: right;
  font-size: 1.375rem; font-weight: 500; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.stepper__val input::-webkit-outer-spin-button, .stepper__val input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__val:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.stepper__val input:focus-visible { outline: none; }
.stepper__val span { color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .stepper__btn:not(:disabled):hover { background: var(--ink); color: var(--bg); } }
.ctl__split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.stepper.is-off { opacity: 0.45; }
.elev { margin-top: 0.9rem; }
.elev__svg { width: 100%; height: 9.5rem; }
.elev figcaption { font-size: var(--step-small); color: var(--muted); margin-top: 0.4rem; }
.slide { margin-top: 0.9rem; }
.slide > label { font-weight: 400; font-size: var(--step-small); margin-bottom: 0.1rem; }
.slide input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 2.75rem; margin: 0; background: transparent; cursor: pointer; }
.slide input[type="range"]::-webkit-slider-runnable-track { height: 0.5rem; background: var(--surface); }
.slide input[type="range"]::-moz-range-track { height: 0.5rem; background: var(--surface); }
.slide input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 1.75rem; height: 1.75rem; margin-top: -0.625rem; background: var(--ink); border: 0; border-radius: 0; }
.slide input[type="range"]::-moz-range-thumb { width: 1.75rem; height: 1.75rem; background: var(--ink); border: 0; border-radius: 0; }
.slide input[type="range"]:disabled { opacity: 0.45; }
.controls > .link { justify-self: start; margin-top: -0.75rem; }

/* what it takes */
.take { margin-top: clamp(4rem, 8vw, 7rem); scroll-margin-top: calc(var(--band-h, 0px) + 1.5rem); }
.noscript { margin-top: 1.5rem; padding: 1rem; background: var(--surface); }
.take h2, .counted h2 { font: 400 var(--step-head)/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.005em; }
.take__intro { margin-top: 0.9rem; max-width: 40ch; text-wrap: pretty; }
.take__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin-top: 1.25rem; }
.take__tip { font-size: var(--step-small); color: var(--muted); }
.takeoff { width: 100%; border-collapse: collapse; margin-top: 0.75rem; font-size: 1rem; line-height: 1.35; font-variant-numeric: tabular-nums; }
[data-ui].takeoff th, [data-ui].takeoff td { padding: 0.5rem 0; text-align: left; vertical-align: top; font-weight: 400; }
[data-ui].takeoff tbody tr:first-child > * { padding-top: 1.6rem; }
[data-ui].takeoff .takeoff__group { width: 5.5rem; color: var(--muted); padding-right: 0.75rem; }
[data-ui].takeoff .takeoff__qty { text-align: right; padding-left: 0.75rem; font-weight: 500; min-width: 5.5rem; max-width: 12.5rem; text-wrap: balance; }
[data-ui].takeoff .takeoff__cost { text-align: right; width: 5.25rem; padding-left: 0.75rem; }
[data-ui] .takeoff__name { background: none; border: 0; padding: 0.7rem 0; margin: -0.7rem 0; text-align: left; font-weight: 500; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.22em; text-decoration-thickness: 0.08em; transition: text-decoration-color var(--t-hover) ease; }
[data-ui] .takeoff__work { display: none; margin-top: 0.3rem; font-size: var(--step-small); color: var(--muted); max-width: 46ch; }
[data-ui].is-working .takeoff__work { display: block; }
[data-ui].takeoff tr.is-picked > .takeoff__item, [data-ui].takeoff tr.is-picked > td { background: var(--ink); color: var(--bg); }
[data-ui].takeoff tr.is-picked > .takeoff__item { padding-left: 0.6rem; }
[data-ui].takeoff tr.is-picked > .takeoff__cost { padding-right: 0.6rem; }
[data-ui].takeoff tr.is-picked .takeoff__work { color: var(--bg); }
@media (hover: hover) and (pointer: fine) {
  [data-ui].takeoff tr[data-key]:not(.is-picked):hover > .takeoff__item, [data-ui].takeoff tr[data-key]:not(.is-picked):hover > td { background: var(--surface); }
  [data-ui] tr:hover .takeoff__name { text-decoration-color: currentColor; }
}
.take__sum { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 1.5rem; padding: 0.85rem 0.9rem; background: var(--surface); }
.take__sum strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.take__law { margin-top: 1.25rem; font-size: var(--step-small); max-width: 46ch; }

/* ---------- the price, as one sentence ---------- */
.price { background: var(--ink); color: var(--bg); padding: var(--gap-section) var(--margin); min-height: 80svh; display: grid; align-content: center; scroll-margin-top: 0; }
.price > * { min-width: 0; }
.price__say { font: 400 15vw/0.98 var(--font-display); text-transform: uppercase; letter-spacing: -0.01em; }
.price__fig { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 0 0.15em; font-variant-numeric: lining-nums; white-space: nowrap; }
.price__row { display: grid; gap: 2.5rem; margin-top: clamp(2.5rem, 4.5vw, 4rem); }
.price__what { display: grid; gap: 1rem; max-width: 34rem; }
.price__lead { font-size: var(--step-lead); line-height: 1.32; }
.price__act { display: grid; gap: 0.75rem; justify-items: start; }
.price__others { display: grid; gap: 0; }

/* ---------- how this is counted ---------- */
.counted { padding: var(--gap-section) var(--margin); }
.counted__grid { display: grid; gap: 2.5rem var(--gutter); margin-top: clamp(2.5rem, 5vw, 5rem); }
.rules h3 { font-size: inherit; font-weight: 500; margin-bottom: 1.1rem; }
.detail { margin-bottom: 1.5rem; }
.detail svg { width: min(100%, 20rem); height: auto; overflow: visible; }
.rules ul { display: grid; gap: 0.95rem; }
.rules li { line-height: 1.35; max-width: 34ch; text-wrap: pretty; }
.here { display: block; margin-top: 0.2rem; font-size: var(--step-small); color: var(--muted); }
.counted__aside { display: grid; gap: 1rem; align-content: start; line-height: 1.35; max-width: 34ch; }
.sheet { display: grid; gap: 2.5rem var(--gutter); margin-top: var(--gap-section); scroll-margin-top: 2rem; }
.sheet__head { display: grid; gap: 1.1rem; align-content: start; justify-items: start; }
.sheet__head h3 { font: 400 var(--step-head)/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.005em; }
.sheet__head p { max-width: 30ch; text-wrap: pretty; }
.sheet__form { display: grid; gap: 2.25rem var(--gutter); align-items: start; }
.sheet__set legend { font-weight: 500; margin-bottom: 0.6rem; }
[data-ui] .sheet__row { display: grid; grid-template-columns: minmax(0, 1fr) 7rem; gap: 0.75rem; align-items: center; padding-block: 0.3rem; font-size: 1rem; line-height: 1.35; }
[data-ui] .sheet__row label span { display: block; font-size: var(--step-small); color: var(--muted); }
[data-ui] .sheet__field { display: flex; align-items: center; gap: 0.25rem; background: var(--surface); padding: 0 0.6rem; min-height: 3rem; }
[data-ui] .sheet__field span { color: var(--muted); }
[data-ui] .sheet__field--pct { flex-direction: row-reverse; }
[data-ui] .sheet__field input { width: 100%; min-width: 0; border: 0; background: transparent; padding: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
[data-ui] .sheet__field input::-webkit-outer-spin-button, [data-ui] .sheet__field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
[data-ui] .sheet__field:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
[data-ui] .sheet__field input:focus-visible { outline: none; }

/* ---------- how a job runs: four lines that step down like stairs ---------- */
.job { background: var(--surface); padding: var(--gap-section) var(--margin); }
.steps { display: grid; gap: clamp(2.5rem, 4vw, 3.5rem); }
.steps li { padding-left: calc(var(--n) * 6vw); }
.steps li:nth-child(1) { --n: 0; } .steps li:nth-child(2) { --n: 1; } .steps li:nth-child(3) { --n: 2; } .steps li:nth-child(4) { --n: 3; }
.steps__line { font: 400 var(--step-d2)/1 var(--font-display); text-transform: uppercase; letter-spacing: -0.005em; }
.steps__text { margin-top: 0.75rem; max-width: 34ch; text-wrap: pretty; }
.job__note { margin-top: clamp(3rem, 6vw, 5rem); max-width: 34ch; text-wrap: pretty; }

/* ---------- contact: display rows ---------- */
.rows { display: grid; }
.row { display: flex; flex-direction: column; justify-content: flex-end; gap: 0.3rem; min-height: clamp(6.5rem, 10.4vw, 9.4rem); padding: 1.1rem var(--margin) 1rem; background: var(--bg); }
.row:nth-child(even) { background: var(--surface); }
.row__big { display: block; width: fit-content; max-width: 100%; font: 400 var(--step-d2)/1 var(--font-display); text-transform: uppercase; letter-spacing: -0.005em; text-decoration: none; }
.row__note { max-width: 44ch; line-height: 1.35; text-wrap: pretty; }
.row--go { background: var(--accent); color: var(--accent-ink); }
.row--go:nth-child(even) { background: var(--accent); }
.row__arrow { display: inline-grid; place-items: center; width: 0.8em; height: 0.8em; margin-left: 0.18em; background: var(--accent-ink); color: var(--accent); vertical-align: 0.02em; transition: transform var(--t-ui) var(--ease-out); }
.row__arrow svg { width: 52%; height: 52%; }
a.row__big { transition: opacity var(--t-hover) ease; }
a.row__big:active { opacity: 0.7; }
.row--go :focus-visible { outline-color: var(--accent-ink); }
@media (hover: hover) and (pointer: fine) { a.row__big:hover .row__arrow { transform: translateX(0.12em); } a.row__big:hover { text-decoration: underline; text-decoration-thickness: 0.05em; text-underline-offset: 0.12em; } }

/* ---------- the close: an invitation over the cropped name ---------- */
.foot { background: var(--ink); color: var(--bg); padding-top: var(--gap-section); display: flex; flex-direction: column; overflow: clip; }
.foot__top { display: grid; gap: 2rem; padding-inline: var(--margin); }
.foot__say { font: 400 var(--step-d2)/0.98 var(--font-display); text-transform: uppercase; letter-spacing: -0.005em; }
.foot__links { display: grid; gap: 0; align-content: start; }
.foot__legal { order: 2; display: grid; gap: 0.4rem 2rem; padding: clamp(3.5rem, 7vw, 6rem) var(--margin) 0; font-size: var(--step-small); line-height: 1.4; }
.foot__legal a { font-weight: 500; text-underline-offset: 0.2em; }
.foot__name { order: 3; padding-inline: var(--margin); margin-top: 0.75rem; font: 400 27.4vw/0.74 var(--font-display); text-transform: uppercase; white-space: nowrap; transform: translateY(20%); }
#foot-name { display: inline-block; }

/* ---------- wide screens: the plan pinned in seven columns, the rest in five ---------- */
@media (min-width: 1024px) {
  :root { --mon: clamp(5rem, 9.6vw, 11.5rem); }
  .tool { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
  .masthead { grid-column: 8 / -1; grid-row: 1; padding-block: 1rem 0; }
  .tool__col { grid-column: 8 / -1; grid-row: 2; padding-top: 2.25rem; padding-bottom: 2.5rem; }
  /* the pinned stage: the plan and its two small corners in one layer, the name's two halves in a second layer over it */
  .tool { --stage-h: max(35rem, calc(100svh - var(--strip-h, 2.75rem))); --pad-r: clamp(0.5rem, 1.6vw, 1.75rem); }
  .band, .mon {
    grid-column: 1 / 8; grid-row: 1 / span 2; position: sticky; top: 0;
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--mon-row) minmax(0, 1fr) var(--mon-row); gap: 0.75rem;
    height: var(--stage-h); margin: 0; padding: var(--margin) var(--pad-r) var(--margin) 0;
  }
  .band { --corner: max(11rem, calc(100% - 3.75 * var(--mon) - 1rem)); z-index: 1; align-items: stretch; background: none; border: 0; }
  .mon { z-index: 2; pointer-events: none; }
  .mon__w { grid-row: 1; }
  .mon__d { grid-row: 3; align-self: end; }
  .plan { grid-column: 1; grid-row: 2; height: auto; }
  .readout { grid-column: 1; grid-row: 1; justify-self: end; align-self: start; text-align: right; width: var(--corner); display: grid; grid-template-columns: minmax(0, 1fr); justify-items: end; }
  .readout__price { font-size: var(--step-lead); white-space: nowrap; }
  .readout__note { margin-top: 0.25rem; }
  .readout__more { display: inline; }
  .stage__foot { grid-column: 1; grid-row: 3; justify-self: start; align-self: end; width: var(--corner); }
  .band .toggle__long { display: inline; }
  .band .toggle__short { display: none; }
  .take h2 { margin-top: 0; }
  .price__row { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
  .price__what { grid-column: 1 / 7; }
  .price__act { grid-column: 9 / -1; }
  .counted__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .rules { grid-column: span 3; }
  .counted__aside { grid-column: span 3; }
  .sheet { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .sheet__head { grid-column: 1 / 4; }
  .sheet__form { grid-column: 4 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps li { padding-left: 0; margin-left: calc(var(--n) * (100% + var(--gutter)) / 6); }
  .row { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 2rem; padding-block: 0 0.9rem; }
  .row__note { text-align: right; max-width: 30ch; padding-bottom: 0.35rem; }
  .foot__top { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
  .foot__say { grid-column: 1 / 9; }
  .foot__act { grid-column: 1 / 9; }
  .foot__links { grid-column: 10 / -1; grid-row: 1 / span 2; }
  .foot__legal { grid-template-columns: 1fr auto; }
}
@media (min-width: 1024px) and (max-height: 599px) { .band, .mon { position: relative; } }
@media (min-width: 1024px) and (max-width: 1179px) { .masthead { font-size: 1rem; } }
@media (min-width: 1024px) and (max-width: 1279px) {
  /* small laptops: the same two columns, with the text blocks given more room */
  .rules, .counted__aside { grid-column: span 6; }
  .sheet__head { grid-column: 1 / -1; }
  .sheet__form { grid-column: 1 / -1; }
}
@media (min-width: 1280px) {
  .readout__est { display: inline; }
  .stage__counts { display: block; margin-top: 0.6rem; font-size: var(--step-small); line-height: 1.35; }
}
@media (min-width: 620px) and (max-width: 1023px) {
  .band { grid-template-rows: clamp(260px, 36svh, 460px) auto; }
}
@media (min-width: 700px) and (max-width: 1023px) {
  .counted__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet__form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls, .take { max-width: 40rem; }
}
@media (max-width: 1023px) {
  /* under a pinned plan the column stays at text sizes: its heading is set in the text face */
  .take h2 { font: 500 var(--step-lead)/1.2 var(--font-text); text-transform: none; letter-spacing: 0; }
}
@media (max-width: 560px) {
  [data-ui].takeoff, [data-ui].takeoff tbody { display: block; }
  [data-ui].takeoff tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.75rem; }
  [data-ui].takeoff .takeoff__group { grid-column: 1 / -1; width: auto; padding: 1.5rem 0 0.2rem; }
  [data-ui].takeoff tbody tr:first-child > .takeoff__item, [data-ui].takeoff tbody tr:first-child > td { padding-top: 0.5rem; }
  [data-ui].takeoff .takeoff__item { grid-column: 1; grid-row: 2 / span 2; }
  [data-ui].takeoff tr:not(:first-child) .takeoff__item { grid-row: 1 / span 2; }
  [data-ui].takeoff .takeoff__qty { grid-column: 2; padding-bottom: 0; }
  [data-ui].takeoff .takeoff__cost { grid-column: 2; width: auto; padding-top: 0; color: var(--muted); }
  [data-ui].takeoff tr.is-picked > .takeoff__cost { color: var(--bg); }
  .ctl__split { grid-template-columns: minmax(0, 1fr); }
  .stepper--inline { max-width: 12rem; }
}

/* ---------- motion: arrivals happen once; the reduced page is the finished page ---------- */
@keyframes line-up { to { transform: none; } }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateY(10px); } }
/* ---------- the same deck, built: a 3D view generated from the count ---------- */
.built { padding-bottom: var(--gap-section); scroll-margin-top: 1rem; }
.built__head { display: grid; gap: 1rem var(--gutter); padding: 0 var(--margin) clamp(1.5rem, 3vw, 2.5rem); }
.built__head h2 { font: 400 var(--step-d2)/0.92 var(--font-display); text-transform: uppercase; letter-spacing: 0.005em; }
.built__lead { font-size: var(--step-lead); line-height: 1.32; max-width: 36ch; text-wrap: pretty; }
.built__stage { position: relative; height: clamp(24rem, 58vw, 86svh); background: #a9bccb; overflow: hidden; }
.built__stage canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 700ms ease; cursor: grab; }
.built__stage canvas:active { cursor: grabbing; }
.built__stage.is-ready canvas { opacity: 1; }
.built__stage canvas:focus-visible { outline: 3px solid var(--ink); outline-offset: -6px; }
.built__wait { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--margin); text-align: center; font: 400 var(--step-head)/1.1 var(--font-display); text-transform: uppercase; color: var(--ink); pointer-events: none; transition: opacity 400ms ease; }
.built__stage.is-ready .built__wait { opacity: 0; }
.built__stage.is-off { background: var(--surface); }
.built__stage.is-off .built__wait { font: 400 var(--step-lead)/1.3 var(--font-text); text-transform: none; max-width: 34ch; margin-inline: auto; }
.built__stage.is-off .built__views, .built__stage.is-off .built__move { display: none; }
.built__views, .built__move { position: absolute; bottom: var(--margin); display: flex; gap: 2px; opacity: 0; transition: opacity 500ms ease 300ms; }
.built__stage.is-ready .built__views, .built__stage.is-ready .built__move { opacity: 1; }
.built__views { left: var(--margin); }
.built__move { right: var(--margin); }
.built__views button, .built__move button {
  min-height: 3rem; padding: 0.5rem 1rem; border: 0; background: var(--bg); color: var(--ink);
  font: 500 1rem/1.2 var(--font-text); white-space: nowrap;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.built__move button { width: 3rem; padding: 0; display: grid; place-items: center; }
.built__move svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 2; }
.built__views button:active, .built__move button:active { transform: scale(0.96); }
.built__views button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.built__views button:disabled { opacity: 0.5; cursor: default; }
.built__stage :focus-visible { outline-color: var(--ink); }
.built__foot { display: grid; gap: 1.75rem var(--gutter); padding: clamp(1.5rem, 3vw, 2.5rem) var(--margin) 0; }
.built__said { display: grid; gap: 0.6rem; align-content: start; }
.built__say { font: 400 var(--step-head)/1.05 var(--font-display); text-transform: uppercase; letter-spacing: 0.005em; max-width: 16ch; text-wrap: balance; }
.built__sub { max-width: 30ch; line-height: 1.35; }
.built__bar { display: grid; gap: 1.5rem var(--gutter); font-size: 1rem; line-height: 1.35; align-items: end; }
.built__sizes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 1rem; }
.built__size { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 3rem; gap: 2px; }
.built__size span { display: flex; gap: 0.3em; align-items: baseline; justify-content: center; background: var(--surface); padding: 0.8rem 0.4rem; white-space: nowrap; }
.built__size b { font-weight: 500; }
.built__toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; }
.built__note { font-size: var(--step-small); line-height: 1.45; color: var(--muted); max-width: 62ch; }
@media (hover: hover) and (pointer: fine) {
  .built__views button:not([aria-pressed="true"]):not(:disabled):hover, .built__move button:hover { background: var(--ink); color: var(--bg); }
}
@media (min-width: 1024px) {
  .built__head { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; }
  .built__head h2 { grid-column: 1 / 8; }
  .built__lead { grid-column: 8 / 13; }
  .built__foot { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .built__said { grid-column: 1 / 5; }
  .built__bar { grid-column: 5 / 13; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .built__note { grid-column: 5 / 13; }
}
@media (max-width: 700px) {
  .built__stage { height: clamp(22rem, 104vw, 70svh); }
  .built__views { right: var(--margin); bottom: calc(var(--margin) + 3rem + 2px); }
  .built__views button { flex: 1; padding-inline: 0.4rem; }
  .built__move { left: var(--margin); }
  .built__move button { width: auto; flex: 1; }
  .built__sizes { grid-template-columns: minmax(0, 1fr); }
}
@media print { .built { display: none; } }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .js:not(.showcase) .mon [data-line] { transform: translateY(108%); animation: line-up 900ms var(--ease-expo) forwards; animation-delay: calc(120ms + var(--i) * 110ms); }
  .js:not(.showcase) [data-load] { opacity: 0; transform: translateY(14px); animation: rise 600ms var(--ease-out) forwards; animation-delay: var(--d); }
  .js:not(.showcase) [data-reveal] [data-line] { transform: translateY(108%); transition: transform 850ms var(--ease-expo) calc(var(--i, 0) * 95ms); }
  .js:not(.showcase) [data-reveal].is-in [data-line] { transform: none; }
  .js:not(.showcase) [data-reveal] [data-rise], .js:not(.showcase) [data-reveal][data-rise] { opacity: 0; transform: translateY(22px); transition: opacity 650ms var(--ease-out) calc(var(--i, 0) * 85ms + 80ms), transform 750ms var(--ease-out) calc(var(--i, 0) * 85ms + 80ms); }
  .js:not(.showcase) [data-reveal].is-in [data-rise], .js:not(.showcase) [data-reveal][data-rise].is-in { opacity: 1; transform: none; }
  .js:not(.showcase) .price__say .price__fig { clip-path: inset(0 100% 0 0); transition: clip-path 800ms var(--ease-in-out) 160ms; }
  .js:not(.showcase) .price__say.is-in .price__fig { clip-path: inset(0); }
  .js:not(.showcase) .takeoff:not(.is-in) tbody { opacity: 0; }
  .js:not(.showcase) .takeoff.is-in:not(.is-done) tbody { animation: row-in 600ms var(--ease-out) both; }
  .js:not(.showcase) .takeoff.is-in:not(.is-done) tbody:nth-of-type(2) { animation-delay: 70ms; }
  .js:not(.showcase) .takeoff.is-in:not(.is-done) tbody:nth-of-type(3) { animation-delay: 140ms; }
  .js:not(.showcase) .takeoff.is-in:not(.is-done) tbody:nth-of-type(4) { animation-delay: 210ms; }
  .js:not(.showcase) .takeoff.is-in:not(.is-done) tbody:nth-of-type(5) { animation-delay: 280ms; }
  .js:not(.showcase) .takeoff.is-in:not(.is-done) tbody:nth-of-type(6) { animation-delay: 350ms; }
  .js:not(.showcase) .foot__name #foot-name { transform: translateY(46%); transition: transform 1200ms var(--ease-expo) 80ms; }
  .js:not(.showcase) .foot__name.is-in #foot-name { transform: none; }
}

/* ---------- print: one page, the plan and the list ---------- */
.paper { display: none; }
@media print {
  @page { size: letter portrait; margin: 12mm; }
  html, body { background: #fff; }
  body > *:not(.paper) { display: none !important; }
  .paper { display: block; color: #000; font: 400 10.5pt/1.35 var(--font-text); }
  .paper__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12pt; }
  .paper__name { font: 400 26pt/1 var(--font-display); text-transform: uppercase; }
  .paper__meta { font-size: 8.5pt; text-align: right; max-width: 60%; }
  .paper__title { font-weight: 500; font-size: 13pt; margin-top: 10pt; }
  .paper__svg { width: 100%; height: auto; margin-top: 6pt; }
  .paper__opts { margin-top: 4pt; }
  .paper__table { width: 100%; border-collapse: collapse; margin-top: 8pt; font-size: 9.5pt; font-variant-numeric: tabular-nums; }
  .paper__table th, .paper__table td { text-align: left; font-weight: 400; padding: 2.4pt 0; border-bottom: 0.5pt solid #999; }
  .paper__table thead th { font-weight: 500; border-bottom: 1pt solid #000; }
  .paper__table td:last-child, .paper__table th:last-child { text-align: right; }
  .paper__range { font-weight: 500; margin-top: 8pt; }
  .paper__law { font-size: 8.5pt; margin-top: 6pt; }
  .paper .p-foot, .paper .p-door { fill: #e6e3dd; }
  .paper .p-note--halo { stroke: #e6e3dd; }
}
