/* The wait while a preview is made (painting-wait.js). Uses paper.css tokens only.
   One column on a phone; side by side when its container is wide enough. */
.pw { container-type: inline-size; }
.pw[hidden] { display: none; }
.pw-in { display: grid; gap: 18px; }

/* ---------- The picture: the clip, then the street photo with the clip in its corner ---------- */
.pw-pic { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 6px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.pw-photo, .pw-painted { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease; }
.pw-photo:not([src]), .pw-painted:not([src]) { visibility: hidden; }
.pw.has-photo .pw-photo { opacity: 1; }

/* Painting: the photo drops to a pale grey sketch and the colour comes back across it from the
   left, as a soft painted copy, rests, fades, and starts again. */
.pw-photo { transition: opacity 0.6s ease, filter 1.2s ease; }
.pw.has-photo[data-phase="painting"] .pw-photo { filter: grayscale(1) contrast(0.7) brightness(1.18); }
.pw-painted { filter: saturate(1.3) contrast(0.86) brightness(1.08) blur(0.6px); }
.pw.has-photo[data-phase="painting"] .pw-painted {
    opacity: 1;
    -webkit-mask-image: linear-gradient(100deg, #000 0%, #000 42%, rgba(0, 0, 0, 0.55) 47%, transparent 52%);
    mask-image: linear-gradient(100deg, #000 0%, #000 42%, rgba(0, 0, 0, 0.55) 47%, transparent 52%);
    -webkit-mask-size: 260% 100%;
    mask-size: 260% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    animation: pw-wash 8s ease-in-out infinite;
}
@keyframes pw-wash {
    0%, 8% { -webkit-mask-position: 100% 0; mask-position: 100% 0; opacity: 1; }
    72%, 88% { -webkit-mask-position: 0% 0; mask-position: 0% 0; opacity: 1; }
    100% { -webkit-mask-position: 0% 0; mask-position: 0% 0; opacity: 0; }
}

/* The clip fills the picture until there is a photo of this house; then it fades out. Kept in a
   corner beside the photo, its sample house read as the house being painted. */
.pw-clip { position: absolute; inset: 0; transition: opacity 0.6s ease, visibility 0s linear 0s; }
.pw-clip video { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--surface); }
.pw.has-photo .pw-clip { opacity: 0; visibility: hidden; transition: opacity 0.6s ease, visibility 0s linear 0.6s; }

.pw-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 88px; min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 600 16px/1 var(--text); cursor: pointer; }
.pw-play[hidden] { display: none; }
.pw:not(.is-still) .pw-play { top: auto; bottom: 12px; left: 12px; transform: none; min-width: 72px; background: rgba(27, 26, 23, 0.72); }
.pw.has-photo .pw-play { display: none; }

.pw-tag { position: absolute; left: 10px; top: 10px; max-width: calc(100% - 20px); margin: 0; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.94); font: 500 15px/1.35 var(--text); color: var(--ink); }

/* ---------- The steps and the clock ---------- */
.pw-side { display: grid; gap: 14px; align-content: start; }
/* The steps in a beige panel, as in the boutique screens. */
/* .pw .pw-steps, not .pw-steps: pro-flow.css zeroes padding on `.flow ol`, which outranks one class. */
.pw .pw-steps { display: grid; margin: 0; padding: 4px 16px; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
/* Every part of a row shares one 24px line, so the ring, the step and "Now" sit level. */
.pw-steps li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: start; column-gap: 12px; padding: 12px 0; color: var(--muted); font-size: 17px; line-height: 24px; }
.pw-steps li + li { border-top: 1px solid var(--line); }
.pw-steps[data-only="painting"] li:not([data-step="painting"]) { display: none; }
.pw-label { font-weight: 500; }
.pw-state { font-size: 14px; }
.pw-sub { grid-column: 2; display: none; margin-top: 2px; font-size: 15px; line-height: 1.4; }
.pw-mark { position: relative; width: 16px; height: 16px; margin-top: 4px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--field-line); }
.pw-steps li.is-now { color: var(--ink); }
.pw-steps li.is-now .pw-label { font-weight: 600; }
.pw-steps li.is-now .pw-sub { display: block; color: var(--muted); }
/* The step under way: a ring with a gold arc going round it. */
.pw-steps li.is-now .pw-mark { box-shadow: inset 0 0 0 2px var(--line); }
.pw-steps li.is-now .pw-mark::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--mark); border-right-color: var(--mark); animation: pw-spin 0.9s linear infinite; }
.pw-steps li.is-done { color: var(--ink); }
.pw-steps li.is-done .pw-mark { background: var(--success); box-shadow: none; }
.pw-steps li.is-done .pw-mark::after { content: ""; position: absolute; left: 5.5px; top: 2.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pw-steps li.is-done .pw-state { color: var(--success); font-weight: 500; }
@keyframes pw-spin { to { transform: rotate(360deg); } }

.pw-time { margin: 0; padding-inline: 16px; font-size: 15px; line-height: 1.45; color: var(--muted); font-variant-numeric: tabular-nums; }
.pw-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Wide containers: the picture and the steps side by side. */
@container (min-width: 760px) {
    .pw-in { grid-template-columns: minmax(0, 1fr) 340px; column-gap: 40px; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
    .pw-clip, .pw-photo, .pw-painted { transition: none; }
    .pw.has-photo[data-phase="painting"] .pw-painted { animation: none; -webkit-mask-position: 50% 0; mask-position: 50% 0; }
    .pw-steps li.is-now .pw-mark::after { animation: none; border-color: var(--mark); }
}
