/* Live scan (Phase D). Loads after studio.css and uses its tokens: ink, bone, signal, Instrument
   Serif, JetBrains Mono labels, hairlines, square corners. The red pen is the teardown's pen. */

.ls-form { max-width: 980px; }
.ls-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; }
.ls-field { display: grid; gap: 10px; }
.ls-go { min-width: 17ch; justify-content: center; }
.ls-busy .ls-go { cursor: progress; }
.ls-busy .ls-go .arr { animation: ls-nudge 1.1s var(--ease) infinite; }
@keyframes ls-nudge { 50% { transform: translateX(5px); } }
.ls-fine { margin-top: 14px; max-width: 62ch; font-size: 13px; line-height: 1.5; color: var(--bone-3); }
.ls-nojs { display: none; margin-top: 10px; font-size: 14.5px; color: var(--bone-2); }
.no-js .ls-nojs { display: block; }

/* alert: same family as the inquiry form's error summary */
.ls-alert:empty { display: none; }
.ls-alert { margin-top: 28px; max-width: 980px; padding: 18px 20px; border: 1px solid var(--signal); background: rgba(230, 57, 70, 0.08); }
.ls-alert-msg { font: 400 22px/1.25 var(--serif); color: var(--bone); max-width: 52ch; }
.ls-alert-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.ls-alert-actions .btn { min-height: 46px; }

/* progress: a proof ledger that fills in line by line */
.ls-steps:empty { display: none; }
.ls-steps { margin-top: 36px; max-width: 980px; border-top: 1px solid var(--line); }
.ls-steps li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--bone-3); font-size: 15px; }
.ls-i, .ls-t { font: 500 10.5px/1 var(--mono); letter-spacing: 0.16em; color: var(--bone-3); }
.ls-t { font-variant-numeric: tabular-nums; }
.ls-steps li.is-done { color: var(--bone-2); }
.ls-steps li.is-now { color: var(--bone); }
.ls-steps li.is-now .ls-i { color: var(--signal); }
.ls-steps li.is-now .ls-i::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; background: var(--signal); vertical-align: 1px; animation: ls-blink 1s steps(2, start) infinite; }
@keyframes ls-blink { to { visibility: hidden; } }

/* result: the phone on the left with the red pen, the proof on the right */
.ls-result { display: grid; gap: clamp(32px, 5vw, 96px); margin-top: clamp(44px, 5vw, 72px); max-width: 880px; }
.ls-result.has-shot { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); max-width: none; align-items: start; }
.ls-result[hidden], .ls-stage[hidden], .ls-cta[hidden] { display: none; }
.ls-stage { position: relative; min-width: 0; }
.ls-phone { width: clamp(240px, 21vw, 320px); }
.ls-screen {
  overflow: hidden; border: 1px solid var(--line-2); border-radius: 26px; padding: 9px; background: #050506;
  box-shadow: 0 60px 140px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.ls-screen img { width: 100%; height: auto; border-radius: 18px; background: #fff; }
.ls-phone figcaption { margin-top: 16px; max-width: 34ch; }
.ls-ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ls-ink path { fill: none; stroke: var(--signal); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ls-ink .pen { stroke-dasharray: var(--len, 1200); transition: stroke-dashoffset 900ms var(--ease); }
.ls-notes { position: absolute; inset: 0; pointer-events: none; }
.ls-hand { position: absolute; max-width: 210px; font: italic 400 clamp(22px, 1.9vw, 30px)/1.02 var(--serif); color: var(--bone); transform: rotate(var(--rot, -3deg)); animation: ls-in 600ms var(--ease) both; }
.ls-notes.is-under { position: static; display: grid; gap: 8px; margin-top: 18px; }
.ls-notes.is-under .ls-hand { position: static; max-width: none; transform: none; padding-left: 14px; border-left: 2px solid var(--signal); }
@keyframes ls-in { from { opacity: 0; transform: translateY(6px) rotate(var(--rot, -3deg)); } }

.ls-proof { display: grid; gap: 28px; align-content: start; min-width: 0; }
.ls-h { font: 400 clamp(32px, 3.2vw, 52px)/1.02 var(--serif); letter-spacing: -0.01em; text-wrap: balance; }
.ls-h:focus, .ls-h:focus-visible { outline: none; } /* focused by script to announce the result; not a control */
.ls-findings:empty { display: none; }
.ls-findings { border-top: 1px solid var(--line); counter-reset: lsf; }
.ls-findings li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); counter-increment: lsf; animation: ls-in 500ms var(--ease) both; }
.ls-findings li::before { content: "F." counter(lsf, decimal-leading-zero); font: 500 11px/1 var(--mono); letter-spacing: 0.14em; color: var(--signal); }
.ls-findings b { font: 400 21px/1.3 var(--serif); color: var(--bone); }
/* the measured number gets the red pen: underlined, never red text on ink (contrast) */
.ls-findings em { font-style: normal; text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-skip-ink: none; }

.ls-ledger:empty { display: none; }
.ls-ledger { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; border-top: 1px solid var(--line); margin: 0; }
.ls-ledger div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ls-ledger dt { font: 500 10.5px/1.6 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--bone-3); }
.ls-ledger dd { margin: 0; font-size: 14.5px; color: var(--bone); text-align: right; font-variant-numeric: tabular-nums; }
.ls-ledger .is-bad dt::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 10px; background: var(--signal); vertical-align: 1px; }
.ls-ledger .is-bad dd { color: #ff8a93; }
.ls-cta { display: grid; gap: 12px; justify-items: start; }

@media (max-width: 980px) {
  .ls-result.has-shot { grid-template-columns: 1fr; }
  .ls-phone { width: min(300px, 70vw); }
}
@media (max-width: 640px) {
  .ls-row { grid-template-columns: 1fr; }
  .ls-go { width: 100%; }
  .ls-ledger { grid-template-columns: 1fr; }
  .ls-findings li { grid-template-columns: 44px 1fr; }
  .ls-findings b { font-size: 19px; }
  .ls-cta .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .ls-hand, .ls-findings li { animation: none; }
  .ls-busy .ls-go .arr, .ls-steps li.is-now .ls-i::after { animation: none; }
  .ls-ink .pen { transition: none; }
}
.still .ls-hand, .still .ls-findings li, .still .ls-busy .ls-go .arr, .still .ls-steps li.is-now .ls-i::after { animation: none; }
.still .ls-ink .pen { transition: none; }
@media print { .ls-form, .ls-alert, .ls-steps, .ls-cta { display: none; } }

/* ---- the rebuild sketch inside the phone (2.5) ---- */
.ls-screen { position: relative; container-type: inline-size; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.ls-after { position: absolute; inset: 0; overflow: hidden; border-radius: 18px; font-size: 3.6cqi; }
.ls-result.has-rebuild .ls-screen img[hidden] + .ls-after { position: relative; aspect-ratio: 412 / 823; }
.ls-after .ta { height: 100%; grid-template-rows: auto 1fr auto; }
.ls-after .ta-body { grid-template-columns: 1fr; align-content: end; }
.ls-after .ta-copy { padding: 1em 1.3em 1.3em; }
.ls-after .ta-copy h3 { font-size: 2.9em; }
.ls-after .ta-photo::after { background: linear-gradient(0deg, rgba(10,10,11,0.95) 0%, rgba(10,10,11,0.55) 55%, rgba(10,10,11,0.25) 100%); }
.ls-after .ta-links { display: none; }
.ls-after .ta-top { padding: 1em 1.3em; }
.ls-after .ta-band { grid-template-columns: 1fr; }
.ls-after .ta-svc li { padding: 0.9em 1.1em; font-size: 1em; }
.ls-after .ta-quick { display: none; }
.ls-hold { position: absolute; left: 50%; bottom: 16px; z-index: 6; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; padding: 10px 14px 12px; background: rgba(10,10,11,0.85); border: 1px solid var(--line-2); pointer-events: none; }
.ls-hold[hidden] { display: none; }
.ls-hold-t { font: 500 10px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--bone); white-space: nowrap; }
.ls-hold-bar { position: relative; display: block; width: 96px; height: 1px; background: var(--line-2); overflow: hidden; }
.ls-hold-bar i { position: absolute; inset: 0; background: var(--signal); transform-origin: left; transform: scaleX(var(--hold, 0)); }
.ls-screen:has(.ls-hold:not([hidden])) { cursor: crosshair; }
.ls-flip { margin-top: 12px; padding: 12px 0; background: none; border: 0; color: var(--bone-2); cursor: pointer; border-bottom: 1px solid var(--line-2); }
.ls-flip[hidden] { display: none; }
.ls-screen img[hidden] { display: none; }
.ls-after .ta-photo img { height: 100%; border-radius: 0; background: none; }
.ls-after .ta { grid-template-columns: minmax(0, 1fr); }
.ls-after .ta-top, .ls-after .ta-copy, .ls-after .ta-band { min-width: 0; }
.ls-screen .ls-after { inset: 9px; border-radius: 18px; }
.ls-result.has-rebuild .ls-screen img[hidden] + .ls-after { inset: auto; }
.ls-screen { -webkit-touch-callout: none; }
@media (max-width: 760px) { .ls-stage { display: grid; justify-items: center; } .ls-phone figcaption { text-align: center; margin-inline: auto; } }
.ls-after .ta-kick { white-space: normal; overflow: visible; }
.ls-result.has-rebuild #scan-cap { font: 400 13.5px/1.5 var(--sans); letter-spacing: 0; text-transform: none; color: var(--bone-2); }
