/* The interactive demo (/demo/). Without JavaScript every step shows in order; with it, one step at a time. */
.badge { display: inline-block; font: 700 12px/1 var(--head); letter-spacing: .06em; text-transform: uppercase; padding: 7px 10px; border-radius: 999px; vertical-align: middle; margin: 2px 0; }
.badge--live { background: var(--green-tint); color: var(--green); }
.badge--soon { background: var(--rust-tint); color: var(--rust-2); }
.badge--illus { background: #eceef1; color: var(--muted); }
.dark .badge--illus, .console .badge--illus { background: var(--ink-3); color: var(--on-dark); }

.demo { padding-bottom: clamp(48px, 7vw, 96px); }
.demo__bar { position: sticky; top: 72px; z-index: 5; background: rgba(246,244,239,.96); backdrop-filter: blur(6px); padding: 12px 0; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.demo__nav { position: relative; list-style: none; margin: 0 0 10px; padding: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.demo__nav button { white-space: nowrap; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 650 14px/1 var(--head); cursor: pointer; }
.demo__nav button b { font-family: ui-monospace, Consolas, monospace; margin-right: 6px; color: var(--rust); }
.demo__nav button[aria-current="step"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.demo__nav button[aria-current="step"] b { color: var(--hivis); }
.demo__nav button.is-done b::after { content: " ✓"; }
.demo__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.demo__count { margin-left: auto; }
.demo__controls [disabled] { opacity: .4; pointer-events: none; }

.dstep { padding: clamp(28px, 4vw, 48px) 0; border-bottom: 1px solid var(--line); }
.is-player .dstep { border-bottom: 0; padding-top: 8px; }
.dstep__head { display: flex; gap: 18px; align-items: flex-start; max-width: 900px; margin-bottom: 26px; }
.dstep__head h2 { font-size: clamp(26px, 3.4vw, 40px); margin-bottom: .35em; }
.dstep__head h2:focus { outline: none; }
.dstep__head p { color: var(--muted); max-width: 720px; margin-bottom: 10px; }
.dstep__n { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--hivis); color: var(--ink); font: 850 22px/1 var(--head); }
.dstep__panes { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.dstep__panes--wide { grid-template-columns: minmax(0, 1fr); }
.pane__label { font: 700 13px/1 var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.pane--inline { max-width: 420px; }

/* A phone, drawn in HTML */
.mock { width: 300px; max-width: 100%; border-radius: 40px; background: #0b1117; padding: 10px; box-shadow: 0 26px 50px rgba(18,23,29,.28); }
.mock__screen { background: #fff; border-radius: 31px; min-height: 560px; overflow: hidden; font-size: 14px; line-height: 1.45; color: var(--text); display: flex; flex-direction: column; }
.mock--dark .mock__screen { background: #f3f5f7; }
.mock__status { display: flex; justify-content: space-between; padding: 12px 22px 6px; font: 700 12px/1 var(--head); color: var(--ink); }
.mock__screen--lock { background: linear-gradient(160deg, #26313c, #12171d); color: #fff; justify-content: center; align-items: center; text-align: center; padding: 28px; }
.lock__time { font: 800 64px/1 var(--head); margin: 0 0 18px; }
.lock__note { color: var(--on-dark); max-width: 200px; }

.chat { padding: 6px 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat__title { text-align: center; font: 700 13px/1 var(--head); color: var(--muted); margin: 4px 0 6px; }
.bubble { margin: 0; padding: 10px 13px; border-radius: 16px; max-width: 92%; }
.bubble p { margin: 0 0 8px; }
.bubble--me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.bubble--ai { align-self: flex-start; background: #eef0f2; border-bottom-left-radius: 4px; }
.listing { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-decoration: none; color: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.listing:hover { border-color: var(--rust); color: var(--text); }
.listing__name { display: block; font: 800 16px/1.2 var(--head); color: var(--ink); }
.listing__meta { display: block; font-size: 12.5px; color: var(--muted); }
.listing__cta { display: block; margin-top: 6px; font-weight: 700; color: var(--rust-2); }

.site { padding: 6px 16px 18px; display: flex; flex-direction: column; gap: 9px; }
.site__brand { margin: 0; font: 800 15px/1.2 var(--head); color: var(--ink); }
.site__h { margin: 0 0 2px; font: 850 22px/1.1 var(--head); color: var(--ink); }
.field { margin: 0; display: flex; flex-direction: column; gap: 3px; }
.field > span { font: 700 11.5px/1 var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field > b { font-weight: 500; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; min-height: 1.45em; }
.field--photo .sink { border-radius: 10px; width: 100%; height: auto; }
.site__btn { margin: 4px 0 0; border: 0; text-align: center; background: var(--hivis); color: var(--ink); font: 800 15px/1 var(--head); padding: 14px; border-radius: 999px; transition: transform .12s, filter .12s; }
.site__btn.is-pressed { transform: scale(.95); filter: brightness(.9); }
button.site__btn { cursor: pointer; width: 100%; }
button.site__btn:hover { filter: brightness(.95); }
.site__btn--go { box-shadow: 0 0 0 0 rgba(220,255,46,.7); animation: pulse 1.8s infinite 1.6s; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(220,255,46,0); } 100% { box-shadow: 0 0 0 0 rgba(220,255,46,0); } }
.site__ok { margin: 0; color: var(--green); font-weight: 700; }
.approve__price { margin: 2px 0; font: 850 38px/1 var(--head); color: var(--ink); }
.approve__price small { font-size: 14px; font-weight: 600; color: var(--muted); }
.sms { margin: 0; background: #e9ecef; border-radius: 16px 16px 16px 4px; padding: 10px 12px; }
.sms--card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 16px; }
.choice { margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.choice.is-picked { border: 2px solid var(--ink); background: #f7ffd6; font-weight: 700; }

/* The back end, drawn in HTML */
.console { background: var(--ink); color: var(--on-dark); border-radius: var(--radius); padding: clamp(14px, 2vw, 22px); display: grid; gap: 14px; font-size: 15.5px; line-height: 1.5; }
.console--split { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.console--split > div:not(.ccard) { display: grid; gap: 14px; }
.ccard { background: var(--ink-2); border: 1px solid var(--line-dark); border-radius: 14px; padding: 16px 18px; }
.ccard h3 { color: #fff; font-size: 17px; margin-bottom: 10px; }
.ccard p:last-child { margin-bottom: 0; }
.ccard .small { color: var(--on-dark-2); font-size: 13.5px; margin: 8px 0 0; }
.ccard--alert { border-color: var(--hivis); }
.ccard--draft { border-color: #5b6b2a; }
.ccard--checks { background: var(--ink); color: var(--on-dark); font-size: 15.5px; line-height: 1.5; }
.ccard__kicker { font: 700 12px/1 var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--hivis); margin: 0 0 8px; }
.console__foot { margin: 0; color: var(--on-dark-2); font-size: 14.5px; }
.ctable { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ctable td { padding: 7px 6px; border-top: 1px solid var(--line-dark); vertical-align: top; }
.ctable tr:first-child td { border-top: 0; }
.ctable tr.is-new td { color: #fff; font-weight: 700; }
.ctable tr.is-new td:first-child::before { content: "● "; color: var(--hivis); }
.ctable--kv td:first-child { color: var(--on-dark-2); width: 48%; }
.ctable--money td:last-child { text-align: right; font-family: ui-monospace, Consolas, monospace; color: #fff; }
.ctable--money .total td { border-top: 2px solid var(--hivis); font-weight: 800; color: var(--hivis); font-size: 16px; }
.redact { color: var(--on-dark-2) !important; text-decoration: line-through; }
.draft__decision { font: 800 22px/1.2 var(--head); color: #fff; margin: 0 0 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill { font: 700 12px/1 var(--head); background: var(--green); color: #fff; padding: 6px 9px; border-radius: 999px; }
.draft__seen { font-size: 14px; margin: 10px 0 0; }
.draft__seen strong { color: #fff; }
.dticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dticks li { padding-left: 26px; position: relative; }
.dticks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--hivis); color: var(--ink); font: 800 12px/18px var(--head); text-align: center; }
.dticks strong { color: #fff; }
.dticks--row { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.map { width: 100%; height: auto; display: block; }
.map__ring { fill: var(--on-dark-2); font: 600 12px var(--body); text-anchor: middle; }
.map__label { fill: #fff; font: 700 12.5px var(--head); text-anchor: middle; }
.map__label--left { text-anchor: start; }
.map__label--right { text-anchor: end; }
.map__dots circle { fill: #4d5d6b; }
.map__dots--far circle { fill: #4d5d6b; stroke: #94a2ae; stroke-dasharray: 3 3; }
.route { stroke-dasharray: 800; stroke-dashoffset: 0; }
.is-player .dstep:not([hidden]) .route { animation: draw 2.2s ease-out .8s both; }
@keyframes draw { from { stroke-dashoffset: 800; } to { stroke-dashoffset: 0; } }
.route__save { margin: 12px 0 8px; }
.route__save strong { color: var(--hivis); }

.cal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cal__day { background: var(--ink); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 180px; }
.cal__day--hi { outline: 2px solid var(--hivis); }
.cal__d { margin: 0; font: 800 13px/1 var(--head); color: #fff; }
.job { margin: 0; font-size: 12.5px; line-height: 1.3; background: var(--ink-3); border-left: 3px solid #6e7f8e; border-radius: 6px; padding: 6px 7px; }
.job--new { background: #3a4a1c; border-left-color: var(--hivis); color: #fff; font-weight: 700; }
@media (max-width: 700px) { .cal { grid-template-columns: 1fr; } .cal__day { min-height: 0; } }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 0; border-left: 3px solid var(--hivis); }
.timeline li { padding: 8px 0 8px 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: 15px; width: 15px; height: 15px; border-radius: 50%; background: var(--ink); border: 3px solid var(--hivis); }
.timeline b { font-family: ui-monospace, Consolas, monospace; color: var(--rust-2); margin-right: 8px; }
.dstep__panes--wide:has(.timeline) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.nums { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.nums p { margin: 0; background: var(--ink); border-radius: 10px; padding: 10px; color: var(--on-dark-2); font-size: 14px; }
.nums b { display: block; font: 850 26px/1.1 var(--head); color: var(--hivis); }

.realshots { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 3vw, 36px); align-items: end; }
.realshots img { border-radius: 12px; }
.realshots .phone { margin: 0 auto; }

/* Step-by-step mode (JavaScript): parts appear in turn */
.is-player [data-in] { opacity: 0; transform: translateY(8px); transition: opacity .45s ease, transform .45s ease; }
.is-player [data-in].is-in { opacity: 1; transform: none; }
.is-player tr[data-in] { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .is-player [data-in] { transition: none; }
  .route, .site__btn--go { animation: none !important; }
}

@media (max-width: 860px) {
  .dstep__panes, .dstep__panes--wide:has(.timeline), .realshots { grid-template-columns: minmax(0, 1fr); }
  .pane--phone { justify-self: center; }
  .demo__bar { top: 64px; }
  .demo__count { width: 100%; margin-left: 0; }
}

/* Playing with voice: the part being described lights up, and the words show as a caption. */
.demo__play { min-width: 172px; }
.demo__play:not(.is-used) { animation: pulse 1.8s infinite; }
.demo__icon { font-size: 13px; letter-spacing: -2px; }
.demo__caption { margin: 10px 0 0; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: 12px; font-size: 16.5px; line-height: 1.45; border-left: 5px solid var(--hivis); }
.demo__progress { height: 4px; background: var(--line); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.demo__progress span { display: block; height: 100%; width: 0; background: var(--rust); transition: width .4s ease; }
.is-speaking { box-shadow: 0 0 0 3px var(--ink), 0 0 0 7px var(--hivis) !important; border-radius: 12px; position: relative; z-index: 2; transition: box-shadow .25s ease; }
.dark .is-speaking, .console .is-speaking { box-shadow: 0 0 0 3px var(--hivis), 0 0 22px 6px rgba(220,255,46,.35) !important; }
.is-playing .dstep:not([hidden]) [data-in]:not(.is-in) { opacity: .0; }
@media (max-width: 860px) { .demo__caption { font-size: 15px; } .demo__play { min-width: 0; } }
.demo-playing .dock { display: none !important; }
@media (max-width: 860px) {
  .demo__controls { gap: 6px; flex-wrap: nowrap; }
  .demo__controls .btn { min-height: 42px; padding: 0 13px; font-size: 15px; }
  .demo__count, .demo__wide { display: none; }
  .demo__caption { margin-top: 8px; padding: 8px 12px; }
  .demo__bar { padding: 8px 0; }
}

/* Step 4: the AI looking at the photo, and the guardrails ticking off one by one */
.vision { position: relative; border-radius: 10px; overflow: hidden; }
.vision .sink { display: block; width: 100%; height: auto; }
.vision__scan { animation: scan 2.4s ease-in-out infinite; }
@keyframes scan { 0% { transform: translateY(0); } 50% { transform: translateY(144px); } 100% { transform: translateY(0); } }
.vision__tag { position: absolute; margin: 0; background: rgba(18,23,29,.88); color: #fff; border: 1.5px solid var(--hivis); border-radius: 8px; padding: 4px 8px; font: 700 12px/1.2 var(--head); max-width: 58%; }
.vision__tag::before { content: "AI · "; color: var(--hivis); }
.guards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.guards li { padding: 8px 10px 8px 36px; position: relative; background: var(--ink-2); border-radius: 10px; }
.guards li::before { content: ""; position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--on-dark-2); border-top-color: transparent; animation: spin .8s linear infinite; }
.guards li::after { content: "✓"; position: absolute; left: 8px; top: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--hivis); color: var(--ink); font: 800 13px/20px var(--head); text-align: center; opacity: 0; }
.ccard--checks.is-in .guards li::before, .demo:not(.is-player) .guards li::before { animation: spin .8s linear infinite, gone 0s linear calc(var(--d) + .7s) forwards; }
.ccard--checks.is-in .guards li::after, .demo:not(.is-player) .guards li::after { animation: pop .25s ease-out calc(var(--d) + .7s) forwards; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes gone { to { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }

/* Step 8: alerts on Sarah's phone and the van on the live map */
.mock__screen--notes { justify-content: flex-start; padding-top: 48px; gap: 12px; }
.mock__screen--notes .lock__time { margin-bottom: 10px; }
.notif { width: 100%; text-align: left; background: rgba(255,255,255,.94); color: var(--text); border-radius: 16px; padding: 10px 12px; font-size: 13.5px; }
.notif p { margin: 0; }
.notif__app { font: 700 11.5px/1 var(--head); color: var(--muted); margin-bottom: 5px !important; text-transform: uppercase; letter-spacing: .04em; }
.notif--hi { outline: 2px solid var(--hivis); }
.van__label { fill: var(--ink); font: 800 12px var(--head); text-anchor: middle; }
.map--live { margin-bottom: 2px; }

/* Step 9: review, certificate and the invoice going to the books */
.review { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stars { margin: 2px 0 4px; font-size: 26px; letter-spacing: 3px; color: #f2b01e; }
.doc { display: flex; flex-direction: column; gap: 2px; border: 1px dashed var(--rust); background: var(--rust-tint); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.doc b { font: 800 14px/1.2 var(--head); color: var(--ink); }
.sync { display: flex; gap: 10px; align-items: center; margin: 0 0 6px; color: #fff; }
.sync__dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--hivis); box-shadow: 0 0 0 0 rgba(220,255,46,.7); animation: pulse 1.6s infinite; }

/* "What makes the approach technically interesting?" */
.pipeline { list-style: none; margin: 0 0 clamp(28px, 4vw, 44px); padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; counter-reset: p; }
.pipeline li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 14px; box-shadow: var(--shadow); }
.pipeline li::after { content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); z-index: 1; color: var(--rust); font: 800 18px/1 var(--head); }
.pipeline li:last-child::after { content: none; }
.pipeline b { display: block; font: 800 16px/1.2 var(--head); color: var(--ink); margin-bottom: 4px; }
.pipeline span { font-size: 14px; color: var(--muted); line-height: 1.35; display: block; }
.pipeline__ai { background: var(--ink) !important; border-color: var(--hivis) !important; }
.pipeline__ai b { color: var(--hivis); }
.pipeline__ai span { color: var(--on-dark); }
.tech { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 22px); }
.tech .card h3 { font-size: 20px; }
.tech .card p { font-size: 16.5px; }
@media (max-width: 980px) { .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pipeline li:nth-child(3)::after { content: none; } .tech { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pipeline { grid-template-columns: 1fr 1fr; } .pipeline li::after { content: none !important; } .tech { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .vision__scan, .sync__dot, .guards li::before { animation: none !important; } .guards li::after { opacity: 1; } }
.ctable--log td:first-child { width: 58px; font-family: ui-monospace, Consolas, monospace; color: var(--hivis) !important; }
