/* For homeowners: the cutaway, its part panel, the example estimate, ordering, delivery and paying, FAQ.
   Built on site.css. The drawing is ink linework on the illustration-only colors (--soil, --lawn,
   --water, --water-deep); the selected part and its label are the only red. */

/* ---------- hero: headline above ground, the cutaway full width ---------- */
.hw-hero { padding-bottom: var(--section); }
.hw-head { padding-top: clamp(36px, 4.6vw, 68px); }
.hw-head h1 { font-size: var(--h1-page); line-height: 1.02; letter-spacing: -0.026em; max-width: 14em; }
.hw-sub { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 48px; margin-top: 18px; }
.hw-sub .lead { margin-top: 0; max-width: 37em; font-size: clamp(17px, 1.4vw, 19px); }

.hw-scene { position: relative; margin-top: clamp(4px, 1vw, 16px); }
.scene-svg {
  display: block; width: 100%; height: auto;
  /* Past 2000px wide the drawing has to grow taller too, or the roof and treetops get cut off */
  aspect-ratio: 1240 / 500; max-height: max(500px, 25vw);
  overflow: hidden; user-select: none; -webkit-user-select: none;
}
.scene-core { transform: translate(-16px, 0); }

/* The drawing. Outlines keep one weight at any size, like the product drawings. */
.scene-svg .soil { fill: var(--soil); }
.scene-svg .lawn { fill: var(--lawn); }
.scene-svg .grade,
.scene-svg .ol,
.scene-svg .w,
.scene-svg .s,
.scene-svg .leaf { stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.scene-svg .grade, .scene-svg .ol { fill: none; }
.scene-svg .w, .scene-svg .fw, .scene-svg .knob { fill: var(--white); }
.scene-svg .s, .scene-svg .fs { fill: var(--stone-2); }
.scene-svg .leaf { fill: var(--lawn); }
.scene-svg .k { fill: none; stroke: var(--ink); stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.scene-svg .i, .scene-svg .cut { fill: var(--ink); }
.scene-svg .drive { fill: var(--grey); }
.scene-svg .peb circle { fill: var(--stone-2); stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.scene-svg .grate { fill: none; stroke: var(--white); stroke-width: 2; stroke-dasharray: 3 3; }
.scene-svg .wet-fill { fill: var(--water); }
.scene-svg .water-line { fill: none; stroke: var(--water-deep); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.scene-svg .sludge { fill: var(--soil); stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.scene-svg .slot { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 8 12; }
.scene-svg .slot-side { stroke-width: 3; stroke-dasharray: none; }
.scene-svg .slot-storm { stroke-width: 3; stroke-dasharray: 10 14; }
.scene-svg .slot.wet { stroke: var(--water-deep); }
.scene-svg .pipe-o { fill: none; stroke: var(--ink); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.scene-svg .pipe-i { fill: none; stroke: var(--white); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.scene-svg .pipe-o.spout { stroke-width: 9; }
.scene-svg .pipe-i.spout { stroke-width: 6; }
.scene-svg .water { fill: none; stroke: var(--water-deep); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 1 2; stroke-dashoffset: 0; }
.scene-svg .seep path { fill: none; stroke: var(--water-deep); stroke-width: 3; stroke-linecap: round; }
.scene-svg .seep .far { opacity: 0.5; }

/* The one moving moment: water runs from the house, through the tank, out to the pools. Once. */
@media (prefers-reduced-motion: no-preference) {
  .scene-svg .w-a { animation: hw-flow 1.1s cubic-bezier(0.4, 0, 0.6, 1) 0.8s both; }
  .scene-svg .w-b { animation: hw-flow 0.7s linear 2.4s both; }
  .scene-svg .w-c1 { animation: hw-flow 0.5s linear 3.1s both; }
  .scene-svg .w-c2 { animation: hw-flow 2.1s linear 3.1s both; }
  .scene-svg .wet-1 { animation: hw-wet 1.4s ease 3.55s both; }
  .scene-svg .wet-2 { animation: hw-wet 1.4s ease 5.1s both; }
  .scene-svg .seep-1 { animation: hw-fade 1.6s ease 4.1s both; }
  .scene-svg .seep-2 { animation: hw-fade 1.6s ease 5.6s both; }
}
@keyframes hw-flow { from { stroke-dashoffset: 1.1; } to { stroke-dashoffset: 0; } }
@keyframes hw-wet { from { stroke: var(--ink); } to { stroke: var(--water-deep); } }
@keyframes hw-fade { from { opacity: 0; } to { opacity: 1; } }

/* Selection (red) and hover (dashed ink) outlines, and the tap areas */
.hl { opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.hl use { fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.hl.is-hover { opacity: 1; }
.hl.is-hover:not(.is-on) use { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 4; }
.hl.is-on { opacity: 1; }
.hit use { fill: transparent; stroke: transparent; stroke-width: 16; cursor: pointer; }

/* Labels with leader lines: the hotspots on wider screens */
.tag { cursor: pointer; }
.tag:focus { outline: none; }
.tag-line { fill: none; stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.tag-dot { fill: var(--ink); }
.tag-box { fill: var(--white); stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tag-text { fill: var(--ink); font-family: var(--sans); font-size: 16px; font-weight: 600; dominant-baseline: central; pointer-events: none; }
.tag:hover .tag-box { stroke-width: 2.5; }
.tag.is-on .tag-box { stroke: var(--red); stroke-width: 3; }
.tag.is-on .tag-line { stroke: var(--red); stroke-width: 1.6; }
.tag.is-on .tag-dot { fill: var(--red); }
.tag-focus { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; opacity: 0; }
.tag:focus-visible .tag-focus { opacity: 1; }

/* Part buttons replace the labels on narrow screens */
.hw-chips { display: none; }
.hw-chips button {
  min-height: 44px; padding: 8px 14px;
  border: 1.5px solid var(--rule-strong); border-radius: 0; background: var(--white);
  font-size: 15px; line-height: 1.2; cursor: pointer;
}
.hw-chips button:hover { border-color: var(--ink); }
.hw-chips button[aria-pressed="true"] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); font-weight: 600; }

/* ---------- the part panel, under the drawing ---------- */
.part {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 32px var(--gap-wide);
  padding-top: clamp(32px, 3.6vw, 52px);
  scroll-margin-top: calc(var(--head-h) + 16px);
}
.part:focus { outline: none; }
.part-about h2 { font-size: var(--h2); line-height: 1.06; letter-spacing: -0.02em; }
.part-what { margin-top: 16px; font-size: clamp(17px, 1.35vw, 19px); max-width: 30em; }
.part-fact { margin-top: 12px; color: var(--grey); font-size: var(--fs-small); max-width: 32em; }

.part-sheets { list-style: none; margin-top: 28px; display: grid; gap: 18px; }
.part-sheets li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0 16px; align-items: start; }
.sheet-thumb img { width: 64px; height: auto; border: 1px solid var(--rule); background: var(--white); }
.sheet-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.sheet-name { font-weight: 600; line-height: 1.35; }
.sheet-meta { font-size: var(--fs-fine); color: var(--grey); }
.sheet-pdf { margin-top: 6px; font-size: var(--fs-fine); }
.part-more { margin-top: 24px; }

.part-prices { min-width: 0; }
.part-prices.is-multi { columns: 2 280px; column-gap: 40px; }
.pgroup { break-inside: avoid; padding-bottom: 28px; }
.pgroup:last-child { padding-bottom: 0; }
.pgroup h3 { margin-bottom: 6px; font-size: 17px; }
.ptable tbody th, .ptable tbody td { padding-block: 9px; vertical-align: middle; }
.ptable tbody th { font-weight: 500; }
.ptable .row-add { width: 1%; text-align: right; padding-left: 14px; }
.row-detail { display: block; font-size: 14.5px; font-weight: 400; color: var(--grey); line-height: 1.4; }
.pnote { break-inside: avoid; margin-top: 4px; }
.hw-note { margin-top: 28px; }

/* ---------- the example estimate ---------- */
.est-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap) var(--gap-wide); align-items: start; }
/* The choices stay in view beside the list, but only on screens tall enough to show all of them,
   town message included (the form is up to about 710px tall); otherwise the town feedback hides. */
@media (min-width: 1081px) and (min-height: 820px) {
  .est-form { position: sticky; top: calc(var(--head-h) + 24px); }
}
.est-opt + .est-opt { margin-top: 28px; }
.est-help { margin-top: 10px; color: var(--grey); font-size: var(--fs-small); max-width: 34em; }
.est-town input { max-width: 360px; }
.est-town .est-help[data-state="zone"], .est-town .est-help[data-state="line"], .est-town .est-help[data-state="unknown"] { color: var(--ink); }

.est-list { padding: clamp(20px, 3vw, 40px); background: var(--white); }
.est-list h3 { font-family: var(--display); font-weight: 500; font-size: clamp(22px, 2vw, 27px); letter-spacing: -0.01em; }
.mini { width: 100%; height: auto; margin: 18px 0 10px; }
.mini .m-soil { fill: var(--soil); }
.mini .m-lawn { fill: var(--lawn); }
.mini .m-k { fill: none; stroke: var(--ink); stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.mini .m-w { fill: var(--white); stroke: var(--ink); stroke-width: 1.1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mini .m-ol { fill: none; stroke: var(--ink); stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.mini .m-air { fill: var(--white); }
.mini .m-s { fill: var(--stone-2); }
.mini .m-i { fill: var(--ink); }
.mini .m-water { fill: var(--water); }
.mini .m-pipe { fill: none; stroke: var(--water-deep); stroke-width: 2.5; stroke-linecap: round; }
.mini .m-slot { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 4 6; }

.est-table { margin-top: 8px; }
.est-table tbody th { font-weight: 500; }
.est-table .est-qty { width: 3.2em; text-align: left; font-weight: 600; }
.est-table thead .est-qty { font-weight: 500; }
.est-table .est-qty + th, .est-table .est-qty + td { padding-left: 0; }

.est-totals { margin: 6px 0 0; }
.t-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; }
.t-row dt { min-width: 0; }
.t-row dd { margin: 0; font-weight: 600; white-space: nowrap; }
.t-sub { display: block; font-size: var(--fs-fine); color: var(--grey); }
.t-total { margin-top: 6px; padding-top: 16px; border-top: 1.5px solid var(--ink); align-items: center; }
.t-total dt { font-weight: 600; }
.t-total dd { font-family: var(--display); font-weight: 500; font-size: clamp(34px, 3vw, 46px); line-height: 1; letter-spacing: -0.02em; }
.est-calm { margin-top: 20px; }
.est-calm p + p { margin-top: 8px; color: var(--grey); }
.est-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 24px; }
.est-added { font-weight: 600; }
.est-added a { margin-left: 4px; white-space: nowrap; }

/* ---------- ordering: a real sequence ---------- */
.order-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--gap) var(--gap-wide); align-items: center; }
.steps { list-style: none; counter-reset: step; border-top: 1px solid var(--ink); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px 0; padding: 22px 0 24px; border-bottom: 1px solid var(--rule); }
.steps li::before { content: counter(step); grid-row: span 2; font: 500 40px/0.9 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.steps h3 { font-size: var(--h3); line-height: 1.3; }
.steps p { max-width: 36em; }
.order-photo img { aspect-ratio: 4 / 3; }

/* ---------- delivery and paying ---------- */
.zone-rates { list-style: none; margin-top: 24px; border-top: 1px solid var(--ink); }
.zone-rates li { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 2px 16px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: var(--fs-small); }
.z-name { font-weight: 600; white-space: nowrap; }
.z-area { color: var(--grey); }
.z-price { font-weight: 600; text-align: right; }
.pay-grid .actions { margin-top: 24px; }
.terms { list-style: none; margin-top: 20px; display: grid; gap: 12px; max-width: 30em; }
.terms li { position: relative; padding-left: 22px; }
.terms li::before { content: ""; position: absolute; left: 1px; top: 0.6em; width: 7px; height: 7px; background: var(--ink); }
.pay-grid .fine { margin-top: 20px; }

/* A phone number in running text never breaks across lines */
#main a[data-phone] { white-space: nowrap; }

/* ---------- FAQ ---------- */
.faq-side .lead a { color: var(--ink); font-weight: 600; }
.faq-side .status { margin-top: 14px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1080px) {
  .part, .est-grid, .order-grid { grid-template-columns: minmax(0, 1fr); }
  .pay-grid { row-gap: clamp(56px, 9vw, 80px); }
  .order-photo { max-width: 640px; }
}
@media (max-width: 1000px) {
  /* No labels to make room for: crop tighter and centre the system, parts as buttons below */
  .scene-svg { aspect-ratio: 1040 / 460; }  /* the script trims the viewBox to match */
  .scene-core { transform: translate(97px, 0); }
  .tags { display: none; }
  .hw-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 18px; }
  .part { padding-top: 28px; }
}
@media (max-width: 720px) {
  .hw-sub .btn { width: 100%; }
  .part-prices.is-multi { columns: auto; }
  .zone-rates li { grid-template-columns: minmax(0, 1fr) auto; }
  .z-area { grid-column: 1 / -1; grid-row: 2; }
  .steps li { grid-template-columns: 48px minmax(0, 1fr); }
  .steps li::before { font-size: 32px; }
  .est-actions .btn { width: 100%; }
}
