@property --mac-motion-ring {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.mac-motion {
  margin: 2rem 0 3rem;
  overflow: hidden;
  border: 1px solid var(--line, #6a6a6a);
  border-radius: .8rem;
}

.mac-motion figcaption,
.mac-motion__controls {
  padding: .8rem 1rem;
}

.mac-motion figcaption {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1rem;
  font: 600 .9rem Manrope, sans-serif;
}

.mac-motion figcaption span {
  font: 400 .73rem "DM Mono", monospace;
}

.mac-motion__screen {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  height: clamp(14rem, 42vw, 18rem);
  background:
    radial-gradient(ellipse at 27% 100%, #253950 0%, transparent 62%),
    radial-gradient(ellipse at 93% 34%, #253134 0%, transparent 54%),
    #111a25;
  color: #f6f9ff;
  font: 500 .85rem Manrope, sans-serif;
}

.mac-motion__bar {
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  display: flex;
  height: 1.65rem;
  justify-content: space-between;
  align-items: center;
  padding-inline: 1rem;
  background: #18232dbb;
  font: 400 .7rem "DM Mono", monospace;
}

.mac-motion__bar i {
  position: absolute;
  inset: 0 auto auto 50%;
  width: 5rem;
  height: 100%;
  translate: -50% 0;
  border-radius: 0 0 .75rem .75rem;
  background: #090b0f;
}

.mac-motion__scene {
  position: absolute;
  inset: 0;
}

.mac-motion [hidden] {
  display: none;
}

.post__body .mac-motion__caption {
  position: absolute;
  z-index: 5;
  inset: auto 1rem .65rem;
  margin: 0;
  text-align: center;
  color: #f6f9ff;
  font: 500 .78rem/1.4 Manrope, sans-serif;
}

.mac-motion__pill {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  translate: -50%;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #090b0f;
  transform-origin: top center;
}

.mac-motion__pill--compact {
  width: min(13rem, 85%);
  height: 2rem;
  justify-content: space-between;
  padding-inline: .75rem;
  border-radius: 0 0 1rem 1rem;
}

.mac-motion__pill b {
  color: #76e6ad;
  font-size: 1.05rem;
}

.mac-motion__pill--card {
  width: min(15rem, 85%);
  min-height: 5.5rem;
  gap: .85rem;
  padding: 1.7rem 1rem .7rem;
  border-radius: 0 0 1.1rem 1.1rem;
}

.mac-motion__pill small {
  display: block;
  color: #b6c4d2;
  margin-top: .15rem;
}

.mac-motion__ring {
  --mac-motion-ring: 259deg;
  flex: 0 0 2.6rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#76e6ad 0 var(--mac-motion-ring), #293740 0);
  -webkit-mask: radial-gradient(farthest-side, transparent 72%, #000 76%);
  mask: radial-gradient(farthest-side, transparent 72%, #000 76%);
}

.mac-motion__pill .mac-motion__spark {
  color: #ffc672;
}

.mac-motion__roll {
  position: relative;
  overflow: hidden;
  width: 4.25rem;
  height: 1.2rem;
  font: 500 .75rem/1.2rem "DM Mono", monospace;
}

.mac-motion__roll i {
  position: absolute;
  inset: 0;
  text-align: right;
  font-style: normal;
}

.mac-motion__roll i:first-child {
  transform: translateY(-100%);
}

.mac-motion__veil {
  position: absolute;
  z-index: 3;
  inset: 0 0 2.4rem;
  background: #090b0f;
  opacity: 0;
  pointer-events: none;
}

.mac-motion__dock {
  position: absolute;
  left: 50%;
  bottom: 3.3rem;
  translate: -50% 0;
  display: flex;
  gap: .4rem;
  padding: .45rem;
  border: 1px solid #ffffff2b;
  border-radius: .8rem;
  background: #b5c4db33;
}

.mac-motion__dock i {
  width: 1.5rem;
  aspect-ratio: 1;
  border-radius: .4rem;
  background: #92b9ff;
}

.mac-motion__dock i:nth-child(2n) { background: #77cfcb; }
.mac-motion__dock i:nth-child(3n) { background: #efb579; }

.mac-motion__dock--peek i:nth-child(3) {
  outline: 1px solid #f4f7fb;
  outline-offset: 2px;
}

.mac-motion__thumbnails {
  position: absolute;
  bottom: 6.45rem;
  left: 50%;
  display: flex;
  width: min(88%, 19rem);
  gap: .5rem;
  padding: .5rem;
  translate: -50% 0;
  transform-origin: bottom center;
  border: 1px solid #778d9c;
  border-radius: .8rem;
  background: #2b3a47;
}

.mac-motion__thumbnails > div {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: .4rem;
  border-radius: .35rem;
  background: #172733;
  font-size: .72rem;
}

.mac-motion__thumbnails i {
  display: block;
  height: 2.15rem;
  margin-top: .3rem;
  background: repeating-linear-gradient(#9dc6e493 0 2px, transparent 2px 7px) 0 .29rem / 82% 100% no-repeat;
}

.mac-motion__thumbnails > div:last-child i {
  background: linear-gradient(90deg, #76e6ad75 30%, #2a4056 30%);
}

.mac-motion__window {
  position: absolute;
  z-index: 2;
  top: 2.5rem;
  left: 50%;
  translate: -50% 0;
  width: min(85%, 23rem);
  overflow: hidden;
  border: 1px solid #42596b;
  border-radius: .55rem;
  background: #121d29;
  font: 400 .78rem/1.55 "DM Mono", monospace;
  box-shadow: 0 .8rem 2rem #0006;
}

.mac-motion__window > span {
  display: block;
  padding: .35rem .75rem;
  color: #c8d5e1;
  background: #233342;
}

.mac-motion__terminal > div {
  padding: 1.1rem .75rem 1.6rem;
}

.mac-motion__terminal--drawer {
  inset: 1.65rem 0 2.85rem auto;
  width: min(49%, 25rem);
  translate: none;
  border-radius: 0 0 0 .55rem;
}

.mac-motion__terminal--drawer > div {
  padding-inline: .5rem;
  white-space: nowrap;
}

.mac-motion__terminal b {
  color: #76e6ad;
}

.mac-motion__cursor {
  display: inline-block;
  width: .53rem;
  height: 1em;
  background: #8ccfff;
  vertical-align: -.12rem;
}

.mac-motion__viewport {
  position: relative;
  height: 5rem;
  overflow: hidden;
  padding: .35rem .75rem;
}

.mac-motion__viewport div {
  transform: translateY(-2.42em);
}

.mac-motion__viewport code {
  display: block;
  padding: 0;
  background: none;
  color: #bfe1ff;
  font: inherit;
}

.mac-motion__viewport > i {
  position: absolute;
  left: 8.6rem;
  top: 2rem;
  width: 2px;
  height: 1em;
  background: #ffc672;
}

.mac-motion__scroll-pair {
  position: absolute;
  inset: 2.8rem 5% auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}

.mac-motion__scroll-pair .mac-motion__window {
  position: relative;
  inset: auto;
  width: auto;
  translate: none;
}

.mac-motion__scroll-view {
  height: 5rem;
  overflow: hidden;
  padding: .45rem;
}

.mac-motion__scroll-view > div {
  height: 11rem;
  transform: translateY(-55%);
  background:
    linear-gradient(90deg, #121d29 18%, transparent 18%) 100% 0 / 35% 100% no-repeat,
    repeating-linear-gradient(#9dc6e47a 0 2px, transparent 2px 9px);
}

.mac-motion__scratchpad {
  inset: 3.1rem auto auto 0;
  width: min(72%, 16rem);
  translate: none;
  border-left: 2px solid #79c9ff;
  border-radius: 0 .65rem .65rem 0;
}

.post__body .mac-motion__scratchpad p {
  margin: .65rem;
  padding: .65rem;
  border: 1px solid #42596b;
  border-radius: .35rem;
  color: inherit;
  font: inherit;
}

.mac-motion__progress {
  overflow: hidden;
  height: 3px;
  background: #2d4253;
}

.mac-motion__progress > i {
  display: block;
  height: 100%;
  transform-origin: left;
  background: #37b6ff;
}

.post__body .mac-motion__check ul {
  margin: .6rem 0;
  padding: 0 .75rem;
  list-style: none;
}

.post__body .mac-motion__check li {
  margin: .25rem 0;
}

.mac-motion__controls,
.mac-motion__choices {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.mac-motion__controls {
  align-items: start;
  justify-content: space-between;
}

.mac-motion__choices {
  flex: 1 1 19rem;
}

.mac-motion button {
  padding: .42rem .65rem;
  border: 1px solid var(--line, currentColor);
  border-radius: .35rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: 600 .75rem Manrope, sans-serif;
}

.mac-motion button[aria-pressed="true"],
.mac-motion .mac-motion__replay {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.mac-motion button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

html:not(.calm) .is-playing .mac-motion__pill { animation: mac-pop .55s both; }
html:not(.calm) #motion-island.is-playing .mac-motion__pill { animation: mac-copy 2.35s both; }
html:not(.calm) .is-playing .mac-motion__spark { animation: mac-pulse 1.1s .45s 2 both; }
html:not(.calm) .is-playing .mac-motion__roll i:first-child { animation: mac-roll-away .35s .9s both; }
html:not(.calm) .is-playing .mac-motion__roll i:last-child { animation: mac-roll-in .35s .9s both; }
html:not(.calm) .is-playing .mac-motion__ring { animation: mac-fill .8s .2s both; }
html:not(.calm) .is-playing .mac-motion__veil { animation: mac-reveal .7s ease-out both; }
html:not(.calm) #motion-unlock.is-playing .mac-motion__pill { animation-delay: .42s; }
html:not(.calm) .is-playing .mac-motion__dock { animation: mac-dock .4s ease-out both; }
html:not(.calm) .is-playing .mac-motion__dock--peek { animation: none; }
html:not(.calm) .is-playing .mac-motion__thumbnails { animation: mac-thumbnails .45s .15s cubic-bezier(.2, .85, .35, 1.12) both; }
html:not(.calm) .is-playing .mac-motion__terminal { animation: mac-terminal .4s ease-out both; }
html:not(.calm) .is-playing .mac-motion__cursor { animation: mac-trail .65s .6s both; }
html:not(.calm) .is-playing .mac-motion__viewport div { animation: mac-scroll .8s .15s ease-out both; }
html:not(.calm) .is-playing .mac-motion__viewport > i { animation: mac-caret .3s 1s ease-out both; }
html:not(.calm) .is-playing .mac-motion__scroll-view > div { animation: mac-scroll 1.15s .15s ease-out both; }
html:not(.calm) .is-playing .mac-motion__window:last-child .mac-motion__scroll-view > div { animation-duration: .55s; }
html:not(.calm) .is-playing .mac-motion__scratchpad { animation: mac-scratchpad 2.55s both; }
html:not(.calm) .is-playing .mac-motion__progress > i { animation: mac-progress 2.4s steps(1, end) both; }
html:not(.calm) .is-playing .mac-motion__check li {
  animation: mac-check-complete .22s var(--check-delay, .72s) ease-out both;
}
html:not(.calm) .is-playing .mac-motion__check li:nth-child(2) { --check-delay: 1.32s; }
html:not(.calm) .is-playing .mac-motion__check li:last-child { --check-delay: 1.92s; }

@keyframes mac-pop {
  0% { transform: scale(.39, .3); opacity: .3; }
  72% { transform: scale(1.025); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes mac-copy {
  0%, 100% { transform: scale(.39, .75); opacity: 0; }
  17% { transform: scale(1.025); opacity: 1; }
  25%, 80% { transform: scale(1); opacity: 1; }
}

@keyframes mac-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

@keyframes mac-roll-away {
  from { transform: translateY(0); }
  to { transform: translateY(-100%); }
}

@keyframes mac-roll-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes mac-fill { from { --mac-motion-ring: 0deg; } }
@keyframes mac-reveal { from { opacity: 1; } }
@keyframes mac-dock { from { transform: translateY(170%); opacity: 0; } }
@keyframes mac-terminal { from { transform: translateX(110%); } }
@keyframes mac-thumbnails { from { transform: translateY(.8rem) scale(.92); opacity: 0; } }
@keyframes mac-scratchpad {
  0%, 100% { transform: translateX(-110%); }
  14%, 78% { transform: translateX(0); }
}
@keyframes mac-progress {
  0% { transform: scaleX(0); }
  30% { transform: scaleX(.33); }
  55% { transform: scaleX(.66); }
  80%, 100% { transform: scaleX(1); }
}
@keyframes mac-check-complete { from { opacity: .2; transform: translateY(.3rem); } }
@keyframes mac-trail {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-2.8em); box-shadow: 1.1rem 0 0 #8ccfff66, 1.9rem 0 0 #8ccfff33; }
  70% { box-shadow: -.8rem 0 0 #8ccfff66, -1.5rem 0 0 #8ccfff33; }
}
@keyframes mac-scroll { from { transform: translateY(0); } }
@keyframes mac-caret { from { transform: translate(-4rem, -1em); } }

@media (prefers-reduced-motion: reduce) {
  .mac-motion .is-playing * {
    animation: none !important;
  }
}
