/* The project sheet: answers on the right, a blueprint elevation that draws itself on the left.
   The drawing reacts to the answers with CSS alone (:has), so it works with scripts off. */
.sheet-sec { background: var(--ground); color: var(--pale); --focus: var(--green); position: relative; }
.sheet-sec::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: linear-gradient(rgba(236, 239, 232, .045) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(236, 239, 232, .045) 1px, transparent 1px) 0 0 / 24px 24px; }
.sheet-sec .wrap { position: relative; }
.sheet { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 960px) { .sheet { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: start; } }

.sheet-draw { border: 1px solid var(--rule-dark); background: rgba(14, 16, 14, .72); }
@media (max-width: 959px) { .sheet-draw { position: sticky; top: calc(var(--bar-h) + 7px); z-index: 2; background: #121412; box-shadow: 0 14px 22px -14px rgba(0, 0, 0, .9); } }
@media (min-width: 960px) { .sheet-draw { position: sticky; top: 100px; } }
.sheet-frame { position: relative; padding: 6px 6px 0; }
.dwg { width: 100%; height: auto; overflow: visible; }
.dwg path, .dwg rect, .dwg line { fill: none; stroke-linecap: square; }
.dwg text { font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; fill: var(--pale-dim); stroke: none; }
.dwg .grid-marks path { stroke: rgba(236, 239, 232, .25); stroke-width: 1; }
.dwg .grid-marks text { fill: rgba(236, 239, 232, .45); }
.dwg #hx line { stroke: rgba(236, 239, 232, .5); stroke-width: 1.2; }
.dwg .gl { stroke: var(--pale); stroke-width: 1.6; }
.dwg .et { stroke: rgba(236, 239, 232, .4); stroke-width: 1; }
.dwg .ngl { stroke: rgba(236, 239, 232, .55); stroke-width: 1; stroke-dasharray: 6 4; }
.dwg .cut { fill: url(#hx); stroke: none; }
.dwg .stump { stroke: var(--pale); stroke-width: 2.2; }
.dwg .wt { stroke: #6fb3c9; stroke-width: 1; stroke-dasharray: 10 4 2 4; }
.dwg .gr-coast text:first-of-type { fill: #8cc4d6; }
.dwg .pile { stroke: var(--pale); stroke-width: 1.4; }
.dwg .setout path { stroke: rgba(236, 239, 232, .45); stroke-width: 1; stroke-dasharray: 3 5; }
.dwg .setout .peg { stroke: var(--green); stroke-dasharray: none; stroke-width: 2; }
.dwg .setout text { fill: rgba(236, 239, 232, .55); }
.dwg .h path.dr { stroke: var(--green); stroke-width: 1.8; }
.dwg .h .bat { stroke-width: 1.1; }
.dwg .h text { fill: var(--green); }
.dwg .h .t-ex { fill: var(--pale-dim); }
.dwg .ex { stroke: rgba(236, 239, 232, .62); stroke-width: 1.4; }
.dwg .demo { stroke: rgba(236, 239, 232, .4); stroke-width: 1.2; stroke-dasharray: 5 4; }
.dwg .pw { fill: url(#hx); stroke: var(--green); stroke-width: 1.4; }

/* which ground: level unless sloping or coastal is ticked */
.dwg .gr-slope, .dwg .gr-coast, .dwg .h { display: none; }
.sheet:has([name="block"][value="sloping"]:checked) .gr-level,
.sheet:has([name="block"][value="coastal"]:checked) .gr-level { display: none; }
.sheet:has([name="block"][value="sloping"]:checked) .gr-slope,
.sheet:has([name="block"][value="coastal"]:checked) .gr-coast { display: inline; }
/* which house */
.sheet:has([name="type"]:checked) .setout { display: none; }
.sheet:has([name="type"][value="new-build"]:checked) .h-new,
.sheet:has([name="type"][value="investment"]:checked) .h-new,
.sheet:has([name="type"][value="renovation"]:checked) .h-reno,
.sheet:has([name="type"][value="knockdown"]:checked) .h-kdr,
.sheet:has([name="type"][value="duplex"]:checked) .h-duplex { display: inline; }
/* the legend shows "existing" only when there is something existing */
.sheet-tag { position: absolute; right: 10px; top: 8px; margin: 0; display: flex; gap: 12px; font-size: .625rem; color: var(--pale-dim); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ""; width: 16px; height: 0; border-top: 2px solid var(--green); }
.lg-ex::before { border-top: 1.5px dashed var(--pale-dim); }
.lg-ex { display: none; }
.sheet:has([name="type"][value="renovation"]:checked) .lg-ex,
.sheet:has([name="type"][value="knockdown"]:checked) .lg-ex { display: inline-flex; }

@media (prefers-reduced-motion: no-preference) {
  .dwg .h path.dr { stroke-dasharray: 1; stroke-dashoffset: 1; animation: dwg-draw .9s var(--ease) forwards; }
  .dwg .h path.dr:nth-of-type(2) { animation-delay: .12s; }
  .dwg .h path.dr:nth-of-type(3) { animation-delay: .26s; }
  .dwg .h path.dr:nth-of-type(4) { animation-delay: .38s; }
  .dwg .h path.dr:nth-of-type(5) { animation-delay: .5s; }
  .dwg .h path.dr:nth-of-type(6) { animation-delay: .6s; }
  .dwg .h path.dr:nth-of-type(7) { animation-delay: .7s; }
  .dwg .h path.dr:nth-of-type(8) { animation-delay: .8s; }
  .dwg .h text, .dwg .h .pw, .dwg .h .ex, .dwg .h .demo, .dwg .gr text { animation: dwg-fade .6s .7s ease-out both; }
  .dwg .h .ex, .dwg .h .demo { animation-delay: 0s; }
  .dwg .gr-slope, .dwg .gr-coast { animation: dwg-fade .5s ease-out both; }
}
@keyframes dwg-draw { to { stroke-dashoffset: 0; } }
@keyframes dwg-fade { from { opacity: 0; } }

/* title block: the answers, ruled like a drawing's title block */
.tb { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rule-dark); }
.tb > div { padding: 8px 10px; border-right: 1px solid var(--rule-dark); border-bottom: 1px solid var(--rule-dark); min-width: 0; }
.tb > div:nth-child(2n) { border-right: 0; }
.tb > div:first-child { grid-column: 1 / -1; border-right: 0; }
.tb dt { font-size: .625rem; color: var(--pale-dim); }
.tb dd { margin: 2px 0 0; font-size: .875rem; line-height: 1.3; color: var(--pale); overflow-wrap: anywhere; }
.tb dd.set { color: var(--green); }
@media (min-width: 600px) { .tb { grid-template-columns: repeat(5, minmax(0, 1fr)); } .tb > div, .tb > div:nth-child(2n) { border-right: 1px solid var(--rule-dark); } .tb > div:first-child { grid-column: auto; border-right: 1px solid var(--rule-dark); } .tb > div:last-child { border-right: 0; } }
.tb-foot { margin: 0; display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; font-size: .625rem; color: var(--pale-dim); }
@media (max-width: 959px) { .tb > div:not(:first-child) { display: none; } .tb > div:first-child { border-bottom: 0; } .tb-foot { display: none; } .tb dd { font-size: .8125rem; } .tb > div { padding: 6px 10px 8px; } }

/* the questions */
.q { border: 0; margin: 0; padding: 14px 0 16px; border-top: 1px solid var(--rule-dark); min-width: 0; }
.q legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; display: flex; align-items: baseline; gap: 10px; font-family: var(--display); font-size: 1.0625rem; font-weight: 400; }
.q-no { color: var(--green); }
.q .chips { clear: both; display: flex; flex-wrap: wrap; gap: 7px; }
@media (max-width: 959px) {
  .q { padding: 12px 0 12px; }
  .q legend { margin-bottom: 8px; font-size: 1rem; }
  .q .chips { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(-1 * var(--gut)); padding-right: var(--gut); scrollbar-width: none; }
  .q .chips::-webkit-scrollbar { display: none; }
  .q .chip { flex: none; }
}
.sheet-sec .chip > span { min-height: 42px; padding: 0 13px; border-color: rgba(236, 239, 232, .28); font-size: .875rem; color: var(--pale); }
.sheet-sec .chip:hover > span { border-color: rgba(236, 239, 232, .6); }
.sheet-sec .chip input:checked + span { background: var(--green); border-color: var(--green); color: var(--ink); }

/* matching projects */
.match { padding: 14px 0 6px; border-top: 1px solid var(--rule-dark); }
.match-h { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; color: var(--pale-dim); }
.m { display: none; margin: 0; padding: 0; list-style: none; font-size: .9375rem; color: var(--pale-dim); }
.m li { padding: 5px 0; }
.m a { color: var(--pale); font-weight: 500; margin-right: 6px; }
.m-idle { display: block; }
.sheet:has([name="type"]:checked) .m-idle { display: none; }
.sheet:has([name="type"][value="new-build"]:checked) .m-new-build,
.sheet:has([name="type"][value="investment"]:checked) .m-investment,
.sheet:has([name="type"][value="renovation"]:checked) .m-renovation,
.sheet:has([name="type"][value="knockdown"]:checked) .m-knockdown,
.sheet:has([name="type"][value="duplex"]:checked) .m-duplex,
.sheet:has([name="block"][value="sloping"]:checked) .m-sloping,
.sheet:has([name="block"][value="coastal"]:checked) .m-coastal,
.sheet:has([name="plans"][value="none"]:checked) .m-noplans { display: block; }
/* a project already named by the type list isn't repeated by the block list */
.sheet:has([name="type"][value="new-build"]:checked) .m-sloping,
.sheet:has([name="type"][value="duplex"]:checked) .m-coastal { display: none; }
.m-noplans { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--rule-dark); font-size: .875rem; }

.sheet-send { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 16px; border-top: 1px solid var(--rule-dark); }
.sheet-send .btn { flex: 1 1 100%; }
.sheet-send p { margin: 0; color: var(--pale-dim); }
.sheet-send a { color: var(--pale); }
@media (min-width: 600px) { .sheet-send .btn { flex: 0 1 auto; } }
