/* ---------------------------------------------------------------
   The Loop — nine sticky module cards in one deck.
   Namespace: every selector is .lo / .lo-*.
   Two card treatments:
     .lo-t1  creative + its decode  (image-led)
     .lo-t2  measurement readout    (data-led)
   The sticky-stack mechanic is carried over from the original:
   all cards are sticky inside one .lo-track, each pinned while the
   next climbs over it; --d is the stack depth written by loop.js.
   --------------------------------------------------------------- */

.loop.lo{
  position:relative;z-index:2;isolation:isolate;
  background:#fafafa;
  background-image:radial-gradient(#17121f14 1px,transparent 1.2px);
  background-size:28px 28px;
  padding-block:clamp(72px,9vh,120px) clamp(32px,5vh,56px);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Helvetica Neue",Inter,system-ui,Arial,sans-serif;
  color:#24202d;
  --lo-nav:96px;
  --lo-step:16px;
  --lo-pin:calc(var(--lo-nav) + 3 * var(--lo-step));
  --lo-card-h:min(560px,calc(100vh - var(--lo-pin) - 32px));
  --lo-stage-h:clamp(220px,calc(var(--lo-card-h) - 168px),392px);
  --lo-ease:cubic-bezier(.16,1,.3,1);
}
.loop.lo::before{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(180deg,#fafafa,#fafafa00 18%,#fafafa00 82%,#fafafa)}

.lo-inner{position:relative;z-index:1;width:min(1560px,calc(100% - 2*clamp(20px,4vw,72px)));margin-inline:auto}

/* --- section head --- */
.lo-head{max-width:880px;margin:0 auto clamp(44px,6vh,76px);text-align:center}
.lo-eyebrow{display:inline-block;margin:0 0 18px;padding:7px 14px;border-radius:999px;
  background:#f2eaff;color:#7c3aed;
  font-family:ui-monospace,Menlo,monospace;font-size:10.5px;letter-spacing:.16em;text-transform:uppercase}
.lo-h2{margin:0 0 14px;font-size:clamp(30px,3.4vw,50px);font-weight:700;letter-spacing:-.04em;
  line-height:1.05;color:#17121f;text-wrap:balance}
.lo-lead{margin:0 auto;max-width:56ch;font-size:clamp(15px,1.15vw,18px);line-height:1.6;color:#5f566f}

/* --- the deck --- */
.lo-track{position:relative;padding-bottom:18vh}
/* .lo-slot adds no box; .lo-sent is a zero-width marker that reports the
   card's position in flow. Spacing lives in the marker, never in a card
   margin: a sticky element releases when its MARGIN box hits the edge. */
.lo-slot{display:contents}
.lo-sent{display:block;height:38vh}
.lo-slot:first-child .lo-sent{height:0}

.lo-card{position:sticky;top:var(--lo-pin);--d:0;
  display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);
  gap:clamp(24px,3.5vw,64px);align-items:center;
  height:var(--lo-card-h);
  padding:clamp(20px,2.4vw,34px) clamp(24px,3.4vw,56px);
  border-radius:26px;background:#fff;overflow:visible;
  box-shadow:inset 0 0 0 1px #fff,0 0 0 1px #17121f0d,0 -18px 44px -26px #17121f4d,0 30px 70px -40px #2a1a5a33;
  /* each level behind steps up and shrinks, so older cards fan out above */
  transform-origin:50% 0;
  transform:translateY(calc(var(--d) * -1 * var(--lo-step))) scale(calc(1 - var(--d) * .05));
  will-change:transform}
.lo-card::after{content:"";position:absolute;inset:0;border-radius:26px;background:#f3f1f7;
  opacity:calc(var(--d) * .3);pointer-events:none;transition:opacity .15s linear}
.lo-card.lo-strips{grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr)}
.lo-card.lo-flip{grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr)}
.lo-card.lo-flip .lo-copy{order:2}
.lo-card.lo-flip .lo-panel{order:1}

/* --- copy column: pillar, heading, one line. Nothing else. --- */
.lo-copy{position:relative;z-index:1;max-width:560px}
.lo-pillar{margin:0 0 12px;font-family:ui-monospace,Menlo,monospace;font-size:11px;
  letter-spacing:.2em;text-transform:uppercase;color:#7c3aed}
.lo-h3{margin:0 0 12px;font-size:clamp(28px,2.8vw,42px);font-weight:700;letter-spacing:-.04em;
  line-height:1.05;color:#17121f}
.lo-sub{margin:0;max-width:24ch;font-size:clamp(16px,1.35vw,20px);line-height:1.5;color:#5f566f}

/* --- panel: the one visual on the card --- */
.lo-panel{position:relative;z-index:1;border-radius:18px;background:#fff;
  padding:clamp(14px,1.5vw,20px);
  min-height:calc(var(--lo-stage-h) - 30px);display:flex;flex-direction:column;justify-content:center;
  box-shadow:inset 0 0 0 1px #17121f0d,0 24px 60px -30px #2a1a5a4d}

/* image boxes: fixed ratio + a fill colour, so a missing file never collapses */
.lo-shot{position:relative;margin:0;overflow:hidden;border-radius:14px;background:#efeaf7;
  box-shadow:inset 0 0 0 1px #17121f0f}
.lo-shot img{display:block;width:100%;height:100%;object-fit:cover;background:#efeaf7;color:transparent;font-size:0;
  filter:saturate(1.06) contrast(1.03) brightness(1.01)}
/* one grade, on every creative/creator frame in the deck, so nine different
   generations still read as one shoot: a faint brand-gradient tint + a hair
   of contrast. Sits above the image, below dots/captions. */
.lo-shot::after{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  mix-blend-mode:multiply;opacity:.16;
  background:linear-gradient(155deg,#8b52e7,#ca7dab 52%,#89a6e6)}
/* one source frame is a 9:16 still padded into 4:5; zoom past the pillarbox */
.lo-shot img.lo-zoom{transform:scale(1.4)}
/* small "subject" thumbnail dropped into a data-readout panel, same creator
   and grade as the big stage shots, so the readout isn't image-less */
.lo-panel > .lo-shot.lo-mini{width:54px;aspect-ratio:4/5;height:auto;border-radius:10px;margin:0 0 14px}

/* treatment 1a — one frame, chips read off it, one chip anchored by a leader line */
.lo-stage{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr);
  gap:clamp(16px,1.8vw,30px);align-items:center;height:var(--lo-stage-h)}
.lo-stage > .lo-shot{height:100%;width:auto;aspect-ratio:4/5;justify-self:start;z-index:0}
/* every dot on the frame is numbered and coloured to match its own chip and
   its own leader line — three claims, three marked points, no orphans */
.lo-dot{position:absolute;left:var(--x);top:var(--y);width:18px;height:18px;margin:-9px 0 0 -9px;
  z-index:2;border-radius:50%;background:var(--c,#7c3aed);box-shadow:0 0 0 3px #ffffffcc,0 2px 8px -2px #17121f66;
  display:grid;place-items:center;
  font-family:ui-monospace,Menlo,monospace;font-size:9px;font-weight:700;color:#fff}
.lo-dot::before{content:attr(data-lead)}
.lo-leader{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;z-index:1}
.lo-leader line{stroke:var(--c,#7c3aed);stroke-width:1.25;stroke-dasharray:3 4;opacity:.7}
.lo-chips{list-style:none;margin:0;padding:0;display:grid;gap:9px}
.lo-chip{position:relative;padding:10px 13px;border-radius:12px;background:#faf8fe;
  box-shadow:inset 0 0 0 1px #17121f0d;
  font-size:clamp(13px,1vw,14.5px);line-height:1.3;color:#2a2235}
.lo-chip.lo-anchor{background:#f6f1ff;box-shadow:inset 0 0 0 1px #17121f0d,inset 3px 0 0 var(--c,#7c3aed);
  color:#17121f;font-weight:600;padding-left:16px}

/* treatment 1b — a strip of frames */
.lo-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-inline:auto;width:100%}
.lo-strip.lo-two{grid-template-columns:repeat(2,minmax(0,1fr));max-width:540px}
.lo-strip .lo-shot{width:100%;aspect-ratio:4/5}
.lo-strip figcaption{position:absolute;left:8px;bottom:8px;padding:5px 9px;border-radius:999px;
  background:#ffffffeb;box-shadow:0 6px 16px -8px #17121f66;
  font-family:ui-monospace,Menlo,monospace;font-size:10px;letter-spacing:.08em;
  text-transform:uppercase;color:#2a2235;white-space:nowrap}
.lo-shot.lo-out img{filter:grayscale(1);opacity:.5}
.lo-shot.lo-out figcaption{color:#8d84a0}
.lo-shot.lo-in figcaption{color:#1e9678}
.lo-shot.lo-stop figcaption{color:#d9435e}
.lo-shot.lo-fund figcaption{color:#1e9678}
.lo-shot.lo-stop{box-shadow:inset 0 0 0 2.5px #d9435e}
.lo-shot.lo-fund{box-shadow:inset 0 0 0 2.5px #1e9678}

/* verdict strip — the decode's one-line answer */
.lo-verdict{display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  margin:12px 0 0;padding-top:12px;border-top:1px solid #17121f0d;
  font-size:13.5px;line-height:1.4;color:#4d4560}
.lo-verdict b{flex:none;padding:4px 10px;border-radius:999px;font-size:11px;font-weight:600;
  letter-spacing:.04em;text-transform:uppercase}
.lo-verdict.lo-worked b{color:#1e9678;background:#e7f6f1}
.lo-verdict.lo-didnt b{color:#d9435e;background:#fdeaee}
.lo-verdict.lo-call b{color:#7c3aed;background:#f2eaff}

/* --- treatment 2 — measurement readouts --- */
.lo-read-t{margin:2px 0 16px;font-size:16.5px;font-weight:600;letter-spacing:-.02em;
  line-height:1.3;color:#17121f}
.lo-foot{margin:14px 0 0;padding-top:11px;border-top:1px solid #17121f0d;
  font-family:ui-monospace,Menlo,monospace;font-size:11px;line-height:1.5;color:#8d84a0}

.lo-bars{list-style:none;margin:0;padding:0;display:grid;gap:14px}
.lo-bars li{display:grid;grid-template-columns:minmax(0,1fr) minmax(110px,1.3fr) 62px;
  align-items:center;gap:14px;font-size:14px;color:#4d4560}
.lo-bars i{display:block;height:9px;border-radius:99px;background:#17121f0a;overflow:hidden}
.lo-bars b{display:block;height:100%;border-radius:99px;background:var(--c);
  transform:scaleX(var(--w));transform-origin:0 50%;transition:transform 1.1s var(--lo-ease)}
.lo-card:not(.lo-seen) .lo-bars b{transform:scaleX(0)}
.lo-bars em{font-style:normal;text-align:right;font-family:ui-monospace,Menlo,monospace;
  font-size:13px;font-weight:600;color:#17121f}
.lo-bars small{font-size:10px;color:#a79ec0;margin-left:2px}

.lo-table{width:100%;border-collapse:collapse;font-size:14px}
.lo-table th{text-align:left;padding:0 0 9px;border-bottom:1px solid #17121f0d;
  font-family:ui-monospace,Menlo,monospace;font-size:9.5px;letter-spacing:.14em;
  text-transform:uppercase;font-weight:500;color:#a79ec0}
.lo-table td{padding:11px 0;border-bottom:1px solid #17121f08;color:#4d4560}
.lo-table tr:last-child td{border-bottom:0}
.lo-table .lo-num{font-family:ui-monospace,Menlo,monospace;font-weight:600;color:#1e9678}
.lo-pill{display:inline-block;padding:3px 9px;border-radius:999px;font-size:11px;font-weight:600}
.lo-pill.lo-held{color:#1e9678;background:#e7f6f1}
.lo-pill.lo-watch{color:#a8531c;background:#fff1e6}

.lo-chat .lo-q{width:max-content;max-width:100%;margin:0 0 12px auto;padding:11px 15px;
  border-radius:15px 15px 4px 15px;background:#17121f;color:#fff;font-size:14px;line-height:1.4}
.lo-chat .lo-a{padding:13px 15px;border-radius:15px 15px 15px 4px;background:#f4f1fb;
  font-size:14px;line-height:1.55;color:#2a2235}
.lo-chat .lo-a p{margin:0}
.lo-ev{display:flex;gap:6px;flex-wrap:wrap;margin-top:11px}
.lo-ev span{padding:3px 9px;border-radius:999px;background:#fff;color:#7c3aed;
  box-shadow:inset 0 0 0 1px #7c3aed22;font-family:ui-monospace,Menlo,monospace;font-size:10px}

.lo-check{list-style:none;margin:0;padding:0;display:grid;gap:9px}
.lo-check li{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:12px;
  background:#faf8fe;font-size:14px;color:#2a2235}
.lo-check i{flex:none;width:18px;height:18px;border-radius:50%;display:grid;place-items:center;
  font-style:normal;font-size:11px;color:#fff;background:#1e9678}
.lo-check i::before{content:"\2713"}
.lo-check li.lo-fail{background:#fdeaee}
.lo-check li.lo-fail i{background:#d9435e}
.lo-check li.lo-fail i::before{content:"\2715"}
.lo-check em{margin-left:auto;font-style:normal;font-family:ui-monospace,Menlo,monospace;
  font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:#1e9678}
.lo-check li.lo-fail em{color:#d9435e}

/* --- narrow: the deck becomes a plain list --- */
@media(max-width:960px){
  .lo-track{padding-bottom:0}
  .lo-sent{height:0!important}
  .lo-card,.lo-card.lo-flip,.lo-card.lo-strips{position:relative;top:auto;height:auto;
    grid-template-columns:1fr;gap:22px;
    padding:26px 20px 28px;margin-bottom:18px;transform:none!important}
  .lo-card::after{display:none}
  .lo-card.lo-flip .lo-copy{order:1}
  .lo-card.lo-flip .lo-panel{order:2}
  .lo-sub{max-width:34ch}
  .lo-stage{height:auto;grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr)}
  .lo-stage > .lo-shot{height:auto;width:100%;aspect-ratio:4/5}
  .lo-strip.lo-two{max-width:none}
  .lo-panel{min-height:0}
}
@media(max-width:640px){
  .lo-stage{grid-template-columns:1fr;gap:14px}
  .lo-leader{display:none}
  .lo-strip{gap:7px}
  .lo-strip figcaption{left:5px;bottom:5px;padding:4px 7px;font-size:9px}
  .lo-bars li{grid-template-columns:minmax(0,1fr) minmax(70px,1fr) 54px;gap:10px;font-size:13px}
  .lo-verdict{font-size:13px}
}

@media(prefers-reduced-motion:reduce){
  .lo-track{padding-bottom:0}
  .lo-sent{height:0!important}
  .lo-card{position:relative;top:auto;height:auto;transform:none!important;margin-bottom:18px}
  .lo-card::after{display:none}
  .lo-card:not(.lo-seen) .lo-bars b{transform:scaleX(var(--w))}
  .lo-bars b{transition:none}
}
