/* Loadcalc: the interface borrows a drawing set's vocabulary and nothing else. */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@100,400;100,500;112,600;112,700&display=swap');

:root {
  --paper: #F7F6F2;
  --paper-2: #EFEEE9;
  --ink: #1E2024;
  --ink-2: #4A4D53;
  --rule: #8A8D93;
  --rule-2: #D2D1CC;
  --mark: #C8331F;
  --cold: #3D6FB4;
  --heat: #D9772B;
  --margin: 72px;
  --measure: 720px;
  --wide: 1120px;
  font-family: 'Archivo', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; font-size: 17px; line-height: 1.5; }
h1, h2, h3 { font-stretch: 112%; font-weight: 600; line-height: 1.1; margin: 0 0 .5rem; letter-spacing: -0.005em; }
h1 { font-size: 2.6rem; }
h2 { font-size: 1.6rem; margin-top: 3rem; }
h3 { font-size: 1.15rem; margin-top: 1.75rem; }
p { max-width: var(--measure); margin: 0 0 1rem; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .15em; }
a:hover { text-decoration-color: var(--mark); }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 3px; }

/* frame: a fixed left margin that holds sheet references, like a drawing margin */
.frame { display: grid; grid-template-columns: var(--margin) minmax(0, var(--wide)); padding: 0 24px 96px 0; }
.frame > .m { padding-top: .35rem; text-align: right; padding-right: 16px; color: var(--ink-2); font-size: .8rem; line-height: 1.3; }
.frame > .m.mark { color: var(--mark); }
.frame > .c { min-width: 0; }
.row { display: contents; }

header.top { display: grid; grid-template-columns: var(--margin) 1fr; align-items: baseline; padding: 20px 24px 20px 0; border-bottom: 1px solid var(--ink); margin-bottom: 40px; }
header.top .wordmark { grid-column: 2; font-stretch: 112%; font-weight: 700; font-size: 1.1rem; text-decoration: none; }
header.top nav { grid-column: 2; margin-top: 6px; display: flex; gap: 22px; font-size: .95rem; }
header.top nav a { text-decoration: none; color: var(--ink-2); }
header.top nav a[aria-current] { color: var(--ink); border-bottom: 2px solid var(--mark); }

.lede { font-size: 1.25rem; max-width: 640px; }
.small { font-size: .85rem; color: var(--ink-2); }
.status { border-left: 3px solid var(--mark); padding: .4rem 0 .4rem 14px; margin: 1rem 0 1.5rem; max-width: var(--measure); }
.status.ok { border-left-color: var(--ink); }

/* buttons say what happens */
.btn { display: inline-block; font: inherit; font-weight: 500; background: var(--ink); color: var(--paper); border: 0; padding: .7rem 1.2rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: #000; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.mark { background: var(--mark); }
.btn:disabled { background: var(--rule-2); color: var(--ink-2); cursor: default; }

/* schedules, set like a window schedule */
table.sched { border-collapse: collapse; width: 100%; font-size: .95rem; margin: .5rem 0 1.5rem; }
table.sched th { text-align: left; font-weight: 500; color: var(--ink-2); border-bottom: 1px solid var(--ink); padding: .35rem .6rem .35rem 0; vertical-align: bottom; }
table.sched td { border-bottom: 1px solid var(--rule-2); padding: .45rem .6rem .45rem 0; vertical-align: top; }
table.sched td.n, table.sched th.n { text-align: right; padding-right: 0; padding-left: .6rem; white-space: nowrap; }
table.sched tr.total td { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 500; }
table.sched tr.sel td { background: var(--paper-2); }
table.sched tbody tr[data-room] { cursor: pointer; }

/* forms */
.field { margin: 0 0 1.25rem; max-width: 560px; }
.field label { display: block; font-weight: 500; margin-bottom: .3rem; }
.field input[type=text], .field select { font: inherit; width: 100%; padding: .6rem .7rem; border: 1px solid var(--rule); background: #fff; color: var(--ink); }
.drop { border: 1px dashed var(--rule); padding: 2rem; max-width: 560px; background: #fff; }
.drop strong { display: block; }
.choice { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; padding: .8rem 0; border-bottom: 1px solid var(--rule-2); max-width: var(--measure); }
.choice .q { font-weight: 500; }
.choice .why { color: var(--ink-2); font-size: .9rem; }
.choice select { font: inherit; padding: .4rem .5rem; border: 1px solid var(--rule); background: #fff; min-width: 240px; }

/* plan review: fact beside its sheet crop */
.review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.review .sheet { position: sticky; top: 16px; border: 1px solid var(--rule-2); background: #fff; }
.review .sheet img { display: block; width: 100%; height: auto; }
.review .sheet figcaption { padding: .5rem .7rem; font-size: .85rem; color: var(--ink-2); border-top: 1px solid var(--rule-2); }
.fact { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: .55rem 0; border-bottom: 1px solid var(--rule-2); }
.fact .ref { color: var(--mark); font-size: .85rem; padding-top: .15rem; }
.fact q { quotes: none; color: var(--ink-2); display: block; font-size: .9rem; }

/* the memorable thing: room drawings with walls stroked by their loss */
.rooms { display: flex; flex-wrap: wrap; gap: 28px 28px; margin: 1rem 0 2rem; align-items: flex-end; }
.room { flex: 0 0 auto; }
.room { cursor: pointer; background: transparent; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; }
.room svg { width: auto; max-width: 100%; height: auto; display: block; background: #fff; border: 1px solid var(--rule-2); }
.room.sel svg { border-color: var(--ink); }
.room .cap { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: .4rem; font-size: .9rem; }
.room .cap b { font-weight: 500; }
.room .cap .n { text-align: right; white-space: nowrap; color: var(--ink-2); }
.wall { stroke-linecap: butt; fill: none; }
.glass { fill: #fff; }
.roomfill { fill: #fff; stroke: var(--rule-2); stroke-width: 1; }
.lbl { font-family: 'Archivo', sans-serif; font-size: 11px; fill: var(--ink-2); }
.north { stroke: var(--rule); fill: none; }

.legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-2); margin: .5rem 0 1.5rem; align-items: center; }
.legend i { display: inline-block; width: 28px; height: 0; border-top-style: solid; vertical-align: middle; margin-right: 6px; }

/* mode toggle heating / cooling */
.seg { display: inline-flex; border: 1px solid var(--ink); margin: 0 0 1rem; }
.seg button { font: inherit; background: transparent; border: 0; padding: .45rem .9rem; cursor: pointer; color: var(--ink); }
.seg button[aria-pressed=true] { background: var(--ink); color: var(--paper); }

/* detail panel for the selected room */
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; border-top: 1px solid var(--ink); padding-top: 1.25rem; }
.detail .big { font-stretch: 112%; font-weight: 600; font-size: 2rem; line-height: 1; }
.detail .big small { font-stretch: 100%; font-weight: 400; font-size: .9rem; color: var(--ink-2); margin-left: .5rem; }
.bars { margin: 1rem 0; }
.bar { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; font-size: .9rem; padding: .25rem 0; }
.bar .track { height: 10px; background: var(--paper-2); position: relative; }
.bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.bar.cold .fill { background: var(--cold); }
.bar.heat .fill { background: var(--heat); }
.bar .v { text-align: right; color: var(--ink-2); }

/* swap-a-window: the interaction that earns the $150 */
.swap { border: 1px solid var(--rule-2); background: #fff; padding: 1rem 1.1rem; }
.swap .op { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--rule-2); font-size: .9rem; }
.swap .op:last-of-type { border-bottom: 0; }
.swap select { font: inherit; font-size: .9rem; padding: .3rem .4rem; border: 1px solid var(--rule); background: #fff; }
.delta { margin-top: .8rem; font-size: .95rem; }
.delta b { color: var(--mark); font-weight: 500; }

/* house hourly line */
.hourly { width: 100%; height: auto; display: block; margin: .5rem 0 1rem; }
.hourly path { fill: none; stroke: var(--heat); stroke-width: 2; }
.hourly .ax { stroke: var(--rule-2); stroke-width: 1; }
.hourly text { font-size: 11px; fill: var(--ink-2); font-family: 'Archivo', sans-serif; }

/* chat bar placeholder: visible, honest, not yet */
.ask { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--ink); padding: 12px 24px 14px var(--margin); margin-top: 3rem; display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.ask input { font: inherit; padding: .55rem .7rem; border: 1px solid var(--rule); background: #fff; }
.ask .small { grid-column: 1 / -1; }

/* deliverables */
.files { list-style: none; padding: 0; margin: 0 0 2rem; max-width: var(--measure); }
.files li { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: .7rem 0; border-bottom: 1px solid var(--rule-2); align-items: baseline; }
.files li .small { display: block; }

/* home: the worked example is the trust */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; margin-bottom: 3rem; }
.hero .rooms { gap: 12px; margin: 0; }
.steps { max-width: var(--measure); counter-reset: s; padding: 0; margin: 0 0 2rem; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: .6rem 0; border-bottom: 1px solid var(--rule-2); }
.steps li::before { content: counter(s); color: var(--mark); font-weight: 500; }
.price { font-stretch: 112%; font-weight: 600; font-size: 2rem; line-height: 1; }
.price small { font-stretch: 100%; font-weight: 400; font-size: .9rem; color: var(--ink-2); margin-left: .4rem; }

@media (max-width: 860px) {
  :root { --margin: 20px; }
  .frame { grid-template-columns: 1fr; padding: 0 16px 80px; }
  .frame > .m { text-align: left; padding: 1rem 0 0; }
  header.top { grid-template-columns: 1fr; padding: 16px; }
  header.top .wordmark, header.top nav { grid-column: 1; }
  .review, .detail, .hero { grid-template-columns: 1fr; }
  .review .sheet { position: static; }
  .ask { padding-left: 16px; grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .room svg, .wall, .bar .fill { transition: all .18s ease; }
}
