/* HOW I WORK */

/* ---------- scene palette ---------- */
.pa {
  --pa-bg: radial-gradient(ellipse 80% 70% at 50% 35%, #0a1d3d 0%, #030c1c 70%);
  --pa-rim: rgba(255, 255, 255, 0.06);
  --pa-win: linear-gradient(160deg, #0a1a36, #050f22);
  --pa-win-rim: rgba(255, 255, 255, 0.08);
  --pa-win-shadow: 0 4cqw 8cqw -3cqw rgba(0, 0, 0, 0.8);
  --pa-ink: #ffffff;
  --pa-ink-2: rgba(255, 255, 255, 0.78);
  --pa-ink-3: rgba(255, 255, 255, 0.55);
  --pa-line: rgba(120, 150, 200, 0.32);
  --pa-hair: rgba(255, 255, 255, 0.12);
  --pa-chip: rgba(255, 255, 255, 0.05);
  --pa-bubble: linear-gradient(160deg, rgba(24, 52, 100, 0.7), rgba(10, 26, 56, 0.7));
  --pa-bubble-rim: rgba(255, 255, 255, 0.08);
  --pa-me: linear-gradient(160deg, #1668ff, #0a4dff);
  --pa-float: linear-gradient(160deg, rgba(14, 36, 76, 0.96), rgba(6, 18, 42, 0.96));
  --pa-float-rim: rgba(90, 160, 255, 0.3);
}
[data-theme="light"] .pa {
  --pa-bg: radial-gradient(ellipse 80% 70% at 50% 35%, #eef5ff 0%, #d8e7fb 75%);
  --pa-rim: rgba(6, 30, 66, 0.08);
  --pa-win: linear-gradient(160deg, #ffffff, #f6f9fd);
  --pa-win-rim: rgba(6, 30, 66, 0.1);
  --pa-win-shadow: 0 4cqw 8cqw -3cqw rgba(10, 50, 120, 0.3);
  --pa-ink: #071a33;
  --pa-ink-2: rgba(7, 26, 51, 0.8);
  --pa-ink-3: rgba(7, 26, 51, 0.55);
  --pa-line: rgba(80, 110, 160, 0.25);
  --pa-hair: rgba(6, 30, 66, 0.12);
  --pa-chip: rgba(6, 30, 66, 0.04);
  --pa-bubble: #ffffff;
  --pa-bubble-rim: rgba(6, 30, 66, 0.1);
  --pa-float: #ffffff;
  --pa-float-rim: rgba(10, 110, 230, 0.25);
}

/* ---------- picture area ---------- */
.step__art {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 1154 / 1044;
  border-radius: 20px;
  overflow: hidden;
  background: var(--pa-bg);
  box-shadow: inset 0 0 0 1px var(--pa-rim);
}
.pa * { box-sizing: border-box; }
.pa svg { display: block; }

/* shared motion: hidden until the card plays */
@keyframes paPop { from { opacity: 0; transform: translateY(2.2cqw) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes paFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes paGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes paGlow { 50% { box-shadow: 0 0 0 0.8cqw rgba(47, 134, 255, 0.22), 0 0 4cqw rgba(47, 134, 255, 0.55); } }
.js .pa .pc__b,
.js .pa .pc__av,
.js .pa .pc__goal,
.js .pa .pd__btn,
.js .pa .pv__live,
.js .pa .pv__toast { opacity: 0; }
.js .pa .pd__line { transform: scaleX(0); }
.pa.is-playing .pc__b,
.pa.is-playing .pc__av,
.pa.is-playing .pc__goal { animation: paPop 0.5s var(--ease-out) var(--d, 0s) both; }
.pa.is-playing .pd__line { animation: paGrow 0.6s var(--ease-out) var(--d) both; }

/* shared mini-site parts */
.pd__dots { display: flex; gap: 0.9cqw; }
.pd__dots i { width: 1.5cqw; height: 1.5cqw; border-radius: 50%; box-shadow: inset 0 0 0 0.2cqw var(--pa-hair); }
.pd__dots i:first-child { background: #2f86ff; box-shadow: none; }
.pd__line { display: block; width: var(--w); height: 1cqw; border-radius: 1cqw; background: var(--pa-line); transform-origin: left; }
.pd__btn { align-self: flex-start; margin-top: 1.8cqw; padding: 1.5cqw 2.6cqw; border-radius: 1cqw; background: linear-gradient(180deg, #1668ff, #0a4dff); color: #fff; font-size: 2cqw; font-weight: 600; white-space: nowrap; }
.pc__av--you { display: grid; place-items: center; border-radius: 50%; background: linear-gradient(160deg, #3fb4ff, #0a6cff); }
.pc__av--you svg { width: 55%; height: 55%; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }

/* 1. DISCOVERY: a conversation about conversions */
/* anchored to the bottom like a real chat; a soft fade covers the top edge */
.pc {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3cqw;
  padding: 5cqw 5.5cqw 6cqw;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 10%);
}
.pc__row { display: flex; align-items: flex-end; gap: 2.4cqw; }
.pc__row--me { justify-content: flex-end; }
.pc__stack { position: relative; display: flex; flex-direction: column; gap: 1.4cqw; max-width: 76%; }
.pc__row--me .pc__stack { align-items: flex-end; }
.pc__av { flex: 0 0 8.4cqw; width: 8.4cqw; height: 8.4cqw; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 0.5cqw rgba(24, 160, 255, 0.22), 0 0 4cqw rgba(24, 160, 255, 0.4); }
.pc__b {
  padding: 2.4cqw 3.4cqw;
  border-radius: 4cqw 4cqw 4cqw 1.2cqw;
  background: var(--pa-bubble);
  box-shadow: inset 0 0 0 1px var(--pa-bubble-rim);
  color: var(--pa-ink-2);
  font-size: 3.5cqw;
  line-height: 1.35;
}
.pc__row--me .pc__b { border-radius: 4cqw 4cqw 1.2cqw 4cqw; background: var(--pa-me); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); color: #fff; }
.pc__typing { display: inline-flex; gap: 1.1cqw; padding: 2.6cqw 3.4cqw; }
.pc__typing i { width: 1.5cqw; height: 1.5cqw; border-radius: 50%; background: currentColor; opacity: 0.6; animation: paDot 1.1s ease-in-out infinite; }
.pc__typing i:nth-child(2) { animation-delay: 0.15s; }
.pc__typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes paDot { 30% { transform: translateY(-1cqw); opacity: 1; } 0%, 60%, 100% { opacity: 0.45; } }
/* the typing dots sit where the reply then appears, so the thread never shifts */
.pc__typing--me { position: absolute; right: 0; bottom: 0; }
.pa.is-playing .pc__typing--me { animation: paTypeOut 0.9s var(--ease-out) var(--d) both; }
@keyframes paTypeOut { 0% { opacity: 0; transform: scale(0.9); } 20%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(0.96); } }
/* the takeaway, pinned under the chat */
.pc__goal {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 1.6cqw;
  margin-top: 1cqw;
  padding: 1.8cqw 3cqw;
  border-radius: 999px;
  background: rgba(43, 212, 125, 0.12);
  box-shadow: inset 0 0 0 1px rgba(43, 212, 125, 0.4);
  color: #7ff0b6;
  font-size: 2.9cqw;
  font-weight: 600;
  white-space: nowrap;
}
.pc__goal svg { width: 3.4cqw; height: 3.4cqw; fill: none; stroke: currentColor; stroke-width: 2; }
[data-theme="light"] .pc__goal { background: rgba(18, 165, 92, 0.1); color: #0c8a4c; }

/* 2. DESIGN & DEVELOPMENT: wireframe, design, code, phone */
.pv, .pg { position: absolute; inset: 0; }
.pv__win {
  position: absolute;
  padding: 2.4cqw 2.8cqw;
  border-radius: 3cqw;
  background: var(--pa-win);
  box-shadow: inset 0 0 0 1px var(--pa-win-rim), var(--pa-win-shadow);
}
.pg [data-depth] { translate: calc(var(--tx, 0) * var(--depth-n, 0) * 1cqw) calc(var(--ty, 0) * var(--depth-n, 0) * 1cqw); transition: translate 0.6s var(--ease-out); }
.pg [data-depth="6"] { --depth-n: 0.6; }
.pg [data-depth="14"] { --depth-n: 1.4; }
.pg [data-depth="22"] { --depth-n: 2.2; }

/* the browser */
.pg__win {
  position: absolute;
  left: 5%;
  top: 6%;
  width: 68%;
  height: 59%;
  display: flex;
  flex-direction: column;
  padding: 1.8cqw;
  border-radius: 3cqw;
  background: var(--pa-win);
  box-shadow: inset 0 0 0 1px var(--pa-win-rim), var(--pa-win-shadow);
}
.pg__bar { display: flex; align-items: center; gap: 2cqw; margin-bottom: 1.6cqw; }
.pg__url { flex: 1; max-width: 60%; margin: 0 auto; padding: 0.8cqw 2cqw; border-radius: 999px; background: var(--pa-chip); box-shadow: inset 0 0 0 1px var(--pa-hair); color: var(--pa-ink-3); font-size: 1.8cqw; text-align: center; }
.pg__page { position: relative; flex: 1; border-radius: 1.6cqw; overflow: hidden; box-shadow: inset 0 0 0 1px var(--pa-hair); }
.pg__layer { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 1.8cqw 2.2cqw; background: var(--pa-win); }
.pg__nav { display: flex; align-items: center; gap: 1.8cqw; margin-bottom: 3cqw; }
.pg__hero { flex: 1; display: grid; grid-template-columns: 1fr 0.9fr; gap: 2.4cqw; align-items: center; }
.pg__copy { display: flex; flex-direction: column; gap: 1.2cqw; }

/* wireframe blocks */
.pg__wire i { display: block; border-radius: 0.6cqw; background: var(--pa-line); }
.w-logo { width: 7cqw; height: 1.8cqw; margin-right: auto; }
.w-link { width: 4.5cqw; height: 1cqw; }
.w-h { width: 92%; height: 2.6cqw; }
.w-h--short { width: 64%; }
.w-p { width: 88%; height: 1cqw; margin-top: 0.6cqw; }
.w-p--short { width: 60%; margin-top: 0; }
.pg__wire .w-btn { width: 11cqw; height: 3.6cqw; margin-top: 1.2cqw; border-radius: 0.9cqw; }
.w-img { align-self: stretch; display: grid; border-radius: 1.2cqw; box-shadow: inset 0 0 0 0.2cqw var(--pa-line); }
.w-img svg { width: 100%; height: 100%; stroke: var(--pa-line); stroke-width: 0.08; }

/* the designed page, revealed by the sweep */
.d-logo { display: inline-flex; align-items: center; gap: 0.8cqw; margin-right: auto; color: var(--pa-ink); font-size: 1.9cqw; font-weight: 700; }
.d-logo em { width: 2.2cqw; height: 2.2cqw; border-radius: 0.6cqw; background: linear-gradient(135deg, #18cdfd, #0a4dff); }
.pg__design .pg__nav span { color: var(--pa-ink-3); font-size: 1.6cqw; }
.pg__design .pg__nav .d-cta { padding: 0.6cqw 1.4cqw; border-radius: 999px; background: var(--pa-chip); box-shadow: inset 0 0 0 1px var(--pa-hair); color: var(--pa-ink); }
.d-h { color: var(--pa-ink); font-size: 4.4cqw; font-weight: 700; line-height: 1.05; letter-spacing: -0.04em; }
.d-h em { font-style: italic; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.06em; }
.d-p { color: var(--pa-ink-3); font-size: 1.8cqw; line-height: 1.4; }
.d-btn { align-self: flex-start; margin-top: 0.8cqw; padding: 1.2cqw 2.2cqw; border-radius: 999px; background: linear-gradient(180deg, #1668ff, #0a4dff); color: #fff; font-size: 1.8cqw; font-weight: 600; white-space: nowrap; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.d-img { position: relative; align-self: stretch; overflow: hidden; border-radius: 1.4cqw; background: linear-gradient(150deg, #0a3a9e, #061a44); }
.d-blob { position: absolute; border-radius: 50%; filter: blur(1.2cqw); }
.d-blob--a { width: 70%; height: 70%; right: -12%; top: -14%; background: #18cdfd; opacity: 0.85; }
.d-blob--b { width: 60%; height: 60%; left: -10%; bottom: -16%; background: #2f86ff; opacity: 0.9; }
.d-card { position: absolute; left: 14%; right: 14%; bottom: 14%; display: flex; flex-direction: column; gap: 0.8cqw; padding: 1.4cqw; border-radius: 1cqw; background: rgba(255, 255, 255, 0.18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.d-card i { height: 0.9cqw; border-radius: 1cqw; background: rgba(255, 255, 255, 0.75); }
.d-card i + i { width: 60%; background: rgba(255, 255, 255, 0.45); }
.js .pa .pg__design { clip-path: inset(0 100% 0 0); }
.pa.is-playing .pg__design { animation: paWipe 1.6s var(--ease) 1.2s both; }
@keyframes paWipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.pg__scan { position: absolute; top: 0; bottom: 0; left: 0; width: 0.3cqw; background: #18cdfd; box-shadow: 0 0 2cqw 0.6cqw rgba(24, 205, 253, 0.55); opacity: 0; }
.pa.is-playing .pg__scan { animation: paScan 1.6s var(--ease) 1.2s both; }
@keyframes paScan { 0% { left: 0; opacity: 0; } 8%, 88% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
.pa.is-playing .pg__design .d-btn { animation: paGlow 2.4s ease-in-out 3.2s infinite; }

/* the code editor (dark in both themes, like a real editor) */
.pg__code {
  position: absolute;
  left: 9%;
  top: 58%;
  width: 57%;
  padding: 1.6cqw 2.2cqw 2.2cqw;
  border-radius: 2.4cqw;
  background: linear-gradient(160deg, #0b1630, #060d1f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 3cqw 7cqw -2cqw rgba(0, 0, 0, 0.6);
}
.pg__tabs { display: flex; gap: 1cqw; margin-bottom: 1.6cqw; }
.pg__tabs span { padding: 0.6cqw 1.4cqw; border-radius: 0.8cqw; color: rgba(255, 255, 255, 0.45); font-size: 1.7cqw; }
.pg__tabs .is-on { background: rgba(255, 255, 255, 0.08); color: #e6edf7; }
.pg__lines { display: flex; flex-direction: column; gap: 0.9cqw; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 2.15cqw; line-height: 1.35; color: #e6edf7; }
.pg__ln { display: block; width: calc(var(--ch) * 1ch); overflow: hidden; white-space: pre; }
.pg__ln b { font-weight: 400; }
.t-tag { color: #7fd3ff; }
.t-attr { color: #c9a5ff; }
.t-str { color: #ffcb6b; }
.js .pa .pg__ln { width: 0; }
.pa.is-playing .pg__ln { animation: paType var(--t) steps(var(--ch)) var(--d) both; }
@keyframes paType { from { width: 0; } to { width: calc(var(--ch) * 1ch); } }
/* a caret blinks after the last line */
.pg__ln--last { width: calc((var(--ch) + 1) * 1ch); }
.pg__ln--last::after { content: ""; display: inline-block; width: 0.6ch; height: 1em; margin-left: 0.2ch; vertical-align: -0.15em; background: #18cdfd; animation: paCaret 0.9s steps(1) infinite; }
@keyframes paCaret { 50% { opacity: 0; } }

/* the phone */
.pg__phone {
  position: absolute;
  left: 73%;
  top: 19%;
  width: 22%;
  aspect-ratio: 9 / 18.5;
  padding: 1cqw;
  border-radius: 3.6cqw;
  background: #050a14;
  box-shadow: inset 0 0 0 0.3cqw #1a2236, 0 3cqw 7cqw -2cqw rgba(0, 0, 0, 0.6);
}
.pg__notch { position: absolute; left: 50%; top: 1.6cqw; z-index: 1; width: 5cqw; height: 1.3cqw; border-radius: 1cqw; background: #050a14; transform: translateX(-50%); }
.pg__mob { height: 100%; display: flex; flex-direction: column; gap: 1cqw; padding: 3.6cqw 1.6cqw 1.6cqw; border-radius: 2.8cqw; overflow: hidden; background: var(--pa-win); }
.pg__mob .d-logo { margin-bottom: 0.8cqw; }
.pg__mob .d-logo em { width: 1.8cqw; height: 1.8cqw; }
.pg__mob .d-h { font-size: 2.9cqw; }
.m-p { display: block; height: 0.7cqw; border-radius: 1cqw; background: var(--pa-line); }
.m-p--short { width: 66%; }
.pg__mob .d-btn { margin-top: 0.4cqw; padding: 0.8cqw 1.6cqw; font-size: 1.3cqw; }
.pg__mob .d-img { flex: 1; margin-top: 0.6cqw; border-radius: 1cqw; }
.js .pa .pg__phone,
.js .pa .pg__chip { opacity: 0; }
.pa.is-playing .pg__phone { animation: paPhone 0.7s var(--ease-out) 3s both; }
@keyframes paPhone { from { opacity: 0; transform: translateX(6cqw) rotate(4deg); } to { opacity: 1; transform: none; } }

.pg__chip {
  position: absolute;
  right: 3.5%;
  bottom: 6%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 1.2cqw;
  padding: 1.4cqw 2.4cqw 1.4cqw 1.6cqw;
  border-radius: 999px;
  background: var(--pa-float);
  box-shadow: inset 0 0 0 1px var(--pa-float-rim), 0 2cqw 5cqw -2cqw rgba(0, 0, 0, 0.5);
  color: var(--pa-ink);
  font-size: 2.2cqw;
  font-weight: 600;
  white-space: nowrap;
}
.pg__chip svg { width: 3cqw; height: 3cqw; padding: 0.5cqw; border-radius: 50%; background: #0a6cff; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pa.is-playing .pg__chip { animation: paPop 0.5s var(--ease-out) 3.6s both; }

/* 3. DELIVERY: launch checks, live, first inquiry */
.pv__win { left: 7%; top: 9%; width: 86%; height: 62%; }
.pv__top { display: flex; align-items: center; gap: 2cqw; margin-bottom: 2.4cqw; }
.pv__url {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1.2cqw;
  padding: 1.2cqw 1.4cqw 1.2cqw 2cqw;
  border-radius: 999px;
  background: var(--pa-chip);
  box-shadow: inset 0 0 0 1px var(--pa-hair);
  color: var(--pa-ink-2);
  font-size: 2.2cqw;
}
.pv__url svg { width: 2.4cqw; height: 2.4cqw; fill: none; stroke: #2bd47d; stroke-width: 2; }
.pv__live { margin-left: auto; display: inline-flex; align-items: center; gap: 0.8cqw; padding: 0.6cqw 1.6cqw; border-radius: 999px; background: rgba(43, 212, 125, 0.15); color: #2bd47d; font-size: 1.9cqw; font-weight: 700; }
.pv__live::before { content: ""; width: 1.2cqw; height: 1.2cqw; border-radius: 50%; background: #2bd47d; box-shadow: 0 0 1.4cqw #2bd47d; }
.pa.is-playing .pv__live { animation: paPop 0.45s var(--ease-out) 2.2s both; }
[data-theme="light"] .pv__live { color: #0c8a4c; }
.pv__body { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; height: calc(100% - 8cqw); }
.pv__site { display: flex; flex-direction: column; justify-content: center; gap: 1.2cqw; }
.pv__h { margin-bottom: 0.8cqw; color: var(--pa-ink); font-size: 4.4cqw; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }
.pa.is-playing .pv__btn { animation: paPop 0.45s var(--ease-out) 0.35s both, paGlow 2.4s ease-in-out 2.4s infinite; }
.pv__checks { display: flex; flex-direction: column; justify-content: center; gap: 1.4cqw; }
.pv__checks li { display: flex; align-items: center; gap: 1.6cqw; padding: 1.5cqw 1.8cqw; border-radius: 1.4cqw; background: var(--pa-chip); box-shadow: inset 0 0 0 1px var(--pa-hair); color: var(--pa-ink-3); font-size: 2.3cqw; font-weight: 500; }
.pv__checks i { flex: 0 0 3.4cqw; display: grid; place-items: center; width: 3.4cqw; height: 3.4cqw; border-radius: 50%; box-shadow: inset 0 0 0 0.25cqw var(--pa-hair); }
.pv__checks svg { width: 2.2cqw; height: 2.2cqw; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.pa.is-playing .pv__checks li { animation: paCheckRow 0.4s var(--ease) var(--d) both; }
.pa.is-playing .pv__checks i { animation: paCheck 0.45s var(--ease-out) var(--d) both; }
.pa.is-playing .pv__checks svg { animation: paFade 0.3s var(--ease) calc(var(--d) + 0.15s) both; }
@keyframes paCheck { from { background: transparent; transform: scale(0.6); } to { background: #0a6cff; box-shadow: 0 0 2cqw rgba(47, 134, 255, 0.5); transform: none; } }
@keyframes paCheckRow { to { color: var(--pa-ink); } }

/* the payoff: the first inquiry lands */
.pv__toast {
  position: absolute;
  right: 6%;
  bottom: 7%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2.2cqw;
  padding: 2.2cqw 3.6cqw 2.2cqw 2.2cqw;
  border-radius: 3cqw;
  background: var(--pa-float);
  box-shadow: inset 0 0 0 1px var(--pa-float-rim), 0 3cqw 7cqw -2cqw rgba(0, 0, 0, 0.55);
}
.pv__icon { display: grid; place-items: center; width: 7.4cqw; height: 7.4cqw; border-radius: 2cqw; background: linear-gradient(160deg, #2bd47d, #12a55c); box-shadow: 0 0 4cqw rgba(43, 212, 125, 0.45); }
.pv__icon svg { width: 55%; height: 55%; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; }
.pv__toast b { display: block; color: var(--pa-ink); font-size: 3cqw; }
.pv__toast span { color: var(--pa-ink-3); font-size: 2.3cqw; white-space: nowrap; }
.pa.is-playing .pv__toast { animation: paToast 0.6s var(--ease-out) 2.7s both; }
@keyframes paToast { from { opacity: 0; transform: translateY(4cqw) scale(0.94); } to { opacity: 1; transform: none; } }

/* confetti from the notification */
.pv__confetti { position: absolute; left: 70%; top: 84%; pointer-events: none; }
.pv__confetti i { position: absolute; width: 1.2cqw; height: 1.8cqw; border-radius: 0.3cqw; background: var(--c, #18cdfd); opacity: 0; }
.pv__confetti i:nth-child(1) { --c: #18cdfd; --x: -14cqw; --y: -16cqw; --r: 200deg; }
.pv__confetti i:nth-child(2) { --c: #2f86ff; --x: -6cqw; --y: -20cqw; --r: -160deg; }
.pv__confetti i:nth-child(3) { --c: #ffd166; --x: 4cqw; --y: -19cqw; --r: 240deg; }
.pv__confetti i:nth-child(4) { --c: #7fd3ff; --x: 12cqw; --y: -14cqw; --r: -220deg; }
.pv__confetti i:nth-child(5) { --c: #ff6b9a; --x: 16cqw; --y: -6cqw; --r: 180deg; }
.pv__confetti i:nth-child(6) { --c: #ffd166; --x: -18cqw; --y: -7cqw; --r: -200deg; }
.pv__confetti i:nth-child(7) { --c: #2bd47d; --x: -10cqw; --y: -12cqw; --r: 140deg; }
.pv__confetti i:nth-child(8) { --c: #18cdfd; --x: 8cqw; --y: -24cqw; --r: -120deg; }
.pv__confetti i:nth-child(9) { --c: #ff6b9a; --x: -2cqw; --y: -12cqw; --r: 260deg; }
.pv__confetti i:nth-child(10) { --c: #2bd47d; --x: 20cqw; --y: -18cqw; --r: -260deg; }
.pa.is-playing .pv__confetti i { animation: paConfetti 1.3s cubic-bezier(0.2, 0.7, 0.3, 1) 2.9s both; }
@keyframes paConfetti {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  10%, 70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 8cqw)) rotate(var(--r)); }
}

/* STORY DECK: the step text on the left, the steps as a stack of story cards on the right.
   The front card plays its scene while its bar fills, then flies off and the next one comes up
   (js/process.js). */
.hw { --hw-dur: 7s; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "head head" "deck side"; column-gap: clamp(40px, 6vw, 96px); align-items: center; }
.hw__head { grid-area: head; margin-bottom: 64px; text-align: center; }
.hw__head .h2 { margin-top: 22px; }
.hw__viewer { grid-area: deck; position: relative; display: flex; flex-direction: column; align-items: center; padding-bottom: 36px; }
.hw__stage { position: relative; display: flex; justify-content: center; width: 100%; padding-top: 6px; }
.hw__side { grid-area: side; min-width: 0; }

/* the deck: cards sit on top of each other, the ones behind step down and lean out */
.hw__deck { position: relative; width: 100%; max-width: 440px; aspect-ratio: 4 / 5; touch-action: pan-y; outline: none; }
.hw__deck:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 28px; }
.hw__deck:focus-visible { outline: 2px solid var(--accent); outline-offset: 12px; border-radius: 28px; }
.hw-card {
  --i: 0;
  --r: 0deg;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: 26px;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, #0a1d3d 0%, #030c1c 75%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 40px 80px -40px rgba(0, 0, 0, 0.9);
  transform: translateY(calc(var(--i) * 16px)) scale(calc(1 - var(--i) * 0.05)) rotate(var(--r));
  z-index: calc(10 - var(--i));
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.42s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.24s var(--ease), filter 0.3s var(--ease);
}
/* the cards behind are a touch darker, so the front one reads first */
.hw-card:not(.is-front) { filter: brightness(0.7); }
.hw-card.is-dragging { transition: none; cursor: grabbing; }
.hw-card.is-out { transform: translateX(125%) rotate(14deg); opacity: 0; }
.hw-card.is-out-left { transform: translateX(-125%) rotate(-14deg); opacity: 0; }

/* the story's top bar: one bar per step, your face and the step */
.hw-card__top { position: relative; z-index: 2; padding: 16px 16px 0; }
.hw-card__bars { display: flex; gap: 5px; }
.hw-card__bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.hw-card__bars b { display: block; width: 0; height: 100%; border-radius: inherit; background: #fff; }
.hw-card__bars .done b { width: 100%; }
.hw-card.is-front .hw-card__bars .now b { animation: hwFill var(--hw-dur) linear forwards; }
.hw.is-paused .hw-card__bars .now b,
.hw.is-offscreen .hw-card__bars .now b { animation-play-state: paused; }
@keyframes hwFill { to { width: 100%; } }
.hw-card__who { display: flex; align-items: center; gap: 9px; margin: 12px 0 0; color: #fff; font-size: 13.5px; line-height: 1; }
.hw-card__who img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 0 4px #2f86ff; }
.hw-card__who b { margin-left: 4px; font-weight: 600; }
.hw-card__who span { color: rgba(255, 255, 255, 0.6); }

/* the scene keeps its own shape, full width and centred in the space under the top bar */
.hw-card__art { flex: none; width: 100%; margin: auto 0; border-radius: 0; background: none; box-shadow: none; }

/* the step text: one at a time, the old one fades out before the new one comes in */
.hw__chapters { display: grid; }
.hw-ch { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity 0.16s var(--ease), transform 0.16s var(--ease), visibility 0s 0.16s; }
.hw-ch.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.3s var(--ease) 0.1s, transform 0.34s var(--ease-out) 0.1s, visibility 0s 0.1s; }
/* a tap, swipe or key changes the story instantly, like Instagram (js/process.js adds .is-instant for a frame) */
.hw.is-instant .hw-card, .hw.is-instant .hw-ch { transition: none !important; }
/* the step number: a small glass pill */
/* the step number, plain */
.hw-ch__num { display: block; margin-bottom: 14px; color: var(--text-4); font-size: 14px; font-weight: 500; letter-spacing: 0.1em; }
.hw-ch h3 { margin-bottom: 16px; font-size: clamp(34px, 3.4vw, 50px); font-weight: 700; line-height: 1.04; letter-spacing: -0.035em; }
.hw-ch p { max-width: 500px; color: var(--text-2); font-size: 17.5px; line-height: 1.6; }

/* the call to action under each step: a raised box with a line and a button */
.hw-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
  padding: 18px 18px 18px 24px;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(120deg, #0a4dff 0%, #1668ff 62%, #18b4fd 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 26px 56px -24px rgba(10, 77, 255, 0.95);
}
/* a soft light in the corner, so the blue has some depth */
.hw-cta::before { content: ""; position: absolute; right: -10%; top: -80%; z-index: -1; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 65%); }
.hw-cta__copy strong { display: block; margin-bottom: 5px; color: #fff; font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
.hw-cta__copy span { display: block; color: rgba(255, 255, 255, 0.9); font-size: 14.5px; line-height: 1.45; }

.hw-cta .sq-btn { flex: none; }

/* the "Next step" chip follows the mouse over the deck; touch screens get a hint until the first swipe */
/* the "Next step" chip that follows the mouse over the deck, and the touch hint (moved here from the old before/after) */
.hw__cursor { position: absolute; left: 0; top: 0; z-index: 6; display: none; align-items: center; gap: 7px; padding: 9px 14px 9px 11px; border-radius: 999px; background: #fff; color: #001224; font-size: 13.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.55); opacity: 0; scale: 0.7; pointer-events: none; transition: opacity 0.2s, scale 0.3s var(--ease-out); }
.hw__cursor svg, .hw__hint svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hw__cursor.is-on { opacity: 1; scale: 1; }
.hw__hint { position: absolute; left: 50%; bottom: -8px; z-index: 6; display: none; align-items: center; gap: 7px; padding: 7px 13px 7px 10px; border-radius: 999px; background: rgba(6, 16, 34, 0.92); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; translate: -50% 0; pointer-events: none; transition: opacity 0.4s; }
@media (hover: hover) and (pointer: fine) { .hw__cursor { display: inline-flex; } }
@media (hover: none) { .hw__hint { display: inline-flex; } }
.hw__viewer .hw__cursor { z-index: 20; }
.hw__viewer .hw__hint { bottom: -22px; z-index: 20; }
.hw__viewer.has-swapped .hw__hint { opacity: 0; }
@media (hover: hover) and (pointer: fine) { .hw__deck, .hw-card { cursor: none; } }

/* light mode: the cards stay dark like real stories; the text and box follow the page */
[data-theme="light"] .hw-card { box-shadow: inset 0 0 0 1px rgba(6, 30, 66, 0.12), 0 40px 80px -40px rgba(10, 50, 120, 0.55); }

/* tablets and phones: heading, then the deck, then the text */
@media (max-width: 1024px) {
  .hw { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "deck" "side"; }
  .hw__head { margin-bottom: 44px; }
  .hw__viewer { padding-bottom: 56px; }
  .hw__deck { max-width: 380px; }
  .hw__side { max-width: 560px; width: 100%; justify-self: center; }
}
@media (max-width: 767px) {
  .hw__head .h2 { margin-top: 16px; }
  /* phones: no stack, one full-width card at a time; it still turns on its own, or on a tap / swipe */
  .hw__deck { max-width: none; aspect-ratio: 1 / 1.08; }
  .hw-card { transform: none !important; }
  .hw-card:not(.is-front) { opacity: 0; filter: none; pointer-events: none; }
  .hw-card.is-out, .hw-card.is-out-left { opacity: 0; transform: none !important; }
  .hw__head { margin-bottom: 32px; }
  .hw__viewer { padding-bottom: 48px; }
  .hw-card { border-radius: 22px; }
  .hw-card__top { padding: 12px 12px 0; }
  .hw-card__who { margin-top: 10px; font-size: 12.5px; }
  .hw-card__who img { width: 26px; height: 26px; }
  .hw-ch__num { margin-bottom: 14px; }
  .hw-cta__copy strong { font-size: 18px; }
  .hw-ch h3 { margin-bottom: 12px; font-size: 30px; }
  .hw-ch p { font-size: 16px; line-height: 1.55; }
  .hw-cta { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
  .hw-cta .sq-btn { width: 100%; justify-content: space-between; }
}

/* ---------- reduced motion: show every picture finished ---------- */
@media (prefers-reduced-motion: reduce) {
  .pa *, .pa *::after { animation-delay: 0s !important; }
  .pc__typing i, .pg__ln--last::after { animation: none !important; }
  .pg [data-depth] { translate: none; }
  .js .pa .pv__btn { opacity: 1; animation: none !important; }
  .pv__confetti { display: none; }
}
