/* Bulk Math concrete calculator.
   The visual language is the jobsite: a cured slab as the page ground, control
   joints between sections, chalk-line blue for anything measured, timber form
   edges on the parts, and a dot-matrix delivery ticket for the result. */

:root {
  --slab: #d6d3cc;        /* cured concrete, the page ground */
  --slab-2: #e3e1db;      /* a lighter trowel pass, for cards */
  --slab-3: #c4c1b9;      /* darker aggregate showing through */
  --wet: #4b5157;         /* wet concrete: structure, secondary text */
  --wet-2: #2b2f33;       /* the hero band, the printer */
  --ink: #16181b;
  --paper: #fbf9f4;       /* ticket paper */
  --paper-2: #efece4;
  --chalk: #1e4fe8;       /* chalk line: dimensions, focus, the active nav item */
  --hivis: #ff5a1f;       /* safety orange: the one loud thing */
  --hivis-2: #d4430f;
  --wood: #b47a3c;
  --wood-2: #7c4f22;
  --line: #b5b2aa;

  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --text: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --pad: clamp(18px, 4vw, 56px);
  --max: 1280px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; color: var(--ink); background: var(--slab);
  font: 400 17px/1.55 var(--text);
  overflow-x: hidden;
}
/* aggregate grain under everything, a surface rather than a photograph */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .2 0 0 0 0 .18 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; height: auto; display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.state-notice { margin: 20px var(--pad); padding: 14px 18px; background: var(--paper); border-left: 4px solid var(--hivis); }
.share-link-fallback { display: block; flex-basis: 100%; min-width: 0; font-size: 14px; }
.share-link-fallback input { display: block; width: 100%; min-width: 0; padding: 8px; }
:focus-visible { outline: 3px solid var(--chalk); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: .95; margin: 0; letter-spacing: .005em; }
h2 { font-size: clamp(34px, 4.4vw, 52px); }
h3 { font-size: 24px; font-weight: 700; }
p { margin: 0 0 1em; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px;
  background: var(--chalk); color: #fff; border-radius: 4px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- header ---------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 40;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px;
  padding: 0 var(--pad); height: 68px;
  background: color-mix(in srgb, var(--wet-2) 94%, transparent);
  color: #f2f1ee; backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 8px 24px -16px rgba(0,0,0,.6);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand__mark { width: 34px; height: 34px; }
.brand__name { font: 900 26px/1 var(--display); letter-spacing: .02em; }

.nav { position: relative; display: flex; gap: 6px; justify-self: center; }
.nav a {
  position: relative; z-index: 1; padding: 10px 14px; color: #d3d2ce; text-decoration: none;
  font-weight: 500; font-size: 15.5px; border-radius: 4px; white-space: nowrap;
  transition: color .2s;
}
.nav a:hover, .nav a.is-on { color: #fff; }
/* the chalk line snaps to whichever section is on screen */
.nav__chalk {
  position: absolute; left: 0; bottom: 4px; height: 2px; width: 0;
  background: var(--chalk); box-shadow: 0 0 6px var(--chalk);
  transition: left .35s var(--ease), width .35s var(--ease);
}

.units { display: inline-flex; padding: 3px; background: rgba(255,255,255,.08); border-radius: 6px; }
.units__b {
  padding: 7px 13px; border: 0; border-radius: 4px; background: transparent; color: #c9c8c3;
  font: 600 15px/1 var(--mono); letter-spacing: .02em; transition: background .2s, color .2s;
}
.units__b.is-on { background: var(--paper); color: var(--ink); }

.menu-btn { display: none; }

/* ---------- hero: the pour, drawn live -------------------------------- */
.hero {
  position: relative; overflow: hidden; color: #f2f1ee;
  background: var(--wet-2);
  display: grid; grid-template-columns: minmax(280px, 5fr) minmax(0, 8fr); align-items: center;
  gap: clamp(8px, 3vw, 40px); padding: clamp(28px, 4vw, 56px) var(--pad) clamp(28px, 4vw, 40px);
  min-height: 560px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("assets/scene.webp") center 40% / cover no-repeat;
  opacity: .16; filter: saturate(.4) contrast(1.1);
  mask-image: linear-gradient(90deg, transparent 0, #000 35%, #000 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 35%, #000 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 80% at 65% 60%, rgba(0,0,0,0) 0, rgba(0,0,0,.35) 100%);
}
.hero__copy { position: relative; z-index: 1; max-width: 32ch; }
.hero h1 { font-size: clamp(56px, 7vw, 96px); letter-spacing: -.005em; text-wrap: balance; }
.lede { font-size: clamp(19px, 2vw, 24px); line-height: 1.35; margin: 18px 0 14px; max-width: 26ch; color: #e7e6e2; }
.hero__note { font: 400 15px/1.45 var(--mono); color: #aeb3b8; margin: 0 0 26px; min-height: 2.9em; }
.hero__go {
  display: inline-block; padding: 14px 22px; border-radius: 6px;
  background: var(--hivis); color: #1a0d05; font-weight: 600; text-decoration: none;
  box-shadow: 0 10px 30px -10px rgba(255,90,31,.7);
  transition: transform .2s var(--ease), background .2s;
}
.hero__go:hover { background: #ff6f3c; transform: translateY(-1px); }

.stage { position: relative; z-index: 1; width: 100%; aspect-ratio: 16 / 9; max-height: 560px; }
.stage__svg { width: 100%; height: 100%; display: block; overflow: visible; }
.stage__tag {
  position: absolute; left: 8%; top: 6%;
  padding: 6px 12px; background: var(--paper); color: var(--ink);
  font: 700 18px/1 var(--display); letter-spacing: .04em; border-radius: 3px;
  box-shadow: 0 6px 18px -8px rgba(0,0,0,.7);
  transform: rotate(-3deg);
}
.st-dims text { font: 600 18px var(--mono); fill: #a9bdff; paint-order: stroke; stroke: rgba(43,47,51,.85); stroke-width: 5px; stroke-linejoin: round; }
.st-dims line, .st-dims path { stroke: var(--chalk); stroke-width: 2; }
.st-dims .tick { stroke: var(--chalk); stroke-width: 1.5; }
.st-truck { transition: transform 1s var(--ease); }
.st-stream__p { stroke-dasharray: 1; stroke-dashoffset: 1; }
.st-stream.is-on .st-stream__p { animation: pour 1.9s var(--ease) forwards; }
@keyframes pour {
  0%   { stroke-dashoffset: 1; opacity: 1; }
  30%  { stroke-dashoffset: 0; }
  70%  { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -1; opacity: 0; }
}
.st-stream.is-off { display: none; }
.st-splash circle { fill: #7c8186; opacity: 0; }
.st-splash.is-on circle { animation: splash .7s ease-out forwards; }
@keyframes splash {
  0%   { opacity: .9; transform: translate(0, 0) scale(.4); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}

/* the load-in: truck arrives, pours, ticket prints. Once. */
.pre-truck .st-truck { transform: translateX(460px); }
.pre-copy .hero__copy > * { opacity: 0; transform: translateY(14px); }
.hero__copy > * { transition: opacity .6s var(--ease), transform .6s var(--ease); }
.hero__copy > *:nth-child(2) { transition-delay: .08s; }
.hero__copy > *:nth-child(3) { transition-delay: .16s; }
.hero__copy > *:nth-child(4) { transition-delay: .24s; }

/* ---------- workbench ------------------------------------------------- */
.work {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: clamp(24px, 4vw, 64px); align-items: start;
  max-width: var(--max); margin: 0 auto; padding: clamp(36px, 5vw, 72px) var(--pad) 40px;
}
.parts__head { max-width: 56ch; margin-bottom: 26px; }
.parts__head p { color: var(--wet); margin: 10px 0 0; }

.part-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.part {
  position: relative; background: var(--slab-2);
  border-radius: 3px 3px 6px 6px;
  box-shadow: 0 1px 0 #fff inset, 0 14px 30px -22px rgba(0,0,0,.6);
  transition: box-shadow .25s, transform .3s var(--ease);
}
.part.is-active { box-shadow: 0 1px 0 #fff inset, 0 0 0 2px var(--chalk), 0 18px 34px -22px rgba(0,0,0,.6); }
.part.is-new { animation: setform .45s var(--ease); }
@keyframes setform { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
/* the timber form board along the top of every part */
.part__edge {
  height: 9px; border-radius: 3px 3px 0 0;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 2px, transparent 2px 9px, rgba(255,255,255,.12) 9px 11px, transparent 11px 23px),
    linear-gradient(180deg, var(--wood), var(--wood-2));
  box-shadow: 0 2px 3px rgba(0,0,0,.25);
}
.part__head { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 14px; align-items: center; padding: 14px 18px 4px; }
.part__icon { width: 64px; height: 44px; }
.part__title { min-width: 0; }
.part__name {
  display: block; width: 100%; border: 0; background: transparent; padding: 2px 0;
  font: 700 26px/1 var(--display); letter-spacing: .02em; color: var(--ink);
  border-bottom: 2px dashed transparent;
}
.part__name:hover { border-bottom-color: var(--line); }
.part__name:focus-visible { outline: none; border-bottom-color: var(--chalk); }
.part__kind { display: block; font-size: 13.5px; color: var(--wet); }
.part__vol { font: 700 24px/1 var(--display); color: var(--ink); white-space: nowrap; }
.part__kill {
  border: 0; background: transparent; color: var(--wet); font-size: 14px; padding: 6px 8px; border-radius: 4px;
}
.part__kill:hover { background: rgba(0,0,0,.06); color: var(--hivis-2); }

.dims { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 16px; padding: 12px 18px 20px; }
.dim { display: grid; gap: 6px; }
.dim > span:first-child { font-size: 14px; font-weight: 500; color: var(--wet); }
.dim__row { display: flex; gap: 8px; }
.pair { position: relative; flex: 1; display: flex; align-items: center; min-width: 0; }
.pair--in { flex: .8; }
.pair input {
  width: 100%; min-width: 0; padding: 10px 40px 10px 12px;
  border: 1.5px solid var(--line); border-radius: 5px; background: #fff;
  font-weight: 600; font-size: 19px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield;
}
.pair input::-webkit-outer-spin-button, .pair input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pair input:focus { border-color: var(--chalk); box-shadow: 0 0 0 3px rgba(30,79,232,.18); outline: none; }
.pair em { position: absolute; right: 12px; font: 400 14px var(--mono); color: var(--wet); pointer-events: none; }

.add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 22px 0 34px; }
.add__label { font-weight: 600; margin-right: 6px; }
.add__b {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 10px;
  border: 1.5px dashed var(--wet); border-radius: 6px; background: transparent;
  font-weight: 600; font-size: 15px; transition: background .15s, border-color .15s, transform .15s var(--ease);
}
.add__b svg { width: 40px; height: 28px; }
.add__b:hover { background: #fff; border-style: solid; border-color: var(--ink); transform: translateY(-1px); }

.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px 22px; padding-top: 28px; border-top: 2px solid var(--slab-3); }
.field label { display: block; font-weight: 600; margin-bottom: 8px; }
.input {
  display: flex; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 5px;
  padding: 0 4px 0 12px; transition: border-color .15s, box-shadow .15s;
}
.input:focus-within { border-color: var(--chalk); box-shadow: 0 0 0 3px rgba(30,79,232,.18); }
.input input { flex: 1; min-width: 0; width: 60px; border: 0; padding: 10px 6px; font-weight: 600; font-size: 19px; background: transparent; -moz-appearance: textfield; }
.input input::-webkit-outer-spin-button, .input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input input:focus { outline: none; }
.input__unit { font: 400 14px var(--mono); color: var(--wet); padding-right: 8px; white-space: nowrap; }
.input__select, .inline select {
  border: 0; background: var(--slab-2); border-radius: 4px; padding: 6px 8px; font: 600 14px var(--mono);
}
.hint { font-size: 14px; color: var(--wet); margin: 8px 0 0; line-height: 1.45; }
.inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; color: var(--ink); margin-right: 8px; }

/* ---------- the ticket ------------------------------------------------ */
.ticket-col { position: sticky; top: 84px; }
.printer {
  position: relative; z-index: 2; height: 26px; margin: 0 -10px;
  background: linear-gradient(180deg, #3a3f44, var(--wet-2));
  border-radius: 8px 8px 3px 3px; box-shadow: 0 8px 14px -8px rgba(0,0,0,.8);
}
.printer__slot { position: absolute; left: 22px; right: 22px; bottom: 5px; height: 5px; background: #0d0f11; border-radius: 3px; box-shadow: 0 1px 0 rgba(255,255,255,.08); }
.ticket-clip { overflow: hidden; margin: 0 -14px; padding: 0 14px 44px; }
.ticket {
  position: relative; background: var(--paper); color: var(--ink); padding: 22px 24px 8px;
  font-family: var(--mono); font-size: 14.5px; line-height: 1.5;
  box-shadow: 0 30px 50px -30px rgba(0,0,0,.7), 0 2px 0 rgba(0,0,0,.05);
  background-image: repeating-linear-gradient(0deg, transparent 0 24px, rgba(0,0,0,.025) 24px 25px);
  transform-origin: top center;
  transition: transform 1s var(--ease);
}
.pre-ticket .ticket { transform: translateY(-104%); }
.ticket-col.is-printing::after { content: none; }
.ticket__head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; letter-spacing: .08em; font-size: 13px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.ticket__meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--wet); padding: 8px 0 4px; }
.total { padding: 12px 0 8px; border-bottom: 1px dashed var(--line); }
.total__n {
  display: block; font: 900 clamp(64px, 6vw, 84px)/.9 var(--display); letter-spacing: -.01em; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.total.is-fresh .total__n { animation: reprint .5s var(--ease); }
@keyframes reprint { 0% { color: var(--hivis); } 100% { color: var(--ink); } }
.total__u { display: block; font-size: 13px; color: var(--wet); margin-top: 6px; }

.lines { margin: 8px 0; padding: 0; }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.line dt { color: var(--wet); white-space: nowrap; }
.line dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.line--sum { font-weight: 600; border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 7px; }
.line--alt { color: var(--wet); font-size: 13px; }

.items { margin: 6px 0 10px; padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); font-size: 13px; }
.items .line dt { color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items .line dd { white-space: nowrap; }
.items .line dt small { color: var(--wet); }

.loads { padding: 6px 0 4px; }
.loads__row { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0 2px; }
.loads__k { color: var(--wet); }
.loads__v { font: 700 22px/1 var(--display); }
.trucks { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; padding: 4px 0 8px; }
.trucks svg { width: 62px; height: 30px; }
.trucks .trk-body { fill: #cfcbc2; }
.trucks .trk-fill { fill: var(--wet); }
.bags { display: grid; grid-template-columns: repeat(auto-fill, minmax(12px, 1fr)); gap: 3px; padding: 4px 0 10px; min-height: 14px; }
.bags i { display: block; height: 14px; background: #c9a37a; border-radius: 2px; border-bottom: 3px solid var(--hivis); }
.bags i.is-ghost { background: transparent; border: 1px dashed var(--line); }
.bags__more { grid-column: 1 / -1; font-size: 12px; color: var(--wet); }

.cost { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 12px 0; border-top: 1px dashed var(--line); }
.cost__col { display: grid; gap: 2px; }
.cost__k { color: var(--wet); font-size: 13px; }
.cost__v { font: 900 34px/1 var(--display); font-variant-numeric: tabular-nums; }
.cost__col.is-best .cost__v { color: var(--hivis-2); }
.cost__d { font-size: 12.5px; color: var(--wet); }
.verdict { font-family: var(--text); font-size: 15px; line-height: 1.45; padding: 4px 0 12px; margin: 0; border-top: 1px dashed var(--line); padding-top: 12px; }
.verdict b { color: var(--hivis-2); }

.ticket__acts { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0 18px; }
.btn {
  flex: 1; padding: 12px 14px; border-radius: 5px; border: 1.5px solid var(--ink);
  background: transparent; font: 600 15px var(--text); transition: transform .15s var(--ease), background .15s;
}
.btn:hover { transform: translateY(-1px); background: #fff; }
.btn--go { background: var(--ink); color: #fff; }
.btn--go:hover { background: #000; }
/* the tear-off perforation */
.ticket__tear {
  height: 14px; margin: 0 -24px -8px;
  background: radial-gradient(circle at 8px 14px, var(--slab) 6px, transparent 6.5px) 0 0 / 22px 14px repeat-x;
}

/* ---------- prose ----------------------------------------------------- */
.prose { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) 40px; }
.prose__s { padding: clamp(36px, 5vw, 64px) 0; max-width: 72ch; }
.prose__s h2 { margin-bottom: 22px; }
.prose__s p { color: #2f3439; }
.prose__s--split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: center; max-width: 100%; }
.prose__s--split > div { max-width: 62ch; }
.barrow { width: 300px; filter: drop-shadow(0 24px 24px rgba(0,0,0,.28)); }
/* a control joint: a saw cut in the slab, not a hairline */
.joint { height: 7px; background: linear-gradient(180deg, #a09d95, #8c8981 60%, #b9b6ae); box-shadow: inset 0 3px 3px rgba(0,0,0,.35), 0 1px 0 #f0eee9; border-radius: 2px; }

.formula {
  font-family: var(--mono); font-size: 16px; background: var(--slab-2); padding: 14px 18px; border-radius: 4px;
  border-left: 5px solid var(--chalk); margin: 18px 0 20px; color: var(--ink) !important;
}
.formula span { color: var(--chalk); }
.shapes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 22px; }
.shape { background: var(--slab-2); padding: 14px 16px; border-top: 4px solid var(--wood); }
.shape h3 { font-size: 22px; margin-bottom: 4px; }
.shape p { font-family: var(--mono); font-size: 14px; margin: 0; }

.yield-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; align-items: start; }
.yield { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.yield th, .yield td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.yield th { font-size: 14px; color: var(--wet); font-weight: 600; }
.yield td:first-child { font-weight: 600; }
.bagfig { margin: 0; }
.bagfig img { width: 170px; margin: 0 auto 12px; filter: drop-shadow(0 18px 16px rgba(0,0,0,.28)); }
.bagfig figcaption { font-size: 14px; color: var(--wet); line-height: 1.45; }

details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 700 24px/1 var(--display); color: var(--wet); transition: transform .25s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0 0 16px; max-width: 62ch; }

.foot { max-width: var(--max); margin: 0 auto; padding: 30px var(--pad) 120px; color: var(--wet); font-size: 14.5px; border-top: 2px solid var(--slab-3); }
.foot__small { margin: 0; font-size: 13px; }

/* ---------- mobile dock ---------------------------------------------- */
.dock {
  display: none; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
  grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px; padding: 12px 16px;
  background: var(--paper); color: var(--ink); border: 0; border-radius: 6px; text-align: left;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.6); font-family: var(--mono);
}
.dock__n { font: 900 30px/1 var(--display); }
.dock__u { font-size: 13px; color: var(--wet); }
.dock__b { font-size: 13px; }

.sheet { display: none; }

/* ---------- responsive ------------------------------------------------ */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 8px; min-height: 0; }
  .hero__copy { max-width: 46ch; }
  .stage { max-height: none; }
}
@media (max-width: 900px) {
  .work { grid-template-columns: 1fr; }
  .ticket-col { position: static; }
  .dock { display: grid; }
  .prose__s--split { grid-template-columns: 1fr; }
  .barrow { width: 220px; }
  .yield-wrap { grid-template-columns: 1fr; }
  .bagfig { display: flex; gap: 18px; align-items: center; }
  .bagfig img { width: 110px; margin: 0; }
}
/* ten calculators in one row: tighter on ordinary laptops, a menu below that */
@media (max-width: 1440px) {
  .nav { gap: 2px; }
  .nav a { padding: 10px 9px; font-size: 14.5px; }
}
@media (max-width: 1200px) {
  .top { grid-template-columns: auto 1fr auto; gap: 12px; height: 60px; }
  .top__right .saved-link { display: none; }
  .top .nav .saved-link { display: block; border: 0; border-radius: 0; border-top: 1px solid rgba(255,255,255,.14); margin-top: 6px; padding-top: 14px; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 10px; justify-self: end;
    border: 0; background: transparent; color: #f2f1ee; padding: 8px; font-weight: 600;
  }
  .menu-btn__bar { display: block; width: 22px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
  .menu-btn__label { font-size: 14px; }
  .nav {
    position: absolute; left: 0; right: 0; top: 60px; flex-direction: column; gap: 0; justify-self: stretch;
    background: var(--wet-2); padding: 8px 12px 14px; transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .25s var(--ease); box-shadow: 0 20px 30px -20px rgba(0,0,0,.8);
  }
  .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 12px 10px; font-size: 17px; }
  .nav__chalk { display: none; }
  .units { order: 3; }
  .units__b { padding: 6px 9px; font-size: 13px; white-space: nowrap; }
}
@media (max-width: 760px) {
  .hero h1 { font-size: clamp(56px, 16vw, 84px); }
  .part__head { grid-template-columns: 48px 1fr auto; }
  .part__icon { width: 48px; height: 34px; }
  .part__kill { grid-column: 1 / -1; justify-self: end; }
  .ticket { padding: 18px 16px 6px; }
  .ticket__tear { margin: 0 -16px -6px; }
}

@media (max-width: 440px) {
  .top { gap: 8px; }
  .brand { gap: 7px; }
  .brand__name { font-size: 24px; }
  .menu-btn { gap: 0; }
  .menu-btn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

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

/* ---------- print: only the ticket and the measured parts ------------- */
@media print {
  body { background: #fff; }
  body::before, .top, .hero, .parts, .prose, .foot, .dock, .printer, .ticket__acts, .ticket__tear, .trucks, .bags { display: none !important; }
  .work { display: block; padding: 0; }
  .ticket-clip { overflow: visible; margin: 0; padding: 0; }
  .ticket { box-shadow: none; transform: none !important; padding: 0; }
  .sheet { display: block; margin-top: 20px; font-family: var(--mono); font-size: 13px; }
  .sheet table { border-collapse: collapse; width: 100%; }
  .sheet th, .sheet td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #999; }
}

/* ── material pages: the few pieces the concrete page has no use for ──── */
.part__name-static { display: block; font: 700 20px/1.2 var(--display); color: var(--ink); }
.part__kill { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--wet); cursor: pointer; padding: 0 4px; }
.part__kill:hover { color: var(--hivis-2); }
.sheet__tot { font-size: 15px; }
.sheet__fine { color: #444; }
.prose__s--more .more { display: flex; flex-wrap: wrap; gap: 12px; }
.prose__s--more .add__b { text-decoration: none; padding: 12px 18px; }
.prose__s--more .add__b small { display: block; font-weight: 400; font-size: 13px; color: var(--wet); }
/* links: the page has its own palette, so nothing should arrive in browser blue */
.prose a, .foot a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
.prose a:hover, .foot a:hover { color: var(--hivis-2); text-decoration-color: currentColor; }
.prose__s--more .add__b { color: var(--ink); text-decoration: none; }
.prose__s--more .add__b span > small { color: var(--wet); }
.prose__s--more .add__b:hover { color: var(--ink); border-color: var(--ink); }
.dock.is-away { transform: translateY(110%); pointer-events: none; }
.dock { transition: transform .22s var(--ease); }

/* ── saved projects ───────────────────────────────────────────────────── */
/* The browser's own [hidden] rule loses to any class that sets display, so
   say it here once, above everything that toggles with the attribute. */
[hidden] { display: none !important; }
/* a plain input, for text rather than the numeric measurement fields */
.input--plain { display: block; width: 100%; padding: 10px 12px; font: 500 16px var(--text); color: var(--ink); }
textarea.input--plain { resize: vertical; min-height: 76px; line-height: 1.45; }

.save-panel {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  padding: 20px; background: rgba(22,24,27,.55); backdrop-filter: blur(2px);
}
.save-panel__box {
  width: min(460px, 100%); max-height: 92vh; overflow: auto;
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: 8px;
  padding: 24px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.7);
}
.save-panel__box h2 { font: 900 30px/1 var(--display); margin: 0 0 16px; }
.save-panel .field { display: block; margin-bottom: 14px; }
.save-panel .field > span { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.save-panel .field small { font-weight: 400; color: var(--wet); }
.save-panel__where { font-size: 13px; line-height: 1.5; color: var(--wet); margin: 0 0 14px; }
.save-panel__err {
  margin: 0 0 14px; padding: 10px 12px; border-left: 3px solid var(--hivis-2);
  background: rgba(255,90,31,.1); font-size: 14px;
}
.save-panel__acts { display: flex; gap: 10px; flex-wrap: wrap; }

.editing {
  margin: 0; padding: 10px var(--pad); background: var(--wood); color: #fff;
  font-size: 14px; font-weight: 500;
}
.editing a { color: #fff; }
.editing__dirty { color: #ffd9c7; font-weight: 600; }

.work--single { display: block; }
/* a working page, not a landing page: the band introduces the list and stops */
.hero--plain {
  display: block; min-height: 0; overflow: visible;
  padding: clamp(22px, 3vw, 34px) var(--pad) clamp(20px, 2.5vw, 28px);
}
.hero--plain::before, .hero--plain::after { display: none; }
.hero--plain h1 { font-size: clamp(40px, 6vw, 62px); margin: 0 0 6px; }
.hero--plain .lede { max-width: 52ch; margin: 0; font-size: clamp(16px, 1.4vw, 19px); }
.hero__note {
  margin: 12px 0 0; font-family: var(--mono); font-size: 13px; color: #c9c8c3;
  padding-left: 12px; border-left: 2px solid var(--hivis);
}
.proj { padding-top: 26px; }

/* already inside .work, so it shares that container's edges exactly */
.proj { padding: 0 0 40px; }
.proj__bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.proj__bar h2 { font: 900 28px/1 var(--display); margin: 0; }
.proj__count { color: var(--wet); font-family: var(--mono); font-size: 16px; font-weight: 400; }
.proj__acts { display: flex; gap: 10px; }
.proj__acts .btn { flex: 0 0 auto; }
.proj__msg { margin: 0 0 16px; padding: 10px 12px; border-left: 3px solid var(--chalk); background: rgba(30,79,232,.08); font-size: 14px; }
.proj__empty { padding: 28px; background: var(--slab-2); border: 1.5px dashed var(--line); border-radius: 8px; color: var(--wet); }

.proj__card {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: start;
  padding: 18px 20px; margin-bottom: 12px;
  background: var(--slab-2); border: 1.5px solid var(--line); border-radius: 8px;
}
.proj__name { font: 700 21px/1.2 var(--display); margin: 0 0 4px; letter-spacing: .01em; }
.proj__meta { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--wet); }
.proj__notes { margin: 8px 0 0; font-size: 14px; color: var(--wet); max-width: 62ch; }
.proj__figs { text-align: right; font-family: var(--mono); }
.proj__figs b { display: block; font: 900 30px/1 var(--display); }
.proj__figs span { display: block; font-size: 12px; color: var(--wet); }
.proj__cost { font-size: 15px !important; color: var(--ink) !important; margin-top: 4px; }
.proj__row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.proj__row .btn { flex: 0 0 auto; padding: 8px 12px; font-size: 14px; text-decoration: none; color: var(--ink); }
.proj__row .btn--go { color: #fff; }
.btn--warn { border-color: var(--hivis-2); color: var(--hivis-2); }
.btn--warn[data-armed] { background: var(--hivis-2); color: #fff; }
.proj__rename { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.proj__rename .input--plain { flex: 1 1 200px; }
.proj__rename .btn { flex: 0 0 auto; padding: 8px 12px; font-size: 14px; }

/* three actions no longer fit one row: the print button, the primary, takes
   its own line and the two secondary ones share the next */
.ticket__acts { flex-wrap: wrap; }
.ticket__acts #print { flex-basis: 100%; }
.save-panel a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
.save-panel a:hover { color: var(--hivis-2); }

/* the header link to saved work: a destination, not another calculator */
.saved-link {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  border: 1.5px solid rgba(255,255,255,.28); border-radius: 6px;
  color: #f2f1ee; text-decoration: none; font: 600 14px var(--text); white-space: nowrap;
}
.saved-link:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.saved-link.is-on { border-color: var(--hivis); }
.top__right { display: inline-flex; align-items: center; gap: 12px; }
.nav .saved-link { display: none; }

/* ── the printed document ─────────────────────────────────────────────── */
.doc-head { display: none; }
.doc-foot { display: none; }

@media print {
  .proj, .work--single .hero, .editing, .save-panel, .top__right { display: none !important; }
  .doc-head { display: block; margin-bottom: 14px; }
  .doc-head__brand {
    display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
    padding-bottom: 6px; margin-bottom: 12px; border-bottom: 2px solid #000;
  }
  .doc-head__name { font: 900 22px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
  .doc-head__site { font: 900 26px/1 var(--display); letter-spacing: .02em; }
  .doc-head__row { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; }
  .doc-foot__made { margin: 14px 0 0 !important; font-family: var(--mono); font-size: 11px; color: #444; }
  .doc-head__job { font: 900 30px/1.05 var(--display); margin: 0 0 4px; }
  .doc-head__line { margin: 0; font-family: var(--mono); font-size: 12px; color: #333; }
  .doc-head__qr { flex: 0 0 auto; width: 108px; text-align: center; }
  .doc-head__qr svg { width: 100px; height: 100px; display: block; margin: 0 auto 4px; }
  .doc-head__qr span { font-family: var(--mono); font-size: 9px; color: #444; line-height: 1.3; display: block; }
  .doc-head__qr--none { width: 150px; text-align: right; }
  .doc-foot { display: block; margin-top: 16px; padding-top: 12px; border-top: 1px solid #999; }
  .doc-foot h3 { font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 4px; }
  .doc-foot p { margin: 0 0 10px; font-size: 12px; line-height: 1.5; }
  .doc-foot__scope { display: flex; gap: 28px; }
  .doc-foot__scope > div { flex: 1; }
  /* printing one saved estimate: only that document goes on the paper */
  .printing-saved #sheet-print { display: block; }
  .printing-saved .doc-head { display: block; }
  .printing-saved .prose, .printing-saved .foot { display: none !important; }
}

/* ── reference pages ──────────────────────────────────────────────────── */
.prose__date { font-family: var(--mono); font-size: 13px; color: var(--wet); margin: 0 0 8px; }
.contact__mail { font: 700 clamp(22px, 3vw, 30px)/1.2 var(--display); letter-spacing: .01em; }
.foot__legal { margin: 8px 0 0; font-size: 13px; color: var(--wet); }
.foot__legal a { color: inherit; }
