/*
 * Author: Hariram S <ramhari4090@gmail.com>
 *
 * Pictures for the marketing pages: real app screenshots with numbered
 * callouts drawn over them (.shot), step-by-step flow infographics (.flow),
 * the looping before and after cleaning example (.ba) and the capability
 * comparison matrix (.cmp). Everything is HTML, inline SVG and CSS, so it runs
 * under the pages' Content-Security-Policy with no script of its own: the
 * entrances hang off the .in class that scenes.js already adds to [data-rv].
 *
 * Motion is transform, opacity and stroke-dashoffset only. Without .js, or
 * under prefers-reduced-motion, everything is drawn in its final state.
 * Meaning never depends on colour: callouts carry numbers, the matrix carries
 * a word and a shape in every cell, flow steps carry numbers.
 *
 * Used by:
 *     landing/cleaning.html, landing/data-visualization.html, landing/forms.html,
 *     landing/features/{no-code-data-cleaning,combine-data-sources,
 *     sharing-and-scheduled-reports,forms-insights-report,dashboard-widgets-and-design}.html,
 *     landing/dotwave-vs-chatgpt-and-claude.html, landing/dotwave-vs-google-forms.html
 *
 * Depends on:
 *     landing/assets/site.css (tokens: --surface, --line, --accent, --muted, --r, --ease)
 *     landing/assets/icons.svg (flow step icons)
 */

/* ---- Screenshot with callouts ---- */
.shot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); gap: clamp(20px, 3vw, 40px); align-items: start; margin: 0; }
.shot.shot-wide { grid-template-columns: 1fr; }
.shot-frame { position: relative; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); overflow: hidden; box-shadow: 0 30px 80px -30px rgba(124, 92, 255, .35); }
.shot-frame.is-narrow { max-width: 360px; margin-inline: auto; border-radius: 28px; }
.shot-frame img { display: block; width: 100%; height: auto; }
.shot .ann { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.shot .ring { fill: rgba(124, 92, 255, .08); stroke: #7c5cff; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0; }
.shot .pin {
  position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  display: grid; place-items: center; font: 600 14px/1 var(--mono); color: #fff; background: #5b3ee8;
  border: 2px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.shot figcaption { display: grid; gap: 14px; }
.shot-key { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: k; }
.shot-key li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; font-size: var(--t5); line-height: 1.55; color: var(--muted); }
.shot-key li::before {
  counter-increment: k; content: counter(k); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 600 14px/1 var(--mono); color: #fff; background: #5b3ee8; border: 2px solid rgba(255, 255, 255, .85);
}
.shot-key b { display: block; color: var(--ink); font-weight: 600; font-size: 15px; }
.shot-note { font-size: 13px; color: var(--muted); }

/* ---- Flow infographic ---- */
.flow { list-style: none; padding: 0; margin: clamp(28px, 3vw, 44px) 0 0; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 14px; counter-reset: s; }
.flow > li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; justify-items: start; align-content: start; padding: 22px 20px 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); counter-increment: s; }
.flow > li::before { content: counter(s); position: absolute; top: 16px; right: 18px; font: 500 12px/1 var(--mono); color: var(--muted); }
.flow .fi { justify-self: start; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(124, 92, 255, .16); color: var(--accent-ink); }
.flow .fi .ic { width: 22px; height: 22px; }
.flow b { color: var(--ink); font-size: var(--t4); font-weight: 600; letter-spacing: -0.01em; }
.flow span.d { font-size: var(--t5); line-height: 1.55; color: var(--muted); }
.flow > li:not(:last-child)::after {
  content: ""; position: absolute; top: 44px; left: calc(100% + 1px); width: 12px; height: 2px; background: var(--accent); transform-origin: left center;
}
html.js .flow[data-rv] > li { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 110ms); }
html.js .flow[data-rv].in > li { opacity: 1; transform: none; }
html.js .flow[data-rv] > li:not(:last-child)::after { transform: scaleX(0); transition: transform .5s var(--ease); transition-delay: calc(var(--i, 0) * 110ms + 350ms); }
html.js .flow[data-rv].in > li:not(:last-child)::after { transform: scaleX(1); }
.vis-stack > .flow-cap { margin-top: calc(14px - clamp(40px, 6vw, 80px)); }
.flow-cap { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ---- Before and after loop ---- */
.ba { margin: 0; padding: clamp(18px, 2.4vw, 28px); border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); }
.ba-head, .ba-row { display: grid; grid-template-columns: minmax(80px, .8fr) minmax(0, 1fr) 28px minmax(0, 1fr); gap: 10px; align-items: center; }
.ba-head { font: 500 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ba-row { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--t5); }
.ba-row:last-of-type { border-bottom: 0; }
.ba-row .k { color: var(--muted); }
.ba-row .b, .ba-row .a { font: 500 14px/1.3 var(--mono); padding: 6px 10px; border-radius: 8px; width: fit-content; max-width: 100%; overflow-wrap: anywhere; }
.ba-row .b { background: rgba(255, 255, 255, .06); color: #d4d4d8; text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .35); }
.ba-row .a { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
.ba-row .ar { color: var(--muted); text-align: center; }
.ba-row .ar .ic { width: 16px; height: 16px; display: inline-block; }
@keyframes ba-fix { 0%, 8% { opacity: .25; transform: translateX(-6px); } 20%, 88% { opacity: 1; transform: none; } 100% { opacity: .25; transform: translateX(-6px); } }
@keyframes ba-old { 0%, 8% { opacity: 1; } 20%, 88% { opacity: .55; } 100% { opacity: 1; } }
html.js .ba .a { animation: ba-fix 9s var(--ease) infinite; animation-delay: calc(var(--i, 0) * 600ms); }
html.js .ba .b { animation: ba-old 9s linear infinite; animation-delay: calc(var(--i, 0) * 600ms); }
.ba-note { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* ---- Callout screenshot rings draw in ---- */
@keyframes ring-draw { from { stroke-dashoffset: 1; opacity: .2; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes pin-pop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
html.js .shot[data-rv] .ring { stroke-dashoffset: 1; opacity: .2; }
html.js .shot[data-rv] .pin { opacity: 0; transform: scale(.5); }
html.js .shot[data-rv].in .ring { animation: ring-draw .9s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 180ms + 300ms); }
html.js .shot[data-rv].in .pin { animation: pin-pop .45s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 180ms + 250ms); }
.shot .ring { stroke-dasharray: 1; }

/* ---- Comparison matrix ---- */
.cmp-wrap { overflow-x: auto; margin-top: clamp(24px, 3vw, 40px); }
.cmp { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--t5); line-height: 1.5; min-width: 640px; }
.cmp caption { text-align: left; font-size: 13px; color: var(--muted); padding-bottom: 12px; }
.cmp th, .cmp td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmp thead th { font: 500 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.cmp thead th.us { color: var(--accent-ink); }
.cmp tbody th { font-weight: 600; color: var(--ink); width: 26%; }
.cmp td.us { background: rgba(124, 92, 255, .08); }
.cmp td span.t { display: block; margin-top: 4px; color: var(--muted); }
.mk { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.mk::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent-ink); flex: none; box-sizing: border-box; }
.mk-yes::before { background: var(--accent-ink); }
.mk-part::before { background: linear-gradient(90deg, var(--accent-ink) 50%, transparent 50%); }
.mk-no::before { border-color: var(--muted); }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.cmp-legend .mk { font-weight: 500; color: var(--muted); }
.cmp-fine { margin-top: 10px; font-size: 13px; color: var(--muted); max-width: 80ch; }
html.js .cmp-wrap[data-rv] .cmp tbody tr { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
html.js .cmp-wrap[data-rv].in .cmp tbody tr { opacity: 1; transform: none; }

/* ---- Subtle hero drift ---- */
@keyframes drift { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -8px, 0); } }
html.js .shot-float .shot-frame { animation: drift 9s ease-in-out infinite; }

.vis-sec .head { margin-bottom: clamp(20px, 3vw, 36px); }
.vis-stack { display: grid; gap: clamp(40px, 6vw, 80px); }

@media (max-width: 900px) {
  .shot { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow > li:not(:last-child)::after { top: 100%; left: 36px; width: 2px; height: 14px; transform-origin: top center; }
  html.js .flow[data-rv] > li:not(:last-child)::after { transform: scaleY(0); }
  html.js .flow[data-rv].in > li:not(:last-child)::after { transform: scaleY(1); }
  .shot .pin { width: 24px; height: 24px; margin: -12px 0 0 -12px; font-size: 12px; }
  .ba-head, .ba-row { grid-template-columns: 52px minmax(0, 1fr) 14px minmax(0, 1fr); gap: 6px; }
  .ba-row .b, .ba-row .a { font-size: 12px; padding: 5px 7px; }
  .cmp { min-width: 0; }
  .cmp caption { display: block; width: auto; }
  .cmp thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cmp, .cmp tbody, .cmp tr, .cmp th, .cmp td { display: block; width: auto; }
  .cmp tbody th { width: auto; padding: 18px 0 6px; border-bottom: 0; font-size: var(--t4); }
  .cmp td { padding: 8px 0; border-bottom: 0; }
  .cmp td::before { content: attr(data-label); display: block; font: 500 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
  .cmp td.us { padding: 10px 12px; border-radius: 10px; margin-bottom: 4px; }
  .cmp tbody tr { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html.js .shot[data-rv] .ring, html.js .shot[data-rv] .pin, html.js .shot[data-rv].in .ring, html.js .shot[data-rv].in .pin { animation: none !important; opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important; }
  html.js .flow[data-rv] > li, html.js .flow[data-rv] > li::after, html.js .cmp-wrap[data-rv] .cmp tbody tr { opacity: 1 !important; transform: none !important; transition: none !important; }
  html.js .ba .a, html.js .ba .b, html.js .shot-float .shot-frame { animation: none !important; }
}
