.mp-example {
  --mp-blue: #306582;
  --mp-pale: #e1edf1;
}

.mp-frame {
  display: grid;
  align-content: start;
  gap: 8px;
  font-size: 12px;
}

.mp-example .motion-action {
  min-height: 30px;
  text-align: start;
}

.mp-example .motion-action[aria-pressed="true"],
.mp-example .motion-action[aria-expanded="true"] {
  background: var(--mp-pale);
  border-color: var(--mp-blue);
}

.mp-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.mp-controls .mp-status {
  min-height: 0;
}

.mp-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
}

.mp-center,
.mp-display {
  display: grid;
  place-items: center;
  min-height: 124px;
  padding: 10px;
  border-radius: 5px;
  background: var(--surface);
}

.mp-records {
  display: grid;
  gap: 4px;
}

.mp-record {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.mp-record small,
.mp-display small {
  color: var(--muted);
  font-size: 11px;
}

.mp-expander > button {
  width: 100%;
}

.mp-fold {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
}

.mp-fold > div {
  min-height: 0;
  overflow: hidden;
}

.mp-fold > div > * {
  padding: 7px 3px;
}

.is-expanded > .mp-fold {
  grid-template-rows: 1fr;
  visibility: visible;
}

.mp-example[data-after="true"] .mp-fold {
  transition:
    grid-template-rows 480ms cubic-bezier(0.2, 0.75, 0.25, 1),
    visibility 480ms;
}

.mp-modal:not([open]) {
  display: none;
}

.mp-modal {
  display: grid;
  gap: 14px;
  width: min(310px, calc(100% - 32px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 15px 40px rgb(var(--shadow-rgb) / 16%);
}

.mp-modal::backdrop {
  background: rgb(var(--shadow-rgb) / 32%);
}

.mp-example[data-after="true"] .mp-modal[open]::backdrop {
  animation: mp-backdrop 360ms both;
}

@keyframes mp-backdrop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.mp-views {
  display: grid;
  min-height: 80px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 5px;
  background: var(--surface);
}

.mp-view {
  grid-area: 1 / 1;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  padding: 10px;
}

.mp-view.is-leaving {
  z-index: -1;
  pointer-events: none;
}

.mp-view input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 6px;
  border: 1px solid var(--brand-border);
  border-radius: 4px;
  color: inherit;
  font: inherit;
}

.mp-view p {
  overflow-wrap: anywhere;
}

.mp-view .mp-tool-sample {
  margin-top: 8px;
  padding: 3px;
}

.mp-style-weight {
  font-weight: 750;
}

.mp-style-italic {
  font-style: italic;
}

.mp-style-underline {
  text-decoration: underline;
}

.mp-tool-shape {
  width: 28px;
  height: 28px;
  border: 2px dashed var(--brand-border);
  border-radius: 6px;
}

.mp-style-fill {
  background: var(--mp-pale);
}

.mp-style-outline {
  border: 2px solid var(--mp-blue);
}

.mp-carousel .mp-view {
  padding: 0;
}

.mp-slide {
  position: relative;
  height: 142px;
  margin: 0;
}

.mp-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp-slide--1 img {
  object-position: 50% 70%;
  filter: saturate(0.7) hue-rotate(18deg);
}

.mp-slide--2 img {
  object-position: 50% 20%;
  filter: saturate(0.85) sepia(0.26);
}

.mp-slide figcaption {
  position: absolute;
  inset: auto 8px 8px;
  width: fit-content;
  padding: 4px 7px;
  border-radius: 3px;
  background: var(--surface);
}

.mp-display {
  position: relative;
  gap: 4px;
  align-content: center;
  text-align: center;
}

.mp-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mp-number,
.mp-text {
  font-size: clamp(16px, 2.4vw, 26px);
  line-height: 1.4;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.mp-text {
  position: relative;
  white-space: pre;
}

.mp-text > span {
  display: inline-block;
}

.mp-sliding-number .mp-value > span,
.mp-text-loop .mp-text {
  display: inline-block;
  height: 1.4em;
  overflow: hidden;
  vertical-align: bottom;
}

.mp-digit-strip,
.mp-loop-strip {
  display: grid !important;
}

.mp-text-roll .mp-text {
  perspective: 180px;
}

.mp-text-roll .mp-text > span {
  display: inline-grid;
  transform-style: preserve-3d;
}

.mp-roll-front,
.mp-roll-back {
  grid-area: 1 / 1;
  backface-visibility: hidden;
}

.mp-roll-back {
  transform: rotateX(180deg);
}

.mp-glyph-ghost {
  position: absolute;
  top: 0;
  pointer-events: none;
}

.mp-sheen {
  background: linear-gradient(
      100deg,
      var(--ink) 37%,
      #388cb6 46%,
      #4a92ad 54%,
      var(--ink) 64%
    )
    175% 0 / 250% 100%;
  background-clip: text;
  color: transparent;
}

.mp-wheel,
.mp-wheel-ring {
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 1;
}

.mp-wheel-center,
.mp-wheel-ring {
  grid-area: 1 / 1;
}

.mp-wheel-center {
  font:
    500 29px Georgia,
    serif;
  color: var(--mp-blue);
}

.mp-wheel-ring {
  position: relative;
  color: var(--ink);
}

.mp-wheel-ring span {
  position: absolute;
  font: 650 9px / 1 system-ui;
  transform: rotate(var(--angle)) translateY(-44px);
}

.mp-spinning-text[data-after="false"].is-playing .mp-wheel-ring {
  color: var(--mp-blue);
}

.mp-spinning-text[data-after="true"] .mp-wheel-ring {
  animation: mp-spin 5s linear infinite paused;
}

@keyframes mp-spin {
  to {
    transform: rotate(1turn);
  }
}

.mp-photo {
  position: relative;
  height: 145px;
  overflow: hidden;
  border-radius: 5px;
}

.mp-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.45) saturate(1.25);
}

.mp-photo .mp-photo-cool {
  filter: saturate(0.8) hue-rotate(28deg);
  visibility: hidden;
}

.mp-image-comparison.is-cool .mp-photo-cool,
.mp-image-comparison[data-after="true"] .mp-photo-cool {
  visibility: visible;
}

.mp-image-comparison[data-after="true"] .mp-photo-cool {
  clip-path: inset(0 0 0 var(--split, 50%));
}

.mp-divider {
  display: none;
}

.mp-image-comparison[data-after="true"] .mp-divider {
  position: absolute;
  display: block;
  inset: 0 auto 0 var(--split, 50%);
  width: 2px;
  background: white;
  box-shadow: 0 0 7px rgb(0 0 0 / 35%);
  transform: translateX(-50%);
}

.mp-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mp-range input {
  flex: 1;
  min-width: 0;
  accent-color: var(--mp-blue);
}

.mp-scroll-wrap {
  position: relative;
  min-width: 0;
  padding: 3px;
  border-radius: 5px;
  background: var(--surface);
}

.mp-scroll {
  display: grid;
  align-content: start;
  gap: 5px;
  height: 150px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px;
  scroll-timeline-name: --mp-reading;
}

.mp-progressive-blur[data-after="true"]:not(.is-at-end) .mp-scroll-wrap::after {
  position: absolute;
  inset: auto 12px 3px 3px;
  height: 48px;
  pointer-events: none;
  content: "";
  background: linear-gradient(transparent, var(--surface));
  backdrop-filter: blur(3px);
  mask-image: linear-gradient(transparent, #000 92%);
}

.mp-percent {
  display: block;
  padding: 4px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.mp-progress {
  display: none;
}

.mp-scroll-progress[data-after="true"] .mp-scroll-wrap {
  timeline-scope: --mp-reading;
}

.mp-scroll-progress[data-after="true"] .mp-progress {
  display: block;
  height: 5px;
  overflow: hidden;
  margin: 3px 4px 0;
  border-radius: 7px;
  background: var(--mp-pale);
}

.mp-progress span {
  display: block;
  height: 100%;
  background: var(--mp-blue);
  transform: scaleX(0);
  transform-origin: left;
}

@supports (animation-timeline: --mp-reading) {
  @media (prefers-reduced-motion: no-preference) {
    .mp-progress span {
      animation: mp-reading linear both;
      animation-timeline: --mp-reading;
    }
  }
}

@keyframes mp-reading {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.mp-marquee {
  overflow: hidden;
  min-height: 124px;
  display: grid;
  align-items: center;
  border-radius: 5px;
  background: var(--surface);
}

.mp-belt,
.mp-belt > div {
  display: flex;
  flex: none;
  width: max-content;
}

.mp-belt {
  animation: mp-discrete 4.8s steps(4, end) infinite paused;
}

.mp-infinite-slider[data-after="true"] .mp-belt {
  animation-name: mp-continuous;
  animation-timing-function: linear;
}

.mp-example.is-playing.is-onscreen :is(.mp-wheel-ring, .mp-belt) {
  animation-play-state: running;
}

.mp-exhibit {
  display: grid;
  place-items: end start;
  flex: 0 0 89px;
  height: 86px;
  margin-right: 8px;
  padding: 8px;
  border-radius: 4px;
  background: #dce9e7;
  color: #264c52;
}

.mp-exhibit:nth-child(2n) {
  background: #e9e1d4;
  color: #554334;
}

.mp-exhibit:nth-child(3) {
  background: #e0e5ef;
  color: #374765;
}

@keyframes mp-discrete {
  to {
    transform: translateX(-388px);
  }
}

@keyframes mp-continuous {
  to {
    transform: translateX(-50%);
  }
}

.mp-trail {
  position: relative;
  display: grid;
  min-width: 126px;
  padding: 2px;
  overflow: hidden;
  isolation: isolate;
  border: 2px solid var(--brand-border);
  border-radius: 8px;
  background: var(--brand-border);
  text-align: center;
}

.mp-trail span {
  z-index: 1;
  padding: 12px;
  border-radius: 5px;
  background: var(--surface);
}

.mp-trail i {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 160%;
  aspect-ratio: 1;
  translate: -50% -50%;
  opacity: 0;
  background: conic-gradient(
    transparent 0 230deg,
    #64c4ec 251deg,
    #16436d 280deg,
    transparent 292deg
  );
}

.mp-pointer {
  --x: 50%;
  --y: 50%;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 135px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.mp-cursor .mp-pointer {
  background:
    linear-gradient(to right, #e5e8ea 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(to bottom, #e5e8ea 1px, transparent 1px) 0 0 / 18px 18px,
    var(--surface);
  cursor: crosshair;
}

.mp-marker {
  position: absolute;
  inset: var(--y) auto auto var(--x);
  width: 22px;
  height: 22px;
  border: 1px solid var(--mp-blue);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    var(--mp-blue) 0 2px,
    #b8e4f170 2px 9px,
    transparent 9px
  );
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.mp-dock {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: var(--brand-soft);
}

.mp-dock .motion-action {
  display: grid;
  place-items: center;
  width: clamp(33px, 4vw, 42px);
  height: clamp(33px, 4vw, 42px);
  padding: 0;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.mp-dock .motion-action:hover,
.mp-dock .motion-action:focus-visible {
  background: var(--mp-pale);
}

.mp-dock-icon {
  position: relative;
  display: block;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--mp-blue);
  border-radius: 2px;
  pointer-events: none;
}

.mp-dock-icon--0 {
  background: repeating-linear-gradient(
      to bottom,
      transparent 0 2px,
      var(--mp-blue) 2px 3px,
      transparent 3px 4px
    )
    center / 7px 8px no-repeat;
}

.mp-dock-icon--1 {
  height: 11px;
}

.mp-dock-icon--1::before {
  position: absolute;
  inset: -4px 5px auto -1.5px;
  height: 4px;
  border: 1.5px solid var(--mp-blue);
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  content: "";
}

.mp-dock-icon--2 {
  background: linear-gradient(
    transparent 3px,
    var(--mp-blue) 3px 4px,
    transparent 4px
  );
}

.mp-dock-icon--3 {
  border-radius: 50%;
  background: radial-gradient(circle, var(--mp-blue) 2px, transparent 3px);
}

.mp-example[data-after="true"] .mp-dock .motion-action {
  transition:
    transform 240ms cubic-bezier(0.2, 0.75, 0.25, 1),
    background 180ms;
  transform-origin: center bottom;
}

.mp-example[data-after="true"]
  .mp-dock
  .motion-action:is(:hover, :focus-visible) {
  z-index: 1;
  transform: translateY(-10px) scale(1.35);
}

.mp-example[data-after="true"]
  .mp-dock
  .motion-action:is(:hover, :focus-visible)
  + button,
.mp-example[data-after="true"]
  .mp-dock
  .motion-action:has(+ button:is(:hover, :focus-visible)) {
  transform: translateY(-4px) scale(1.12);
}

.mp-lamp {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #202436;
  color: #fff;
}

.mp-lamp::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: #354774;
  content: "";
}

.mp-glow-effect.is-lit .mp-lamp::before {
  opacity: 1;
}

.mp-glow-effect[data-after="true"] .mp-lamp::before {
  background:
    radial-gradient(ellipse at 34% 72%, #7251ad, transparent 54%),
    radial-gradient(ellipse at 68% 34%, #277992, transparent 60%), #202436;
  transform: scale(0.72);
  transition:
    opacity 650ms ease,
    transform 650ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.mp-glow-effect[data-after="true"].is-lit .mp-lamp::before {
  transform: scale(1.08);
}

.mp-magnet {
  display: grid;
  min-width: 130px;
  min-height: 66px;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--stage-fill);
  color: var(--ink);
  cursor: pointer;
}

.mp-magnet span {
  padding: 8px 14px;
  border-radius: 22px;
  background: var(--brand-soft-hover);
  pointer-events: none;
}

.mp-magnet:hover span,
.mp-magnet:focus-visible span {
  background: var(--mp-pale);
}

.mp-example[data-after="true"] .mp-magnet span {
  transform: translate(var(--pull-x, 0), var(--pull-y, 0));
  transition: transform 160ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.mp-spotlight .mp-pointer {
  isolation: isolate;
  background: #182a35;
  color: #fff;
}

.mp-starfield {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle, #d3eef4 1px, transparent 2px) 6px 11px / 20px 23px,
    radial-gradient(circle, #849fc3 1px, transparent 2px) 0 0 / 27px 33px,
    #29627c;
  mask-image: radial-gradient(
    circle 66px at var(--x) var(--y),
    #000,
    transparent
  );
  pointer-events: none;
}

.mp-tilt-card {
  display: grid;
  width: 110px;
  min-height: 82px;
  align-content: end;
  padding: 8px;
  border: 1px solid #b6a18c;
  border-radius: 6px;
  background: repeating-linear-gradient(
    155deg,
    #e8ded1 0 3px,
    #f2e8dc 3px 11px,
    #e4d7c7 12px 13px
  );
  color: #49372b;
  box-shadow: 0 8px 12px rgb(78 54 33 / 14%);
  pointer-events: none;
}

.mp-tilt-card small {
  font-size: 10px;
}

.mp-example[data-after="true"] .mp-tilt-card {
  transform: perspective(190px) rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg));
  transition: transform 180ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

@media (prefers-reduced-motion: reduce) {
  .mp-example *,
  .mp-example *::before,
  .mp-example *::backdrop {
    animation: none !important;
    transition: none !important;
  }

  .mp-example[data-after="true"]
    :is(.mp-dock button, .mp-magnet span, .mp-tilt-card) {
    transform: none !important;
  }
}
