/* 07 · MerchantScope · another build: merchant fraud triage for analysts.
   Glass on light: an aurora drifts behind the section in the app's own colours
   (violet, teal, a little of our gold), the guide plays in a frosted browser
   window lit from behind by the video itself, and a glass rail beside it follows
   the clip. Everything that moves is js/merchantscope.js. */
.ms {
  --ms-violet: #a78bfa; --ms-fuchsia: #e879f9; --ms-teal: #2dd4bf; --ms-glass: rgba(255, 255, 255, .055);
  --ms-rim: rgba(255, 255, 255, .14);
  /* the accent as rgb triplets, so a section can retheme the whole block (08 does, in consortium.css) */
  --ms-glow: 167, 139, 250; --ms-edge: 196, 181, 253; --ms-shade: 76, 29, 149; --ms-cool: 45, 212, 191;
  --ms-a1: 139, 92, 246; --ms-a2: 45, 212, 191; --ms-a3: 233, 173, 79;
  --ms-word: linear-gradient(100deg, #c4b5fd 0%, var(--ms-violet) 34%, var(--ms-fuchsia) 58%, #fbbf77 100%);
  overflow: clip; isolation: isolate;
  background:
    radial-gradient(80% 50% at 85% 8%, rgba(var(--ms-glow), .14), transparent 62%),
    radial-gradient(60% 45% at 5% 70%, rgba(var(--ms-cool), .10), transparent 60%),
    var(--ink);
}
.ms .eyebrow { color: var(--ms-violet); }

/* three soft lights that drift behind the glass, so the frost has something to blur */
.ms__aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ms__aurora i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.ms__aurora i:nth-child(1) { width: 46vw; height: 46vw; left: 30%; top: 22%; background: radial-gradient(circle, rgba(var(--ms-a1), .55), transparent 65%); }
.ms__aurora i:nth-child(2) { width: 36vw; height: 36vw; left: 2%; top: 48%; background: radial-gradient(circle, rgba(var(--ms-a2), .4), transparent 65%); }
.ms__aurora i:nth-child(3) { width: 30vw; height: 30vw; right: 0; top: 60%; background: radial-gradient(circle, rgba(var(--ms-a3), .32), transparent 65%); }

/* the name, set like the app's own wordmark, and one line */
.ms__title { margin: 0 0 clamp(36px, 5vw, 64px); display: grid; gap: .35em; font-weight: 700; }
.ms__word {
  font-size: clamp(2.8rem, 7vw, 6.4rem); line-height: .95; letter-spacing: -.05em; width: fit-content;
  background: var(--ms-word);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 14px 40px rgba(var(--ms-glow), .28));
}
.ms__word b { font-weight: inherit; }
.ms__line { font-size: clamp(1.15rem, 2vw, 1.75rem); letter-spacing: -.02em; color: var(--cream); font-weight: 500; }

/* the title row: the name and line on the left, the credit on the right */
.ms__top { display: flex; align-items: center; justify-content: space-between; gap: 32px 60px; flex-wrap: wrap; margin-bottom: clamp(36px, 5vw, 64px); }
.ms__top .ms__title { margin: 0; }

/* the credit: whose idea it was. A quiet glass plate, his name in a muted gold that
   a soft light crosses now and then, and sparkles twinkling round it on their own clocks.
   Toned down on the user's note: upright, the site's sans, smaller, less glow. */
.ms__credit {
  position: relative; margin: 0 clamp(0px, 4vw, 60px) 0 0; display: grid; justify-items: center; gap: 4px; text-align: center;
  padding: 22px 34px 20px; border-radius: 22px;
  background: linear-gradient(150deg, rgba(201, 164, 102, .06), rgba(255, 255, 255, .025) 45%, rgba(var(--ms-glow), .04));
  -webkit-backdrop-filter: blur(16px) saturate(130%); backdrop-filter: blur(16px) saturate(130%);
  box-shadow: inset 0 0 0 1px rgba(201, 164, 102, .2), inset 0 1px 0 rgba(255, 255, 255, .1), 0 24px 60px rgba(0, 0, 0, .3);
}
.ms__credit::before { /* the warm light behind the plate */
  content: ""; position: absolute; inset: -40% -25%; z-index: -1; pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(201, 164, 102, .08), transparent 70%); filter: blur(10px);
}
.ms__credit-k, .ms__credit-r { font-family: var(--mono); font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: #c9a466; opacity: .8; }
.ms__credit-r { letter-spacing: .08em; text-transform: none; font-size: .72rem; color: var(--cream-2); opacity: .9; }
.ms__credit-name {
  font-family: var(--display); font-weight: 600; font-size: clamp(1.45rem, 2.3vw, 2.05rem); line-height: 1.1; letter-spacing: -.02em; padding: 0 .04em;
  background: linear-gradient(100deg, #d9c49a 0%, #c9a466 35%, #e6d6b0 50%, #c9a466 65%, #d4b47a 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 10px rgba(201, 164, 102, .18));
}
/* sparkles: four-point stars, each placed round the plate and twinkling on its own beat */
.ms__credit i {
  position: absolute; width: var(--s, 14px); height: var(--s, 14px); pointer-events: none;
  background: radial-gradient(circle, #fff 0 18%, #fde68a 30%, transparent 62%);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 4px rgba(230, 214, 176, .6));
}
.ms__credit i:nth-of-type(1) { --s: 22px; left: -10px;  top: 10%;  --d: 0s; }
.ms__credit i:nth-of-type(2) { --s: 13px; left: 18%;   top: -8px; --d: .7s; }
.ms__credit i:nth-of-type(3) { --s: 18px; right: 12%;  top: -10px; --d: 1.4s; }
.ms__credit i:nth-of-type(4) { --s: 26px; right: -13px; top: 38%; --d: .35s; }
.ms__credit i:nth-of-type(5) { --s: 12px; right: 26%;  bottom: -6px; --d: 1.9s; }
.ms__credit i:nth-of-type(6) { --s: 16px; left: 8%;    bottom: -8px; --d: 1.1s; }
.ms__credit i:nth-of-type(7) { --s: 10px; left: 64%;   top: -5px; --d: 2.3s; opacity: .8; }
@media (prefers-reduced-motion: no-preference) {
  .ms__credit-name { animation: ms-gold 4.5s ease-in-out infinite; }
  @keyframes ms-gold { 0%, 30% { background-position: 100% 0; } 70%, 100% { background-position: 0% 0; } }
  .ms__credit i { animation: ms-twinkle 2.6s ease-in-out infinite var(--d); transform: scale(.2); }
  @keyframes ms-twinkle { 0%, 100% { transform: scale(.15) rotate(0deg); opacity: 0; } 45% { transform: scale(1) rotate(45deg); opacity: 1; } 60% { transform: scale(.85) rotate(60deg); opacity: .9; } }
}

/* stage: the window, and the rail beside it */
.ms__stage { display: grid; grid-template-columns: minmax(0, 1fr) clamp(250px, 21vw, 310px); gap: clamp(24px, 3vw, 48px); align-items: center; perspective: 1400px; }
.ms__win { position: relative; transform-origin: 50% 100%; }
.ms__glow {
  position: absolute; left: -5%; top: -6%; width: 110%; height: 112%; pointer-events: none; z-index: -1;
  filter: blur(70px) saturate(1.6) brightness(1.15); opacity: .55;
}
.ms__glass {
  position: relative; padding: 0 10px 10px; border-radius: 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .03) 40%, rgba(255, 255, 255, .05));
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  box-shadow: inset 0 0 0 1px var(--ms-rim), inset 0 1px 0 rgba(255, 255, 255, .22), 0 50px 110px rgba(0, 0, 0, .45);
}
/* a sheen crosses the glass once as the window lands (--sheen, 0 → 1, from the JS) */
.ms__glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .16) 48%, transparent 60%) no-repeat;
  background-size: 250% 100%; background-position: calc(160% - var(--sheen, 1) * 220%) 0; opacity: calc(1 - var(--sheen, 1) * var(--sheen, 1));
}
.ms__bar { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 8px; }
.ms__bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.ms__bar i:nth-child(1) { background: #ff5f57; } .ms__bar i:nth-child(2) { background: #febc2e; } .ms__bar i:nth-child(3) { background: #28c840; }
.ms__bar span {
  margin: 0 auto; transform: translateX(-24px); font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; color: var(--cream-2);
  padding: 4px 14px; border-radius: 999px; background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.ms__screen { position: relative; aspect-ratio: 16 / 10; border-radius: 13px; overflow: hidden; background: #0c0b14; box-shadow: 0 0 0 1px rgba(255, 255, 255, .07); }
.ms__video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* callouts: a dot on the thing and a glass pill beside it, on a short leader.
   The <p> is the anchor (no size, at --x/--y on the screen); they follow the clip. */
.ms__note { position: absolute; left: var(--x); top: var(--y); margin: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .35s ease; }
.ms__note::before {
  content: ""; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(var(--ms-glow), .4), 0 0 16px rgba(var(--ms-glow), .9);
}
.ms__note::after { content: ""; position: absolute; left: 0; top: 0; width: 26px; height: 1px; background: rgba(255, 255, 255, .55); transform-origin: 0 0; transform: rotate(35deg); }
.ms__note span {
  position: absolute; left: 20px; top: 13px; white-space: nowrap; padding: .5em .95em; border-radius: 999px;
  font-size: clamp(.72rem, .9vw, .88rem); font-weight: 600; letter-spacing: -.005em; color: #fff;
  background: rgba(20, 16, 34, .48); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), inset 0 1px 0 rgba(255, 255, 255, .18), 0 10px 30px rgba(0, 0, 0, .35);
  transform: translateY(6px); transition: transform .45s var(--ease);
}
.ms__note--up::after { width: 22px; transform: rotate(90deg); }
.ms__note--up span { left: 0; top: 22px; translate: -50% 0; }
.ms__note--left::after { transform: rotate(145deg); }
.ms__note--left span { left: auto; right: 18px; top: 12px; }
.ms__note.is-on { opacity: 1; }
.ms__note.is-on span { transform: none; }
.ms__note.is-on::before { animation: ms-ping 1.6s ease-out infinite; }
@keyframes ms-ping { 0% { box-shadow: 0 0 0 0 rgba(var(--ms-glow), .7), 0 0 16px rgba(var(--ms-glow), .9); } 100% { box-shadow: 0 0 0 14px rgba(var(--ms-glow), 0), 0 0 16px rgba(var(--ms-glow), .9); } }

/* play: only shown when the clip doesn't start by itself (reduced motion) */
.ms__play {
  position: absolute; left: 50%; top: 50%; z-index: 3; width: 78px; height: 78px; margin: -39px 0 0 -39px; border: 0; border-radius: 50%; cursor: pointer;
  display: none; place-items: center; color: #fff;
  background: rgba(255, 255, 255, .12); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), 0 18px 40px rgba(0, 0, 0, .4);
}
.ms__play svg { width: 30px; height: 30px; fill: currentColor; margin-left: 4px; }
.ms.is-still .ms__play { display: grid; }

/* beside the window: the rail, and a way into the live tool under it */
.ms__side { display: grid; gap: 18px; }
.ms__visit {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 22px; border-radius: 999px;
  font-weight: 600; font-size: .98rem; letter-spacing: -.01em; color: #fff; text-decoration: none; isolation: isolate;
  background: linear-gradient(120deg, rgba(var(--ms-glow), .26), rgba(232, 121, 249, .16) 55%, rgba(45, 212, 191, .16));
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  box-shadow: inset 0 0 0 1px rgba(var(--ms-edge), .45), inset 0 1px 0 rgba(255, 255, 255, .25), 0 14px 40px rgba(124, 58, 237, .3);
  transition: box-shadow .4s; /* GSAP owns its transform (the entrance) */
}
.ms__visit .ic { transform: rotate(-45deg); transition: transform .4s var(--ease); }
.ms__visit::after { /* a slow light crossing the pill, so it reads as the way in */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%) no-repeat; background-size: 250% 100%; background-position: 160% 0;
}
.ms__visit:hover { box-shadow: inset 0 0 0 1px rgba(221, 214, 254, .7), inset 0 1px 0 rgba(255, 255, 255, .3), 0 18px 50px rgba(124, 58, 237, .5); }
.ms__visit:hover .ic { transform: rotate(-45deg) translate(3px, 0); }
.ms__visit:focus-visible { outline: 2px solid var(--ms-violet); outline-offset: 3px; }

/* the rail: one glass card per part of the clip. The card on screen lifts and
   lights, and its line fills the way the app's agent strip does (teal → violet). */
.ms__rail { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: none; }
.ms__step button {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; width: 100%; text-align: left; cursor: pointer;
  padding: 18px 20px 20px; border: 0; border-radius: 18px; overflow: hidden;
  background: var(--ms-glass); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), inset 0 1px 0 rgba(255, 255, 255, .12);
  opacity: .62; transition: opacity .45s, transform .55s var(--ease), box-shadow .45s, background .45s;
}
.ms__n { grid-row: span 2; font-family: var(--mono); font-size: .7rem; color: var(--dim); padding-top: .3em; }
.ms__name { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; color: var(--cream); }
.ms__say { font-size: .86rem; line-height: 1.45; color: var(--cream-2); }
.ms__fill { position: absolute; left: 20px; right: 20px; bottom: 10px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.ms__fill i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--ms-teal), var(--ms-violet) 70%, var(--ms-fuchsia)); box-shadow: 0 0 10px rgba(var(--ms-glow), .8); }
.ms__step.is-on button {
  opacity: 1; transform: translateX(-6px);
  background: linear-gradient(150deg, rgba(var(--ms-glow), .16), rgba(var(--ms-cool), .07) 70%);
  box-shadow: inset 0 0 0 1px rgba(var(--ms-edge), .35), inset 0 1px 0 rgba(255, 255, 255, .2), 0 18px 50px rgba(var(--ms-shade), .35);
}
.ms__step.is-on .ms__n { color: var(--ms-violet); }
.ms__step button:hover { opacity: 1; }
.ms__step button:focus-visible { outline: 2px solid var(--ms-violet); outline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) {
  .ms__aurora i { animation: ms-drift 22s ease-in-out infinite alternate; }
  .ms__aurora i:nth-child(2) { animation-duration: 27s; animation-delay: -9s; }
  .ms__aurora i:nth-child(3) { animation-duration: 31s; animation-delay: -15s; }
  .ms__visit::after { animation: ms-sweep 5s ease-in-out infinite 1s; }
  @keyframes ms-sweep { 0%, 55% { background-position: 160% 0; } 100% { background-position: -60% 0; } }
  @keyframes ms-drift { 50% { transform: translate(6vw, -4vw) scale(1.12); } 100% { transform: translate(-5vw, 3vw) scale(.94); } }
}
@media (max-width: 1100px) {
  .ms__stage { grid-template-columns: minmax(0, 1fr); }
  .ms__rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ms__visit { justify-self: center; }
  .ms__step.is-on button { transform: translateY(-4px); }
}
@media (max-width: 700px) {
  .ms__credit { margin: 0 auto; padding: 18px 26px 16px; }
  .ms__glass { padding: 0 6px 6px; border-radius: 16px; }
  .ms__bar { height: 30px; } .ms__bar i { width: 8px; height: 8px; }
  .ms__screen { border-radius: 10px; }
  .ms__note { display: none; } /* too small to point at anything; the rail carries it */
  .ms__rail { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ms__step button { padding: 14px 16px 16px; }
  .ms__aurora i { filter: blur(60px); }
}
