/* ════════════════════════════════════════════════════════════════════════
 * HOW IT WORKS v2 — Paths + Core flow + Optional tools + Post-gen
 * v0.2.26 — replaces the old 4-step workflow with a full feature showcase.
 * Every tool gets its own CSS-only animated demo. Imported from marketing.css.
 * ════════════════════════════════════════════════════════════════════════ */

/* ── Two style-source paths ─────────────────────────────────────────── */
.hiw-paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-5);
  margin: var(--gap-7) 0 var(--gap-6);
}
@media (max-width: 900px) { .hiw-paths { grid-template-columns: 1fr; } }
.hiw-path {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  padding: var(--gap-5) var(--gap-5) var(--gap-4);
  box-shadow: var(--shadow-1);
  transition: border-color 200ms ease, box-shadow 240ms ease, transform 200ms ease;
}
.hiw-path:hover {
  border-color: var(--brand-coral);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.10);
  transform: translateY(-2px);
}
.hiw-path-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-700);
  margin-bottom: var(--gap-3);
}
.hiw-path-tag-new {
  background: var(--brand-coral);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.hiw-path h3 { margin: 0 0 var(--gap-2); font-size: 22px; letter-spacing: -0.02em; }
.hiw-path > p { color: var(--ink-500); font-size: 15px; line-height: 1.55; margin-bottom: var(--gap-4); }

/* ── Channel-list animation ─────────────────────────────────────────── */
.hiw-anim {
  background: var(--bg-soft);
  border-radius: var(--radius-2);
  padding: var(--gap-4);
  margin-top: var(--gap-3);
  overflow: hidden;
}
.hiw-anim-channel { display: flex; flex-direction: column; gap: 8px; }
.hiw-ch-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--ink-700);
  position: relative;
}
.hiw-ch-avatar { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; }
.hiw-ch-avatar.a { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.hiw-ch-avatar.b { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.hiw-ch-avatar.c { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.hiw-ch-avatar.d { background: linear-gradient(135deg, #10b981, #06b6d4); }
.hiw-ch-name { flex: 1; }
.hiw-ch-check {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-coral); color: #fff;
  font-size: 13px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.6);
  transition: opacity 300ms ease, transform 300ms ease;
}
.hiw-ch-row[data-row="1"] .hiw-ch-check { animation: hiwChCheck 6s infinite ease-in-out 0s; }
.hiw-ch-row[data-row="2"] .hiw-ch-check { animation: hiwChCheck 6s infinite ease-in-out 1.5s; }
.hiw-ch-row[data-row="3"] .hiw-ch-check { animation: hiwChCheck 6s infinite ease-in-out 3s; }
.hiw-ch-row[data-row="4"] .hiw-ch-check { animation: hiwChCheck 6s infinite ease-in-out 4.5s; }
.hiw-ch-row[data-row="1"] { animation: hiwChActive 6s infinite ease-in-out 0s; }
.hiw-ch-row[data-row="2"] { animation: hiwChActive 6s infinite ease-in-out 1.5s; }
.hiw-ch-row[data-row="3"] { animation: hiwChActive 6s infinite ease-in-out 3s; }
.hiw-ch-row[data-row="4"] { animation: hiwChActive 6s infinite ease-in-out 4.5s; }
@keyframes hiwChCheck {
  0%, 90%, 100% { opacity: 0; transform: scale(0.6); }
  10%, 25% { opacity: 1; transform: scale(1); }
}
@keyframes hiwChActive {
  0%, 90%, 100% { border-color: var(--border); background: #fff; }
  10%, 25% { border-color: var(--brand-coral); background: rgba(37,99,235,0.04); }
}

/* ── Clone source → output animation ────────────────────────────────── */
.hiw-anim-clone {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--gap-3);
  padding: var(--gap-4);
}
.hiw-clone-side {
  position: relative;
  border-radius: var(--radius-2);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.hiw-clone-side img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hiw-clone-label {
  position: absolute;
  bottom: 8px; left: 8px;
  background: rgba(0,0,0,0.62);
  color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px;
}
.hiw-clone-arrow {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--brand-coral);
}
.hiw-clone-arrow svg { width: 28px; height: 28px; animation: hiwArrowPulse 2.4s infinite ease-in-out; }
.hiw-clone-arrow span { font-size: 9px; font-weight: 800; letter-spacing: 0.12em; }
@keyframes hiwArrowPulse {
  0%, 100% { transform: translateX(-4px); opacity: 0.55; }
  50% { transform: translateX(4px); opacity: 1; }
}
.hiw-clone-out img { animation: hiwCloneFade 4s infinite ease-in-out; }
@keyframes hiwCloneFade {
  0%, 100% { opacity: 1; }
  45%, 55% { opacity: 0.35; filter: blur(2px); }
}

/* ── Core 3-step flow ───────────────────────────────────────────────── */
.hiw-core {
  display: flex; align-items: center; justify-content: center;
  gap: var(--gap-3);
  background: linear-gradient(135deg, rgba(37,99,235,0.04), rgba(37,99,235,0.01));
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  padding: var(--gap-4) var(--gap-5);
  margin: 0 0 var(--gap-7);
  flex-wrap: wrap;
}
.hiw-core-step { display: flex; align-items: center; gap: var(--gap-3); flex: 1; min-width: 220px; }
.hiw-core-num {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--ink-900); color: #fff;
  font-size: 16px; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hiw-core-body { display: flex; flex-direction: column; gap: 2px; }
.hiw-core-body strong { font-size: 15px; color: var(--ink-900); font-weight: 700; }
.hiw-core-body span { font-size: 13px; color: var(--ink-500); }
.hiw-core-link { color: var(--ink-300); font-size: 22px; font-weight: 700; }
@media (max-width: 900px) {
  .hiw-core-link { display: none; }
  .hiw-core { padding: var(--gap-4); }
}

/* ── Section dividers ───────────────────────────────────────────────── */
.hiw-divider { text-align: center; margin: var(--gap-6) 0 var(--gap-5); }
.hiw-divider-tag {
  display: inline-block;
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 14px; border-radius: 999px;
  background: var(--ink-900); color: #fff;
  margin-bottom: var(--gap-2);
}
.hiw-divider-tag-after { background: var(--brand-coral); }
.hiw-divider p { color: var(--ink-500); font-size: 14px; max-width: 540px; margin: 0 auto; }

/* ── Optional power tools grid ──────────────────────────────────────── */
.hiw-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-4);
}
@media (max-width: 980px) { .hiw-tools { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .hiw-tools { grid-template-columns: 1fr; } }
.hiw-tool {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  padding: var(--gap-4);
  display: flex; flex-direction: column; gap: var(--gap-3);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 220ms ease;
}
.hiw-tool:hover {
  border-color: var(--brand-coral);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}
.hiw-tool-head { display: flex; align-items: center; gap: var(--gap-2); flex-wrap: wrap; }
.hiw-tool-head h4 { font-size: 16px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.hiw-tool > p { font-size: 13.5px; line-height: 1.5; color: var(--ink-500); margin: 0; }
.hiw-optional-pill {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: var(--bg-soft); color: var(--ink-500);
  border: 1px solid var(--border);
}

.hiw-tool-anim {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  border-radius: var(--radius-2);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  margin-top: auto;
}

/* Tool 1 — Sketch pad: pencil draws shapes */
.hiw-anim-sketch .hiw-sketch-canvas {
  width: 100%; height: 100%;
  background:
    linear-gradient(0deg, rgba(0,0,0,0.04) 1px, transparent 1px) 0 0/16px 16px,
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px) 0 0/16px 16px,
    #fff;
  display: flex; align-items: center; justify-content: center;
}
.hiw-anim-sketch svg { width: 80%; height: 80%; }
/* Hand-drawn sketch animation — circle drawn first, then three text-line
 * scribbles wobble in one after the other so it reads as a quick mockup. */
.sketch-draw { animation: hiwSketchDrawCircle 5s infinite ease-in-out; }
.sketch-draw-2 { animation: hiwSketchDrawLine 5s infinite ease-in-out 1.2s; }
.sketch-draw-3 { animation: hiwSketchDrawLine 5s infinite ease-in-out 1.6s; }
.sketch-draw-4 { animation: hiwSketchDrawLine 5s infinite ease-in-out 2.0s; }
@keyframes hiwSketchDrawCircle {
  0%   { stroke-dashoffset: 220; opacity: 0; }
  10%  { opacity: 1; }
  45%  { stroke-dashoffset: 0; opacity: 1; }
  85%  { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes hiwSketchDrawLine {
  0%   { stroke-dashoffset: 80; opacity: 0; }
  20%  { opacity: 1; }
  60%  { stroke-dashoffset: 0; opacity: 1; }
  85%  { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* Tool 2 — Multi-reference: 3-step storyboard using a real founder
 * generation ("The truth about the Lord of Light" → @midnightlorekeeper).
 * Step 1 shows the 2 user refs, step 2 shows 3 channel-style samples,
 * step 3 shows the final render — all crossfading in the same 16:9
 * panel on a 9s loop. Tells the actual "refs + channel = render" story
 * instead of just stacking 4 tiles.
 */
/* Multi-ref panel — light bg-soft, same as every other tool. 4-step
 * storyboard tells the actual workflow:
 *   Step 1 (0–2.5s)   empty dashed drop zone with +
 *   Step 2 (2.5–5s)   2 refs SLIDE INTO the box (real entrance motion)
 *   Step 3 (5–7.5s)   channel sample full-width
 *   Step 4 (7.5–10s)  final render full-width
 * 10s loop. Labels are ABSOLUTE overlays on top-left of each step so
 * the image area gets the FULL panel height — solves the 16:9 source
 * getting cropped to a 2:1 box. */
.hiw-anim-refs {
  position: relative;
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}
.hiw-ref-step {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: hiwRefStep 10s infinite ease-in-out;
}
.hiw-ref-step[data-step="1"] { animation-delay: 0s;   }
.hiw-ref-step[data-step="2"] { animation-delay: 2.5s; }
.hiw-ref-step[data-step="3"] { animation-delay: 5s;   }
.hiw-ref-step[data-step="4"] { animation-delay: 7.5s; }
@keyframes hiwRefStep {
  0%   { opacity: 0; }
  3%   { opacity: 1; }
  22%  { opacity: 1; }
  25%  { opacity: 0; }
  100% { opacity: 0; }
}

/* Step label — absolutely positioned overlay so the image content
 * below gets the full panel rect (no flex column eating ~32px). */
.hiw-ref-step-label {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink-700);
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Empty drop zone — fills full panel. Dashed border + huge + + hint. */
.hiw-ref-dropzone {
  position: absolute;
  inset: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px dashed var(--border-strong, #d1d5db);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.015);
}
.hiw-ref-plus {
  font-size: 48px;
  font-weight: 300;
  line-height: 1;
  color: var(--ink-400);
  margin-top: -4px;
  /* gentle breathing pulse so the + reads as a 'tap here' affordance */
  animation: hiwRefPlusPulse 1.8s infinite ease-in-out;
}
@keyframes hiwRefPlusPulse {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.10); opacity: 1; }
}
.hiw-ref-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-500);
  letter-spacing: 0.02em;
}

/* Step 2 — refs land IN the same drop-zone-shaped area. The dashed
 * border stays so it visually reads as 'the box now has stuff'. */
.hiw-ref-row {
  position: absolute;
  inset: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  /* Keep the dashed border in step 2 so the visual continuity from
   * step 1 (empty box → filled box) is unmistakable. Step 3/4 use
   * full-width single-image variant which overrides this. */
}
.hiw-ref-step[data-step="2"] .hiw-ref-row {
  border: 2px dashed var(--border-strong, #d1d5db);
  border-radius: 8px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.015);
}
.hiw-ref-row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  min-width: 0;
  min-height: 0;
}

/* The "being added" motion: refs slide up from below the box with a
 * small scale bounce, staggered. The keyframes are tuned to the 10s
 * loop — at the moment step 2 starts (25% of cycle), the refs are
 * tucked down + invisible; they spring to settled position by 30%. */
.hiw-ref-step[data-step="2"] .hiw-ref-row img {
  animation: hiwRefLandIn 10s infinite cubic-bezier(.22,.9,.3,1.25);
}
.hiw-ref-step[data-step="2"] .hiw-ref-row img:nth-child(2) {
  animation-delay: 0.2s; /* second ref lands a beat after the first */
}
@keyframes hiwRefLandIn {
  /* before step 2's window: hidden + below */
  0%, 22%  { opacity: 0; transform: translateY(28px) scale(0.86); }
  /* mid-step-2 fade-in window: arrive */
  28%, 47% { opacity: 1; transform: translateY(0)    scale(1);    }
  /* after step 2: parent step fades, but reset here so loop is clean */
  50%, 100% { opacity: 0; transform: translateY(28px) scale(0.86); }
}

/* Single full-width image (channel sample, final render). Step 3+4
 * tiles fill the FULL panel rect, no dashed border, no padding —
 * 16:9 source in 16:9 frame = perfect object-fit:cover, zero crop. */
.hiw-ref-step[data-step="3"] .hiw-ref-row,
.hiw-ref-step[data-step="4"] .hiw-ref-row {
  inset: 0;
  grid-template-columns: 1fr;
  gap: 0;
  border: none;
  padding: 0;
  background: none;
}
.hiw-ref-row .hiw-ref-final {
  grid-column: 1 / -1;
  border-radius: var(--radius-2);
  box-shadow: none;
}

/* Tool 3 — Auto character: title + portrait pop */
.hiw-anim-character { flex-direction: column; gap: 10px; padding: 14px; background: #fff; }
.hiw-char-title { font-size: 15px; font-weight: 800; color: var(--ink-900); text-align: center; }
.hiw-char-title em {
  color: var(--brand-coral); font-style: normal;
  background: linear-gradient(180deg, transparent 60%, rgba(37,99,235,0.18) 60%);
  padding: 0 2px;
}
.hiw-char-pop {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-soft);
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1.5px solid var(--brand-coral);
  opacity: 0; transform: scale(0.85);
  animation: hiwCharPop 4s infinite ease-out;
}
.hiw-char-portrait {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  /* Subtle warm photo-like background — stands in for an actual
   * Wikipedia portrait without using a copyrighted likeness. */
  background: linear-gradient(160deg, #fef3c7 0%, #fde68a 40%, #c4b59a 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.hiw-char-portrait svg {
  width: 28px;
  height: 28px;
  color: #44403c;        /* warm-grey silhouette */
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0;
  /* Trim the bottom of the body so the silhouette fits the circle without
   * looking cut off — the path naturally ends at the circle boundary. */
}
.hiw-char-label { font-size: 11px; font-weight: 700; color: var(--brand-coral); letter-spacing: 0.04em; }
@keyframes hiwCharPop {
  0%, 85%, 100% { opacity: 0; transform: scale(0.85); }
  25%, 75% { opacity: 1; transform: scale(1); }
}

/* Tool 4 — Creative mode: 3-position slider */
.hiw-anim-mode { padding: 12px; }
.hiw-mode-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  width: 100%;
  max-width: 280px;
}
.hiw-mode-btn {
  position: relative; z-index: 2;
  text-align: center;
  font-size: 12px; font-weight: 700;
  padding: 8px 0;
  color: var(--ink-500);
  border-radius: 999px;
  transition: color 240ms ease;
}
.hiw-mode-slider {
  position: absolute;
  top: 4px; bottom: 4px;
  width: calc((100% - 8px) / 3);
  background: var(--ink-900);
  border-radius: 999px;
  z-index: 1;
  animation: hiwModeSlide 5s infinite ease-in-out;
}
@keyframes hiwModeSlide {
  0%, 25% { left: 4px; }
  33%, 58% { left: calc(33.33% + 1px); }
  66%, 91% { left: calc(66.66% - 2px); }
  100% { left: 4px; }
}

/* Tool 5 — Variants: REAL 4-variant generation, displayed as ONE
 * full-panel image that crossfades between the 4 takes every 2s.
 *
 * Why this approach (not a 2x2 grid): the panel is 16:9, each source
 * thumbnail is 16:9 — so a single image fits the panel pixel-perfect
 * with zero cropping AND ~4× larger linear size than a 2x2 grid would
 * give. The cycling carousel still tells the "4 variants from one
 * brief" story via dots + counter overlay. No padding wasted.
 */
.hiw-anim-variants {
  padding: 0;
  background: #000;
  position: relative;
  /* aspect-ratio: 16/9 inherited from .hiw-tool-anim */
}
.hiw-var-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}
.hiw-var-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;  /* 16:9 image in 16:9 box = perfect fill, no crop */
  display: block;
  opacity: 0;
  animation: hiwVarFrame 8s infinite ease-in-out;
}
.hiw-var-frame[data-i="1"] { animation-delay: 0s; }
.hiw-var-frame[data-i="2"] { animation-delay: 2s; }
.hiw-var-frame[data-i="3"] { animation-delay: 4s; }
.hiw-var-frame[data-i="4"] { animation-delay: 6s; }
@keyframes hiwVarFrame {
  0%   { opacity: 0; }
  3%   { opacity: 1; }
  22%  { opacity: 1; }
  25%  { opacity: 0; }
  100% { opacity: 0; }
}

/* Top overlay — title + soft dark gradient so the brief is readable
 * over any thumbnail without obscuring the artwork below. */
.hiw-var-overlay-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 8px 12px 14px;
  z-index: 2;
  background: linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}
.hiw-var-brief {
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  color: #fff;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.45);
}

/* Bottom overlay — dots indicator + variant counter (1/4 → 4/4). */
.hiw-var-overlay-bot {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 12px 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(0deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}
.hiw-var-dots {
  display: flex;
  gap: 5px;
}
.hiw-var-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  transition: none;
  animation: hiwVarDot 8s infinite ease-in-out;
}
.hiw-var-dot[data-i="1"] { animation-delay: 0s; }
.hiw-var-dot[data-i="2"] { animation-delay: 2s; }
.hiw-var-dot[data-i="3"] { animation-delay: 4s; }
.hiw-var-dot[data-i="4"] { animation-delay: 6s; }
@keyframes hiwVarDot {
  0%, 25%, 100% { background: rgba(255, 255, 255, 0.32); transform: scale(1); }
  3%,  22%      { background: var(--brand-coral); transform: scale(1.4); }
}

/* Counter — 4 absolutely-stacked numerals, one visible per variant. */
.hiw-var-counter {
  position: relative;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.hiw-var-counter-num {
  display: inline-block;
  position: absolute;
  right: 22px;   /* slot to the left of " / 4" */
  top: 0;
  opacity: 0;
  animation: hiwVarCounter 8s infinite ease-in-out;
}
.hiw-var-counter-num[data-i="1"] { animation-delay: 0s; }
.hiw-var-counter-num[data-i="2"] { animation-delay: 2s; }
.hiw-var-counter-num[data-i="3"] { animation-delay: 4s; }
.hiw-var-counter-num[data-i="4"] { animation-delay: 6s; }
@keyframes hiwVarCounter {
  0%, 25%, 100% { opacity: 0; }
  3%, 22%       { opacity: 1; }
}

/* Tool 6 — No text: bold text + diagonal strike on the SAME light
 * panel background as every other tool card. Previous version had a
 * black panel — visually inconsistent with the row, looked like an
 * error case. Now text is ink-900 on bg-soft so it matches Sketch /
 * Multi-ref / Auto character / Creative / Variants. */
.hiw-anim-notext {
  /* inherits bg-soft from .hiw-tool-anim — no override needed */
}
.hiw-notext-canvas {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  /* Small side padding so the strike can extend slightly past the
   * text edges without overflowing its parent. */
  padding: 0 8px;
}
.hiw-notext-word {
  position: relative;
  font-size: 22px; font-weight: 900;
  color: var(--ink-900);
  letter-spacing: 0.02em;
  font-family: Inter, system-ui, sans-serif;
  animation: hiwNoTextFade 4s infinite ease-in-out;
}
.hiw-notext-strike {
  position: absolute;
  /* Span the canvas width edge-to-edge so the strike covers the full
   * word with a tiny margin from the padding above. */
  left: 0; right: 0;
  top: 50%;
  height: 3px;
  background: #ef4444;
  border-radius: 2px;
  /* transform-origin CENTER (was 'left center' — that's what caused the
   * right end to drift below the word as it rotated). Reduced angle
   * -8deg -> -3deg so the strike stays on the text line. */
  transform-origin: center center;
  transform: translateY(-1.5px) scaleX(0) rotate(-3deg);
  animation: hiwNoTextStrike 4s infinite ease-in-out;
}
@keyframes hiwNoTextFade {
  0%, 100% { opacity: 1; }
  85%, 95% { opacity: 0.35; }
}
@keyframes hiwNoTextStrike {
  0%, 30%  { transform: translateY(-1.5px) scaleX(0) rotate(-3deg); }
  55%, 95% { transform: translateY(-1.5px) scaleX(1) rotate(-3deg); }
  100%     { transform: translateY(-1.5px) scaleX(0) rotate(-3deg); }
}

/* ── Post-generation cards ──────────────────────────────────────────── */
.hiw-post {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-4);
}
@media (max-width: 900px) { .hiw-post { grid-template-columns: 1fr; } }
.hiw-post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  padding: var(--gap-4);
  display: flex; flex-direction: column; gap: var(--gap-3);
  box-shadow: var(--shadow-1);
  transition: border-color 200ms ease, transform 200ms ease;
}
.hiw-post-card:hover { border-color: var(--brand-coral); transform: translateY(-2px); }
.hiw-post-head { display: flex; align-items: center; gap: 10px; }
.hiw-post-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-coral); color: #fff;
  font-size: 14px; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center;
}
.hiw-post-head h4 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.015em; }
.hiw-post-card > p { font-size: 14px; color: var(--ink-500); line-height: 1.55; margin: 0; }
.hiw-post-anim {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  border-radius: var(--radius-2);
  overflow: hidden;
  margin-top: auto;
}

/* Post 1 — Refine: prompt typing + image swap */
.hiw-anim-refine { display: flex; flex-direction: column; padding: 10px; gap: 6px; }
.hiw-refine-prompt {
  background: #fff;
  border: 1.5px solid var(--brand-coral);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px; font-weight: 600; color: var(--ink-900);
  font-family: 'Courier New', monospace;
  min-height: 24px;
}
.hiw-refine-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  animation: hiwRefineType 5s infinite steps(40, end);
  max-width: 100%;
}
.hiw-refine-cursor {
  display: inline-block; color: var(--brand-coral);
  animation: hiwBlink 0.6s infinite step-end;
}
@keyframes hiwRefineType {
  0% { width: 0; }
  60%, 100% { width: 100%; }
}
@keyframes hiwBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
.hiw-refine-arrow {
  font-size: 14px; font-weight: 700;
  color: var(--brand-coral); text-align: center; line-height: 1;
}
.hiw-refine-img {
  border-radius: 4px;
  position: absolute;
  bottom: 10px; left: 10px; right: 10px;
  height: 38%;
}
.hiw-refine-img-before {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  animation: hiwRefineSwap 5s infinite ease-in-out;
}
.hiw-refine-img-after  {
  background: linear-gradient(135deg, #1e1b4b, #6366f1);
  opacity: 0;
  animation: hiwRefineSwap 5s infinite ease-in-out reverse;
}
@keyframes hiwRefineSwap {
  0%, 60% { opacity: 1; }
  75%, 100% { opacity: 0; }
}

/* Post 2 — PinPoint: REAL before/after using master's Einstein-clone
 * edit (green syringe → red). 6s loop:
 *   0–15%   BEFORE alone
 *   15–40%  red circle draws around the syringe
 *   38–55%  'make it red' tooltip pops
 *   55–70%  AFTER crossfades in (the syringe + drip turn red)
 *   70–90%  AFTER held; circle + tooltip fade out
 *   90–100% AFTER fades back to BEFORE for seamless loop */
.hiw-anim-pinpoint .hiw-pp-canvas {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
}
.hiw-pp-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hiw-pp-before { z-index: 1; }
.hiw-pp-after  { z-index: 2; opacity: 0; animation: hiwPpReveal 6s infinite ease-in-out; }
@keyframes hiwPpReveal {
  0%, 50%   { opacity: 0; }
  62%, 90%  { opacity: 1; }
  100%      { opacity: 0; }
}

/* SVG overlay holds the circle. preserveAspectRatio=none stretches
 * with the card so the circle stays locked on the syringe. */
.hiw-pp-mark {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 3;
  pointer-events: none;
}
.pp-draw {
  animation: hiwPpDraw 6s infinite ease-in-out;
  /* Drop shadow so the red circle reads on the dark mannequin head. */
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
}
@keyframes hiwPpDraw {
  0%, 15%   { stroke-dashoffset: 113; opacity: 0; }
  20%       { opacity: 1; }
  40%       { stroke-dashoffset: 0; opacity: 1; }
  75%       { stroke-dashoffset: 0; opacity: 1; }
  88%, 100% { stroke-dashoffset: 0; opacity: 0; }
}

/* Tooltip — bottom-left over the AFTER so it reads on either frame.
 * Animates in once the circle is fully drawn, holds, then fades. */
.hiw-pp-bubble {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 4;
  background: #fff;
  color: var(--ink-900);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.32);
  opacity: 0;
  animation: hiwPpBubble 6s infinite ease-in-out;
}
.hiw-pp-bubble::before {
  /* Red dot before the text — matches the circle, signals 'this is the
   * mark you drew'. */
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ef4444;
  margin-right: 6px;
  vertical-align: 1px;
}
@keyframes hiwPpBubble {
  0%, 38%   { opacity: 0; transform: translateY(8px); }
  45%, 80%  { opacity: 1; transform: translateY(0); }
  90%, 100% { opacity: 0; transform: translateY(8px); }
}

/* Post 3 — Restyle: REAL before/after using master's actual restyle
 * test. The Khronicle-style realistic syringe Einstein crossfades to
 * the @theodd1sout cartoon styling while a channel pill at the bottom
 * morphs from '@Khronicle' to '@theodd1sout' synchronously.
 *
 * 8s loop, same composition / radically different visual language:
 *   0–18%    BEFORE alone, pill says '@Khronicle'
 *   18–32%   pill quick-flips on Y axis at 25% → text swaps to @theodd1sout
 *   32–55%   AFTER (cartoon) crossfades over BEFORE
 *   55–82%   AFTER held with @theodd1sout pill
 *   82–95%   AFTER fades back to BEFORE, pill back to @Khronicle
 *   95–100%  rest before loop */
.hiw-anim-restyle {
  padding: 0;
  position: relative;
}
.hiw-restyle-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}
.hiw-restyle-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hiw-restyle-before { z-index: 1; }
.hiw-restyle-after  { z-index: 2; opacity: 0; animation: hiwRestyleReveal 8s infinite ease-in-out; }
@keyframes hiwRestyleReveal {
  0%, 25%   { opacity: 0; }
  40%, 85%  { opacity: 1; }
  95%, 100% { opacity: 0; }
}

/* Channel pill at bottom-center. Two-arrow swap icon + stacked
 * channel labels that crossfade with a brief flip motion. Bumped
 * bottom inset (12→18px) so it sits clear of the card's rounded
 * corner. Slightly larger padding to give the swap icon room. */
.hiw-restyle-pill {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink-900);
  font-size: 11.5px;
  font-weight: 800;
  padding: 6px 13px 6px 11px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.30);
  letter-spacing: 0.01em;
  animation: hiwRestylePillFlip 8s infinite ease-in-out;
}
@keyframes hiwRestylePillFlip {
  /* Flat most of the time; brief 3D edge-on flip at the swap moment
   * (~25% of the loop) — feels like a card flipping. */
  0%, 20%   { transform: translateX(-50%) rotateX(0deg)   scale(1); }
  25%       { transform: translateX(-50%) rotateX(82deg)  scale(0.95); }
  30%       { transform: translateX(-50%) rotateX(-12deg) scale(1.04); }
  35%, 100% { transform: translateX(-50%) rotateX(0deg)   scale(1); }
}

/* Two-arrow swap icon — spins 180° at the channel-switch moment, then
 * spins back 360° on the loop-reset so it always animates whenever
 * the text changes. Coral color so the eye locks on it. */
.hiw-restyle-swap {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--brand-coral);
  animation: hiwRestyleSwapSpin 8s infinite cubic-bezier(.4,.0,.2,1);
}
@keyframes hiwRestyleSwapSpin {
  /* Resting at 0 — quick 180° spin at the swap moment (22-32% of loop)
   * to emphasise the channel change. Then sits at 180° during the AFTER
   * window. Spins back 180° (to 360° = 0° visually) when the loop
   * resets to BEFORE around 88-95%. */
  0%, 22%   { transform: rotate(0deg);   }
  32%, 88%  { transform: rotate(180deg); }
  95%, 100% { transform: rotate(360deg); }
}
/* Both channel labels share the SAME CSS-grid cell — the cell auto-
 * sizes to the WIDER of the two labels (@theodd1sout = 12ch vs
 * @Khronicle = 10ch). Neither label affects layout, only opacity
 * animates. No more pill width jump or overflow during the swap. */
.hiw-restyle-ch-stack {
  display: inline-grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
.hiw-restyle-ch-stack > .hiw-restyle-ch {
  grid-column: 1;
  grid-row: 1;
  white-space: nowrap;
  text-align: center;
}
.hiw-restyle-ch-1 { animation: hiwRestyleChOut 8s infinite ease-in-out; }
.hiw-restyle-ch-2 { animation: hiwRestyleChIn  8s infinite ease-in-out; }
@keyframes hiwRestyleChOut {
  0%, 22%   { opacity: 1; }
  27%, 90%  { opacity: 0; }
  95%, 100% { opacity: 1; }
}
@keyframes hiwRestyleChIn {
  0%, 25%   { opacity: 0; }
  30%, 88%  { opacity: 1; }
  93%, 100% { opacity: 0; }
}
