/* build.css: DRAW YOUR LINE. An app shell: a fixed top (back, count, progress), a scrolling middle (question, answers),
   a fixed bottom where YOUR DRAWING is the big thing and the money hides behind a dropdown until you ask for it. */
[hidden] { display: none !important; }
.bar { display: none; }            /* the tool has its own top: back, count, close */
.lamp { display: none; }

.tool { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; height: 100svh; max-width: 860px; margin-inline: auto; padding: 0; }
body { overflow: hidden; }
body[data-phase="draw"], body[data-phase="done"] { overflow: auto; }

/* ---------- top: back, count, the progress rule ---------- */
.toolhead { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px var(--gut) 10px; background: none; }
.toolhead .yline { display: none; }
.stepcount { justify-self: center; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--dim); }
.backb { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--light); font: inherit; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; cursor: pointer; padding: 10px 8px 10px 0; min-height: 44px; }
.backb i { width: 9px; height: 9px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.backb:disabled { opacity: .22; cursor: default; }
.exitb { background: none; border: 0; color: var(--dim); font: inherit; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; cursor: pointer; padding: 10px 0; min-height: 44px; }
.prog { display: block; height: 2px; background: rgba(244,242,238,.14); margin: 0 var(--gut); }
.prog i { display: block; height: 100%; background: var(--silver); transform-origin: left; transform: scaleX(0); transition: transform .45s var(--ease); }

/* ---------- middle: the question and its answers ---------- */
.qwrap { min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: safe center; padding: clamp(14px, 2.6vh, 28px) var(--gut); -webkit-overflow-scrolling: touch; }
.qsheet { background: none; box-shadow: none; padding: 0; color: var(--light); display: grid; gap: clamp(12px, 2vh, 20px); align-content: start; opacity: 0; transform: translateY(10px); }
.qsheet::after { display: none; }
.qsheet .num { display: none; }
.qsheet.in { animation: qin .34s var(--ease) forwards; }
@keyframes qin { to { opacity: 1; transform: none; } }
.qh { margin: 0 0 -4px; font-size: clamp(27px, 6.6vw, 40px); font-weight: 300; line-height: 1.08; letter-spacing: -.012em; max-width: 16ch; }
.qhint { margin: 0; font-size: 12.5px; color: var(--dim); letter-spacing: .01em; }

/* answers: real cards, thumb sized, obviously tappable, readable in one glance */
.opts { display: grid; gap: 9px; }
.opt { position: relative; text-align: left; background: rgba(244,242,238,.07); border: 1px solid rgba(244,242,238,.17); border-radius: 2px; padding: 17px 58px 17px 20px; min-height: 70px; align-content: center; cursor: pointer; font: inherit; color: var(--light); display: grid; gap: 4px; transition: background .16s var(--ease), border-color .16s var(--ease), transform .12s var(--ease); }
.opt b { font-weight: 400; font-size: 19px; line-height: 1.2; letter-spacing: -.005em; }
.opt span { font-size: 13px; line-height: 1.35; letter-spacing: 0; text-transform: none; color: rgba(244,242,238,.52); }
.opt::after { content: ''; position: absolute; right: 20px; top: 50%; width: 21px; height: 21px; margin-top: -11px; border: 1.5px solid rgba(244,242,238,.32); border-radius: 50%; transition: background .16s, border-color .16s, box-shadow .16s; }
.opts.multi .opt::after { border-radius: 2px; }
.opt:hover { background: rgba(244,242,238,.1); border-color: rgba(244,242,238,.34); }
.opt:active { transform: scale(.985); }
.opt.on { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.opt.on span { color: rgba(23,24,26,.6); }
.opt.on::after { background: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 3.5px var(--paper); }
.opts.multi .opt.on::after { box-shadow: none; background: var(--ink); }

/* the style question: photo cards, two up, no sideways scrolling */
.opts.tiles { grid-template-columns: 1fr 1fr; gap: 9px; }
.opt.tile { padding: 0; min-height: 0; background: rgba(244,242,238,.04); border: 1px solid rgba(244,242,238,.17); overflow: clip; display: grid; grid-template-rows: auto auto; gap: 0; }
.opt.tile::after { content: ''; position: absolute; right: 9px; top: 9px; width: 20px; height: 20px; margin: 0; border-radius: 50%; border: 1.5px solid rgba(244,242,238,.85); background: none; box-shadow: 0 1px 6px rgba(0,0,0,.55); }
.opt.tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.opt.tile b { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; padding: 11px 11px 12px; color: var(--light); }
.opt.tile.on { background: var(--paper); border-color: var(--paper); }
.opt.tile.on b { color: var(--ink); }
.opt.tile.on::after { background: var(--paper); border-color: var(--paper); box-shadow: inset 0 0 0 4px var(--ink); }

/* the size question */
.sizer { display: grid; gap: 12px; }
.sizer output { font-family: var(--sten); font-weight: 800; font-size: clamp(46px, 14vw, 76px); letter-spacing: .01em; line-height: 1; color: var(--light); }
.sizer input[type=range] { width: 100%; appearance: none; background: none; height: 48px; cursor: pointer; }
.sizer input[type=range]::-webkit-slider-runnable-track { height: 3px; background: rgba(244,242,238,.3); }
.sizer input[type=range]::-moz-range-track { height: 3px; background: rgba(244,242,238,.3); }
.sizer input[type=range]::-webkit-slider-thumb { appearance: none; width: 32px; height: 32px; border-radius: 50%; background: var(--paper); margin-top: -15px; }
.sizer input[type=range]::-moz-range-thumb { border: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--paper); }
.sizer .ends { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }

/* ---------- bottom: THE DRAWING is the hero, the money is a dropdown ---------- */
.qnav { display: grid; gap: 0; padding: 0 0 env(safe-area-inset-bottom); border-top: 1px solid rgba(244,242,238,.12); background: #191b1e; }
.drawbox { position: relative; padding: 8px var(--gut) 2px; }
.drawbox .drawtag { position: absolute; left: var(--gut); top: 12px; font-size: 9.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--dim); }
.navline { display: block; width: 100%; height: clamp(74px, 11.5vh, 116px); color: var(--silver); }
.navline svg { width: 100%; height: 100%; overflow: visible; }
.drawbox.lit .navline { animation: litline .6s var(--ease); }
@keyframes litline { 0% { color: var(--paper); filter: drop-shadow(0 0 10px rgba(244,242,238,.45)); } 100% { color: var(--silver); filter: none; } }

.estpop { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 12px var(--gut) 14px; border-top: 1px solid rgba(244,242,238,.1); animation: qin .22s var(--ease) forwards; }
.estpop span { display: grid; gap: 3px; min-width: 0; }
.estpop span.wide { grid-column: 1 / -1; }
.estpop em { font-style: normal; font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--dim); }
.estpop b { font-weight: 400; font-size: 15px; color: var(--light); }
.estpop span.wide b { font-family: var(--sten); font-weight: 800; font-size: clamp(19px, 5.4vw, 26px); letter-spacing: 0; }

.navrow { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px var(--gut) 12px; }
.costb { display: inline-flex; align-items: center; gap: 9px; background: none; border: 1px solid rgba(244,242,238,.2); color: var(--light); font: inherit; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; cursor: pointer; padding: 0 16px; min-height: 54px; transition: border-color .16s var(--ease), background .16s var(--ease); }
.costb:hover { border-color: rgba(244,242,238,.4); background: rgba(244,242,238,.05); }
.costb i { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .22s var(--ease); }
.costb.open i { transform: rotate(-135deg) translate(-3px, -3px); }
.nextb { background: var(--paper); color: var(--ink); border: 0; font: inherit; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; padding: 0 18px; white-space: nowrap; min-height: 54px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .16s var(--ease); }
.nextb:active { transform: scale(.985); }
.nextb i { width: 9px; height: 9px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); }
.ghost { display: none; }

/* ---------- drawing, and the designs you flip through ---------- */
.stageb { padding: 0 var(--gut); }
.drawing { display: flex; align-items: center; justify-content: center; gap: 16px; color: var(--silver); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; padding: 64px 0; }
.drawing i { width: 80px; height: 1px; background: var(--silver); transform-origin: left; animation: drawpulse 1.4s var(--ease) infinite; }
@keyframes drawpulse { 0% { transform: scaleX(0); opacity: .3; } 60% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: .2; } }

.contact { display: grid; gap: 10px; padding-top: 12px; }
.bigwrap { position: relative; overflow: clip; background: #101216; }
.bigwrap img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.bigwrap.working::after { content: 'Drawing'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(16,18,22,.72); color: var(--silver); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; animation: pulsefade 1.2s ease-in-out infinite; }
@keyframes pulsefade { 50% { opacity: .45; } }
.flip { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 64px; display: grid; place-items: center; background: rgba(16,18,22,.55); backdrop-filter: blur(4px); border: 0; cursor: pointer; color: var(--paper); transition: background .16s, opacity .16s; }
.flip:hover { background: rgba(16,18,22,.8); }
.flip.prev { left: 0; } .flip.nxt { right: 0; }
.flip i { width: 11px; height: 11px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }
.flip.prev i { transform: rotate(45deg) translate(1px, -1px); }
.flip.nxt i { transform: rotate(-135deg) translate(1px, -1px); }
.flip:disabled { opacity: 0; pointer-events: none; }
.bigwrap.solo .flip { display: none; }

.takecap { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin: 0; }
.takecap b { font-weight: 400; font-size: 17px; color: var(--light); }
.takecap em { font-style: normal; font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }

.frames { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.frame { position: relative; padding: 0; background: none; border: 0; cursor: pointer; }
.frame img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; filter: brightness(.5); transition: filter .2s; }
.frame.on img, .frame:hover img { filter: none; }
.frame.on { outline: 2px solid var(--paper); outline-offset: -2px; }
.frame em { position: absolute; left: 6px; bottom: 4px; font-style: normal; font-size: 9px; letter-spacing: .2em; color: var(--light); text-shadow: 0 1px 3px rgba(0,0,0,.9); }

/* the button he could not find: full width, paper, says what it will do */
.againb { display: grid; gap: 4px; justify-items: center; width: 100%; background: var(--paper); color: var(--ink); border: 0; font: inherit; padding: 15px 18px 16px; cursor: pointer; transition: transform .16s var(--ease), opacity .16s; }
.againb span { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; }
.againb em { font-style: normal; font-size: 12.5px; color: rgba(23,24,26,.58); letter-spacing: 0; text-transform: none; }
.againb:active { transform: scale(.99); }
.againb:disabled { background: none; border: 1px solid rgba(244,242,238,.18); color: var(--light); cursor: default; }
.againb:disabled em { color: var(--dim); }

/* ---------- the estimate ---------- */
.req { display: grid; gap: 18px; margin: 20px var(--gut) 40px; }
.reqhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 1px solid var(--ink); padding-bottom: 14px; }
.reqhead h2 { font-size: clamp(26px, 6vw, 38px); }
.reqmark { width: 108px; height: auto; color: var(--ink); opacity: .5; }
.reqmeta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reqmeta em { display: block; font-style: normal; font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--dimp); }
.reqmeta b { font-weight: 400; }
.lines { display: grid; }
.li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dotted var(--rulep); opacity: 0; animation: lin .4s var(--ease) forwards; animation-delay: calc(var(--i) * 80ms); }
.li em { font-style: normal; color: var(--dimp); font-size: 14px; }
.li b { font-weight: 400; font-variant-numeric: tabular-nums; text-align: right; }
@keyframes lin { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-top: 1px solid var(--ink); padding-top: 12px; }
.total em { font-style: normal; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--dimp); }
.total b { font-family: var(--sten); font-weight: 800; font-size: clamp(22px, 6vw, 34px); text-align: right; }
.stamp { justify-self: stretch; text-align: center; background: none; border: 2px solid var(--red); color: var(--red); font-family: var(--sten); font-weight: 800; font-size: clamp(18px, 5vw, 24px); letter-spacing: .08em; text-transform: uppercase; padding: 14px 18px 12px; cursor: pointer; transform: rotate(-1deg); transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease); }
.stamp:hover { transform: rotate(-1deg) scale(1.02); background: var(--red); color: var(--paper); }
.cform { display: grid; gap: 14px; }
.cform label { display: grid; gap: 6px; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--dimp); }
.cform input { font: inherit; font-size: 16px; text-transform: none; letter-spacing: 0; background: none; border: 0; border-bottom: 1px solid var(--rulep); padding: 10px 0; color: var(--ink); }
.cform .two { display: grid; gap: 14px; }
.cok { display: grid; gap: 8px; } .cok .stencil { font-size: clamp(28px, 7vw, 44px); }
.err { color: var(--red); margin: 0; }

/* once it is drawing, the questions and the foot go, but the way out never does */
body[data-phase="draw"] .qwrap, body[data-phase="draw"] .qnav, body[data-phase="draw"] .prog,
body[data-phase="done"] .qwrap, body[data-phase="done"] .qnav, body[data-phase="done"] .prog { display: none; }
body[data-phase="draw"] .stepcount, body[data-phase="done"] .stepcount { display: none; }
body[data-phase="draw"] .tool, body[data-phase="done"] .tool { height: auto; min-height: 100svh; grid-template-rows: auto auto 1fr; }
body[data-phase="draw"] .toolhead, body[data-phase="done"] .toolhead {
  position: sticky; top: 0; z-index: 40; background: rgba(27,29,32,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(244,242,238,.12); grid-template-columns: auto 1fr auto; padding: 10px var(--gut);
}
.toolhead .where { display: none; justify-self: center; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
body[data-phase="done"] .toolhead .where { display: block; }

/* and the estimate ends with the plain ways on */
.reqouts { display: grid; gap: 10px; padding-top: 6px; border-top: 1px solid var(--rulep); }
.reqouts b { font-weight: 400; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--dimp); }
.reqouts .row { display: flex; flex-wrap: wrap; gap: 10px; }
.outb { background: none; border: 1px solid var(--rulep); color: var(--ink); font: inherit; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; padding: 0 16px; min-height: 48px; display: inline-flex; align-items: center; cursor: pointer; transition: background .16s var(--ease), border-color .16s var(--ease); }
.outb:hover { background: var(--paper2); border-color: var(--ink); }

@media (min-width: 760px) {
  .opts.tiles { grid-template-columns: repeat(3, 1fr); }
  .estpop { grid-template-columns: repeat(3, 1fr); }
  .estpop span.wide { grid-column: auto; }
  .reqmeta { grid-template-columns: repeat(3, 1fr); }
  .cform .two { grid-template-columns: 1fr 1fr; }
  .stamp { justify-self: start; }
  .navrow { grid-template-columns: auto 1fr auto; }
  .navrow .nextb { grid-column: 3; justify-self: end; min-width: 200px; }
  .againb { justify-self: start; width: auto; min-width: 380px; }
}
@media (prefers-reduced-motion: reduce) { .qsheet, .li, .estpop { opacity: 1; animation: none; transform: none; } .drawing i, .bigwrap.working::after { animation: none; } }
