/* RoofStudio: a quiet, light page that takes the roofer's own two colours (set by js/main.js). */
:root{
  --main:#1f2937; --accent:#d97706; --on-accent:#fff; --on-main:#fff;
  --page:#f6f5f2; --panel:#fff; --line:#e3e1dc; --text:#1c1f24; --muted:#636872; --danger:#b42318;
  --sans:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; --radius:16px;
  color-scheme:light;
}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--page); color:var(--text); font-family:var(--sans); font-size:16px; line-height:1.55; -webkit-font-smoothing:antialiased; min-height:100vh; min-height:100dvh; display:flex; flex-direction:column}
img,canvas{max-width:100%; display:block}
a{color:inherit}
button,input{font:inherit; color:inherit}
button{cursor:pointer}
:focus-visible{outline:3px solid var(--accent); outline-offset:3px; border-radius:6px}
[hidden]{display:none!important}

.top{background:var(--main); color:var(--on-main); padding:14px max(20px,calc((100vw - 1240px) / 2 + 16px)); min-height:64px; display:flex; align-items:center; box-shadow:0 1px 0 rgba(0,0,0,.08)}
.brand{display:inline-flex; align-items:center; text-decoration:none}
.brand img{max-height:40px; width:auto}
.brand-name{font-size:19px; font-weight:700; letter-spacing:.01em}
main{flex:1; width:100%; max-width:1240px; margin:0 auto; padding:24px 16px 48px}
.foot{border-top:1px solid var(--line); padding:16px 20px 24px; color:var(--muted); font-size:13px; text-align:center}
.foot p{margin:6px auto; max-width:70ch}
.foot summary{cursor:pointer; text-decoration:underline; text-underline-offset:3px; list-style:none}
.foot summary::-webkit-details-marker{display:none}
.privacy-link{color:inherit; text-decoration:underline; text-underline-offset:3px}

h1{font-size:clamp(30px,6vw,48px); line-height:1.08; letter-spacing:-.02em; margin:0 0 14px; text-wrap:balance; color:var(--main)}
h2{font-size:22px; line-height:1.2; margin:0 0 10px}
h2.small{font-size:14px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin:18px 0 10px}
.intro{font-size:18px; margin:0 0 20px; max-width:56ch; color:#3a3f47}
.loading,.notice{margin:24px 0; padding:16px 18px; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); max-width:60ch}
.loading:empty{display:none}

.btn{display:inline-flex; gap:8px; align-items:center; justify-content:center; background:var(--accent); color:var(--on-accent); border:2px solid var(--accent); border-radius:999px; font-weight:700; font-size:16px; padding:14px 26px; text-decoration:none; transition:transform .15s,filter .15s}
.btn:hover{filter:brightness(1.06); transform:translateY(-1px)}
.btn[disabled]{opacity:.45; cursor:not-allowed; transform:none; filter:none}
.btn.ghost{background:var(--panel); color:var(--text); border-color:var(--line)}
.btn.ghost:hover{border-color:var(--text); filter:none}
.link{background:none; border:0; padding:0; color:var(--muted); text-decoration:underline; text-underline-offset:3px; font-size:14px; margin-top:18px}
.actions{display:flex; flex-wrap:wrap; gap:10px; margin:0 0 10px}

/* ── The start: text on the left, the roofer's coverings on the right ───────────────────── */
.start{padding-top:12px; display:grid; gap:32px; align-items:center}
.start-copy{max-width:640px}
@media (min-width:960px){.start.with-side{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:48px; padding-top:28px}}
.steps{list-style:none; counter-reset:step; margin:0 0 22px; padding:0; display:grid; gap:10px}
.steps li{counter-increment:step; display:flex; align-items:center; gap:12px; font-weight:600; font-size:15.5px}
.steps li::before{content:counter(step); flex:0 0 28px; height:28px; border-radius:50%; display:grid; place-items:center; background:var(--main); color:var(--on-main); font-size:13.5px; font-weight:700}
.example{margin:0 0 20px}
.example figcaption{margin-top:8px; font-size:13.5px; color:#3a3f47}
.example-credit{color:#6b7078; font-size:12px}
.intro.after{font-size:15.5px; margin:20px 0 4px}
.consent{display:flex; gap:12px; align-items:flex-start; font-size:14.5px; background:var(--panel); border:1.5px solid var(--line); border-radius:12px; padding:13px 14px; margin:0 0 16px; cursor:pointer}
.consent.need{border-color:var(--danger)}
.consent input{flex:0 0 20px; width:20px; height:20px; margin:2px 0 0; accent-color:var(--accent)}
.error{color:var(--danger); font-size:15px; margin:6px 0 0; min-height:1.5em}
.error:empty{min-height:0; margin:0}
.tips{margin:0; padding:0 0 0 20px; color:var(--muted); font-size:15px}
.tips li{margin:3px 0}
.mosaic{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0}
.mosaic figure{margin:0; position:relative; border-radius:14px; overflow:hidden; aspect-ratio:1; box-shadow:0 8px 24px rgba(20,20,20,.12)}
.mosaic img{width:100%; height:100%; object-fit:cover}
.mosaic figcaption{position:absolute; inset:auto 0 0 0; padding:22px 10px 9px; color:#fff; font-size:12.5px; font-weight:600; line-height:1.25; background:linear-gradient(transparent,rgba(0,0,0,.72))}
.mosaic-note{margin:12px 0 0; color:var(--muted); font-size:14px; text-align:center}
@media (max-width:959px){.start-side{order:2}.mosaic{grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px}.mosaic figure{border-radius:10px}.mosaic figcaption{font-size:11px; padding:18px 7px 6px}}

/* ── The photo and the panel beside it ───────────────────────────────────────────────────── */
.work{display:grid; gap:18px; align-items:start}
@media (min-width:960px){
  .work{grid-template-columns:minmax(0,1.55fr) minmax(360px,1fr); gap:24px}
  /* The photo stays in view while the visitor scrolls the panel or fills in the form. */
  .stage-col{position:sticky; top:20px}
}
.stage{position:relative; width:100%; border-radius:var(--radius); overflow:hidden; background:#dedcd6; box-shadow:0 10px 30px rgba(20,20,20,.12); user-select:none; -webkit-user-select:none}
.stage.comparing{touch-action:pan-y; cursor:ew-resize}
.layer{width:100%; height:100%; display:block}
.compare-after{position:absolute; inset:0}
.compare-handle{position:absolute; top:0; bottom:0; width:3px; margin-left:-1.5px; background:#fff; box-shadow:0 0 0 1px rgba(0,0,0,.25)}
.compare-handle::after{content:"‹ ›"; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:44px; height:44px; border-radius:50%; background:#fff; color:#1c1f24; font-weight:700; display:grid; place-items:center; box-shadow:0 2px 10px rgba(0,0,0,.3)}
.compare-play{position:absolute; left:12px; bottom:12px; width:44px; height:44px; border-radius:50%; border:0; background:rgba(17,24,39,.72); color:#fff; cursor:pointer; display:grid; place-items:center; box-shadow:0 2px 10px rgba(0,0,0,.3); padding:0}
.compare-play::before{content:""; width:0; height:0; margin-left:4px; border-style:solid; border-width:8px 0 8px 13px; border-color:transparent transparent transparent #fff}
.comparing.playing .compare-play::before{width:4px; height:16px; margin-left:0; border:0; border-left:4px solid #fff; border-right:4px solid #fff; box-sizing:content-box}
.compare-play:hover{background:rgba(17,24,39,.88)}
.compare-play:focus-visible{outline:3px solid #fff; outline-offset:2px}
.tag{position:absolute; top:12px; background:rgba(17,24,39,.72); color:#fff; font-size:12.5px; font-weight:700; letter-spacing:.04em; padding:5px 10px; border-radius:999px; transition:opacity .2s; pointer-events:none}
.tag.before{left:12px}
.tag.after{right:12px}
.impression{position:absolute; right:12px; bottom:10px; color:#fff; font-size:11.5px; text-shadow:0 1px 3px rgba(0,0,0,.7); pointer-events:none}

.panel{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:20px; box-shadow:0 1px 2px rgba(20,20,20,.04); min-width:0}
.status{margin:0 0 4px; font-size:15.5px; font-weight:600; min-height:1.55em}
.status.bad{color:var(--danger); font-weight:500}
.status.waiting::before{content:""; display:inline-block; width:15px; height:15px; margin-right:10px; vertical-align:-2px; border:2.5px solid var(--line); border-top-color:var(--accent); border-radius:50%; animation:turn .9s linear infinite}
@keyframes turn{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.status.waiting::before{animation-duration:3s}}

/* The coverings: photo tiles with the name on the photo. A strip to swipe on a phone. */
.materials{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px}
.material{position:relative; display:grid; min-width:0; padding:0; overflow:hidden; text-align:left; background:var(--panel); border:2px solid var(--line); border-radius:12px; font-size:13.5px; font-weight:600; line-height:1.25; transition:border-color .15s, box-shadow .15s}
.material img{width:100%; aspect-ratio:16 / 10; object-fit:cover; background:var(--line); transition:transform .3s}
.material:not(.plain) span{position:absolute; inset:auto 0 0 0; padding:20px 10px 8px; color:#fff; background:linear-gradient(transparent,rgba(0,0,0,.75)); text-shadow:0 1px 2px rgba(0,0,0,.4)}
.material.plain{align-content:center; min-height:64px; padding:10px 12px}
.material:hover:not([disabled]){border-color:var(--accent)}
.material:hover:not([disabled]) img{transform:scale(1.04)}
.material[aria-pressed="true"]{border-color:var(--accent); box-shadow:0 0 0 2px var(--accent)}
.material[aria-pressed="true"]::after{content:"✓"; position:absolute; top:7px; right:7px; width:24px; height:24px; border-radius:50%; background:var(--accent); color:var(--on-accent); display:grid; place-items:center; font-size:13px; font-weight:800; box-shadow:0 1px 4px rgba(0,0,0,.3)}
.material[disabled]{opacity:.55; cursor:not-allowed}
.material[disabled][aria-pressed="true"]{opacity:1}
/* Many coverings: on a computer they scroll up and down in a frame of four and a half rows, so the
   half row at the bottom shows there is more. */
.picker{container-type:inline-size}
.picker-hint{margin:-4px 0 10px; color:var(--muted); font-size:13px}
@media (min-width:960px){
  .picker.many .materials{--tile:calc(((100cqw - 16px) / 2 - 4px) * 0.625 + 4px); max-height:calc(var(--tile) * 4.5 + 46px); overflow-y:auto; overscroll-behavior:contain; padding:3px; margin:-3px; scrollbar-width:thin}
}
@media (max-width:959px){
  .materials{display:flex; overflow-x:auto; scroll-snap-type:x mandatory; scroll-padding-inline:16px; gap:10px; margin:0 -20px; padding:2px 20px 10px; scrollbar-width:thin}
  .material{flex:0 0 148px; scroll-snap-align:start}
  .material img{aspect-ratio:4 / 3}
}

/* After a result: the call to action, above the coverings so it is seen at once. */
.contact{margin:12px 0 18px; padding:16px; border-radius:12px; background:color-mix(in srgb,var(--accent) 9%,#fff); border:1px solid color-mix(in srgb,var(--accent) 30%,#fff)}
.contact h2{font-size:19px; margin:0 0 12px}
.contact .actions{margin:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px}
.contact .btn{padding:12px 14px; font-size:15px; text-align:center}
.contact .actions > :first-child{grid-column:1 / -1}
.contact .actions > :last-child:nth-child(2){grid-column:1 / -1}
.note{font-size:13px; color:var(--muted); margin:10px 0 0}
.extra:empty{display:none}

/* Download and share, under the call to action. */
.share{margin-top:12px; padding-top:12px; border-top:1px solid color-mix(in srgb,var(--accent) 25%,#fff)}
.share-buttons{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px}
.share-buttons .btn{padding:10px 12px; font-size:14.5px}
.share-panel{margin-top:12px; padding:14px; background:#fff; border:1px solid var(--line); border-radius:12px; display:grid; gap:10px}
.share-lead{margin:0; font-weight:700}
.share-row{display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px}
.share-row input{min-width:0}
.btn.wa{background:#1fa855; border-color:#1fa855; color:#fff; padding:10px 14px; font-size:14.5px}
.share-links{display:flex; flex-wrap:wrap; gap:8px}
.chip{display:inline-flex; align-items:center; background:var(--page); border:1px solid var(--line); border-radius:999px; padding:7px 14px; font-size:14px; font-weight:600; text-decoration:none; color:var(--text)}
.chip:hover{border-color:var(--text)}
.share-note:empty{display:none}
@media (max-width:420px){.share-row{grid-template-columns:1fr}}

/* The estimate form, in the panel in place of the coverings. */
.back{background:none; border:0; padding:4px 0; margin:0 0 12px; color:var(--muted); font-size:14px; font-weight:600}
.back:hover{color:var(--text)}
.choice{display:flex; align-items:center; gap:12px; padding:10px; margin:0 0 16px; border:1px solid var(--line); border-radius:12px; background:var(--page)}
.choice img{width:84px; aspect-ratio:4 / 3; object-fit:cover; border-radius:8px; flex:0 0 auto}
.choice div{display:grid; gap:2px; min-width:0}
.choice-label{font-size:12px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--muted)}
.choice strong{font-size:15px; line-height:1.3}
.lead{display:grid; gap:14px}
.lead h2{margin:0; font-size:21px}
.lead > .note{margin:-8px 0 0}
.fields{align-items:start; display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr)); gap:12px}
.field{display:grid; gap:5px; align-content:start; font-size:13.5px; font-weight:600}
.field.wide{grid-column:1 / -1}
.field input,.field select,.field textarea{width:100%; font-weight:400; font-size:16px; padding:11px 12px; border:1.5px solid var(--line); border-radius:10px; background:#fff; transition:border-color .15s, box-shadow .15s}
.field input:focus,.field select:focus,.field textarea:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 20%,transparent)}
.field textarea{resize:vertical; min-height:76px}
.field.bad input,.field.bad select,.field.bad textarea{border-color:var(--danger)}
.msg{color:var(--danger); font-size:13px; font-weight:500}
.msg:empty{display:none}
.lead .consent{margin:0; display:grid; grid-template-columns:auto minmax(0,1fr); column-gap:12px; row-gap:6px; font-size:14px}
.lead .consent .msg{grid-column:1 / -1}
.lead .actions{margin:0}
.lead .actions .btn[type=submit]{flex:1 1 auto}
.free{text-align:center; margin:0}
.gate{margin-top:4px}
.gate-intro{margin:0; font-size:15px}
.trap{position:absolute; left:-5000px; width:1px; height:1px; opacity:0}
.lead-done{display:grid; justify-items:center; text-align:center; gap:8px; padding:18px 0 6px}
.lead-done h2{margin:0}
.lead-done p{margin:0 0 8px; color:var(--muted)}
.done-mark{width:52px; height:52px; border-radius:50%; display:grid; place-items:center; background:var(--accent); color:var(--on-accent); font-size:26px; font-weight:800}
.link{display:block}
@media (max-width:600px){
  .start .actions .btn{width:100%}
  .panel{padding:18px 16px}
  .materials{margin:0 -16px; padding:2px 16px 10px}
  .lead .actions{display:grid; grid-template-columns:minmax(0,1fr) auto}
}

/* Another photo: right under the photo, and under a picture that was not shown. */
.photo-again{display:inline-flex; align-items:center; gap:6px; margin-top:12px; padding:9px 16px; border:1px solid var(--line); border-radius:999px; background:var(--panel); color:var(--text); font-size:14px; font-weight:600; cursor:pointer}
.photo-again:hover{border-color:var(--accent)}
.why{margin:-4px 0 12px; color:var(--muted); font-size:13.5px}
.btn.again{margin:0 0 18px}

/* Inside a roofer's own website (embed.js): their site has the header; the page is as tall as what is on it. */
.framed .top{display:none}
.framed main{padding:16px 12px 24px}
.framed body{background:transparent}
.sized body{min-height:0}
.sized .stage-col{position:static}
